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