12 #include "CLHEP/Units/GlobalPhysicalConstants.h"
13 #include "CLHEP/Units/GlobalSystemOfUnits.h"
24 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: FillHisto : "
26 <<
" == Eta plot: NX " <<
binEta <<
" Range "
27 << -maxEta <<
":" << maxEta <<
" Phi plot: NX "
28 << binPhi <<
" Range " << -
pi <<
":" <<
pi
41 DDValue ddv1(attribute,value,0);
46 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Names to be "
47 <<
"tested for " << attribute <<
" = "
51 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: sensitives["
57 DDValue ddv2(attribute,value,0);
65 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Names to be "
66 <<
"tested for " << attribute <<
" = "
67 << value <<
" has " <<
hfNames.size()
69 for (
unsigned int i=0;
i<
hfNames.size();
i++) {
70 int level =
static_cast<int>(temp[
i]);
72 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: HF[" <<
i
73 <<
"] = " <<
hfNames[
i] <<
" at level "
77 std::string ecalRO[2] = {
"EcalHitsEB",
"EcalHitsEE"};
78 attribute =
"ReadOutName";
79 for (
int k=0;
k<2;
k++) {
82 DDValue ddv3(attribute,value,0);
86 std::vector<std::string> senstmp =
getNames(fv3);
87 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Names to be"
88 <<
" tested for " << attribute <<
" = "
89 << value <<
" has " << senstmp.size()
91 for (
unsigned int i=0;
i<senstmp.size();
i++)
95 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos:sensitiveEC["
106 const G4ThreeVector&
dir = aTrack->GetMomentum() ;
107 if (dir.theta() != 0 ) {
113 double theEnergy = aTrack->GetTotalEnergy();
114 int theID = (int)(aTrack->GetDefinition()->GetPDGEncoding());
123 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Track "
124 << aTrack->GetTrackID() <<
" Code " << theID
125 <<
" Energy " << theEnergy/
GeV <<
" GeV; Eta "
126 <<
eta <<
" Phi " <<
phi/deg <<
" PT "
127 << dir.perp()/
GeV <<
" GeV *****";
133 G4Material * material = aStep->GetPreStepPoint()->GetMaterial();
134 double step = aStep->GetStepLength();
135 double radl = material->GetRadlen();
136 double intl = material->GetNuclearInterLength();
137 double density = material->GetDensity() / (
g/cm3);
140 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
160 edm::LogInfo(
"MaterialBudget") << name <<
" " << step <<
" " << matName
161 <<
" " <<
stepLen <<
" " << step/radl <<
" "
164 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Step at "
165 << name <<
" Length " << step <<
" in "
166 << matName <<
" of density " << density
167 <<
" g/cc; Radiation Length " <<radl <<
" mm;"
168 <<
" Interaction Length " << intl <<
" mm\n"
170 << aStep->GetPreStepPoint()->GetPosition()
172 <<aStep->GetPreStepPoint()->GetPosition().perp()
173 <<
" Length (so far) " <<
stepLen <<
" L/X0 "
174 << step/radl <<
"/" <<
radLen <<
" L/Lambda "
175 << step/intl <<
"/" <<
intLen;
190 det = (touch->GetReplicaNumber(1))/1000;
191 lay = (touch->GetReplicaNumber(0)/10)%100 + 3;
194 if (abeta < 1.479) lay =
layer + 1;
196 if (lay < 3) lay = 3;
197 if (lay ==
layer) lay++;
198 if (lay > 20) lay = 20;
200 }
else if (lay !=
layer) {
205 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Det " << det
206 <<
" Layer " << lay <<
" Eta " <<
eta
207 <<
" Phi " <<
phi/deg;
208 }
else if (
layer == 1) {
230 if (
layer == 21 && det == 5) {
231 if (!
isItHF(aStep->GetPostStepPoint()->GetTouchable())) {
232 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: After HF in "
233 << aStep->GetPostStepPoint()->GetTouchable()->GetVolume(0)->GetName();
267 <<
"please add it to config file";
270 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Booking user "
271 <<
"histos === with " <<
binEta <<
" bins "
272 <<
"in eta from " << -
maxEta <<
" to "
274 <<
"in phi from " << -maxPhi <<
" to "
280 sprintf(name,
"%d",
i+100);
281 sprintf(title,
"MB(X0) prof Eta in region %d",
i);
283 sprintf(name,
"%d",
i+200);
284 sprintf(title,
"MB(L0) prof Eta in region %d",
i);
286 sprintf(name,
"%d",
i+300);
287 sprintf(title,
"MB(Step) prof Eta in region %d",
i);
289 sprintf(name,
"%d",
i+400);
290 sprintf(title,
"Eta in region %d",
i);
292 sprintf(name,
"%d",
i+500);
293 sprintf(title,
"MB(X0) prof Ph in region %d",
i);
295 sprintf(name,
"%d",
i+600);
296 sprintf(title,
"MB(L0) prof Ph in region %d",
i);
298 sprintf(name,
"%d",
i+700);
299 sprintf(title,
"MB(Step) prof Ph in region %d",
i);
301 sprintf(name,
"%d",
i+800);
302 sprintf(title,
"Phi in region %d",
i);
304 sprintf(name,
"%d",
i+900);
305 sprintf(title,
"MB(X0) prof Eta Phi in region %d",
i);
307 binPhi/2, -maxPhi, maxPhi);
308 sprintf(name,
"%d",
i+1000);
309 sprintf(title,
"MB(L0) prof Eta Phi in region %d",
i);
311 binPhi/2, -maxPhi, maxPhi);
312 sprintf(name,
"%d",
i+1100);
313 sprintf(title,
"MB(Step) prof Eta Phi in region %d",
i);
315 binPhi/2, -maxPhi, maxPhi);
316 sprintf(name,
"%d",
i+1200);
317 sprintf(title,
"Eta vs Phi in region %d",
i);
319 binPhi/2, -maxPhi, maxPhi);
322 sprintf(name,
"%d",
i+1300);
323 sprintf(title,
"Events with layers Hit (0 all, 1 HB, ..) for %d",
i);
325 sprintf(name,
"%d",
i+1400);
326 sprintf(title,
"Eta vs Phi for layers hit in %d",
i);
328 binPhi/2, -maxPhi, maxPhi);
329 sprintf(name,
"%d",
i+1500);
330 sprintf(title,
"Number of layers crossed (0 all, 1 HB, ..) for %d",
i);
334 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Booking user "
335 <<
"histos done ===";
341 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos:FillHisto called "
342 <<
"with index " << ii <<
" integrated step "
346 if (ii >=0 && ii <
maxSet) {
410 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Save user "
416 std::vector<std::string>
tmp;
422 for (
unsigned int i=0;
i<tmp.size();
i++)
423 if (namx == tmp[
i]) ok =
false;
424 if (ok) tmp.push_back(namx);
433 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos:getDDDArray called "
438 const std::vector<double> & fvec = value.
doubles();
439 int nval = fvec.size();
441 edm::LogError(
"MaterialBudget") <<
"MaterialBudgetHcalHistos : # of "
442 << str <<
" bins " << nval
443 <<
" < 1 ==> illegal";
445 <<
"nval < 1 for array " << str <<
"\n";
450 edm::LogError(
"MaterialBudget") <<
"MaterialBudgetHcalHistos : cannot get "
453 <<
"cannot get array " << str <<
"\n";
459 std::vector<std::string>::const_iterator it =
sensitives.begin();
460 std::vector<std::string>::const_iterator itEnd =
sensitives.end();
461 for (; it != itEnd; ++it)
462 if (name == *it)
return true;
469 int levels = ((touch->GetHistoryDepth())+1);
470 for (
unsigned int it=0; it <
hfNames.size(); it++) {
473 if (name ==
hfNames[it])
return true;
481 std::vector<std::string>::const_iterator it =
sensitiveEC.begin();
482 std::vector<std::string>::const_iterator itEnd =
sensitiveEC.end();
483 for (; it != itEnd; ++it)
484 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.