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
43 DDValue ddv1(attribute,value,0);
48 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Names to be "
49 <<
"tested for " << attribute <<
" = "
53 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: sensitives["
59 DDValue ddv2(attribute,value,0);
67 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Names to be "
68 <<
"tested for " << attribute <<
" = "
69 << value <<
" has " <<
hfNames.size()
71 for (
unsigned int i=0;
i<
hfNames.size();
i++) {
72 int level =
static_cast<int>(temp[
i]);
74 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: HF[" <<
i
75 <<
"] = " <<
hfNames[
i] <<
" at level "
79 std::string ecalRO[2] = {
"EcalHitsEB",
"EcalHitsEE"};
80 attribute =
"ReadOutName";
81 for (
int k=0;
k<2;
k++) {
84 DDValue ddv3(attribute,value,0);
88 std::vector<std::string> senstmp =
getNames(fv3);
89 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Names to be"
90 <<
" tested for " << attribute <<
" = "
91 << value <<
" has " << senstmp.size()
93 for (
unsigned int i=0;
i<senstmp.size();
i++)
97 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos:sensitiveEC["
108 const G4ThreeVector&
dir = aTrack->GetMomentum() ;
109 if (dir.theta() != 0 ) {
115 double theEnergy = aTrack->GetTotalEnergy();
116 int theID = (int)(aTrack->GetDefinition()->GetPDGEncoding());
125 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Track "
126 << aTrack->GetTrackID() <<
" Code " << theID
127 <<
" Energy " << theEnergy/
GeV <<
" GeV; Eta "
128 <<
eta <<
" Phi " <<
phi/deg <<
" PT "
129 << dir.perp()/
GeV <<
" GeV *****";
135 G4Material * material = aStep->GetPreStepPoint()->GetMaterial();
136 double step = aStep->GetStepLength();
137 double radl = material->GetRadlen();
138 double intl = material->GetNuclearInterLength();
139 double density = material->GetDensity() / (
g/cm3);
142 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
162 edm::LogInfo(
"MaterialBudget") << name <<
" " << step <<
" " << matName
163 <<
" " <<
stepLen <<
" " << step/radl <<
" "
166 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Step at "
167 << name <<
" Length " << step <<
" in "
168 << matName <<
" of density " << density
169 <<
" g/cc; Radiation Length " <<radl <<
" mm;"
170 <<
" Interaction Length " << intl <<
" mm\n"
172 << aStep->GetPreStepPoint()->GetPosition()
174 <<aStep->GetPreStepPoint()->GetPosition().perp()
175 <<
" Length (so far) " <<
stepLen <<
" L/X0 "
176 << step/radl <<
"/" <<
radLen <<
" L/Lambda "
177 << step/intl <<
"/" <<
intLen;
192 det = (touch->GetReplicaNumber(1))/1000;
193 lay = (touch->GetReplicaNumber(0)/10)%100 + 3;
196 if (abeta < 1.479) lay =
layer + 1;
198 if (lay < 3) lay = 3;
199 if (lay ==
layer) lay++;
200 if (lay > 20) lay = 20;
202 }
else if (lay !=
layer) {
207 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Det " << det
208 <<
" Layer " << lay <<
" Eta " <<
eta
209 <<
" Phi " <<
phi/deg;
210 }
else if (
layer == 1) {
232 if (
layer == 21 && det == 5) {
233 if (!
isItHF(aStep->GetPostStepPoint()->GetTouchable())) {
234 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: After HF in "
235 << aStep->GetPostStepPoint()->GetTouchable()->GetVolume(0)->GetName();
269 <<
"please add it to config file";
272 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Booking user "
273 <<
"histos === with " <<
binEta <<
" bins "
274 <<
"in eta from " << -
maxEta <<
" to "
276 <<
"in phi from " << -maxPhi <<
" to "
282 iter = std::to_string(
i);
283 me100[
i] = tfile->
make<TProfile>(std::to_string(
i + 100).c_str(),
285 me200[
i] = tfile->
make<TProfile>(std::to_string(
i + 200).c_str(),
287 me300[
i] = tfile->
make<TProfile>(std::to_string(
i + 300).c_str(),
289 me400[
i] = tfile->
make<TH1F>(std::to_string(
i + 400).c_str(),
291 me500[
i] = tfile->
make<TProfile>(std::to_string(
i + 500).c_str(),
292 (
"MB(X0) prof Ph in region " + iter).c_str(),
binPhi, -maxPhi, maxPhi);
293 me600[
i] = tfile->
make<TProfile>(std::to_string(
i + 600).c_str(),
294 (
"MB(L0) prof Ph in region " + iter).c_str(),
binPhi, -maxPhi, maxPhi);
295 me700[
i] = tfile->
make<TProfile>(std::to_string(
i + 700).c_str(),
296 (
"MB(Step) prof Ph in region " + iter).c_str(),
binPhi, -maxPhi, maxPhi);
297 me800[
i] = tfile->
make<TH1F>(std::to_string(
i + 800).c_str(),
298 (
"Phi in region " + iter).c_str(),
binPhi, -maxPhi, maxPhi);
299 me900[
i] = tfile->
make<TProfile2D>(std::to_string(
i + 900).c_str(),
301 binPhi/2, -maxPhi, maxPhi);
302 me1000[
i]= tfile->
make<TProfile2D>(std::to_string(
i + 1000).c_str(),
304 binPhi/2, -maxPhi, maxPhi);
305 me1100[
i]= tfile->
make<TProfile2D>(std::to_string(
i + 1100).c_str(),
307 binPhi/2, -maxPhi, maxPhi);
308 me1200[
i]= tfile->
make<TH2F>(std::to_string(
i + 1200).c_str(),
310 binPhi/2, -maxPhi, maxPhi);
313 iter = std::to_string(
i);
314 me1300[
i]= tfile->
make<TH1F>(std::to_string(
i + 1300).c_str(),
315 (
"Events with layers Hit (0 all, 1 HB, ..) for " + iter).c_str(),
binEta, -
maxEta,
maxEta);
316 me1400[
i]= tfile->
make<TH2F>(std::to_string(
i + 1400).c_str(),
318 binPhi/2, -maxPhi, maxPhi);
319 me1500[
i]= tfile->
make<TProfile>(std::to_string(
i + 1500).c_str(),
320 (
"Number of layers crossed (0 all, 1 HB, ..) for " + iter).c_str(),
binEta, -
maxEta,
maxEta);
323 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Booking user "
324 <<
"histos done ===";
330 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos:FillHisto called "
331 <<
"with index " << ii <<
" integrated step "
335 if (ii >=0 && ii <
maxSet) {
399 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Save user "
405 std::vector<std::string>
tmp;
411 for (
unsigned int i=0;
i<tmp.size();
i++)
412 if (namx == tmp[
i]) ok =
false;
413 if (ok) tmp.push_back(namx);
422 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos:getDDDArray called "
427 const std::vector<double> & fvec = value.
doubles();
428 int nval = fvec.size();
430 edm::LogError(
"MaterialBudget") <<
"MaterialBudgetHcalHistos : # of "
431 << str <<
" bins " << nval
432 <<
" < 1 ==> illegal";
434 <<
"nval < 1 for array " << str <<
"\n";
439 edm::LogError(
"MaterialBudget") <<
"MaterialBudgetHcalHistos : cannot get "
442 <<
"cannot get array " << str <<
"\n";
448 std::vector<std::string>::const_iterator it =
sensitives.begin();
449 std::vector<std::string>::const_iterator itEnd =
sensitives.end();
450 for (; it != itEnd; ++it)
451 if (name == *it)
return true;
458 int levels = ((touch->GetHistoryDepth())+1);
459 for (
unsigned int it=0; it <
hfNames.size(); it++) {
462 if (name ==
hfNames[it])
return true;
470 std::vector<std::string>::const_iterator it =
sensitiveEC.begin();
471 std::vector<std::string>::const_iterator itEnd =
sensitiveEC.end();
472 for (; it != itEnd; ++it)
473 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 addFilter(const DDFilter &, DDLogOp op=DDLogOp::AND)
void fillPerStep(const G4Step *)
T * make(const Args &...args) const
make new ROOT object
type of data representation of DDCompactView
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
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
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
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.
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
std::vector< double > intLength
bool isItHF(const G4VTouchable *)
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.