4 #include "G4Material.hh" 5 #include "G4EventManager.hh" 7 #include "DD4hep/Filter.h" 23 const G4ThreeVector&
dir = aTrack->GetMomentum();
135 theID = (
int)(aTrack->GetDefinition()->GetPDGEncoding());
137 if (
dir.theta() != 0) {
144 theMass = aTrack->GetDefinition()->GetPDGMass();
148 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: [OVAL] MaterialBudget " 149 << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID()
152 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData:" <<
theStepN <<
"Recorded steps ";
155 LogDebug(
"Material Budget") <<
"MaterialBudgetData: Radiation Length " 156 << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() <<
" Eta" 161 LogDebug(
"Material Budget") <<
"MaterialBudgetData: Interaction Length " 162 << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() <<
" Eta " 169 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: HGCal Material Budget: Radiation Length " 170 << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() <<
" Eta " 181 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: HGCal Material Budget: Interaction Length " 182 << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() <<
" Eta " 196 G4StepPoint* prePoint = aStep->GetPreStepPoint();
197 G4StepPoint* postPoint = aStep->GetPostStepPoint();
200 G4Material* theMaterialPre = prePoint->GetMaterial();
203 CLHEP::Hep3Vector prePos = prePoint->GetPosition();
204 CLHEP::Hep3Vector postPos = postPoint->GetPosition();
206 G4double steplen = aStep->GetStepLength();
208 G4double radlen = theMaterialPre->GetRadlen();
209 G4double intlen = theMaterialPre->GetNuclearInterLength();
212 G4String materialName =
static_cast<std::string>(dd4hep::dd::noNamespace(theMaterialPre->GetName()));
214 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: Material " << materialName <<
" steplen " << steplen <<
" radlen " 215 << radlen <<
" mb " << steplen / radlen;
218 dd4hep::dd::noNamespace(aStep->GetPreStepPoint()->GetTouchable()->GetVolume(0)->GetLogicalVolume()->GetName()));
220 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: Volume " << volumeName <<
" Material " << materialName;
227 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: Volume ID " << volumeID <<
" Material ID " << materialID;
239 if (materialName.compare(
"Air") == 0) {
245 edm::LogVerbatim(
"MaterialBudget") <<
"MaterialBudgetData: Material forced to 'Other': " << materialName
246 <<
" in volume " << volumeName <<
". Check Categorization.";
259 <<
"MaterialBudgetData: Material found with no category: " << materialName <<
" in volume " << volumeName;
271 <<
"MaterialBudgetData: Material found with no category: " << materialName <<
" in volume " << volumeName;
278 if (isHGCalx0fractionEmpty && isHGCall0fractionEmpty) {
282 edm::LogVerbatim(
"MaterialBudget") <<
"MaterialBudgetData: Material forced to 'Other': " << materialName
283 <<
" in volume " << volumeName;
305 std::cout <<
"MaterialBudgetData: Material found with no category: " << materialName <<
" in volume " 306 << volumeName << std::endl;
326 edm::LogVerbatim(
"MaterialBudget") <<
"MaterialBudgetData: Material found with no category " << materialName
327 <<
" in volume " << volumeName << std::endl;
331 float dmb = steplen / radlen;
332 float dil = steplen / intlen;
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();
341 G4Track*
track = aStep->GetTrack();
343 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: Simulated Particle " <<
theID <<
"\tMass " <<
theMass 345 <<
"\tPt = " <<
thePt <<
" MeV/c" 446 int preProcType = -99;
447 int postProcType = -99;
449 preProcType = interactionPre->GetProcessType();
452 postProcType = interactionPost->GetProcessType();
468 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: Process Pre " << interactionPre->GetProcessName() <<
" type " 473 <<
"MaterialBudgetData: Process Post " << interactionPost->GetProcessName() <<
" type " 478 <<
" Polar Radius = " <<
sqrt(prePos.x() * prePos.x() + prePos.y() * prePos.y())
481 <<
" Polar Radius = " <<
sqrt(postPos.x() * postPos.x() + postPos.y() * postPos.y())
508 <<
" Secondaries" << std::endl;
510 for (G4TrackVector::const_iterator iSec = aStep->GetSecondary()->begin(); iSec != aStep->GetSecondary()->end();
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()));
519 theTrkLen = aStep->GetTrack()->GetTrackLength();
Log< level::Info, true > LogVerbatim
std::array< float, MAXNUMBERSTEPS > theVolumeYaxis3
std::array< float, MAXNUMBERSTEPS > theMaterialX0
std::array< float, MAXNUMBERSTEPS > theStepInitialBeta
float theHGC_EEConnectorMB
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
float theSensitiveFractionIL
float theAluminiumFractionMB
std::array< float, MAXNUMBERSTEPS > theLeadDil
float theStainlessSteelMB
std::array< float, MAXNUMBERSTEPS > theCopperDmb
std::array< float, MAXNUMBERSTEPS > theSiliconDmb
float theHGC_G10_FR4FractionIL
float theCoolingFractionIL
std::array< float, MAXNUMBERSTEPS > theSensitiveDmb
std::array< double, MAXNUMBERSTEPS > theFinalX
std::array< double, MAXNUMBERSTEPS > theInitialZ
std::array< float, MAXNUMBERSTEPS > theStepFinalPy
float theElectronicsFractionMB
float theCopperFractionIL
float theHGC_EEConnectorFractionMB
float theHGC_HEConnectorMB
std::array< float, MAXNUMBERSTEPS > theStepFinalEnergy
std::array< float, MAXNUMBERSTEPS > theMaterialLambda0
float theElectronicsFractionIL
float theH_ScintillatorIL
std::array< float, MAXNUMBERSTEPS > theSiliconDil
float theCoolingFractionMB
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
std::array< float, MAXNUMBERSTEPS > theStepFinalPt
std::array< float, MAXNUMBERSTEPS > theHGC_G10_FR4Dmb
std::array< float, MAXNUMBERSTEPS > theStepInitialEta
float theKaptonFractionMB
std::array< float, MAXNUMBERSTEPS > theDil
float theH_ScintillatorFractionMB
float theSensitiveFractionMB
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
float theHGC_EEConnectorIL
float thePolystyreneFractionMB
std::array< float, MAXNUMBERSTEPS > theStepFinalGamma
std::array< float, MAXNUMBERSTEPS > theWCuDmb
float theStainlessSteelFractionIL
float theSupportFractionIL
std::array< double, MAXNUMBERSTEPS > theInitialX
std::array< float, MAXNUMBERSTEPS > theVolumeZaxis2
std::array< float, MAXNUMBERSTEPS > theHGC_HEConnectorDmb
std::array< float, MAXNUMBERSTEPS > theStainlessSteelDmb
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
float thePolystyreneFractionIL
std::array< float, MAXNUMBERSTEPS > theAluminiumDmb
float theHGC_HEConnectorFractionMB
std::array< float, MAXNUMBERSTEPS > theStepInitialPy
std::array< double, MAXNUMBERSTEPS > theInitialY
std::array< float, MAXNUMBERSTEPS > theEpoxyDmb
std::array< float, MAXNUMBERSTEPS > theStepFinalMass
float theH_ScintillatorMB
float theH_ScintillatorFractionIL
float theHGC_G10_FR4FractionMB
float theCablesFractionMB
std::array< float, MAXNUMBERSTEPS > theKaptonDil
std::array< float, MAXNUMBERSTEPS > theH_ScintillatorDil
std::array< float, MAXNUMBERSTEPS > theVolumeX
std::array< float, MAXNUMBERSTEPS > theStepInitialEnergy
float theCablesFractionIL
float theStainlessSteelIL
std::array< float, MAXNUMBERSTEPS > theHGC_G10_FR4Dil
std::array< float, MAXNUMBERSTEPS > theVolumeZaxis1
std::array< float, MAXNUMBERSTEPS > theStepInitialPt
std::array< float, MAXNUMBERSTEPS > theDmb
float theHGC_HEConnectorIL
std::array< float, MAXNUMBERSTEPS > theCablesDmb
std::array< int, MAXNUMBERSTEPS > theVolumeID
std::array< float, MAXNUMBERSTEPS > theStepFinalBeta
double densityConvertionFactor
std::array< float, MAXNUMBERSTEPS > theVolumeY
std::array< float, MAXNUMBERSTEPS > theMaterialDensity
float theCopperFractionMB
float theHGC_HEConnectorFractionIL
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
float theSiliconFractionMB
float theKaptonFractionIL
std::array< std::string, MAXNUMBERSTEPS > theVolumeName
float theStainlessSteelFractionMB
std::array< float, MAXNUMBERSTEPS > theOtherDil
std::array< float, MAXNUMBERSTEPS > theStepFinalPz
float theSupportFractionMB
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
float theAluminiumFractionIL
std::array< float, MAXNUMBERSTEPS > theStainlessSteelDil
std::array< float, MAXNUMBERSTEPS > theStepFinalPhi
std::array< float, MAXNUMBERSTEPS > theElectronicsDil
float theHGC_EEConnectorFractionIL
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
float theSiliconFractionIL