12 #include "CLHEP/Units/GlobalPhysicalConstants.h" 13 #include "CLHEP/Units/GlobalSystemOfUnits.h" 26 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: FillHisto : " 28 <<
" == Eta plot: NX " <<
binEta <<
" Range " 29 << -maxEta <<
":" << maxEta <<
" Phi plot: NX " 30 << binPhi <<
" Range " << -
pi <<
":" <<
pi 45 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Names to be " 46 <<
"tested for " << attribute <<
" = " 50 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: sensitives[" 61 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Names to be " 62 <<
"tested for " << attribute <<
" = " 63 << value <<
" has " <<
hfNames.size()
65 for (
unsigned int i=0;
i<
hfNames.size();
i++) {
66 int level =
static_cast<int>(temp[
i]);
68 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: HF[" <<
i 69 <<
"] = " <<
hfNames[
i] <<
" at level " 73 std::string ecalRO[2] = {
"EcalHitsEB",
"EcalHitsEE"};
74 attribute =
"ReadOutName";
75 for (
int k=0;
k<2;
k++) {
79 std::vector<std::string> senstmp =
getNames(fv3);
80 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Names to be" 81 <<
" tested for " << attribute <<
" = " 82 << value <<
" has " << senstmp.size()
84 for (
unsigned int i=0;
i<senstmp.size();
i++)
88 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos:sensitiveEC[" 99 const G4ThreeVector&
dir = aTrack->GetMomentum() ;
100 if (dir.theta() != 0 ) {
106 double theEnergy = aTrack->GetTotalEnergy();
107 int theID = (
int)(aTrack->GetDefinition()->GetPDGEncoding());
116 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Track " 117 << aTrack->GetTrackID() <<
" Code " << theID
118 <<
" Energy " << theEnergy/
GeV <<
" GeV; Eta " 119 <<
eta <<
" Phi " <<
phi/deg <<
" PT " 120 << dir.perp()/
GeV <<
" GeV *****";
126 G4Material * material = aStep->GetPreStepPoint()->GetMaterial();
127 double step = aStep->GetStepLength();
128 double radl = material->GetRadlen();
129 double intl = material->GetNuclearInterLength();
130 double density = material->GetDensity() / (
g/cm3);
133 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
153 edm::LogInfo(
"MaterialBudget") << name <<
" " << step <<
" " << matName
154 <<
" " <<
stepLen <<
" " << step/radl <<
" " 157 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Step at " 158 << name <<
" Length " << step <<
" in " 159 << matName <<
" of density " << density
160 <<
" g/cc; Radiation Length " <<radl <<
" mm;" 161 <<
" Interaction Length " << intl <<
" mm\n" 163 << aStep->GetPreStepPoint()->GetPosition()
165 <<aStep->GetPreStepPoint()->GetPosition().perp()
166 <<
" Length (so far) " <<
stepLen <<
" L/X0 " 167 << step/radl <<
"/" <<
radLen <<
" L/Lambda " 168 << step/intl <<
"/" <<
intLen;
183 det = (touch->GetReplicaNumber(1))/1000;
184 lay = (touch->GetReplicaNumber(0)/10)%100 + 3;
187 if (abeta < 1.479) lay =
layer + 1;
189 if (lay < 3) lay = 3;
190 if (lay ==
layer) lay++;
191 if (lay > 20) lay = 20;
193 }
else if (lay !=
layer) {
198 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Det " << det
199 <<
" Layer " << lay <<
" Eta " <<
eta 200 <<
" Phi " <<
phi/deg;
201 }
else if (
layer == 1) {
223 if (
layer == 21 && det == 5) {
224 if (!
isItHF(aStep->GetPostStepPoint()->GetTouchable())) {
225 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: After HF in " 226 << aStep->GetPostStepPoint()->GetTouchable()->GetVolume(0)->GetName();
260 <<
"please add it to config file";
263 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Booking user " 264 <<
"histos === with " <<
binEta <<
" bins " 265 <<
"in eta from " << -
maxEta <<
" to " 267 <<
"in phi from " << -maxPhi <<
" to " 273 iter = std::to_string(
i);
274 me100[
i] = tfile->
make<TProfile>(std::to_string(
i + 100).c_str(),
276 me200[
i] = tfile->
make<TProfile>(std::to_string(
i + 200).c_str(),
278 me300[
i] = tfile->
make<TProfile>(std::to_string(
i + 300).c_str(),
280 me400[
i] = tfile->
make<TH1F>(std::to_string(
i + 400).c_str(),
282 me500[
i] = tfile->
make<TProfile>(std::to_string(
i + 500).c_str(),
284 me600[
i] = tfile->
make<TProfile>(std::to_string(
i + 600).c_str(),
286 me700[
i] = tfile->
make<TProfile>(std::to_string(
i + 700).c_str(),
288 me800[
i] = tfile->
make<TH1F>(std::to_string(
i + 800).c_str(),
290 me900[
i] = tfile->
make<TProfile2D>(std::to_string(
i + 900).c_str(),
293 me1000[
i]= tfile->
make<TProfile2D>(std::to_string(
i + 1000).c_str(),
296 me1100[
i]= tfile->
make<TProfile2D>(std::to_string(
i + 1100).c_str(),
299 me1200[
i]= tfile->
make<TH2F>(std::to_string(
i + 1200).c_str(),
304 iter = std::to_string(
i);
305 me1300[
i]= tfile->
make<TH1F>(std::to_string(
i + 1300).c_str(),
306 (
"Events with layers Hit (0 all, 1 HB, ..) for " + iter).c_str(),
binEta, -
maxEta,
maxEta);
307 me1400[
i]= tfile->
make<TH2F>(std::to_string(
i + 1400).c_str(),
310 me1500[
i]= tfile->
make<TProfile>(std::to_string(
i + 1500).c_str(),
311 (
"Number of layers crossed (0 all, 1 HB, ..) for " + iter).c_str(),
binEta, -
maxEta,
maxEta);
314 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Booking user " 315 <<
"histos done ===";
321 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos:FillHisto called " 322 <<
"with index " << ii <<
" integrated step " 326 if (ii >=0 && ii <
maxSet) {
390 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Save user " 396 std::vector<std::string>
tmp;
402 for (
unsigned int i=0;
i<tmp.size();
i++)
403 if (namx == tmp[
i]) ok =
false;
404 if (ok) tmp.push_back(namx);
413 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos:getDDDArray called " 418 const std::vector<double> & fvec = value.
doubles();
419 int nval = fvec.size();
421 edm::LogError(
"MaterialBudget") <<
"MaterialBudgetHcalHistos : # of " 422 << str <<
" bins " << nval
423 <<
" < 1 ==> illegal";
425 <<
"nval < 1 for array " << str <<
"\n";
430 edm::LogError(
"MaterialBudget") <<
"MaterialBudgetHcalHistos : cannot get " 433 <<
"cannot get array " << str <<
"\n";
439 std::vector<std::string>::const_iterator it =
sensitives.begin();
440 std::vector<std::string>::const_iterator itEnd =
sensitives.end();
441 for (; it != itEnd; ++it)
442 if (name == *it)
return true;
449 int levels = ((touch->GetHistoryDepth())+1);
450 for (
unsigned int it=0; it <
hfNames.size(); it++) {
453 if (name ==
hfNames[it])
return true;
461 std::vector<std::string>::const_iterator it =
sensitiveEC.begin();
462 std::vector<std::string>::const_iterator itEnd =
sensitiveEC.end();
463 for (; it != itEnd; ++it)
464 if (name == *it)
return true;
T getUntrackedParameter(std::string const &, T const &) const
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
std::vector< double > stepLength
TProfile2D * me1100[maxSet]
void fillPerStep(const G4Step *)
T * make(const Args &...args) const
make new ROOT object
Compact representation of the geometrical detector hierarchy.
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
std::vector< int > hfLevels
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
std::vector< std::string > getNames(DDFilteredView &fv)
std::vector< std::string > hfNames
bool isSensitive(std::string)
void fillBeginJob(const DDCompactView &)
TProfile2D * me900[maxSet]
std::vector< std::string > matList
void fillStartTrack(const G4Track *)
bool next()
set current node to the next node in the filtered tree
std::vector< double > radLength
Abs< T >::type abs(const T &t)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
std::vector< std::string > sensitiveEC
TProfile2D * me1000[maxSet]
DDsvalues_type mergedSpecifics() const
std::vector< std::vector< double > > tmp
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
bool firstChild()
set the current node to the first child ...
MaterialBudgetHcalHistos(const edm::ParameterSet &p)
std::vector< std::string > sensitives
TProfile * me1500[maxSet2]
std::vector< double > getDDDArray(const std::string &str, const DDsvalues_type &sv)
const std::string & name() const
Returns the name.
std::vector< double > intLength
bool isItHF(const G4VTouchable *)