QwGeant4
QweakSimUserInformation.cc
Go to the documentation of this file.
2 
3 #include "G4PhysicsOrderedFreeVector.hh"
4 
6 {
8  Initialize();
9 }
10 
12 {
13 }
14 
16 {
17  G4cout << G4endl;
18  G4cout << "**** Calling QweakSimUserInformation::Print() ****" << G4endl;
19  G4cout << "Primary Event #:: " << PrimaryEventNumber << G4endl;
20  G4cout << "Reaction type:: " << ReactionType << G4endl;
21  G4cout << "Beam pos:: " << fPositionX << "\t" << fPositionY << G4endl;
22  G4cout << "Tgt center z:: " << TargetCenterPositionZ << G4endl;
23  G4cout << "Tgt length:: " << TargetLength << G4endl;
24  G4cout << "Beam mom:: " << fNormMomentumX << "\t" << fNormMomentumY << G4endl;
25  G4cout << "Org ver pos:: " << OriginVertexPositionX <<"\t" << OriginVertexPositionY << "\t" << OriginVertexPositionZ << G4endl;
26  G4cout << "Org ver ang:: "<< OriginVertexThetaAngle <<"\t"<< OriginVertexPhiAngle << G4endl;
27  G4cout << "Org ver mom dir:: " << OriginVertexMomentumDirectionX <<"\t" << OriginVertexMomentumDirectionY << "\t" << OriginVertexMomentumDirectionZ << G4endl;
28  G4cout << "Org ver KE:: " << OriginVertexKineticEnergy << G4endl;
29  G4cout << "Org ver TE:: " << OriginVertexTotalEnergy << G4endl;
30  G4cout << "**** Exiting QweakSimUserInformation::Print() ****" << G4endl;
31 }
32 
33 
35 { // various energy losses at the target
36  G4cout << G4endl;
37  G4cout << "**** Calling QweakSimUserInformation::PrintEloss() ****" << G4endl;
38  G4cout << "Ion Eloss (In,Out,Tot):: "<< dEIonIn <<"\t" << dEIonOut <<"\t" << GetdEIonTot() << G4endl;
39  G4cout << "Brem Eloss (In,Out,Tot):: "<< dEBremIn <<"\t" << dEBremOut <<"\t" << GetdEBremTot() << G4endl;
40  G4cout << "Msc Eloss (In,Out,Tot):: "<< dEMscIn <<"\t" << dEMscOut <<"\t" << GetdEMscTot() << G4endl;
41  G4cout << "Net Eloss (In,Out,Tot):: "<< GetdETotIn() <<"\t" << GetdETotOut() <<"\t" << GetdETot() << G4endl;
42  G4cout << "**** Leaving QweakSimUserInformation::PrintEloss() ****" << G4endl;
43 }
44 
46 {
47 
48  fPositionX = 0.0*mm;
49  fPositionY = 0.0*mm;
50  fNormMomentumX = 0.0*mrad;
51  fNormMomentumY = 0.0*mrad;
52 
53  TargetCenterPositionZ = -652.67*cm;
54 
55  TargetLength = 34.346*cm;
56 
57  TargetUSDummyPositionOffsetZ = -178.956*mm; // Offset from LH2 center
58  TargetDSDummyPositionOffsetZ = 168.68*mm; // Offset from LH2 center
59  // Dummy target Z positions are taken from the June 21, 2012 target survey
60  // The average US and average DS positions are used.
61 
62  // Thicknesses taken from 2012 target survey (https://qweak.jlab.org/elog/Target/21)
63  //TargetThicknessUSALDummy1 = 0.8812*mm;
64  //TargetThicknessUSALDummy2 = 1.7987*mm;
65  //TargetThicknessUSALDummy4 = 3.6030*mm;
66  //TargetThicknessDSALDummy2 = 1.8637*mm;
67  //TargetThicknessDSALDummy4 = 3.6828*mm;
68  //TargetThicknessDSALDummy8 = 7.1980*mm;
69  //TargetThicknessUSCDummy = 0.9973*mm;
70  //TargetThicknessDSCDummy = 3.1876*mm;
71 
72  //G4double densityLH2 = 0.0708 g*cm^-3;
73  //G4double densityAL = 2.80 g*cm^-3; // From 2012 target survey
74  //G4double densityUSC = 1.70 g*cm^-3; //
75  //G4double densityDSC = 2.205 g*cm^-3; //
76 
77  // Molar masses taken from PDG:
78  // J. Beringer et al. (Particle Data Group), Phys. Rev. D86, 010001 (2012).
79  //G4double massLH2 = 1.00794 g*mol^-1;
80  //G4double massAL = 26.9815386 g*mol^-1;
81  //G4double massC = 12.0107 g*mol^-1;
82 
83  //TargetLuminosityLH2 = CalculateLuminosity(massLH2, densityLH2, TargetLength);
84  //TargetLuminosityUSALWindow = CalculateLuminosity(massAL, densityAL, TargetThicknessUSALWindow);
85  //TargetLuminosityDSALWindow;
86  //TargetLuminosityUSALDummy1;
87  //TargetLuminosityUSALDummy2;
88  //TargetLuminosityUSALDummy4;
89  //TargetLuminosityDSALDummy2;
90  //TargetLuminosityDSALDummy4;
91  //TargetLuminosityDSALDummy8;
92  //TargetLuminosityUSCDummy;
93  //TargetLuminosityDSCDummy;
94 
96  ReactionRegion = 0;
97  ReactionType = 0; // assign a number to which kind of reaction,e.g. 1 = elastic ep,
98  PDGcode = 0; // particle data code/number for the primary particle, e.g. 3=electron
99  TrackID = 0;
100  GlobalTime = 0.0;
101  PrimaryQ2 = 0.0;
102  CrossSection = 0.0;
103  CrossSectionWeight = 0.0;
104  CrossSectionBornTotal = 0.0;
106  CrossSectionBornQE = 0.0;
107  CrossSectionRadTotal = 0.0;
109  CrossSectionRadQE = 0.0;
110  CrossSectionRadDIS = 0.0;
116  Asymmetry = 0.0;
117  OriginVertexPositionX = 0.0;
118  OriginVertexPositionY = 0.0;
119  OriginVertexPositionZ = 0.0;
121  OriginVertexPhiAngle = 0.0;
127 
128  fEPrime_Min = 0.059*GeV;
129  fEPrime_Max = 1.159*GeV;
130  fThetaAngle_Min = 4.0*degree;
131  fThetaAngle_Max = 13.5*degree;
132  fPhiAngle_Min = -16.0*degree;
133  fPhiAngle_Max = 16.0*degree;
134  fBeamEnergy = 1.16*GeV;
135  fLuminosity = 0.0;
136  fPhaseSpace = 0.0;
137 
142 
143  EffectiveKinematicQ2 = 0.0;
144  EffectiveKinematicNu = 0.0;
145  EffectiveKinematicX = 0.0;
146  EffectiveKinematicW = 0.0;
147 
148  // various energy losses at the target
149  ClearELoss();
150 
151  CerEngDep = 0.0;
152 
153  leftPMTHitValid = 0;
154  rightPMTHitValid = 0;
155  StoreStepVolumeName("none");
157 
159  delete[] cerenkovSecondaryPartOrig;
160  delete[] cerenkovSecondaryPartMom;
161  delete[] cerenkovSecondaryPartEng;
163  }
167 
169  CerenkovPhotonEnergy.clear();
170  CerenkovPhotonEnergy.resize(0);
171 
177 
178  G4ThreeVector tmp(1000,1000,1000);
179  cerenkovEventExitPos = tmp;
180 
181 // G4double D753WKBS20_QE[65][2] = {
182 // {200.0*nanometer, 0.68},
183 // {210.0*nanometer, 3.55},
184 // {220.0*nanometer, 7.40},
185 // {230.0*nanometer, 10.4},
186 // {240.0*nanometer, 14.6},
187 // {250.0*nanometer, 17.8},
188 // {260.0*nanometer, 20.6},
189 // {270.0*nanometer, 22.6},
190 // {280.0*nanometer, 22.4},
191 // {290.0*nanometer, 21.8},
192 // {300.0*nanometer, 21.1},
193 // {310.0*nanometer, 20.5},
194 // {320.0*nanometer, 19.7},
195 // {330.0*nanometer, 19.2},
196 // {340.0*nanometer, 18.4},
197 // {350.0*nanometer, 18.0},
198 // {360.0*nanometer, 18.2},
199 // {370.0*nanometer, 18.8},
200 // {380.0*nanometer, 18.3},
201 // {390.0*nanometer, 17.6},
202 // {400.0*nanometer, 17.7},
203 // {410.0*nanometer, 17.6},
204 // {420.0*nanometer, 17.5},
205 // {430.0*nanometer, 17.1},
206 // {440.0*nanometer, 16.7},
207 // {450.0*nanometer, 15.8},
208 // {460.0*nanometer, 15.0},
209 // {470.0*nanometer, 14.4},
210 // {480.0*nanometer, 13.7},
211 // {490.0*nanometer, 13.1},
212 // {500.0*nanometer, 12.4},
213 // {510.0*nanometer, 11.7},
214 // {520.0*nanometer, 11.0},
215 // {530.0*nanometer, 10.4},
216 // {540.0*nanometer, 9.77},
217 // {550.0*nanometer, 9.15},
218 // {560.0*nanometer, 8.53},
219 // {570.0*nanometer, 7.95},
220 // {580.0*nanometer, 7.39},
221 // {590.0*nanometer, 6.87},
222 // {600.0*nanometer, 6.38},
223 // {610.0*nanometer, 5.90},
224 // {620.0*nanometer, 5.45},
225 // {630.0*nanometer, 5.07},
226 // {640.0*nanometer, 4.71},
227 // {650.0*nanometer, 4.39},
228 // {660.0*nanometer, 4.10},
229 // {670.0*nanometer, 3.79},
230 // {680.0*nanometer, 3.51},
231 // {690.0*nanometer, 3.25},
232 // {700.0*nanometer, 2.98},
233 // {710.0*nanometer, 2.68},
234 // {720.0*nanometer, 2.40},
235 // {730.0*nanometer, 2.13},
236 // {740.0*nanometer, 1.88},
237 // {750.0*nanometer, 1.65},
238 // {760.0*nanometer, 1.47},
239 // {770.0*nanometer, 1.30},
240 // {780.0*nanometer, 1.13},
241 // {790.0*nanometer, 0.96},
242 // {800.0*nanometer, 0.80},
243 // {810.0*nanometer, 0.65},
244 // {820.0*nanometer, 0.48},
245 // {830.0*nanometer, 0.33},
246 // {840.0*nanometer, 0.18}
247 // };
248 
249 // if quantum efficiency is processed in the Cerenkov detector class,
250 // set it to 100% here
251  G4double D753WKBS20_QE[65][2] = {
252  {200.0*nanometer, 100},
253  {210.0*nanometer, 100},
254  {220.0*nanometer, 100},
255  {230.0*nanometer, 100},
256  {240.0*nanometer, 100},
257  {250.0*nanometer, 100},
258  {260.0*nanometer, 100},
259  {270.0*nanometer, 100},
260  {280.0*nanometer, 100},
261  {290.0*nanometer, 100},
262  {300.0*nanometer, 100},
263  {310.0*nanometer, 100},
264  {320.0*nanometer, 100},
265  {330.0*nanometer, 100},
266  {340.0*nanometer, 100},
267  {350.0*nanometer, 100},
268  {360.0*nanometer, 100},
269  {370.0*nanometer, 100},
270  {380.0*nanometer, 100},
271  {390.0*nanometer, 100},
272  {400.0*nanometer, 100},
273  {410.0*nanometer, 100},
274  {420.0*nanometer, 100},
275  {430.0*nanometer, 100},
276  {440.0*nanometer, 100},
277  {450.0*nanometer, 100},
278  {460.0*nanometer, 100},
279  {470.0*nanometer, 100},
280  {480.0*nanometer, 100},
281  {490.0*nanometer, 100},
282  {500.0*nanometer, 100},
283  {510.0*nanometer, 100},
284  {520.0*nanometer, 100},
285  {530.0*nanometer, 100},
286  {540.0*nanometer, 100},
287  {550.0*nanometer, 100},
288  {560.0*nanometer, 100},
289  {570.0*nanometer, 100},
290  {580.0*nanometer, 100},
291  {590.0*nanometer, 100},
292  {600.0*nanometer, 100},
293  {610.0*nanometer, 100},
294  {620.0*nanometer, 100},
295  {630.0*nanometer, 100},
296  {640.0*nanometer, 100},
297  {650.0*nanometer, 100},
298  {660.0*nanometer, 100},
299  {670.0*nanometer, 100},
300  {680.0*nanometer, 100},
301  {690.0*nanometer, 100},
302  {700.0*nanometer, 100},
303  {710.0*nanometer, 100},
304  {720.0*nanometer, 100},
305  {730.0*nanometer, 100},
306  {740.0*nanometer, 100},
307  {750.0*nanometer, 100},
308  {760.0*nanometer, 100},
309  {770.0*nanometer, 100},
310  {780.0*nanometer, 100},
311  {790.0*nanometer, 100},
312  {800.0*nanometer, 100},
313  {810.0*nanometer, 100},
314  {820.0*nanometer, 100},
315  {830.0*nanometer, 100},
316  {840.0*nanometer, 100}
317  };
318 
319 
320  G4double XP4572_QE[15][2] = {
321  {200.0*nanometer , 0.0} ,
322  {250.0*nanometer , 0.0} ,
323  {280.0*nanometer , 0.1} ,
324  {290.0*nanometer , 0.3} ,
325  {300.0*nanometer , 3.0} ,
326  {315.0*nanometer , 10.0} ,
327  {330.0*nanometer , 20.0} ,
328  {350.0*nanometer , 27.5} ,
329  {400.0*nanometer , 26.0} ,
330  {480.0*nanometer , 20.0} ,
331  {540.0*nanometer , 10.0} ,
332  {590.0*nanometer , 3.0} ,
333  {615.0*nanometer , 1.0} ,
334  {640.0*nanometer , 0.3} ,
335  {660.0*nanometer , 0.1}
336  };
337 
338  PMTQE_XP4572 = new G4PhysicsOrderedFreeVector();
339  PMTQED753WKBS20 = new G4PhysicsOrderedFreeVector();
340  G4double E_value;
341 
342  for (G4int kk=0; kk<65 ; kk++)
343  {
344  if(kk < 15 ){
345  E_value= 2*pi*hbarc/( XP4572_QE[kk][0] *nanometer);
346  G4cout << "E_value " << kk << " = " << E_value << " QE = " << XP4572_QE[kk][1] << G4endl;
347  PMTQE_XP4572->InsertValues(E_value, XP4572_QE[kk][1]/100.);
348  }
349 
350  E_value= 2*pi*hbarc/( D753WKBS20_QE[kk][0] *nanometer);
351  PMTQED753WKBS20->InsertValues(E_value, D753WKBS20_QE[kk][1]/100.);
352  }
353 }
354 
355 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
356 //G4double QweakSimUserInformation::CalculateLuminosity(G4double mass, G4double density, G4double length)
357 //{
358 //G4double L = 0.0; // Luminosity
359 //G4double N_b = 6.241*10^12 Hz*microamp; // # of particles in the beam (from definition of ampere)
360 //G4double N_A = 6.02214129*10^23 * mol^-1;// Avagadro's number
361 
362 //L = N_b*length*density*N_A/mass;
363 
364 //return L;
365 //}
366 
367 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
368 
370 {
371  //return PMTQE_XP4572->Value(eng);
372  G4bool isOutRange;
373  return PMTQE_XP4572->GetValue(eng,isOutRange);
374 }
375 
377 {
378  //return PMTQED753WKBS20->Value(eng);
379  G4bool isOutRange;
380  //std::cout<<"Eng="<<eng<<", QE="<<PMTQED753WKBS20->GetValue(eng,isOutRange)<<std::endl;
381  return PMTQED753WKBS20->GetValue(eng,isOutRange);
382 }
383 
385  G4ThreeVector em,
386  G4double eng,
387  G4double charge)
388 {
389  G4int cnt = cerenkovSecondaryParticleCount;
390  G4ThreeVector *tmp1 = NULL;
391  G4ThreeVector *tmp2 = NULL;
392  G4double *tmp3 = NULL;
393  G4double *tmp4 = NULL;
394 
395  if(cnt){
396  tmp1 = new G4ThreeVector[cnt];
397  tmp2 = new G4ThreeVector[cnt];
398  tmp3 = new G4double[cnt];
399  tmp4 = new G4double[cnt];
400  }
401 
402  for(G4int i = 0; i < cnt; i++){
403  tmp1[i] = cerenkovSecondaryPartOrig[i];
404  tmp2[i] = cerenkovSecondaryPartMom[i];
405  tmp3[i] = cerenkovSecondaryPartEng[i];
406  tmp4[i] = cerenkovSecondaryPartCharge[i];
407  }
408 
413 
414  cerenkovSecondaryPartOrig = new G4ThreeVector[cnt+1];
415  cerenkovSecondaryPartMom = new G4ThreeVector[cnt+1];
416  cerenkovSecondaryPartEng = new G4double[cnt+1];
417  cerenkovSecondaryPartCharge = new G4double[cnt+1];
418 
419  for(G4int i = 0; i < cnt; i++) {
420  cerenkovSecondaryPartOrig[i] = tmp1[i];
421  cerenkovSecondaryPartMom[i] = tmp2[i];
422  cerenkovSecondaryPartEng[i] = tmp3[i];
423  cerenkovSecondaryPartCharge[i] = tmp4[i];
424  }
425 
426  cerenkovSecondaryPartOrig[cnt] = ev;
427  cerenkovSecondaryPartMom[cnt] = em;
428  cerenkovSecondaryPartEng[cnt] = eng;
429  cerenkovSecondaryPartCharge[cnt] = charge;
430 
431  if(cnt){
432  delete[] tmp1;
433  delete[] tmp2;
434  delete[] tmp3;
435  delete[] tmp4;
436  }
437 
438  if(charge == -1) cerenkovSecondaryElectronCount++;
439  if(charge == 0) cerenkovSecondaryPhotonCount++;
440  if(charge == 1) cerenkovSecondaryPositronCount++;
442 }
443 
444 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
446 {
447  G4ThreeVector tmp(1000,1000,1000);
448  if(!cerenkovSecondaryParticleCount) return tmp;
449  if(idx < 0 || idx >= cerenkovSecondaryParticleCount) return tmp;
450  return cerenkovSecondaryPartOrig[idx];
451 }
452 
453 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
455 {
456  G4ThreeVector tmp(1000,1000,1000);
457  if(!cerenkovSecondaryParticleCount) return tmp;
458  if(idx < 0 || idx >= cerenkovSecondaryParticleCount) return tmp;
459  return cerenkovSecondaryPartMom[idx];
460 }
461 
462 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
464 {
465  if(!cerenkovSecondaryParticleCount) return 0;
466  if(idx < 0 || idx >= cerenkovSecondaryParticleCount) return 0;
467  return cerenkovSecondaryPartEng[idx];
468 }
469 
470 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
472 {
473  if(!cerenkovSecondaryParticleCount) return 0;
474  if(idx < 0 || idx >= cerenkovSecondaryParticleCount) return 0;
475  return cerenkovSecondaryPartCharge[idx];
476 }
477 
478 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
480 {
482  delete[] cerenkovSecondaryPartOrig;
483  delete[] cerenkovSecondaryPartMom;
484  delete[] cerenkovSecondaryPartEng;
486  }
488  CerenkovPhotonEnergy.clear();
489  CerenkovPhotonEnergy.resize(0);
490 
497  cerenkovSecondaryPartEng = NULL;
499 }
G4PhysicsOrderedFreeVector * PMTQED753WKBS20
void StoreCerenkovSecondaryParticleInfo(G4ThreeVector ep, G4ThreeVector ee, G4double eng, G4double charge)
void StoreStepVolumeName(G4String name)
G4ThreeVector GetCerenkovSecondaryParticleMomentum(G4int indx)
G4double GetNumberOfPhotoelectrons(G4double eng)
std::vector< G4double > CerenkovPhotonEnergy
G4ThreeVector GetCerenkovSecondaryParticleOrigin(G4int indx)
G4double GetCerenkovSecondaryParticleEnergy(G4int indx)
G4double GetNumberOfPhotoelectronsS20(G4double eng)
G4double GetCerenkovSecondaryParticleCharge(G4int indx)
G4PhysicsOrderedFreeVector * PMTQE_XP4572