12 #include "CLHEP/Units/GlobalPhysicalConstants.h" 13 #include "CLHEP/Units/GlobalSystemOfUnits.h" 25 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: FillHisto : " <<
fillHistos <<
" PrintSummary " 26 << printSum <<
" == Eta plot: NX " <<
binEta <<
" Range " << -maxEta <<
":" << maxEta
27 <<
" Phi plot: NX " << binPhi <<
" Range " << -
pi <<
":" <<
pi <<
" (Eta limit " 40 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Names to be " 41 <<
"tested for " << attribute <<
" = " << value <<
" has " <<
sensitives.size()
54 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Names to be " 55 <<
"tested for " << attribute <<
" = " << value <<
" has " <<
hfNames.size()
57 for (
unsigned int i = 0;
i <
hfNames.size();
i++) {
58 int level =
static_cast<int>(temp[
i]);
60 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: HF[" <<
i <<
"] = " <<
hfNames[
i] <<
" at level " 64 std::string ecalRO[2] = {
"EcalHitsEB",
"EcalHitsEE"};
65 attribute =
"ReadOutName";
66 for (
int k = 0;
k < 2;
k++) {
70 std::vector<std::string> senstmp =
getNames(fv3);
71 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Names to be" 72 <<
" tested for " << attribute <<
" = " << value <<
" has " << senstmp.size()
74 for (
unsigned int i = 0;
i < senstmp.size();
i++)
87 const G4ThreeVector&
dir = aTrack->GetMomentum();
88 if (dir.theta() != 0) {
94 double theEnergy = aTrack->GetTotalEnergy();
95 int theID = (
int)(aTrack->GetDefinition()->GetPDGEncoding());
104 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Track " << aTrack->GetTrackID() <<
" Code " << theID
105 <<
" Energy " << theEnergy /
GeV <<
" GeV; Eta " <<
eta <<
" Phi " <<
phi / deg
106 <<
" PT " << dir.perp() /
GeV <<
" GeV *****";
110 G4Material* material = aStep->GetPreStepPoint()->GetMaterial();
111 double step = aStep->GetStepLength();
112 double radl = material->GetRadlen();
113 double intl = material->GetNuclearInterLength();
114 double density = material->GetDensity() / (
g / cm3);
117 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
137 edm::LogInfo(
"MaterialBudget") << name <<
" " << step <<
" " << matName <<
" " <<
stepLen <<
" " << step / radl
138 <<
" " <<
radLen <<
" " << step / intl <<
" " <<
intLen;
140 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Step at " << name <<
" Length " << step <<
" in " 141 << matName <<
" of density " << density <<
" g/cc; Radiation Length " << radl
143 <<
" Interaction Length " << intl <<
" mm\n" 144 <<
" Position " << aStep->GetPreStepPoint()->GetPosition()
145 <<
" Cylindrical R " << aStep->GetPreStepPoint()->GetPosition().perp()
146 <<
" Length (so far) " <<
stepLen <<
" L/X0 " << step / radl <<
"/" <<
radLen 147 <<
" L/Lambda " << step / intl <<
"/" <<
intLen;
150 int det = 0, lay = 0;
163 det = (touch->GetReplicaNumber(1)) / 1000;
164 lay = (touch->GetReplicaNumber(0) / 10) % 100 + 3;
179 }
else if (lay !=
layer) {
186 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Det " << det <<
" Layer " << lay <<
" Eta " <<
eta 187 <<
" Phi " <<
phi / deg;
188 }
else if (
layer == 1) {
210 if (
layer == 21 && det == 5) {
211 if (!
isItHF(aStep->GetPostStepPoint()->GetTouchable())) {
212 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: After HF in " 213 << aStep->GetPostStepPoint()->GetTouchable()->GetVolume(0)->GetName();
243 <<
"please add it to config file";
246 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Booking user " 247 <<
"histos === with " <<
binEta <<
" bins " 249 <<
"in phi from " << -maxPhi <<
" to " <<
maxPhi;
254 iter = std::to_string(
i);
256 std::to_string(
i + 100).c_str(), (
"MB(X0) prof Eta in region " + iter).c_str(),
binEta, -
maxEta,
maxEta);
258 std::to_string(
i + 200).c_str(), (
"MB(L0) prof Eta in region " + iter).c_str(),
binEta, -
maxEta,
maxEta);
260 std::to_string(
i + 300).c_str(), (
"MB(Step) prof Eta in region " + iter).c_str(),
binEta, -
maxEta,
maxEta);
262 tfile->
make<TH1F>(std::to_string(
i + 400).c_str(), (
"Eta in region " + iter).c_str(),
binEta, -
maxEta,
maxEta);
264 std::to_string(
i + 500).c_str(), (
"MB(X0) prof Ph in region " + iter).c_str(),
binPhi, -
maxPhi,
maxPhi);
266 std::to_string(
i + 600).c_str(), (
"MB(L0) prof Ph in region " + iter).c_str(),
binPhi, -
maxPhi,
maxPhi);
268 std::to_string(
i + 700).c_str(), (
"MB(Step) prof Ph in region " + iter).c_str(),
binPhi, -
maxPhi,
maxPhi);
270 tfile->
make<TH1F>(std::to_string(
i + 800).c_str(), (
"Phi in region " + iter).c_str(),
binPhi, -
maxPhi,
maxPhi);
271 me900[
i] = tfile->
make<TProfile2D>(std::to_string(
i + 900).c_str(),
272 (
"MB(X0) prof Eta Phi in region " + iter).c_str(),
279 me1000[
i] = tfile->
make<TProfile2D>(std::to_string(
i + 1000).c_str(),
280 (
"MB(L0) prof Eta Phi in region " + iter).c_str(),
287 me1100[
i] = tfile->
make<TProfile2D>(std::to_string(
i + 1100).c_str(),
288 (
"MB(Step) prof Eta Phi in region " + iter).c_str(),
295 me1200[
i] = tfile->
make<TH2F>(std::to_string(
i + 1200).c_str(),
296 (
"Eta vs Phi in region " + iter).c_str(),
305 iter = std::to_string(
i);
306 me1300[
i] = tfile->
make<TH1F>(std::to_string(
i + 1300).c_str(),
307 (
"Events with layers Hit (0 all, 1 HB, ..) for " + iter).c_str(),
311 me1400[
i] = tfile->
make<TH2F>(std::to_string(
i + 1400).c_str(),
312 (
"Eta vs Phi for layers hit in " + iter).c_str(),
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(),
326 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Booking user " 327 <<
"histos done ===";
331 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos:FillHisto called " 332 <<
"with index " << ii <<
" integrated step " <<
stepLen <<
" X0 " <<
radLen <<
" Lamda " 335 if (ii >= 0 && ii <
maxSet) {
397 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetHcalHistos: Save user " 402 std::vector<std::string>
tmp;
408 for (
unsigned int i = 0;
i < tmp.size();
i++)
419 LogDebug(
"MaterialBudget") <<
"MaterialBudgetHcalHistos:getDDDArray called " 424 const std::vector<double>& fvec = value.
doubles();
425 int nval = fvec.size();
427 edm::LogError(
"MaterialBudget") <<
"MaterialBudgetHcalHistos : # of " << str <<
" bins " << nval
428 <<
" < 1 ==> illegal";
429 throw cms::Exception(
"Unknown",
"MaterialBudgetHcalHistos") <<
"nval < 1 for array " << str <<
"\n";
434 edm::LogError(
"MaterialBudget") <<
"MaterialBudgetHcalHistos : cannot get " 436 throw cms::Exception(
"Unknown",
"MaterialBudgetHcalHistos") <<
"cannot get array " << str <<
"\n";
441 std::vector<std::string>::const_iterator it =
sensitives.begin();
442 std::vector<std::string>::const_iterator itEnd =
sensitives.end();
443 for (; it != itEnd; ++it)
451 int levels = ((touch->GetHistoryDepth()) + 1);
452 for (
unsigned int it = 0; it <
hfNames.size(); it++) {
463 std::vector<std::string>::const_iterator it =
sensitiveEC.begin();
464 std::vector<std::string>::const_iterator itEnd =
sensitiveEC.end();
465 for (; it != itEnd; ++it)
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 &)
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
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
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 *)