6 #include "G4Material.hh"
7 #include "G4EventManager.hh"
103 std::cout <<
"MaterialBudget Analysis of Event #" << G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetEventID() << std::endl;
106 const G4ThreeVector&
dir = aTrack->GetMomentum() ;
152 theID = (int)(aTrack->GetDefinition()->GetPDGEncoding());
154 if( dir.theta() != 0 ) {
162 theMass = aTrack->GetDefinition()->GetPDGMass();
180 G4Material * theMaterialPre = aStep->GetPreStepPoint()->GetMaterial();
183 G4StepPoint* prePoint = aStep->GetPreStepPoint();
184 G4StepPoint* postPoint = aStep->GetPostStepPoint();
186 CLHEP::Hep3Vector prePos = prePoint->GetPosition();
187 CLHEP::Hep3Vector postPos = postPoint->GetPosition();
189 G4double steplen = aStep->GetStepLength();
195 radlen = theMaterialPre->GetRadlen();
196 intlen = theMaterialPre->GetNuclearInterLength();
199 G4String
name = theMaterialPre->GetName();
202 G4LogicalVolume* lv = aStep->GetTrack()->GetVolume()->GetLogicalVolume();
208 std::string volumeName = lv->GetName();
209 std::string materialName = lv->GetMaterial()->GetName();
225 <<
" in volume " << lv->GetName() << std::endl;
234 <<
" in volume " << lv->GetName() << std::endl;
239 float dmb = steplen/radlen;
240 float dil = steplen/intlen;
242 G4VPhysicalVolume* pv = aStep->GetPreStepPoint()->GetPhysicalVolume();
243 const G4VTouchable*
t = aStep->GetPreStepPoint()->GetTouchable();
244 G4ThreeVector objectTranslation = t->GetTranslation();
245 const G4RotationMatrix* objectRotation = t->GetRotation();
246 const G4VProcess* interactionPre = prePoint->GetProcessDefinedStep();
247 const G4VProcess* interactionPost = postPoint->GetProcessDefinedStep();
249 G4Track* track = aStep->GetTrack();
251 <<
"\tPt = " <<
thePt <<
" MeV/c" <<
"\tEta = " <<
theEta <<
"\tPhi = " <<
thePhi
323 int preProcType = -99;
324 int postProcType = -99;
325 if (interactionPre) preProcType = interactionPre->GetProcessType();
327 if (interactionPost) postProcType = interactionPost->GetProcessType();
352 std::cout <<
"\tProcess Pre " << interactionPre->GetProcessName()
356 std::cout <<
"\tProcess Post " << interactionPost->GetProcessName()
363 <<
"\tPolar Radius = " <<
sqrt(prePos.x()*prePos.x()+prePos.y()*prePos.y())
372 <<
"\tPolar Radius = " <<
sqrt(postPos.x()*postPos.x()+postPos.y()*postPos.y())
424 for(G4TrackVector::iterator iSec = aStep->GetSecondary()->begin(); iSec!=aStep->GetSecondary()->end(); iSec++) {
425 std::cout <<
"\t\tid " << (*iSec)->GetDefinition()->GetPDGEncoding()
426 <<
" created through process "
427 <<
" type " << (*iSec)->GetCreatorProcess()->GetProcessType()
428 <<
" " << (*iSec)->GetCreatorProcess()->GetProcessTypeName(G4ProcessType((*iSec)->GetCreatorProcess()->GetProcessType()))
434 theTrkLen = aStep->GetTrack()->GetTrackLength();
float * theStepInitialEnergy
float theSensitiveFractionIL
float theCoolingFractionIL
int material(std::string s)
std::vector< float > x0fraction(std::string s)
float theElectronicsFractionMB
float theElectronicsFractionIL
float theCoolingFractionMB
int volume(std::string s)
float * theStepFinalGamma
float * theElectronicsDil
std::string * theMaterialName
float theSensitiveFractionMB
float * theElectronicsDmb
float * theStepFinalEnergy
float * theStepInitialBeta
float theSupportFractionIL
void dataEndTrack(const G4Track *aTrack)
void dataPerStep(const G4Step *aStep)
float * theMaterialDensity
float * theStepInitialEta
float theCablesFractionMB
MaterialBudgetCategorizer * myMaterialBudgetCategorizer
float theCablesFractionIL
float * theStepInitialMass
float * theStepInitialGamma
double densityConvertionFactor
void dataStartTrack(const G4Track *aTrack)
float * theStepInitialPhi
std::string * theVolumeName
std::vector< float > l0fraction(std::string s)
float theSupportFractionMB
float * theMaterialLambda0