101 tok_HRNDC_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>();
112 desc.add<
int>(
"Verbose", 0);
113 desc.add<
bool>(
"TestNumber",
true);
114 desc.add<
bool>(
"hep17",
false);
115 descriptions.
add(
"hcalSimHitCheck",
desc);
150 int iEtaMax = (iEtaHBMax > iEtaHEMax ? iEtaHBMax : iEtaHEMax);
184 meAllNHit_ = fs->
make<TH1D>(
"Hit01",
"Number of Hits in HCal", 20000, 0., 20000.);
185 meBadDetHit_ = fs->
make<TH1D>(
"Hit02",
"Hits with wrong Det", 100, 0., 100.);
186 meBadSubHit_ = fs->
make<TH1D>(
"Hit03",
"Hits with wrong Subdet", 100, 0., 100.);
187 meBadIdHit_ = fs->
make<TH1D>(
"Hit04",
"Hits with wrong ID", 100, 0., 100.);
188 meHBNHit_ = fs->
make<TH1D>(
"Hit05",
"Number of Hits in HB", 20000, 0., 20000.);
189 meHENHit_ = fs->
make<TH1D>(
"Hit06",
"Number of Hits in HE", 10000, 0., 10000.);
190 meHONHit_ = fs->
make<TH1D>(
"Hit07",
"Number of Hits in HO", 10000, 0., 10000.);
191 meHFNHit_ = fs->
make<TH1D>(
"Hit08",
"Number of Hits in HF", 10000, 0., 10000.);
197 meSubdetHit_ = fs->
make<TH1D>(
"Hit10",
"Subdetectors in HCal", 50, 0., 50.);
203 sprintf(hname,
"Hit12bd%d",
depth);
204 sprintf(htitle,
"Eta-phi in HCal d%d",
depth);
213 meTimeHit_ = fs->
make<TH1D>(
"Hit15",
"Time in HCal", 528, 0., 528.);
214 meTimeWHit_ = fs->
make<TH1D>(
"Hit16",
"Time in HCal (E wtd)", 528, 0., 528.);
223 meHFDepHitw_ = fs->
make<TH1D>(
"Hit20b",
"Depths in HF (p.e. weighted)", 20, 0., 20.);
244 meHFEneHit_ = fs->
make<TH1D>(
"Hit32",
"Energy in HF", 1001, -0.5, 1000.5);
265 meHFEneSum_ = fs->
make<TH1D>(
"HFEneSum",
"HFEneSum", 1001, -0.5, 1000.5);
294 meHBL10Ene_ = fs->
make<TH1D>(
"Hit41",
"Log10Energy in HB", 140, -10., 4.);
295 meHEL10Ene_ = fs->
make<TH1D>(
"Hit42",
"Log10Energy in HE", 140, -10., 4.);
296 meHFL10Ene_ = fs->
make<TH1D>(
"Hit43",
"Log10Energy in HF", 50, -1., 4.);
297 meHOL10Ene_ = fs->
make<TH1D>(
"Hit44",
"Log10Energy in HO", 140, -10., 4.);
298 meHBL10EneP_ = fs->
make<TProfile>(
"Hit45",
"Log10Energy in HB vs Hit contribution", 140, -10., 4., 0., 1.);
299 meHEL10EneP_ = fs->
make<TProfile>(
"Hit46",
"Log10Energy in HE vs Hit contribution", 140, -10., 4., 0., 1.);
300 meHFL10EneP_ = fs->
make<TProfile>(
"Hit47",
"Log10Energy in HF vs Hit contribution", 140, -10., 4., 0., 1.);
301 meHOL10EneP_ = fs->
make<TProfile>(
"Hit48",
"Log10Energy in HO vs Hit contribution", 140, -10., 4., 0., 1.);
307 edm::LogVerbatim(
"HcalSim") <<
"Run = " <<
e.id().run() <<
" Event = " <<
e.id().event();
309 std::vector<PCaloHit> caloHits;
312 bool getHits =
false;
319 edm::LogVerbatim(
"HcalSim") <<
"HcalValidation: Input flags Hits " << getHits;
322 caloHits.insert(caloHits.end(), hitsHcal->begin(), hitsHcal->end());
324 edm::LogVerbatim(
"HcalSim") <<
"HcalValidation: Hit buffer " << caloHits.size();
330 int nHit =
hits.size();
331 int nHB = 0, nHE = 0, nHO = 0, nHF = 0, nBad1 = 0, nBad2 = 0, nBad = 0;
332 std::vector<double> encontHB(140, 0.);
333 std::vector<double> encontHE(140, 0.);
334 std::vector<double> encontHF(140, 0.);
335 std::vector<double> encontHO(140, 0.);
336 double entotHB = 0, entotHE = 0, entotHF = 0, entotHO = 0;
373 for (
int i = 0;
i < nHit;
i++) {
375 double log10en = log10(
energy);
376 int log10i =
int((log10en + 10.) * 10.);
378 unsigned int id =
hits[
i].id();
393 << subdet <<
" depth " <<
depth <<
" Eta " <<
eta <<
" Phi " <<
phi <<
" E " <<
energy
398 else if (subdet == static_cast<int>(
HcalEndcap))
400 else if (subdet == static_cast<int>(
HcalOuter))
425 else if (subdet == static_cast<int>(
HcalEndcap))
427 else if (subdet == static_cast<int>(
HcalOuter))
451 if (log10i >= 0 && log10i < 140)
452 encontHB[log10i] +=
energy;
457 }
else if (subdet == static_cast<int>(
HcalEndcap)) {
462 bool isHEP17 = (
phi >= 63) && (
phi <= 66) && (
eta > 0);
478 if (log10i >= 0 && log10i < 140)
479 encontHE[log10i] +=
energy;
484 }
else if (subdet == static_cast<int>(
HcalOuter)) {
492 if (log10i >= 0 && log10i < 140)
493 encontHO[log10i] +=
energy;
498 }
else if (subdet == static_cast<int>(
HcalForward)) {
507 if (log10i >= 0 && log10i < 140)
508 encontHF[log10i] +=
energy;
516 for (
int i = 0;
i < 140;
i++)
517 meHBL10EneP_->Fill(-10. + (
float(
i) + 0.5) / 10., encontHB[
i] / entotHB);
519 for (
int i = 0;
i < 140;
i++)
520 meHEL10EneP_->Fill(-10. + (
float(
i) + 0.5) / 10., encontHE[
i] / entotHE);
522 for (
int i = 0;
i < 140;
i++)
523 meHFL10EneP_->Fill(-10. + (
float(
i) + 0.5) / 10., encontHF[
i] / entotHF);
525 for (
int i = 0;
i < 140;
i++)
526 meHOL10EneP_->Fill(-10. + (
float(
i) + 0.5) / 10., encontHO[
i] / entotHO);
539 if (HBEneMap[
i][
j] != 0) {
549 if (HEEneMap[
i][
j] != 0) {
559 if (HOEneMap[
i][
j] != 0) {
569 if (HFEneMap[
i][
j] != 0) {
578 edm::LogVerbatim(
"HcalSim") <<
"HcalSimHitCheck::analyzeHits: HB " << nHB <<
" HE " << nHE <<
" HO " << nHO
579 <<
" HF " << nHF <<
" Bad " << nBad <<
" All " << nHit;