12 #include "G4LogicalVolumeStore.hh"
29 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudget initialized for " <<
detTypes.size() <<
" detector types";
45 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudget Stop condition for " <<
etaRegions.size() <<
" eta regions";
56 const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
57 std::vector<G4LogicalVolume*>::const_iterator lvcite;
59 unsigned int kount =
detNames.size();
60 for (
unsigned int ii = 0;
ii < kount; ++
ii)
63 for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++) {
65 if (strcmp(
detNames[
ii].c_str(), (*lvcite)->GetName().c_str()) == 0) {
99 const G4Track* aTrack = (*trk)();
100 const G4ThreeVector& mom = aTrack->GetMomentum();
101 if (mom.theta() != 0) {
110 double theEnergy = aTrack->GetTotalEnergy();
111 int theID = (
int)(aTrack->GetDefinition()->GetPDGEncoding());
112 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Track " << aTrack->GetTrackID() <<
" Code " << theID
113 <<
" Energy " << theEnergy /
CLHEP::GeV <<
" GeV; Eta " <<
eta_ <<
" Phi "
114 <<
phi_ / CLHEP::deg <<
" PT " << mom.perp() /
CLHEP::GeV <<
" GeV *****";
120 G4Material* material = aStep->GetPreStepPoint()->GetMaterial();
121 double step = aStep->GetStepLength();
122 double radl = material->GetRadlen();
123 double intl = material->GetNuclearInterLength();
125 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
126 unsigned int indx =
detTypes.size();
130 if (
detLevels[nc +
kk] <= (
int)((touch->GetHistoryDepth()) + 1)) {
132 if ((touch->GetVolume(
jj)->GetLogicalVolume()) ==
logVolumes[nc +
kk]) {
148 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudget::Step in " << touch->GetVolume(0)->GetLogicalVolume()->GetName()
149 <<
" Index " << indx <<
" Step " <<
step <<
" RadL " <<
step / radl <<
" IntL "
154 G4Track*
track = aStep->GetTrack();
155 track->SetTrackStatus(fStopAndKill);
192 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudget::Volume[" <<
ii <<
"]: " <<
name <<
" eta " <<
eta_ <<
" == Step "
202 if (!
tfile.isAvailable())
204 <<
"please add it to config file";
211 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudget: Booking user "
212 <<
"histos === with " << binEta <<
" bins "
213 <<
"in eta from " <<
minEta <<
" to " <<
maxEta <<
" and " << binPhi <<
" bins "
218 for (
unsigned int i = 0;
i <=
detTypes.size();
i++) {
223 sprintf(
name,
"%d",
i + 100);
224 sprintf(
title,
"MB(X0) prof Eta in %s", named.c_str());
226 sprintf(
name,
"%d",
i + 200);
227 sprintf(
title,
"MB(L0) prof Eta in %s", named.c_str());
229 sprintf(
name,
"%d",
i + 300);
230 sprintf(
title,
"MB(Step) prof Eta in %s", named.c_str());
232 sprintf(
name,
"%d",
i + 400);
233 sprintf(
title,
"MB(X0) prof Phi in %s", named.c_str());
235 sprintf(
name,
"%d",
i + 500);
236 sprintf(
title,
"MB(L0) prof Phi in %s", named.c_str());
238 sprintf(
name,
"%d",
i + 600);
239 sprintf(
title,
"MB(Step) prof Phi in %s", named.c_str());
243 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudget: Booking user "
244 <<
"histos done ===";
248 G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
249 if (aStep->GetPostStepPoint() !=
nullptr)
250 hitPoint = aStep->GetPostStepPoint()->GetPosition();
251 double rr = hitPoint.perp();
257 edm::LogInfo(
"MaterialBudget") <<
" MaterialBudget::Eta " <<
eta_ <<
" in Region[" <<
ii <<
"] with "
270 edm::LogInfo(
"MaterialBudget") <<
" MaterialBudget::Stop after R = " <<
rr <<
" and Z = " <<
zz;
276 edm::LogInfo(
"MaterialBudget") <<
" MaterialBudget:: R = " <<
rr <<
" and Z = " <<
zz <<
" Flag " <<
flag;