82 : g4Label(ps.getUntrackedParameter<
std::
string>(
"moduleLabel",
"g4SimHits")),
83 hcalHits(ps.getUntrackedParameter<
std::
string>(
"HitCollection",
"HcalHits")),
84 outFile_(ps.getUntrackedParameter<
std::
string>(
"outputFile",
"hcHit.root")),
85 verbose_(ps.getUntrackedParameter<
bool>(
"Verbose",
false)),
87 testNumber_(ps.getParameter<
bool>(
"TestNumber")),
88 hep17_(ps.getParameter<
bool>(
"hep17")),
127 int iEtaMax = (iEtaHBMax > iEtaHEMax ? iEtaHBMax : iEtaHEMax);
157 ib.setCurrentFolder(
"HcalHitsV/HcalSimHitsTask");
161 meAllNHit_ =
ib.book1D(
"Hit01",
"Number of Hits in HCal", 20000, 0., 20000.);
162 meBadDetHit_ =
ib.book1D(
"Hit02",
"Hits with wrong Det", 100, 0., 100.);
163 meBadSubHit_ =
ib.book1D(
"Hit03",
"Hits with wrong Subdet", 100, 0., 100.);
164 meBadIdHit_ =
ib.book1D(
"Hit04",
"Hits with wrong ID", 100, 0., 100.);
165 meHBNHit_ =
ib.book1D(
"Hit05",
"Number of Hits in HB", 20000, 0., 20000.);
166 meHENHit_ =
ib.book1D(
"Hit06",
"Number of Hits in HE", 10000, 0., 10000.);
167 meHONHit_ =
ib.book1D(
"Hit07",
"Number of Hits in HO", 10000, 0., 10000.);
168 meHFNHit_ =
ib.book1D(
"Hit08",
"Number of Hits in HF", 10000, 0., 10000.);
170 meSubdetHit_ =
ib.book1D(
"Hit10",
"Subdetectors in HCal", 50, 0., 50.);
171 meDepthHit_ =
ib.book1D(
"Hit11",
"Depths in HCal", 20, 0., 20.);
176 sprintf(hname,
"Hit12bd%d",
depth);
177 sprintf(htitle,
"Eta-phi in HCal d%d",
depth);
185 meEnergyHit_ =
ib.book1D(
"Hit14",
"Energy in HCal", 2000, 0., 20.);
186 meTimeHit_ =
ib.book1D(
"Hit15",
"Time in HCal", 528, 0., 528.);
187 meTimeWHit_ =
ib.book1D(
"Hit16",
"Time in HCal (E wtd)", 528, 0., 528.);
188 meHBDepHit_ =
ib.book1D(
"Hit17",
"Depths in HB", 20, 0., 20.);
189 meHEDepHit_ =
ib.book1D(
"Hit18",
"Depths in HE", 20, 0., 20.);
190 meHODepHit_ =
ib.book1D(
"Hit19",
"Depths in HO", 20, 0., 20.);
191 meHFDepHit_ =
ib.book1D(
"Hit20",
"Depths in HF", 20, 0., 20.);
192 meHFDepHitw_ =
ib.book1D(
"Hit20b",
"Depths in HF (p.e. weighted)", 20, 0., 20.);
201 meHBEneHit_ =
ib.book1D(
"Hit29",
"Energy in HB", 2000, 0., 20.);
202 meHEEneHit_ =
ib.book1D(
"Hit30",
"Energy in HE", 500, 0., 5.);
204 meHOEneHit_ =
ib.book1D(
"Hit31",
"Energy in HO", 500, 0., 5.);
205 meHFEneHit_ =
ib.book1D(
"Hit32",
"Energy in HF", 1001, -0.5, 1000.5);
219 meHBEneSum_ =
ib.book1D(
"HBEneSum",
"HBEneSum", 2000, 0., 20.);
220 meHEEneSum_ =
ib.book1D(
"HEEneSum",
"HEEneSum", 500, 0., 5.);
221 meHOEneSum_ =
ib.book1D(
"HOEneSum",
"HOEneSum", 500, 0., 5.);
222 meHFEneSum_ =
ib.book1D(
"HFEneSum",
"HFEneSum", 1001, -0.5, 1000.5);
233 meHBTimHit_ =
ib.book1D(
"Hit33",
"Time in HB", 528, 0., 528.);
234 meHETimHit_ =
ib.book1D(
"Hit34",
"Time in HE", 528, 0., 528.);
235 meHOTimHit_ =
ib.book1D(
"Hit35",
"Time in HO", 528, 0., 528.);
236 meHFTimHit_ =
ib.book1D(
"Hit36",
"Time in HF", 528, 0., 528.);
238 meHBEneHit2_ =
ib.book1D(
"Hit37",
"Energy in HB 2", 100, 0., 0.0001);
239 meHEEneHit2_ =
ib.book1D(
"Hit38",
"Energy in HE 2", 100, 0., 0.0001);
241 meHOEneHit2_ =
ib.book1D(
"Hit39",
"Energy in HO 2", 100, 0., 0.0001);
242 meHFEneHit2_ =
ib.book1D(
"Hit40",
"Energy in HF 2", 100, 0.5, 100.5);
243 meHBL10Ene_ =
ib.book1D(
"Hit41",
"Log10Energy in HB", 140, -10., 4.);
244 meHEL10Ene_ =
ib.book1D(
"Hit42",
"Log10Energy in HE", 140, -10., 4.);
245 meHFL10Ene_ =
ib.book1D(
"Hit43",
"Log10Energy in HF", 50, -1., 4.);
246 meHOL10Ene_ =
ib.book1D(
"Hit44",
"Log10Energy in HO", 140, -10., 4.);
247 meHBL10EneP_ =
ib.bookProfile(
"Hit45",
"Log10Energy in HB vs Hit contribution", 140, -10., 4., 100, 0., 1.);
248 meHEL10EneP_ =
ib.bookProfile(
"Hit46",
"Log10Energy in HE vs Hit contribution", 140, -10., 4., 100, 0., 1.);
249 meHFL10EneP_ =
ib.bookProfile(
"Hit47",
"Log10Energy in HF vs Hit contribution", 140, -10., 4., 100, 0., 1.);
250 meHOL10EneP_ =
ib.bookProfile(
"Hit48",
"Log10Energy in HO vs Hit contribution", 140, -10., 4., 100, 0., 1.);
259 edm::LogVerbatim(
"HcalSim") <<
"Run = " <<
e.id().run() <<
" Event = " <<
e.id().event();
261 bool getHits =
false;
266 std::vector<PCaloHit> caloHits;
267 caloHits.insert(caloHits.end(), hitsHcal->begin(), hitsHcal->end());
268 edm::LogVerbatim(
"HcalSim") <<
"HcalValidation: Hit buffer " << caloHits.size();
273 edm::LogVerbatim(
"HcalSim") <<
"HcalValidation: Input flags Hits " << getHits;
277 int nHit =
hits.size();
278 int nHB = 0, nHE = 0, nHO = 0, nHF = 0, nBad1 = 0, nBad2 = 0, nBad = 0;
279 std::vector<double> encontHB(140, 0.);
280 std::vector<double> encontHE(140, 0.);
281 std::vector<double> encontHF(140, 0.);
282 std::vector<double> encontHO(140, 0.);
283 double entotHB = 0, entotHE = 0, entotHF = 0, entotHO = 0;
320 for (
int i = 0;
i < nHit;
i++) {
322 double log10en = log10(
energy);
323 int log10i =
int((log10en + 10.) * 10.);
325 unsigned int id =
hits[
i].id();
339 << subdet <<
" depth " <<
depth <<
" Eta " <<
eta <<
" Phi " <<
phi <<
" E " <<
energy 344 else if (subdet == static_cast<int>(
HcalEndcap))
346 else if (subdet == static_cast<int>(
HcalOuter))
371 else if (subdet == static_cast<int>(
HcalEndcap))
373 else if (subdet == static_cast<int>(
HcalOuter))
397 if (log10i >= 0 && log10i < 140)
398 encontHB[log10i] +=
energy;
403 }
else if (subdet == static_cast<int>(
HcalEndcap)) {
408 bool isHEP17 = (
phi >= 63) && (
phi <= 66) && (
eta > 0);
424 if (log10i >= 0 && log10i < 140)
425 encontHE[log10i] +=
energy;
430 }
else if (subdet == static_cast<int>(
HcalOuter)) {
438 if (log10i >= 0 && log10i < 140)
439 encontHO[log10i] +=
energy;
444 }
else if (subdet == static_cast<int>(
HcalForward)) {
453 if (log10i >= 0 && log10i < 140)
454 encontHF[log10i] +=
energy;
462 for (
int i = 0;
i < 140;
i++)
465 for (
int i = 0;
i < 140;
i++)
468 for (
int i = 0;
i < 140;
i++)
471 for (
int i = 0;
i < 140;
i++)
485 if (HBEneMap[
i][
j] != 0) {
495 if (HEEneMap[
i][
j] != 0) {
505 if (HOEneMap[
i][
j] != 0) {
515 if (HFEneMap[
i][
j] != 0) {
523 edm::LogVerbatim(
"HcalSim") <<
"HcalSimHitStudy::analyzeHits: HB " << nHB <<
" HE " << nHE <<
" HO " << nHO <<
" HF " 524 << nHF <<
" Bad " << nBad <<
" All " << nHit;
MonitorElement * mePhiHit_
MonitorElement * meHBEneMap_
Log< level::Info, true > LogVerbatim
std::pair< int, int > getEtaRange(const int &i) const
MonitorElement * meHEDepHit_
MonitorElement * meHOL10Ene_
std::vector< PCaloHit > PCaloHitContainer
MonitorElement * meHOEneSum_vs_ieta_
MonitorElement * meHOEneSum_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
MonitorElement * meHOPhiHit_
MonitorElement * meDetectHit_
MonitorElement * meHFNHit_
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * meHFEtaHit_
int getNPhi(const int &type) const
MonitorElement * meHFL10EneP_
MonitorElement * meHBEneSum_vs_ieta_
MonitorElement * meHFEneHit2_
MonitorElement * meHOL10EneP_
MonitorElement * meHFDepHitw_
MonitorElement * meHBNHit_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meHFTimHit_
MonitorElement * meHEEneSum_vs_ieta_
constexpr Detector det() const
get the detector field from this detid
MonitorElement * meHBEneHit2_
MonitorElement * meHONHit_
MonitorElement * meAllNHit_
MonitorElement * meHBL10Ene_
MonitorElement * meHEEneSum_
constexpr HcalSubdetector subdet() const
get the subdetector
const std::string outFile_
MonitorElement * meBadDetHit_
MonitorElement * meHEP17EneHit2_
MonitorElement * meHFL10Ene_
MonitorElement * mePhiHitb_
const std::string hcalHits
MonitorElement * meHETimHit_
constexpr int ieta() const
get the cell ieta
MonitorElement * meTimeHit_
void analyzeHits(std::vector< PCaloHit > &)
const HcalDDDRecConstants * hcons_
MonitorElement * meHFDepHit_
MonitorElement * meHBEneSum_
MonitorElement * meHOEneMap_
MonitorElement * meHBTimHit_
MonitorElement * meHFEneSum_vs_ieta_
MonitorElement * meTimeWHit_
#define DEFINE_FWK_MODULE(type)
DetId relabel(const uint32_t testId) const
int getMaxDepth(const int &type) const
MonitorElement * meHBDepHit_
MonitorElement * meHFEneSum_
MonitorElement * meHFEneMap_
~HcalSimHitStudy() override=default
MonitorElement * meBadSubHit_
MonitorElement * meHENHit_
MonitorElement * meBadIdHit_
MonitorElement * meHEL10EneP_
MonitorElement * meEnergyHit_
const edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tok_HRNDC_
MonitorElement * meHOEtaHit_
MonitorElement * meEtaPhiHit_
MonitorElement * meHEEneMap_
MonitorElement * meEtaHit_
MonitorElement * meHBEneHit_
MonitorElement * meHOTimHit_
MonitorElement * meHBL10EneP_
MonitorElement * meHEEneHit2_
MonitorElement * meHFPhiHit_
MonitorElement * meDepthHit_
MonitorElement * meHBEtaHit_
const std::string g4Label
MonitorElement * meHODepHit_
std::vector< MonitorElement * > meEtaPhiHitDepth_
MonitorElement * meHEL10Ene_
MonitorElement * meHEEneHit_
MonitorElement * meHEPhiHit_
HcalSimHitStudy(const edm::ParameterSet &ps)
MonitorElement * meSubdetHit_
MonitorElement * meHBPhiHit_
constexpr int iphi() const
get the cell iphi
MonitorElement * meHEP17EneHit_
MonitorElement * meHFEneHit_
MonitorElement * meHEEtaHit_
MonitorElement * meHOEneHit_
MonitorElement * meHOEneHit2_
constexpr int depth() const
get the tower depth