QwGeant4
QweakSimTungstenPlug_DetectorHit.cc
Go to the documentation of this file.
1 
2 // QweakSimTungstenPlug_DetectorHit.cc
3 // Martin McHugh
4 // 2015-05-04
5 
6 /////// --------------------------------------------------------------------
7 
9 
10 //--- geant4 includes
11 #include "G4Circle.hh"
12 
13 
14 
15 /////// --------------------------------------------------------------------
16 
17 G4Allocator<QweakSimTungstenPlug_DetectorHit> QweakSimTungstenPlug_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  //--- TungstenPlug deposited energy
55  depositedEnergy = 0.;
56 
57  pLogV = 0;
58 }
59 
60 
61 
62 /////// --------------------------------------------------------------------
63 
65 {
66  detectorID = detector_id;
67  time = 0.;
68  pLogV = 0;
69 
70 }
71 
72 
73 
74 /////// --------------------------------------------------------------------
75 
77 {;}
78 
79 
80 
81 /////// --------------------------------------------------------------------
82 
84 : G4VHit()
85 {
86  detectorID = right.detectorID;
87 
89 
90  trackID = right.trackID;
91 
92  particleName = right.particleName;
93  particleType = right.particleType;
94 
95  time = right.time;
96 
97  hasBeenHit = right.hasBeenHit;
99  nbOfHits = right.nbOfHits;
100 
101  worldPos = right.worldPos;
102  localPos = right.localPos;
103  localExitPos = right.localExitPos;
105 
110 
113 
116 
117  //--- TungstenPlug deposited energy
119 
120  cellPos = right.cellPos;
121  cellRot = right.cellRot;
122  pLogV = right.pLogV;
123 
124 }
125 
126 
127 
128 /////// --------------------------------------------------------------------
129 
131 {
132  detectorID = right.detectorID;
133 
135 
136  trackID = right.trackID;
137 
138  particleName = right.particleName;
139  particleType = right.particleType;
140 
141  time = right.time;
142 
143  hasBeenHit = right.hasBeenHit;
145  nbOfHits = right.nbOfHits;
146 
147  worldPos = right.worldPos;
148  localPos = right.localPos;
149  localExitPos = right.localExitPos;
151 
156 
157  //originVertexThetaAngle = right.originVertexthetaAngle;
158  //originVertexPhiAngle = right.originVertexPhiAngle;
159 
162 
165 
166  //primaryQ2 = right.primaryQ2;
167  //crossSection = right.crossSection;
168  //crossSectionWeight = right.crossSectionWeight;
169 
170  //globalThetaAngle = right.globalThetaAngle;
171  //globalPhiAngle = right.globalPhiAngle;
172 
173  //--- TungstenPlug deposited energy
175 
176  cellPos = right.cellPos;
177  cellRot = right.cellRot;
178  pLogV = right.pLogV;
179 
180  return *this;
181 
182 }
183 
184 
185 
186 /////// --------------------------------------------------------------------
187 
189 {
190  //return (this==&right) ? 1 : 0;
191  return 0;
192 }
193 
194 
195 
196 /////// --------------------------------------------------------------------
197 
199 {
200  G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
201 
202  if (pVVisManager)
203  {
204  //--- draw small yellow balls for the impact point
205 
206  G4Colour colourHit (255/255., 255/255., 0/255.); // yellow
207 
208  G4VisAttributes attribs(colourHit);
209 
210  G4Circle circle(worldPos);
211  circle.SetScreenSize(0.01);
212  circle.SetFillStyle(G4Circle::filled);
213  circle.SetVisAttributes(attribs);
214 
215  pVVisManager->Draw(circle);
216 
217  //--- draw/overlay a white drift cell for a hit
218 
219  // G4Transform3D trans(cellRot.inverse(),cellPos);
220  // const G4VisAttributes* pVA = pLogV->GetVisAttributes();
221  // if(pVA) attribs = *pVA;
222  // G4Colour colourCell (1.,1.,1.); // white
223  // attribs.SetColour(colourCell);
224  // attribs.SetForceSolid(true);
225  // attribs.SetVisibility(true);
226  // pVVisManager->Draw(*pLogV,attribs,trans);
227 
228  }
229 
230 }
231 
232 
233 
234 /////// --------------------------------------------------------------------
235 
237 {
238  // G4cout << " TungstenPlug[" << DetectorID << "] : time " << time/ns
239  // << " (nsec) --- local (x,y,z) [cm] "
240  // << localPos.x()/cm << ", "
241  // << localPos.y()/cm << ", "
242  // << localPos.z()/cm << ", "
243  // << G4endl;
244 }
245 
246 
247 
248 /////// --------------------------------------------------------------------
249 
250 
251 
G4Allocator< QweakSimTungstenPlug_DetectorHit > QweakSimTungstenPlug_DetectorHitAllocator
const QweakSimTungstenPlug_DetectorHit & operator=(const QweakSimTungstenPlug_DetectorHit &right)
int operator==(const QweakSimTungstenPlug_DetectorHit &right) const