ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SensitiveDetectorHit.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SensitiveDetectorHit.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 
27 #include "SensitiveDetectorHit.hh"
28 #include "G4ios.hh"
29 #include "G4VVisManager.hh"
30 #include "G4Circle.hh"
31 #include "G4Colour.hh"
32 #include "G4AttDefStore.hh"
33 #include "G4AttDef.hh"
34 #include "G4AttValue.hh"
35 #include "G4UIcommand.hh"
36 #include "G4UnitsTable.hh"
37 #include "G4VisAttributes.hh"
38 #include "G4LogicalVolume.hh"
39 #include "G4SystemOfUnits.hh"
40 
41 #ifdef G4MULTITHREADED
44 #else
47 #endif
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
50 
52  fLayerID = -1;
53 }
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
56 
58  fLayerID = z;
59 }
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
62 
64 }
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
67 
70  fLayerID = right.fLayerID;
71  fWorldPos = right.fWorldPos;
72 }
73 
74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
75 
79  fLayerID = right.fLayerID;
80  fWorldPos = right.fWorldPos;
81  return *this;
82 }
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
85 
86 G4bool SensitiveDetectorHit::operator==
87 (const SensitiveDetectorHit &/*right*/) const{
88  return false;
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
92 
95  if(pVVisManager)
96  {
97  G4Circle circle(fWorldPos);
98  circle.SetScreenSize(2);
99  circle.SetFillStyle(G4Circle::filled);
100  G4Colour colour(1.,1.,0.);
101  G4VisAttributes attribs(colour);
102  circle.SetVisAttributes(attribs);
103  pVVisManager->Draw(circle);
104  }
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
108 
109 const std::map<G4String,G4AttDef>*
111  G4bool isNew;
112  std::map<G4String,G4AttDef>* store =
113  G4AttDefStore::GetInstance("SensitiveDetectorHit",isNew);
114  if (isNew) {
115  G4String ID("ID");
116  (*store)[ID] = G4AttDef(ID,"ID","Physics","","G4int");
117 
118  G4String Pos("Pos");
119  (*store)[Pos] =
120  G4AttDef(Pos, "Position","Physics","G4BestUnit","G4ThreeVector");
121  }
122  return store;
123 }
124 
125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
126 
127 std::vector<G4AttValue>*
129  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
130 
131  values->push_back(G4AttValue("ID",
133  ""));
134 
135  values->push_back(G4AttValue("Pos",G4BestUnit(fWorldPos,"Length"),""));
136 
137  return values;
138 }
139 
140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
141 
143  G4cout << fLayerID <<
144  "," << fWorldPos.x() <<
145  "," << fWorldPos.z() <<
146  "," << fWorldPos.y() << G4endl;
147 }
148 
149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....