CMS 3D CMS Logo

MaterialBudgetData.cc
Go to the documentation of this file.
2 
3 #include "G4Step.hh"
4 #include "G4Material.hh"
5 #include "G4EventManager.hh"
6 #include "G4Event.hh"
7 
9 {
10  //instantiate categorizer to assign an ID to volumes and materials
12  allStepsToTree = false;
13  isHGCal = false;
14  densityConvertionFactor = 6.24E18;
15 }
16 
18 
20 {
21  allStepsToTree = true;
22 }
23 
24 
25 void MaterialBudgetData::dataStartTrack( const G4Track* aTrack )
26 {
27 
28  const G4ThreeVector& dir = aTrack->GetMomentum() ;
29 
30  if( myMaterialBudgetCategorizer == nullptr){
31  if(isHGCal){
32  myMaterialBudgetCategorizer = std::make_unique<MaterialBudgetCategorizer>("HGCal");
33  } else {
34  myMaterialBudgetCategorizer = std::make_unique<MaterialBudgetCategorizer>("Tracker");
35  }
36  }
37 
38  theStepN=0;
39  theTotalMB=0;
40  theTotalIL=0;
41  theEta=0;
42  thePhi=0;
43  theID=0;
44  thePt=0;
45  theEnergy=0;
46  theMass=0;
47 
48  theSupportMB = 0.f;
49  theSensitiveMB = 0.f;
50  theCoolingMB = 0.f;
51  theElectronicsMB = 0.f;
52  theOtherMB = 0.f;
53 
54  //HGCal
55  theAirMB = 0.f;
56  theCablesMB = 0.f;
57  theCopperMB = 0.f;
58  theH_ScintillatorMB = 0.f;
59  theLeadMB = 0.f;
60  theEpoxyMB = 0.f;
61  theKaptonMB = 0.f;
62  theAluminiumMB = 0.f;
63  theHGC_G10_FR4MB = 0.f;
64  theSiliconMB = 0.f;
65  theStainlessSteelMB = 0.f;
66  theWCuMB = 0.f;
67 
68  theSupportIL = 0.f;
69  theSensitiveIL = 0.f;
70  theCoolingIL = 0.f;
71  theElectronicsIL = 0.f;
72  theOtherIL = 0.f;
73 
74  //HGCal
75  theAirIL = 0.f;
76  theCablesIL = 0.f;
77  theCopperIL = 0.f;
78  theH_ScintillatorIL = 0.f;
79  theLeadIL = 0.f;
80  theEpoxyIL = 0.f;
81  theKaptonIL = 0.f;
82  theAluminiumIL = 0.f;
83  theHGC_G10_FR4IL = 0.f;
84  theSiliconIL = 0.f;
85  theStainlessSteelIL = 0.f;
86  theWCuIL = 0.f;
87 
92  theOtherFractionMB = 0.f;
93  //HGCal
94  theAirFractionMB = 0.f;
95  theCablesFractionMB = 0.f;
96  theCopperFractionMB = 0.f;
98  theLeadFractionMB = 0.f;
99  theEpoxyFractionMB = 0.f;
100  theKaptonFractionMB = 0.f;
103  theSiliconFractionMB = 0.f;
105  theWCuFractionMB = 0.f;
106 
107  theSupportFractionIL = 0.f;
109  theCoolingFractionIL = 0.f;
111  theOtherFractionIL = 0.f;
112  //HGCal
113  theAirFractionIL = 0.f;
114  theCablesFractionIL = 0.f;
115  theCopperFractionIL = 0.f;
117  theLeadFractionIL = 0.f;
118  theEpoxyFractionIL = 0.f;
119  theKaptonFractionIL = 0.f;
122  theSiliconFractionIL = 0.f;
124  theWCuFractionIL = 0.f;
125 
126  theID = (int)(aTrack->GetDefinition()->GetPDGEncoding());
127  thePt = dir.perp();
128  if( dir.theta() != 0 ) {
129  theEta = dir.eta();
130  } else {
131  theEta = -99;
132  }
133  thePhi = dir.phi();
134  theEnergy = aTrack->GetTotalEnergy();
135  theMass = aTrack->GetDefinition()->GetPDGMass();
136 }
137 
138 
139 void MaterialBudgetData::dataEndTrack( const G4Track* aTrack )
140 {
141  LogDebug("MaterialBudget") << "MaterialBudgetData: [OVAL] MaterialBudget "
142  << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID()
143  << " Eta:" << theEta << " Phi:" << thePhi << " TotalMB" << theTotalMB;
144 
145  LogDebug("MaterialBudget") << "MaterialBudgetData:" << theStepN << "Recorded steps ";
146 
147  if (!isHGCal){
148 
149  LogDebug("Material Budget") <<"MaterialBudgetData: Radiation Length "
150  << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID()
151  << " Eta" << theEta << " Phi" << thePhi
152  << " TotalMB" << theTotalMB
153  << " SUP " << theSupportMB << " SEN " << theSensitiveMB
154  << " CAB " << theCablesMB << " COL " << theCoolingMB
155  << " ELE " << theElectronicsMB << " other " << theOtherMB
156  << " Air " << theAirMB;
157 
158  LogDebug("Material Budget") << "MaterialBudgetData: Interaction Length "
159  << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID()
160  << " Eta " << theEta << " Phi " << thePhi
161  << " TotalIL " << theTotalIL
162  << " SUP " << theSupportIL << " SEN " << theSensitiveIL
163  << " CAB " << theCablesIL << " COL " << theCoolingIL
164  << " ELE " << theElectronicsIL << " other " << theOtherIL
165  << " Air " << theAirIL << std::endl;
166 
167  } else {
168 
169  LogDebug("MaterialBudget") << "MaterialBudgetData: HGCal Material Budget: Radiation Length "
170  << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID()
171  << " Eta " << theEta << " Phi " << thePhi
172  << " TotaLMB" << theTotalMB
173  << " theCopperMB " << theCopperMB << " theH_ScintillatorMB " << theH_ScintillatorMB
174  << " CAB " << theCablesMB << " theLeadMB " << theLeadMB << " theEpoxyMB " << theEpoxyMB << " theKaptonMB " << theKaptonMB << " theAluminiumMB " << theAluminiumMB << " theHGC_G10_FR4MB "
175  << theHGC_G10_FR4MB << " theSiliconMB " << theSiliconMB
176  << " theAirMB " << theAirMB << " theStainlessSteelMB " << theStainlessSteelMB
177  << " theWCuMB " << theWCuMB;
178 
179  LogDebug("MaterialBudget") << "MaterialBudgetData: HGCal Material Budget: Interaction Length "
180  << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID()
181  << " Eta " << theEta << " Phi " << thePhi
182  << " TotalIL " << theTotalIL << " theCopperIL " << theCopperIL
183  << " theH_ScintillatorIL " << theH_ScintillatorIL
184  << " CAB " << theCablesIL << " theLeadIL " << theLeadIL << " theEpoxyIL " << theEpoxyIL
185  << " theKaptonIL " << theKaptonIL << " theAluminiumIL " << theAluminiumIL << " theHGC_G10_FR4IL "
186  << theHGC_G10_FR4IL << " theSiliconIL " << theSiliconIL << " Air "
187  << theAirIL << " theStainlessSteelIL " << theStainlessSteelIL
188  << " theWCuIL " << theWCuIL << std::endl;
189  }
190 }
191 
192 void MaterialBudgetData::dataPerStep( const G4Step* aStep )
193 {
194  assert(aStep);
195  G4StepPoint* prePoint = aStep->GetPreStepPoint();
196  G4StepPoint* postPoint = aStep->GetPostStepPoint();
197  assert(prePoint);
198  assert(postPoint);
199  G4Material * theMaterialPre = prePoint->GetMaterial();
200  assert(theMaterialPre);
201 
202  CLHEP::Hep3Vector prePos = prePoint->GetPosition();
203  CLHEP::Hep3Vector postPos = postPoint->GetPosition();
204 
205  G4double steplen = aStep->GetStepLength();
206 
207  G4double radlen = theMaterialPre->GetRadlen();
208  G4double intlen = theMaterialPre->GetNuclearInterLength();
209  G4double density = theMaterialPre->GetDensity() / densityConvertionFactor; // always g/cm3
210 
211  G4String materialName = theMaterialPre->GetName();
212 
213  LogDebug("MaterialBudget") << "MaterialBudgetData: Material " << materialName
214  << " steplen " << steplen
215  << " radlen " << radlen
216  << " mb " << steplen/radlen;
217 
218  G4String volumeName = aStep->GetPreStepPoint()->GetTouchable()->GetVolume(0)->GetLogicalVolume()->GetName();
219 
220  LogDebug("MaterialBudget") << "MaterialBudgetData: Volume " << volumeName
221  << " Material " << materialName;
222 
223  // instantiate the categorizer
225  int volumeID = myMaterialBudgetCategorizer->volume( volumeName );
226  int materialID = myMaterialBudgetCategorizer->material( materialName );
227 
228  LogDebug("MaterialBudget") << "MaterialBudgetData: Volume ID " << volumeID
229  << " Material ID " << materialID;
230 
231  // FIXME: Both volume ID and material ID are zeros, so this part is not executed leaving all
232  // values as zeros.
233 
234  if (!isHGCal){
235 
236  bool isCtgOk = !myMaterialBudgetCategorizer->x0fraction(materialName).empty()
237  && !myMaterialBudgetCategorizer->l0fraction(materialName).empty()
238  && (myMaterialBudgetCategorizer->x0fraction(materialName).size() == 7) /*7 Categories*/
239  && (myMaterialBudgetCategorizer->l0fraction(materialName).size() == 7);
240 
241  if(!isCtgOk)
242  {
243  if(materialName.compare("Air") == 0){
244  theAirFractionMB = 1.f;
245  theAirFractionIL = 1.f;
246  } else {
247  theOtherFractionMB = 1.f;
248  theOtherFractionIL = 1.f;
249  edm::LogWarning("MaterialBudget")
250  << "MaterialBudgetData: Material forced to 'Other': " << materialName
251  << " in volume " << volumeName << ". Check Categorization.";
252  }
253  }
254  else
255  {
256  theSupportFractionMB = myMaterialBudgetCategorizer->x0fraction(materialName)[0];
257  theSensitiveFractionMB = myMaterialBudgetCategorizer->x0fraction(materialName)[1];
258  theCablesFractionMB = myMaterialBudgetCategorizer->x0fraction(materialName)[2];
259  theCoolingFractionMB = myMaterialBudgetCategorizer->x0fraction(materialName)[3];
260  theElectronicsFractionMB = myMaterialBudgetCategorizer->x0fraction(materialName)[4];
261  theOtherFractionMB = myMaterialBudgetCategorizer->x0fraction(materialName)[5];
262  theAirFractionMB = myMaterialBudgetCategorizer->x0fraction(materialName)[6];
263 
264  if(theOtherFractionMB > 0.f)
265  edm::LogWarning("MaterialBudget") << "MaterialBudgetData: Material found with no category: " << materialName
266  << " in volume " << volumeName;
267 
268  theSupportFractionIL = myMaterialBudgetCategorizer->l0fraction(materialName)[0];
269  theSensitiveFractionIL = myMaterialBudgetCategorizer->l0fraction(materialName)[1];
270  theCablesFractionIL = myMaterialBudgetCategorizer->l0fraction(materialName)[2];
271  theCoolingFractionIL = myMaterialBudgetCategorizer->l0fraction(materialName)[3];
272  theElectronicsFractionIL = myMaterialBudgetCategorizer->l0fraction(materialName)[4];
273  theOtherFractionIL = myMaterialBudgetCategorizer->l0fraction(materialName)[5];
274  theAirFractionIL = myMaterialBudgetCategorizer->l0fraction(materialName)[6];
275 
276  if(theOtherFractionIL > 0.f)
277  edm::LogWarning("MaterialBudget") << "MaterialBudgetData: Material found with no category: " << materialName
278  << " in volume " << volumeName;
279  }
280  } else { // isHGCal
281 
282  bool isHGCalx0fractionEmpty = myMaterialBudgetCategorizer->HGCalx0fraction(materialName).empty();
283  bool isHGCall0fractionEmpty = myMaterialBudgetCategorizer->HGCall0fraction(materialName).empty();
284 
285  if( isHGCalx0fractionEmpty && isHGCall0fractionEmpty ) {
286  theOtherFractionMB = 1.f;
287  theOtherFractionIL = 1.f;
288 
289  edm::LogWarning("MaterialBudget") << "MaterialBudgetData: Material forced to 'Other': " << materialName
290  << " in volume " << volumeName;
291  } else{
292 
293  theAirFractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[0];
294  theCablesFractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[1];
295  theCopperFractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[2];
296  theH_ScintillatorFractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[3];
297  theLeadFractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[4];
298  theHGC_G10_FR4FractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[5];
299  theSiliconFractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[6];
300  theStainlessSteelFractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[7];
301  theWCuFractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[8];
302  theOtherFractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[9];
303  theEpoxyFractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[10];
304  theKaptonFractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[11];
305  theAluminiumFractionMB = myMaterialBudgetCategorizer->HGCalx0fraction(materialName)[12];
306 
307 
308  if(theOtherFractionMB!=0)
309  // edm::LogWarning("MaterialBudget") << "MaterialBudgetData: Material found with no category: " << materialName
310  // << " in volume " << volumeName << std::endl;
311  std::cout << "MaterialBudgetData: Material found with no category: " << materialName
312  << " in volume " << volumeName << std::endl;
313 
314  theAirFractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[0];
315  theCablesFractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[1];
316  theCopperFractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[2];
317  theH_ScintillatorFractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[3];
318  theLeadFractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[4];
319  theHGC_G10_FR4FractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[5];
320  theSiliconFractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[6];
321  theStainlessSteelFractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[7];
322  theWCuFractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[8];
323  theOtherFractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[9];
324  theEpoxyFractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[10];
325  theKaptonFractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[11];
326  theAluminiumFractionIL = myMaterialBudgetCategorizer->HGCall0fraction(materialName)[12];
327 
328 
329  if(theOtherFractionIL!=0)
330  edm::LogWarning("MaterialBudget") << "MaterialBudgetData: Material found with no category " << materialName
331  << " in volume " << volumeName << std::endl;
332  }
333  }
334 
335  float dmb = steplen/radlen;
336  float dil = steplen/intlen;
337 
338  G4VPhysicalVolume* pv = aStep->GetPreStepPoint()->GetPhysicalVolume();
339  const G4VTouchable* t = aStep->GetPreStepPoint()->GetTouchable();
340  const G4ThreeVector& objectTranslation = t->GetTranslation();
341  const G4RotationMatrix* objectRotation = t->GetRotation();
342  const G4VProcess* interactionPre = prePoint->GetProcessDefinedStep();
343  const G4VProcess* interactionPost = postPoint->GetProcessDefinedStep();
344 
345  G4Track* track = aStep->GetTrack();
346  if(theStepN==0)
347  LogDebug("MaterialBudget") << "MaterialBudgetData: Simulated Particle " << theID
348  << "\tMass " << theMass << " MeV/c2"
349  << "\tPt = " << thePt << " MeV/c"
350  << "\tEta = " << theEta
351  << "\tPhi = " << thePhi
352  << "\tEnergy = " << theEnergy << " MeV";
353 
354  //fill data per step
355  if( allStepsToTree ){
356  assert(theStepN < MAXNUMBERSTEPS);
358  theDmb[theStepN] = dmb;
359  theDil[theStepN] = dil;
365  //HGCal
377  theWCuDmb[theStepN] = (dmb * theWCuFractionMB);
378 
384  //HGCal
396  theWCuDil[theStepN] = (dil * theWCuFractionIL);
397 
398  theInitialX[theStepN] = prePos.x();
399  theInitialY[theStepN] = prePos.y();
400  theInitialZ[theStepN] = prePos.z();
401  theFinalX[theStepN] = postPos.x();
402  theFinalY[theStepN] = postPos.y();
403  theFinalZ[theStepN] = postPos.z();
404  theVolumeID[theStepN] = volumeID;
405  theVolumeName[theStepN] = volumeName;
406  theVolumeCopy[theStepN] = pv->GetCopyNo();
407  theVolumeX[theStepN] = objectTranslation.x();
408  theVolumeY[theStepN] = objectTranslation.y();
409  theVolumeZ[theStepN] = objectTranslation.z();
410  theVolumeXaxis1[theStepN] = objectRotation->xx();
411  theVolumeXaxis2[theStepN] = objectRotation->xy();
412  theVolumeXaxis3[theStepN] = objectRotation->xz();
413  theVolumeYaxis1[theStepN] = objectRotation->yx();
414  theVolumeYaxis2[theStepN] = objectRotation->yy();
415  theVolumeYaxis3[theStepN] = objectRotation->yz();
416  theVolumeZaxis1[theStepN] = objectRotation->zx();
417  theVolumeZaxis2[theStepN] = objectRotation->zy();
418  theVolumeZaxis3[theStepN] = objectRotation->zz();
419  theMaterialID[theStepN] = materialID;
420  theMaterialName[theStepN] = materialName;
421  theMaterialX0[theStepN] = radlen;
422  theMaterialLambda0[theStepN] = intlen;
423  theMaterialDensity[theStepN] = density;
424  theStepID[theStepN] = track->GetDefinition()->GetPDGEncoding();
425  theStepInitialPt[theStepN] = prePoint->GetMomentum().perp();
426  theStepInitialEta[theStepN] = prePoint->GetMomentum().eta();
427  theStepInitialPhi[theStepN] = prePoint->GetMomentum().phi();
428  theStepInitialEnergy[theStepN] = prePoint->GetTotalEnergy();
429  theStepInitialPx[theStepN] = prePoint->GetMomentum().x();
430  theStepInitialPy[theStepN] = prePoint->GetMomentum().y();
431  theStepInitialPz[theStepN] = prePoint->GetMomentum().z();
432  theStepInitialBeta[theStepN] = prePoint->GetBeta();
433  theStepInitialGamma[theStepN] = prePoint->GetGamma();
434  theStepInitialMass[theStepN] = prePoint->GetMass();
435  theStepFinalPt[theStepN] = postPoint->GetMomentum().perp();
436  theStepFinalEta[theStepN] = postPoint->GetMomentum().eta();
437  theStepFinalPhi[theStepN] = postPoint->GetMomentum().phi();
438  theStepFinalEnergy[theStepN] = postPoint->GetTotalEnergy();
439  theStepFinalPx[theStepN] = postPoint->GetMomentum().x();
440  theStepFinalPy[theStepN] = postPoint->GetMomentum().y();
441  theStepFinalPz[theStepN] = postPoint->GetMomentum().z();
442  theStepFinalBeta[theStepN] = postPoint->GetBeta();
443  theStepFinalGamma[theStepN] = postPoint->GetGamma();
444  theStepFinalMass[theStepN] = postPoint->GetMass();
445  int preProcType = -99;
446  int postProcType = -99;
447  if (interactionPre) preProcType = interactionPre->GetProcessType();
448  theStepPreProcess[theStepN] = preProcType;
449  if (interactionPost) postProcType = interactionPost->GetProcessType();
450  theStepPostProcess[theStepN] = postProcType;
451 
452  LogDebug("MaterialBudget")
453  << "MaterialBudgetData: Step " << theStepN
454  << "\tDelta MB = " << theDmb[theStepN]
455  << std::endl
456  << " Support " << theSupportDmb[theStepN]
457  << " Sensitive " << theSensitiveDmb[theStepN]
458  << " Cables " << theCablesDmb[theStepN]
459  << " Cooling " << theCoolingDmb[theStepN]
460  << " Electronics " << theElectronicsDmb[theStepN]
461  << " Other " << theOtherDmb[theStepN]
462  << " Air " << theAirDmb[theStepN]
463  << std::endl
464  << "\tDelta IL = " << theDil[theStepN]
465  << std::endl
466  << " Support " << theSupportDil[theStepN]
467  << " Sensitive " << theSensitiveDil[theStepN]
468  << " Cables " << theCablesDil[theStepN]
469  << " Cooling " << theCoolingDil[theStepN]
470  << " Electronics " << theElectronicsDil[theStepN]
471  << " Other " << theOtherDil[theStepN]
472  << " Air " << theAirDil[theStepN];
473 
474  if (interactionPre)
475  LogDebug("MaterialBudget")
476  << "MaterialBudgetData: Process Pre " << interactionPre->GetProcessName()
477  << " type " << theStepPreProcess[theStepN]
478  << " name " << interactionPre->GetProcessTypeName(G4ProcessType(theStepPreProcess[theStepN]));
479  if (interactionPost)
480  LogDebug("MaterialBudget")
481  << "MaterialBudgetData: Process Post " << interactionPost->GetProcessName()
482  << " type " << theStepPostProcess[theStepN]
483  << " name "<< interactionPost->GetProcessTypeName(G4ProcessType(theStepPostProcess[theStepN]))
484  << " Pre x = " << theInitialX[theStepN]
485  << " y = " << theInitialY[theStepN]
486  << " z = " << theInitialZ[theStepN]
487  << " Polar Radius = " << sqrt(prePos.x()*prePos.x()+prePos.y()*prePos.y())
488  << " Pt = " << theStepInitialPt[theStepN]
489  << " Energy = " << theStepInitialEnergy[theStepN]
490  << " Final: "
491  << " Post x = " << theFinalX[theStepN]
492  << " y = " << theFinalY[theStepN]
493  << " z = " << theFinalZ[theStepN]
494  << " Polar Radius = " << sqrt(postPos.x()*postPos.x()+postPos.y()*postPos.y())
495  << " Pt = " << theStepFinalPt[theStepN]
496  << " Energy = " << theStepFinalEnergy[theStepN]
497  << std::endl
498  << " Volume " << volumeID << " name " << theVolumeName[theStepN]
499  << " copy number " << theVolumeCopy[theStepN]
500  << " material " << theMaterialID[theStepN] << " " << theMaterialName[theStepN]
501  << " Density = " << theMaterialDensity[theStepN] << " g/cm3"
502  << " X0 = " << theMaterialX0[theStepN] << " mm"
503  << " Lambda0 = " << theMaterialLambda0[theStepN] << " mm"
504  << std::endl
505  << " Particle " << theStepID[theStepN]
506  << " Initial Pt = " << theStepInitialPt[theStepN] << " MeV/c"
507  << " eta = " << theStepInitialEta[theStepN]
508  << " phi = " << theStepInitialPhi[theStepN]
509  << " Energy = " << theStepInitialEnergy[theStepN] << " MeV"
510  << " Mass = " << theStepInitialMass[theStepN] << " MeV/c2"
511  << " Beta = " << theStepInitialBeta[theStepN]
512  << " Gamma = " << theStepInitialGamma[theStepN]
513  << std::endl
514  << " Particle " << theStepID[theStepN]
515  << " Final Pt = " << theStepFinalPt[theStepN] << " MeV/c"
516  << " eta = " << theStepFinalEta[theStepN]
517  << " phi = " << theStepFinalPhi[theStepN]
518  << " Energy = " << theStepFinalEnergy[theStepN] << " MeV"
519  << " Mass = " << theStepFinalMass[theStepN] << " MeV/c2"
520  << " Beta = " << theStepFinalBeta[theStepN]
521  << " Gamma = " << theStepFinalGamma[theStepN]
522  << std::endl
523  << " Volume Centre x = " << theVolumeX[theStepN]
524  << " y = " << theVolumeY[theStepN]
525  << " z = " << theVolumeZ[theStepN]
526  << "Polar Radius = " << sqrt( theVolumeX[theStepN]*theVolumeX[theStepN] +
527  theVolumeY[theStepN]*theVolumeY[theStepN] )
528  << std::endl
529  << " x axis = ("
530  << theVolumeXaxis1[theStepN] << ","
531  << theVolumeXaxis2[theStepN] << ","
532  << theVolumeXaxis3[theStepN] << ")"
533  << std::endl
534  << " y axis = ("
535  << theVolumeYaxis1[theStepN] << ","
536  << theVolumeYaxis2[theStepN] << ","
537  << theVolumeYaxis3[theStepN] << ")"
538  << std::endl
539  << " z axis = ("
540  << theVolumeZaxis1[theStepN] << ","
541  << theVolumeZaxis2[theStepN] << ","
542  << theVolumeZaxis3[theStepN] << ")"
543  << std::endl
544  << " Secondaries"
545  << std::endl;
546 
547  for(G4TrackVector::const_iterator iSec = aStep->GetSecondary()->begin(); iSec!=aStep->GetSecondary()->end(); iSec++) {
548  LogDebug("MaterialBudget")
549  << "MaterialBudgetData: tid " << (*iSec)->GetDefinition()->GetPDGEncoding()
550  << " created through process type " << (*iSec)->GetCreatorProcess()->GetProcessType()
551  << (*iSec)->GetCreatorProcess()->GetProcessTypeName(G4ProcessType((*iSec)->GetCreatorProcess()->GetProcessType()));
552  }
553  }
554 
555  theTrkLen = aStep->GetTrack()->GetTrackLength();
556  thePVname = pv->GetName();
557  thePVcopyNo = pv->GetCopyNo();
558  theRadLen = radlen;
559  theIntLen = intlen;
560  theTotalMB += dmb;
561  theTotalIL += dil;
562 
567  theOtherMB += (dmb * theOtherFractionMB);
568 
569  //HGCal
570  theAirMB += (dmb * theAirFractionMB);
571  theCablesMB += (dmb * theCablesFractionMB);
572  theCopperMB += (dmb * theCopperFractionMB);
574  theLeadMB += (dmb * theLeadFractionMB);
575  theEpoxyMB += (dmb * theEpoxyFractionMB);
576  theKaptonMB += (dmb * theKaptonFractionMB);
581  theWCuMB += (dmb * theWCuFractionMB);
582 
587  theOtherIL += (dil * theOtherFractionIL);
588  //HGCal
589  theAirIL += (dil * theAirFractionIL);
590  theCablesIL += (dil * theCablesFractionIL);
591  theCopperIL += (dil * theCopperFractionIL);
593  theLeadIL += (dil * theLeadFractionIL);
594  theEpoxyIL += (dil * theEpoxyFractionIL);
595  theKaptonIL += (dil * theKaptonFractionIL);
600  theWCuIL += (dil * theWCuFractionIL);
601 
602 
603 
604  // rr
605 
606  theStepN++;
607 
608 }
609 
610 
#define LogDebug(id)
std::array< float, MAXNUMBERSTEPS > theStepInitialMass
std::array< float, MAXNUMBERSTEPS > theWCuDil
std::array< float, MAXNUMBERSTEPS > theMaterialX0
std::array< float, MAXNUMBERSTEPS > theVolumeZaxis1
std::array< float, MAXNUMBERSTEPS > theAirDil
std::array< float, MAXNUMBERSTEPS > theStepInitialBeta
std::array< float, MAXNUMBERSTEPS > theSupportDmb
std::array< float, MAXNUMBERSTEPS > theStepFinalEta
std::array< float, MAXNUMBERSTEPS > theKaptonDil
std::array< int, MAXNUMBERSTEPS > theStepPreProcess
std::array< float, MAXNUMBERSTEPS > theStainlessSteelDil
std::array< int, MAXNUMBERSTEPS > theStepPostProcess
std::array< float, MAXNUMBERSTEPS > theSiliconDil
std::array< float, MAXNUMBERSTEPS > theKaptonDmb
std::array< float, MAXNUMBERSTEPS > theCopperDmb
std::array< double, MAXNUMBERSTEPS > theFinalX
std::array< float, MAXNUMBERSTEPS > theStepFinalBeta
std::array< float, MAXNUMBERSTEPS > theAirDmb
std::array< float, MAXNUMBERSTEPS > theStepInitialPt
std::array< float, MAXNUMBERSTEPS > theWCuDmb
std::array< float, MAXNUMBERSTEPS > theEpoxyDmb
std::array< float, MAXNUMBERSTEPS > theStepInitialPz
std::array< float, MAXNUMBERSTEPS > theStepInitialPx
std::array< float, MAXNUMBERSTEPS > theStepFinalPhi
std::array< float, MAXNUMBERSTEPS > theVolumeYaxis1
std::array< double, MAXNUMBERSTEPS > theInitialY
std::array< float, MAXNUMBERSTEPS > theHGC_G10_FR4Dil
std::array< float, MAXNUMBERSTEPS > theStepFinalGamma
std::array< float, MAXNUMBERSTEPS > theVolumeZaxis2
std::array< float, MAXNUMBERSTEPS > theStepFinalMass
std::array< float, MAXNUMBERSTEPS > theHGC_G10_FR4Dmb
std::unique_ptr< MaterialBudgetCategorizer > myMaterialBudgetCategorizer
std::array< float, MAXNUMBERSTEPS > theSiliconDmb
std::array< int, MAXNUMBERSTEPS > theVolumeCopy
std::array< float, MAXNUMBERSTEPS > theLeadDmb
std::array< double, MAXNUMBERSTEPS > theInitialZ
std::array< float, MAXNUMBERSTEPS > theMaterialDensity
std::array< float, MAXNUMBERSTEPS > theVolumeXaxis1
std::array< float, MAXNUMBERSTEPS > theOtherDmb
std::array< int, MAXNUMBERSTEPS > theStepID
T sqrt(T t)
Definition: SSEVec.h:18
void dataEndTrack(const G4Track *aTrack)
std::array< float, MAXNUMBERSTEPS > theSensitiveDil
std::array< double, MAXNUMBERSTEPS > theFinalY
def pv(vc)
Definition: MetAnalyzer.py:7
void dataPerStep(const G4Step *aStep)
double f[11][100]
std::array< float, MAXNUMBERSTEPS > theStepFinalPx
std::array< float, MAXNUMBERSTEPS > theStepInitialEta
std::array< float, MAXNUMBERSTEPS > theStepInitialPhi
std::array< float, MAXNUMBERSTEPS > theCoolingDmb
std::array< float, MAXNUMBERSTEPS > theVolumeX
std::array< float, MAXNUMBERSTEPS > theLeadDil
std::array< float, MAXNUMBERSTEPS > theCablesDil
std::array< float, MAXNUMBERSTEPS > theVolumeXaxis2
std::array< float, MAXNUMBERSTEPS > theSupportDil
std::array< float, MAXNUMBERSTEPS > theVolumeXaxis3
std::array< float, MAXNUMBERSTEPS > theStepFinalPt
std::array< float, MAXNUMBERSTEPS > theStepFinalPy
std::array< float, MAXNUMBERSTEPS > theDil
std::array< float, MAXNUMBERSTEPS > theMaterialLambda0
std::array< double, MAXNUMBERSTEPS > theFinalZ
std::array< float, MAXNUMBERSTEPS > theVolumeZ
std::array< int, MAXNUMBERSTEPS > theVolumeID
std::array< float, MAXNUMBERSTEPS > theVolumeY
std::array< float, MAXNUMBERSTEPS > theDmb
std::array< std::string, MAXNUMBERSTEPS > theVolumeName
void dataStartTrack(const G4Track *aTrack)
std::array< float, MAXNUMBERSTEPS > theStepFinalEnergy
std::array< float, MAXNUMBERSTEPS > theH_ScintillatorDmb
std::array< float, MAXNUMBERSTEPS > theStepInitialGamma
std::array< float, MAXNUMBERSTEPS > theSensitiveDmb
std::array< int, MAXNUMBERSTEPS > theMaterialID
std::array< float, MAXNUMBERSTEPS > theEpoxyDil
std::array< float, MAXNUMBERSTEPS > theElectronicsDmb
std::array< float, MAXNUMBERSTEPS > theVolumeYaxis3
std::array< float, MAXNUMBERSTEPS > theVolumeYaxis2
std::array< float, MAXNUMBERSTEPS > theCoolingDil
std::array< float, MAXNUMBERSTEPS > theH_ScintillatorDil
std::array< float, MAXNUMBERSTEPS > theOtherDil
std::array< float, MAXNUMBERSTEPS > theStepInitialEnergy
std::array< float, MAXNUMBERSTEPS > theElectronicsDil
dbl *** dir
Definition: mlp_gen.cc:35
std::array< float, MAXNUMBERSTEPS > theStainlessSteelDmb
std::array< float, MAXNUMBERSTEPS > theCablesDmb
std::array< float, MAXNUMBERSTEPS > theCopperDil
std::array< std::string, MAXNUMBERSTEPS > theMaterialName
std::array< float, MAXNUMBERSTEPS > theAluminiumDil
std::array< float, MAXNUMBERSTEPS > theVolumeZaxis3
std::array< float, MAXNUMBERSTEPS > theStepInitialPy
std::array< float, MAXNUMBERSTEPS > theAluminiumDmb
std::array< float, MAXNUMBERSTEPS > theStepFinalPz
std::array< double, MAXNUMBERSTEPS > theInitialX