12 #include "G4LogicalVolumeStore.hh"
25 public Observer<const BeginOfTrack*>,
37 void update(
const G4Step*)
override;
41 int findVolume(
const G4VTouchable* touch,
bool stop)
const;
63 if (!
tfile.isAvailable())
65 <<
"please add it to config file";
68 for (
unsigned int i = 0;
i <=
nList_;
i++) {
70 sprintf(
name,
"RadL%d",
i);
71 sprintf(
title,
"MB(X0) for (%s)", named.c_str());
75 sprintf(
name,
"IntL%d",
i);
76 sprintf(
title,
"MB(L0) for (%s)", named.c_str());
80 sprintf(
name,
"StepL%d",
i);
81 sprintf(
title,
"MB(Step) for (%s)", named.c_str());
97 const G4Track* aTrack = (*trk)();
98 const G4ThreeVector& mom = aTrack->GetMomentum();
99 double theEnergy = aTrack->GetTotalEnergy();
100 int theID = (
int)(aTrack->GetDefinition()->GetPDGEncoding());
101 edm::LogVerbatim(
"HGCSim") <<
"MaterialBudgetHcalHistos: Track " << aTrack->GetTrackID() <<
" Code " << theID
102 <<
" Energy " << theEnergy /
CLHEP::GeV <<
" GeV; Momentum " << mom;
107 G4Material* material = aStep->GetPreStepPoint()->GetMaterial();
108 double step = aStep->GetStepLength();
109 double radl = material->GetRadlen();
110 double intl = material->GetNuclearInterLength();
112 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
124 edm::LogVerbatim(
"HGCSim") <<
"HGCalTBMB::Step in " << touch->GetVolume(0)->GetLogicalVolume()->GetName() <<
" Index "
125 << indx <<
" Step " <<
step <<
" RadL " <<
step / radl <<
" IntL " <<
step / intl;
129 G4Track*
track = aStep->GetTrack();
130 track->SetTrackStatus(fStopAndKill);
151 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
152 G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
153 if (aStep->GetPostStepPoint() !=
nullptr)
154 hitPoint = aStep->GetPostStepPoint()->GetPosition();
155 double zz = hitPoint.z();
160 edm::LogVerbatim(
"HGCSim") <<
" HGCalTBMB::Name " << touch->GetVolume(0)->GetName() <<
" z " <<
zz <<
" Flag" <<
flag;
167 int level = (touch->GetHistoryDepth()) + 1;
174 for (
unsigned int k = 0;
k <
nList_; ++
k) {