82 : g4Label(ps.getUntrackedParameter<
std::
string>(
"moduleLabel",
"g4SimHits")),
83 hcalHits(ps.getUntrackedParameter<
std::
string>(
"HitCollection",
"HcalHits")),
85 nxNInfo(ps.getUntrackedParameter<
std::
string>(
"NxNInfo",
"PHcalValidInfoNxN")),
86 jetsInfo(ps.getUntrackedParameter<
std::
string>(
"JetsInfo",
"PHcalValidInfoJets")),
87 outFile_(ps.getUntrackedParameter<
std::
string>(
"outputFile",
"hcValid.root")),
88 verbose_(ps.getUntrackedParameter<
bool>(
"Verbose",
false)),
89 scheme_(ps.getUntrackedParameter<
bool>(
"TestNumbering",
true)),
90 checkHit_(ps.getUntrackedParameter<
bool>(
"CheckHits",
true)),
91 checkLay_(ps.getUntrackedParameter<
bool>(
"CheckLayer",
true)),
92 checkNxN_(ps.getUntrackedParameter<
bool>(
"CheckNxN",
true)),
93 checkJet_(ps.getUntrackedParameter<
bool>(
"CheckJets",
true)),
101 <<
" Output: " <<
outFile_ <<
" Usage of TestNumberingScheme " <<
scheme_;
108 double my_pi = 3.1415926;
111 meAllNHit_ = ibooker.
book1D(
"Hit01",
"Number of Hits in HCal", 1000, 0., 5000.);
115 meHBNHit_ = ibooker.
book1D(
"Hit05",
"Number of Hits in HB", 1000, 0., 5000.);
116 meHENHit_ = ibooker.
book1D(
"Hit06",
"Number of Hits in HE", 1000, 0., 5000.);
117 meHONHit_ = ibooker.
book1D(
"Hit07",
"Number of Hits in HO", 1000, 0., 5000.);
118 meHFNHit_ = ibooker.
book1D(
"Hit08",
"Number of Hits in HF", 1000, 0., 5000.);
147 mePMTHit_ = ibooker.
book1D(
"Hit37",
"Number of Hit in PMT", 1000, 0., 1000.);
160 mePhiHLay_ = ibooker.
book1D(
"Lay03",
"Phi of the Hits", 100, -my_pi, my_pi);
165 meEtaPhi_ = ibooker.
book2D(
"Lay08",
"Phi%Eta of the Hits", 100, -5., 5., 100, -my_pi, my_pi);
173 sprintf(
name,
"Layl%d",
nn);
175 sprintf(
title,
"Energy deposit in Layer %d",
i);
178 meLngLay_ = ibooker.
book1D(
"Lay13",
"Lonitudinal Shower Profile", 20, 0, 20.);
181 sprintf(
name,
"Layl%d",
nn);
183 sprintf(
title,
"Energy deposit in Depth %d",
i);
200 meHoRNxN_ = ibooker.
book1D(
"NxN03",
"Energy in HO (NxN)r", 100, 0., 200.);
202 meEcalNxN_ = ibooker.
book1D(
"NxN05",
"Energy in ECal (NxN)", 100, 0., 200.);
203 meHcalNxN_ = ibooker.
book1D(
"NxN06",
"Energy in HCal (NxN)", 100, 0., 200.);
204 meHoNxN_ = ibooker.
book1D(
"NxN07",
"Energy in HO (NxN)", 100, 0., 200.);
206 meEiNxN_ = ibooker.
book1D(
"NxN09",
"Energy of Hits in (NxN)", 100, 0., 1.);
207 meTiNxN_ = ibooker.
book1D(
"NxN10",
"Time of Hits in (NxN)", 100, 0., 400.);
208 meTrNxN_ = ibooker.
book1D(
"NxN11",
"Dist. of Hits in (NxN)", 100, 0., 1.);
214 meTJet_ = ibooker.
book1D(
"Jet02",
"T of Hits", 100, 0., 200.);
215 meEJet_ = ibooker.
book1D(
"Jet03",
"E of Hits", 100, 0., 200.);
216 meEcalJet_ = ibooker.
book1D(
"Jet04",
"Ecal Energy (First Jet)", 100, 0., 200.);
217 meHcalJet_ = ibooker.
book1D(
"Jet05",
"Hcal Energy (First Jet)", 100, 0., 200.);
218 meHoJet_ = ibooker.
book1D(
"Jet06",
"Ho Energy (First Jet)", 100, 0., 200.);
219 meEtotJet_ = ibooker.
book1D(
"Jet07",
"Total Energy(First Jet)", 100, 0., 200.);
220 meEcHcJet_ = ibooker.
book2D(
"Jet08",
"Energy in Hcal% Ecal", 100, 0., 200., 100, 0., 200.);
233 edm::LogVerbatim(
"HcalHitValid") <<
"Run = " <<
e.id().run() <<
" Event = " <<
e.id().event();
235 bool getHits =
false;
241 std::vector<PCaloHit> caloHits;
242 caloHits.insert(caloHits.end(), hitsHcal->begin(), hitsHcal->end());
243 edm::LogVerbatim(
"HcalHitValid") <<
"HcalValidation: Hit buffer " << caloHits.size();
266 bool getJets =
false;
276 <<
", NxN " << getNxN <<
", Jets " << getJets;
280 int nHit =
hits.size();
281 int nHB = 0, nHE = 0, nHO = 0, nHF = 0, nPMT = 0, nBad1 = 0, nBad2 = 0, nBad = 0;
282 for (
int i = 0;
i < nHit;
i++) {
285 unsigned int id_ =
hits[
i].id();
289 subdet = (id_ >> 28) & 15;
290 depth = (id_ >> 26) & 3;
292 int zside = ((id_ & 0x100000) ? (1) : (-1));
298 subdet =
id.subdet();
303 uint16_t depth_ =
hits[
i].depth();
304 double energyEM =
hits[
i].energyEM();
305 double energyHad =
hits[
i].energyHad();
307 <<
" Sub " << subdet <<
" depth " <<
depth <<
" " << depth_ <<
" Eta " <<
eta 308 <<
" Phi " <<
phi <<
" E " <<
energy <<
"(EM " << energyEM <<
", Had " << energyHad
309 <<
") time " <<
time;
313 }
else if (subdet == static_cast<int>(
HcalEndcap)) {
315 }
else if (subdet == static_cast<int>(
HcalOuter)) {
317 }
else if (subdet == static_cast<int>(
HcalForward)) {
332 if (det == 4 && depth_ == 0) {
346 }
else if (subdet == static_cast<int>(
HcalEndcap)) {
352 }
else if (subdet == static_cast<int>(
HcalOuter)) {
358 }
else if (subdet == static_cast<int>(
HcalForward)) {
365 }
else if (det == 0 && subdet == static_cast<int>(
HcalForward)) {
384 edm::LogVerbatim(
"HcalHitValid") <<
"HcalHitValidation::analyzeHits: HB " << nHB <<
" HE " << nHE <<
" HO " << nHO
385 <<
" HF " << nHF <<
" PMT " << nPMT <<
" Bad " << nBad <<
" All " << nHit;
391 std::vector<float> idHits = infoLayer->
idHit();
392 std::vector<float> phiHits = infoLayer->
phiHit();
393 std::vector<float> etaHits = infoLayer->
etaHit();
394 std::vector<float> layerHits = infoLayer->
layerHit();
395 std::vector<float> eHits = infoLayer->
eHit();
396 std::vector<float> tHits = infoLayer->
tHit();
401 int id = (
int)(idHits[
j]);
409 edm::LogVerbatim(
"HcalHitValid") <<
"HcalHitValidation::analyzeLayer:Hit subdet = " <<
id <<
" lay = " <<
layer;
429 std::vector<float> eLayer = infoLayer->
elayer();
430 std::vector<float> eDepth = infoLayer->
edepth();
446 double eHO = infoLayer->
eho();
447 double eHBHE = infoLayer->
ehbhe();
448 double elongHF = infoLayer->
elonghf();
449 double eshortHF = infoLayer->
eshorthf();
450 double eEcalHF = infoLayer->
eecalhf();
451 double eHcalHF = infoLayer->
ehcalhf();
460 edm::LogVerbatim(
"HcalHitValid") <<
"HcalHitValidation::analyzeLayer: eHO " << eHO <<
" eHBHE = " << eHBHE
461 <<
" elongHF = " << elongHF <<
" eshortHF = " << eshortHF
462 <<
" eEcalHF = " << eEcalHF <<
" eHcalHF = " << eHcalHF;
467 double ecalNxNr = infoNxN->
ecalnxnr();
468 double hcalNxNr = infoNxN->
hcalnxnr();
469 double hoNxNr = infoNxN->
honxnr();
470 double etotNxNr = infoNxN->
etotnxnr();
472 double ecalNxN = infoNxN->
ecalnxn();
473 double hcalNxN = infoNxN->
hcalnxn();
474 double hoNxN = infoNxN->
honxn();
475 double etotNxN = infoNxN->
etotnxn();
487 int nIxI = infoNxN->
nnxn();
488 std::vector<float> idIxI = infoNxN->
idnxn();
489 std::vector<float> eIxI = infoNxN->
enxn();
490 std::vector<float> tIxI = infoNxN->
tnxn();
492 for (
int j = 0;
j < nIxI;
j++)
499 edm::LogVerbatim(
"HcalHitValid") <<
"HcalHitValidation::analyzeNxN: " << nIxI
500 <<
" hits in NxN analysis; Total Energy " << etotNxN <<
"/" << etotNxNr;
505 int nJetHits = infoJets->
njethit();
507 std::vector<float> rJetHits = infoJets->
jethitr();
508 std::vector<float> tJetHits = infoJets->
jethitt();
509 std::vector<float> eJetHits = infoJets->
jethite();
511 double ecalJet = infoJets->
ecaljet();
512 double hcalJet = infoJets->
hcaljet();
513 double hoJet = infoJets->
hojet();
514 double etotJet = infoJets->
etotjet();
516 double detaJet = infoJets->
detajet();
517 double dphiJet = infoJets->
dphijet();
518 double drJet = infoJets->
drjet();
519 double dijetM = infoJets->
dijetm();
521 for (
int j = 0;
j < nJetHits;
j++) {
540 std::vector<float> jetE = infoJets->
jete();
549 edm::LogVerbatim(
"HcalHitValid") <<
"HcalHitValidation::analyzeJets: " <<
nJets <<
" jets with " << nJetHits
550 <<
" hits in the leading jet\n" 551 <<
" d(Eta) = " << detaJet <<
" d(Phi) = " << dphiJet <<
" d(R) = " << drJet
552 <<
" diJet Mass = " << dijetM;
MonitorElement * meHONHit_
MonitorElement * meDetaJet_
Log< level::Info, true > LogVerbatim
MonitorElement * meHODepHit_
MonitorElement * meEnergyHit_
std::vector< float > jetphi() const
std::vector< PCaloHit > PCaloHitContainer
std::vector< float > jethitt() const
MonitorElement * meHitHLay_
MonitorElement * meHOEtaHit_
MonitorElement * meAllNHit_
MonitorElement * meHBPhiHit_
MonitorElement * meHoNxN_
MonitorElement * mePMTTimHit_
MonitorElement * mePMTEtaHit_
MonitorElement * meHFEneHit_
virtual void setCurrentFolder(std::string const &fullpath)
const std::string nxNInfo
MonitorElement * meEcalRNxN_
MonitorElement * meHFDepHit_
MonitorElement * mePMTDepHit_
MonitorElement * meBadDetHit_
MonitorElement * meHcalNxN_
MonitorElement * meBadIdHit_
MonitorElement * meTrNxN_
MonitorElement * meHFEtaHit_
MonitorElement * meEFibSLay_
MonitorElement * meEtaHLay_
std::vector< float > eHit() const
MonitorElement * meEtotNxN_
std::vector< float > enxn() const
MonitorElement * mePMTPhiHit_
MonitorElement * meHOPhiHit_
std::vector< float > idHit() const
MonitorElement * meTimeWHit_
MonitorElement * meEneLay_[nLayersMAX]
MonitorElement * meHitELay_
MonitorElement * meEHFEmLay_
std::vector< float > layerHit() const
MonitorElement * meHENHit_
MonitorElement * meHoJet_
MonitorElement * meHOEneHit_
~HcalHitValidation() override=default
MonitorElement * meEtotJet_
std::vector< float > etaHit() const
MonitorElement * mePhiHLay_
MonitorElement * meEtaPhi_
std::vector< float > tnxn() const
constexpr uint8_t getLayer(uint32_t detId)
std::vector< float > jeteta() const
MonitorElement * meHEEneHit_
MonitorElement * meHFNHit_
MonitorElement * meHFTimHit_
MonitorElement * meHBDepHit_
MonitorElement * mePMTEn1Hit_
const std::string outFile_
MonitorElement * meTiNxN_
MonitorElement * meDphiJet_
void analyze(const edm::Event &e, const edm::EventSetup &c) override
HcalHitValidation(const edm::ParameterSet &ps)
MonitorElement * meEHBHELay_
std::vector< float > jete() const
MonitorElement * meHETimHit_
MonitorElement * meEneHLay_
MonitorElement * mePMTHit_
MonitorElement * meHBEtaHit_
static const int nDepthsMAX
const edm::EDGetTokenT< PHcalValidInfoNxN > tok_iN_
MonitorElement * meTimeHit_
std::vector< float > jethite() const
MonitorElement * meBadSubHit_
#define DEFINE_FWK_MODULE(type)
MonitorElement * meEtotLay_
void analyzeHits(std::vector< PCaloHit > &)
MonitorElement * meLngLay_
MonitorElement * meMassJet_
MonitorElement * meTimWLay_
MonitorElement * meEHFHdLay_
MonitorElement * meHitTLay_
MonitorElement * meHEEtaHit_
std::vector< float > idnxn() const
MonitorElement * meHBNHit_
MonitorElement * mePhiHit_
MonitorElement * meHoRNxN_
MonitorElement * meHOTimHit_
const std::string jetsInfo
void analyzeNxN(const edm::Handle< PHcalValidInfoNxN > &)
MonitorElement * meEneDLay_
std::vector< float > phiHit() const
MonitorElement * meLayerLay_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * meHcalJet_
MonitorElement * meEtotRNxN_
MonitorElement * meEFibLLay_
MonitorElement * meEHOLay_
MonitorElement * meEneLLay_
const edm::EDGetTokenT< PHcalValidInfoJets > tok_iJ_
MonitorElement * mePMTEn2Hit_
static const int nLayersMAX
MonitorElement * meEcalNxN_
void analyzeLayer(const edm::Handle< PHcalValidInfoLayer > &)
MonitorElement * meHBEneHit_
MonitorElement * meDepthHit_
MonitorElement * mePhiJet_
MonitorElement * meHEPhiHit_
MonitorElement * meEneJet_
MonitorElement * meEtaHit_
std::vector< float > edepth() const
MonitorElement * meEcalJet_
MonitorElement * meDepLay_[nDepthsMAX]
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * meSubdetHit_
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
MonitorElement * meDetectHit_
MonitorElement * meHcalRNxN_
const std::string g4Label
const std::string layerInfo
void analyzeJets(const edm::Handle< PHcalValidInfoJets > &)
MonitorElement * meHEDepHit_
std::vector< float > elayer() const
MonitorElement * meEiNxN_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hh_
const edm::EDGetTokenT< PHcalValidInfoLayer > tok_iL_
MonitorElement * meHFPhiHit_
std::vector< float > jethitr() const
MonitorElement * meDrJet_
MonitorElement * meEcHcJet_
MonitorElement * meEtaJet_
MonitorElement * meTimHLay_
const std::string hcalHits
MonitorElement * meDepHlay_
MonitorElement * meHBTimHit_
std::vector< float > tHit() const