4 #include "G4Material.hh" 5 #include "G4EventManager.hh" 28 const G4ThreeVector&
dir = aTrack->GetMomentum() ;
126 theID = (
int)(aTrack->GetDefinition()->GetPDGEncoding());
128 if( dir.theta() != 0 ) {
135 theMass = aTrack->GetDefinition()->GetPDGMass();
141 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: [OVAL] MaterialBudget " 142 << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID()
145 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData:" <<
theStepN <<
"Recorded steps ";
149 LogDebug(
"Material Budget") <<
"MaterialBudgetData: Radiation Length " 150 << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID()
152 <<
" TotalMB" << theTotalMB
158 LogDebug(
"Material Budget") <<
"MaterialBudgetData: Interaction Length " 159 << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID()
165 <<
" Air " <<
theAirIL << std::endl;
169 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: HGCal Material Budget: Radiation Length " 170 << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID()
172 <<
" TotaLMB" << theTotalMB
179 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: HGCal Material Budget: Interaction Length " 180 << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID()
188 <<
" theWCuIL " <<
theWCuIL << std::endl;
195 G4StepPoint* prePoint = aStep->GetPreStepPoint();
196 G4StepPoint* postPoint = aStep->GetPostStepPoint();
199 G4Material * theMaterialPre = prePoint->GetMaterial();
200 assert(theMaterialPre);
202 CLHEP::Hep3Vector prePos = prePoint->GetPosition();
203 CLHEP::Hep3Vector postPos = postPoint->GetPosition();
205 G4double steplen = aStep->GetStepLength();
207 G4double radlen = theMaterialPre->GetRadlen();
208 G4double intlen = theMaterialPre->GetNuclearInterLength();
211 G4String materialName = theMaterialPre->GetName();
213 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: Material " << materialName
214 <<
" steplen " << steplen
215 <<
" radlen " << radlen
216 <<
" mb " << steplen/radlen;
218 G4String volumeName = aStep->GetPreStepPoint()->GetTouchable()->GetVolume(0)->GetLogicalVolume()->GetName();
220 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: Volume " << volumeName
221 <<
" Material " << materialName;
228 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: Volume ID " << volumeID
229 <<
" Material ID " << materialID;
243 if(materialName.compare(
"Air") == 0){
250 <<
"MaterialBudgetData: Material forced to 'Other': " << materialName
251 <<
" in volume " << volumeName <<
". Check Categorization.";
265 edm::LogWarning(
"MaterialBudget") <<
"MaterialBudgetData: Material found with no category: " << materialName
266 <<
" in volume " << volumeName;
277 edm::LogWarning(
"MaterialBudget") <<
"MaterialBudgetData: Material found with no category: " << materialName
278 <<
" in volume " << volumeName;
285 if( isHGCalx0fractionEmpty && isHGCall0fractionEmpty ) {
289 edm::LogWarning(
"MaterialBudget") <<
"MaterialBudgetData: Material forced to 'Other': " << materialName
290 <<
" in volume " << volumeName;
311 std::cout <<
"MaterialBudgetData: Material found with no category: " << materialName
312 <<
" in volume " << volumeName << std::endl;
330 edm::LogWarning(
"MaterialBudget") <<
"MaterialBudgetData: Material found with no category " << materialName
331 <<
" in volume " << volumeName << std::endl;
335 float dmb = steplen/radlen;
336 float dil = steplen/intlen;
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();
345 G4Track*
track = aStep->GetTrack();
347 LogDebug(
"MaterialBudget") <<
"MaterialBudgetData: Simulated Particle " <<
theID 348 <<
"\tMass " <<
theMass <<
" MeV/c2" 349 <<
"\tPt = " <<
thePt <<
" MeV/c" 445 int preProcType = -99;
446 int postProcType = -99;
447 if (interactionPre) preProcType = interactionPre->GetProcessType();
449 if (interactionPost) postProcType = interactionPost->GetProcessType();
453 <<
"MaterialBudgetData: Step " <<
theStepN 476 <<
"MaterialBudgetData: Process Pre " << interactionPre->GetProcessName()
481 <<
"MaterialBudgetData: Process Post " << interactionPost->GetProcessName()
483 <<
" name "<< interactionPost->GetProcessTypeName(G4ProcessType(
theStepPostProcess[theStepN]))
487 <<
" Polar Radius = " <<
sqrt(prePos.x()*prePos.x()+prePos.y()*prePos.y())
494 <<
" Polar Radius = " <<
sqrt(postPos.x()*postPos.x()+postPos.y()*postPos.y())
498 <<
" Volume " << volumeID <<
" name " <<
theVolumeName[theStepN]
523 <<
" Volume Centre x = " <<
theVolumeX[theStepN]
547 for(G4TrackVector::const_iterator iSec = aStep->GetSecondary()->begin(); iSec!=aStep->GetSecondary()->end(); iSec++) {
549 <<
"MaterialBudgetData: tid " << (*iSec)->GetDefinition()->GetPDGEncoding()
550 <<
" created through process type " << (*iSec)->GetCreatorProcess()->GetProcessType()
551 << (*iSec)->GetCreatorProcess()->GetProcessTypeName(G4ProcessType((*iSec)->GetCreatorProcess()->GetProcessType()));
555 theTrkLen = aStep->GetTrack()->GetTrackLength();
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
float theSensitiveFractionIL
float theAluminiumFractionMB
float theStainlessSteelMB
float theHGC_G10_FR4FractionIL
std::array< float, MAXNUMBERSTEPS > theStepInitialBeta
float theCoolingFractionIL
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
float theElectronicsFractionMB
std::array< int, MAXNUMBERSTEPS > theStepPostProcess
std::array< float, MAXNUMBERSTEPS > theSiliconDil
float theCopperFractionIL
std::array< float, MAXNUMBERSTEPS > theKaptonDmb
std::array< float, MAXNUMBERSTEPS > theCopperDmb
std::array< double, MAXNUMBERSTEPS > theFinalX
float theElectronicsFractionIL
std::array< float, MAXNUMBERSTEPS > theStepFinalBeta
float theH_ScintillatorIL
float theCoolingFractionMB
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
float theKaptonFractionMB
float theH_ScintillatorFractionMB
float theSensitiveFractionMB
std::array< float, MAXNUMBERSTEPS > theHGC_G10_FR4Dmb
static int MAXNUMBERSTEPS
std::unique_ptr< MaterialBudgetCategorizer > myMaterialBudgetCategorizer
std::array< float, MAXNUMBERSTEPS > theSiliconDmb
std::array< int, MAXNUMBERSTEPS > theVolumeCopy
std::array< float, MAXNUMBERSTEPS > theLeadDmb
float theStainlessSteelFractionIL
float theSupportFractionIL
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
void dataEndTrack(const G4Track *aTrack)
std::array< float, MAXNUMBERSTEPS > theSensitiveDil
std::array< double, MAXNUMBERSTEPS > theFinalY
void dataPerStep(const G4Step *aStep)
float theH_ScintillatorMB
float theH_ScintillatorFractionIL
std::array< float, MAXNUMBERSTEPS > theStepFinalPx
std::array< float, MAXNUMBERSTEPS > theStepInitialEta
std::array< float, MAXNUMBERSTEPS > theStepInitialPhi
std::array< float, MAXNUMBERSTEPS > theCoolingDmb
float theHGC_G10_FR4FractionMB
float theCablesFractionMB
std::array< float, MAXNUMBERSTEPS > theVolumeX
std::array< float, MAXNUMBERSTEPS > theLeadDil
std::array< float, MAXNUMBERSTEPS > theCablesDil
float theCablesFractionIL
float theStainlessSteelIL
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
double densityConvertionFactor
std::array< double, MAXNUMBERSTEPS > theFinalZ
std::array< float, MAXNUMBERSTEPS > theVolumeZ
float theCopperFractionMB
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
float theSiliconFractionMB
std::array< int, MAXNUMBERSTEPS > theMaterialID
std::array< float, MAXNUMBERSTEPS > theEpoxyDil
float theKaptonFractionIL
std::array< float, MAXNUMBERSTEPS > theElectronicsDmb
std::array< float, MAXNUMBERSTEPS > theVolumeYaxis3
std::array< float, MAXNUMBERSTEPS > theVolumeYaxis2
float theStainlessSteelFractionMB
std::array< float, MAXNUMBERSTEPS > theCoolingDil
std::array< float, MAXNUMBERSTEPS > theH_ScintillatorDil
float theSupportFractionMB
std::array< float, MAXNUMBERSTEPS > theOtherDil
std::array< float, MAXNUMBERSTEPS > theStepInitialEnergy
std::array< float, MAXNUMBERSTEPS > theElectronicsDil
std::array< float, MAXNUMBERSTEPS > theStainlessSteelDmb
float theAluminiumFractionIL
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
float theSiliconFractionIL