QwGeant4
QweakSimLeadGlass_DetectorHit.cc
Go to the documentation of this file.
1 
2 // QweakSimLeadGlass_DetectorHit.cc
3 // Fang Guo
4 // 2012/07/31
5 
6 /////// --------------------------------------------------------------------
7 
9 
10 //--- geant4 includes
11 #include "G4Circle.hh"
12 
13 
14 
15 /////// --------------------------------------------------------------------
16 
17 G4Allocator<QweakSimLeadGlass_DetectorHit> QweakSimLeadGlass_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 
48  //calculate in Event Action
49  //originVertexThetaAngle = 0.;
50  //originVertexPhiAngle = 0.;
51 
54 
56  currentTotalEnergy = 0.;
57 
58  //primaryQ2 = 0.;
59  //crossSection = 0.;
60  //crossSectionWeight = 0.;
61 
62  //calculated in Event Action
63  //globalThetaAngle = 0.;
64  //globalPhiAngle = 0.;
65 
66  //--- LeadGlass deposited energy
67  depositedEnergyHit = 0.;
68 
69  pLogV = 0;
70 }
71 
72 
73 
74 /////// --------------------------------------------------------------------
75 
77 {
78  detectorID = detector_id;
79  time = 0.;
80  pLogV = 0;
81 
82 }
83 
84 
85 
86 /////// --------------------------------------------------------------------
87 
89 {;}
90 
91 
92 
93 /////// --------------------------------------------------------------------
94 
96 : G4VHit()
97 {
98  detectorID = right.detectorID;
99 
101 
102  trackID = right.trackID;
103 
104  particleName = right.particleName;
105  particleType = right.particleType;
106 
107  time = right.time;
108 
109  hasBeenHit = right.hasBeenHit;
111  nbOfHits = right.nbOfHits;
112 
113  worldPos = right.worldPos;
114  localPos = right.localPos;
115  localExitPos = right.localExitPos;
117 
122 
123  //originVertexThetaAngle = right.originVertexthetaAngle;
124  //originVertexPhiAngle = right.originVertexPhiAngle;
125 
128 
131 
132  //primaryQ2 = right.primaryQ2;
133  //crossSection = right.crossSection;
134  //crossSectionWeight = right.crossSectionWeight;
135 
136  //globalThetaAngle = right.globalThetaAngle;
137  //globalPhiAngle = right.globalPhiAngle;
138 
139  //--- LeadGlass deposited energy
141 
142  cellPos = right.cellPos;
143  cellRot = right.cellRot;
144  pLogV = right.pLogV;
145 
146 }
147 
148 
149 
150 /////// --------------------------------------------------------------------
151 
153 {
154  detectorID = right.detectorID;
155 
157 
158  trackID = right.trackID;
159 
160  particleName = right.particleName;
161  particleType = right.particleType;
162 
163  time = right.time;
164 
165  hasBeenHit = right.hasBeenHit;
167  nbOfHits = right.nbOfHits;
168 
169  worldPos = right.worldPos;
170  localPos = right.localPos;
171  localExitPos = right.localExitPos;
173 
178 
179  //originVertexThetaAngle = right.originVertexthetaAngle;
180  //originVertexPhiAngle = right.originVertexPhiAngle;
181 
184 
187 
188  //primaryQ2 = right.primaryQ2;
189  //crossSection = right.crossSection;
190  //crossSectionWeight = right.crossSectionWeight;
191 
192  //globalThetaAngle = right.globalThetaAngle;
193  //globalPhiAngle = right.globalPhiAngle;
194 
195  //--- LeadGlass deposited energy
197 
198  cellPos = right.cellPos;
199  cellRot = right.cellRot;
200  pLogV = right.pLogV;
201 
202  return *this;
203 
204 }
205 
206 
207 
208 /////// --------------------------------------------------------------------
209 
211 {
212  //return (this==&right) ? 1 : 0;
213  return 0;
214 }
215 
216 
217 
218 /////// --------------------------------------------------------------------
219 
221 {
222  G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
223 
224  if (pVVisManager)
225  {
226  //--- draw small yellow balls for the impact point
227 
228  G4Colour colourHit (255/255., 255/255., 0/255.); // yellow
229 
230  G4VisAttributes attribs(colourHit);
231 
232  G4Circle circle(worldPos);
233  circle.SetScreenSize(0.01);
234  circle.SetFillStyle(G4Circle::filled);
235  circle.SetVisAttributes(attribs);
236 
237  pVVisManager->Draw(circle);
238 
239  //--- draw/overlay a white drift cell for a hit
240 
241  // G4Transform3D trans(cellRot.inverse(),cellPos);
242  // const G4VisAttributes* pVA = pLogV->GetVisAttributes();
243  // if(pVA) attribs = *pVA;
244  // G4Colour colourCell (1.,1.,1.); // white
245  // attribs.SetColour(colourCell);
246  // attribs.SetForceSolid(true);
247  // attribs.SetVisibility(true);
248  // pVVisManager->Draw(*pLogV,attribs,trans);
249 
250  }
251 
252 }
253 
254 
255 
256 /////// --------------------------------------------------------------------
257 
259 {
260  G4cout << " LeadGlass[" << detectorID << "] : time " << time/ns
261  << " (nsec) --- local (x,y,z) [cm] "
262  << worldPos.x()/cm << ", "
263  << worldPos.y()/cm << ", "
264  << worldPos.z()/cm
265  << G4endl << G4endl;
266 }
267 
268 
269 
270 /////// --------------------------------------------------------------------
271 
272 
273 
int operator==(const QweakSimLeadGlass_DetectorHit &right) const
const QweakSimLeadGlass_DetectorHit & operator=(const QweakSimLeadGlass_DetectorHit &right)
G4Allocator< QweakSimLeadGlass_DetectorHit > QweakSimLeadGlass_DetectorHitAllocator