QwGeant4
QweakSimTarget_DetectorHit.cc
Go to the documentation of this file.
1 
2 // QweakSimTarget_DetectorHit.cc
3 // Wouter Deconinck
4 // 2014-10-07
5 
6 /////// --------------------------------------------------------------------
7 
9 
10 //--- geant4 includes
11 #include "G4Circle.hh"
12 
13 
14 
15 /////// --------------------------------------------------------------------
16 
17 G4Allocator<QweakSimTarget_DetectorHit> QweakSimTarget_DetectorHitAllocator;
18 
19 /////// --------------------------------------------------------------------
20 
22 {
23  detectorID = -1;
24 
25  primaryEventNumber = -1;
26 
27  trackID = -1.;
28 
29  particleName = "None";
30  particleType = -1;
31 
32  time = 0.;
33 
34  hasBeenHit = 0;
35  edgeEventFlag = 0;
36  nbOfHits = 0;
37 
38  worldPos = G4ThreeVector(0.0,0.0,0.0);
39  localPos = G4ThreeVector(0.0,0.0,0.0);
40  localExitPos = G4ThreeVector(0.0,0.0,0.0);
41  originVertexPosition = G4ThreeVector(0.0,0.0,0.0);
42 
43  worldMomentum = G4ThreeVector(0.0,0.0,0.0);
44  localMomentum = G4ThreeVector(0.0,0.0,0.0);
45  currentMomentumDirection = G4ThreeVector(0.0,0.0,0.0);
46  originVertexMomentumDirection = G4ThreeVector(0.0,0.0,0.0);
47 
50 
52  currentTotalEnergy = 0.;
53 
54  //--- Target deposited energy
55  depositedEnergy = 0.;
56 
57  pLogV = 0;
58 }
59 
60 
61 /////// --------------------------------------------------------------------
62 
64 {;}
65 
66 
67 
68 /////// --------------------------------------------------------------------
69 
71 : G4VHit()
72 {
73  detectorID = right.detectorID;
74 
76 
77  trackID = right.trackID;
78 
79  particleName = right.particleName;
80  particleType = right.particleType;
81 
82  time = right.time;
83 
84  hasBeenHit = right.hasBeenHit;
86  nbOfHits = right.nbOfHits;
87 
88  worldPos = right.worldPos;
89  localPos = right.localPos;
90  localExitPos = right.localExitPos;
92 
97 
100 
103 
104  //--- Target deposited energy
106 
107  cellPos = right.cellPos;
108  cellRot = right.cellRot;
109  pLogV = right.pLogV;
110 
111 }
112 
113 
114 
115 /////// --------------------------------------------------------------------
116 
118 {
119  detectorID = right.detectorID;
120 
122 
123  trackID = right.trackID;
124 
125  particleName = right.particleName;
126  particleType = right.particleType;
127 
128  time = right.time;
129 
130  hasBeenHit = right.hasBeenHit;
132  nbOfHits = right.nbOfHits;
133 
134  worldPos = right.worldPos;
135  localPos = right.localPos;
136  localExitPos = right.localExitPos;
138 
143 
146 
149 
150  //--- Target deposited energy
152 
153  cellPos = right.cellPos;
154  cellRot = right.cellRot;
155  pLogV = right.pLogV;
156 
157  return *this;
158 
159 }
160 
161 
162 
163 /////// --------------------------------------------------------------------
164 
166 {
167  //return (this==&right) ? 1 : 0;
168  return 0;
169 }
170 
171 
172 
173 /////// --------------------------------------------------------------------
174 
176 {
177  G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
178 
179  if (pVVisManager)
180  {
181  //--- draw small yellow balls for the impact point
182 
183  G4Colour colourHit (255/255., 255/255., 0/255.); // yellow
184 
185  G4VisAttributes attribs(colourHit);
186 
187  G4Circle circle(worldPos);
188  circle.SetScreenSize(0.01);
189  circle.SetFillStyle(G4Circle::filled);
190  circle.SetVisAttributes(attribs);
191 
192  pVVisManager->Draw(circle);
193 
194  //--- draw/overlay a white drift cell for a hit
195 
196  // G4Transform3D trans(cellRot.inverse(),cellPos);
197  // const G4VisAttributes* pVA = pLogV->GetVisAttributes();
198  // if(pVA) attribs = *pVA;
199  // G4Colour colourCell (1.,1.,1.); // white
200  // attribs.SetColour(colourCell);
201  // attribs.SetForceSolid(true);
202  // attribs.SetVisibility(true);
203  // pVVisManager->Draw(*pLogV,attribs,trans);
204 
205  }
206 
207 }
208 
209 
210 
211 /////// --------------------------------------------------------------------
212 
214 {
215  // G4cout << " Target[" << DetectorID << "] : time " << time/ns
216  // << " (nsec) --- local (x,y,z) [cm] "
217  // << localPos.x()/cm << ", "
218  // << localPos.y()/cm << ", "
219  // << localPos.z()/cm << ", "
220  // << G4endl;
221 }
222 
223 
224 
225 /////// --------------------------------------------------------------------
226 
227 
228 
int operator==(const QweakSimTarget_DetectorHit &right) const
G4Allocator< QweakSimTarget_DetectorHit > QweakSimTarget_DetectorHitAllocator
const QweakSimTarget_DetectorHit & operator=(const QweakSimTarget_DetectorHit &right)