11 #include "G4LogicalVolumeStore.hh" 25 nList_ = listNames_.size();
26 edm::LogInfo(
"HGCSim") <<
"HGCalTBMB initialized for " << nList_ <<
" volumes\n";
28 edm::LogInfo(
"HGCSim") <<
" [" <<
k <<
"] " << listNames_[
k] << std::endl;
29 edm::LogInfo(
"HGCSim") <<
"Stop after " << stopZ_ <<
" or reaching volume " 30 << stopName_ << std::endl;
35 <<
"please add it to config file";
40 sprintf(name,
"RadL%d",
i);
41 sprintf(title,
"MB(X0) for (%s)", named.c_str());
45 sprintf(name,
"IntL%d",
i);
46 sprintf(title,
"MB(L0) for (%s)", named.c_str());
50 sprintf(name,
"StepL%d",
i);
51 sprintf(title,
"MB(Step) for (%s)", named.c_str());
56 edm::LogInfo(
"HGCSim") <<
"HGCalTBMB: Booking user histos done ===";
65 intLen_ = std::vector<double>(nList_+1,0);
66 stepLen_ = std::vector<double>(nList_+1,0);
69 const G4Track * aTrack = (*trk)();
70 const G4ThreeVector& mom = aTrack->GetMomentum() ;
71 double theEnergy = aTrack->GetTotalEnergy();
72 int theID = (
int)(aTrack->GetDefinition()->GetPDGEncoding());
73 std::cout <<
"MaterialBudgetHcalHistos: Track " << aTrack->GetTrackID()
74 <<
" Code " << theID <<
" Energy " <<theEnergy/
CLHEP::GeV 75 <<
" GeV; Momentum " << mom << std::endl;
81 G4Material * material = aStep->GetPreStepPoint()->GetMaterial();
82 double step = aStep->GetStepLength();
83 double radl = material->GetRadlen();
84 double intl = material->GetNuclearInterLength();
86 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
99 << touch->GetVolume(0)->GetLogicalVolume()->GetName()
100 <<
" Index " << indx <<
" Step " << step <<
" RadL " << step/radl
101 <<
" IntL " << step/intl << std::endl;
105 G4Track*
track = aStep->GetTrack();
106 track->SetTrackStatus(fStopAndKill);
119 std::cout <<
"HGCalTBMB::Volume[" << ii <<
"]: " << name <<
" == Step " 129 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
130 G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
131 if (aStep->GetPostStepPoint() != 0)
132 hitPoint = aStep->GetPostStepPoint()->GetPosition();
133 double zz = hitPoint.z();
137 std::cout <<
" HGCalTBMB::Name " << touch->GetVolume(0)->GetName() <<
" z " 138 << zz <<
" Flag" << flag << std::endl;
146 int level = (touch->GetHistoryDepth())+1;
150 if (strcmp(name.c_str(),
stopName_.c_str()) == 0) ivol = 0;
153 if (strcmp(name.c_str(),
listNames_[
k].c_str()) == 0) {
158 if (ivol >= 0)
break;
T getParameter(std::string const &) const
T * make(const Args &...args) const
make new ROOT object
int findVolume(const G4VTouchable *touch, bool stop) const
bool stopAfter(const G4Step *)
std::vector< double > intLen_
void update(const BeginOfTrack *)
This routine will be called when the appropriate signal arrives.
std::vector< TH1D * > me100_
std::vector< TH1D * > me300_
HGCalTBMB(const edm::ParameterSet &)
std::vector< TH1D * > me200_
std::vector< double > radLen_
std::vector< std::string > listNames_
std::vector< double > stepLen_