9 : topFolderName_(conf.getParameter<
std::
string>(
"TopFolderName")),
10 outputFile_(conf.getUntrackedParameter<
std::
string>(
"outputFile",
"myfile.root")),
11 hcalselector_(conf.getUntrackedParameter<
std::
string>(
"hcalselector",
"all")),
12 ecalselector_(conf.getUntrackedParameter<
std::
string>(
"ecalselector",
"yes")),
13 sign_(conf.getUntrackedParameter<
std::
string>(
"sign",
"*")),
14 mc_(conf.getUntrackedParameter<
std::
string>(
"mc",
"yes")),
15 testNumber_(conf.getParameter<
bool>(
"TestNumber")),
16 EBRecHitCollectionLabel_(conf.getParameter<
edm::
InputTag>(
"EBRecHitCollectionLabel")),
17 EERecHitCollectionLabel_(conf.getParameter<
edm::
InputTag>(
"EERecHitCollectionLabel")),
31 edm::LogVerbatim(
"OutputInfo") <<
" Hcal RecHit Task histograms will NOT be saved";
76 sprintf(
histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths");
79 sprintf(
histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_E");
82 sprintf(
histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_EH");
88 sprintf(
histo,
"HcalRecHitTask_M2Log10Chi2_of_rechits_HB");
91 sprintf(
histo,
"HcalRecHitTask_Log10Chi2_vs_energy_profile_HB");
94 sprintf(
histo,
"HcalRecHitTask_energy_of_rechits_HB");
97 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_HB");
100 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HB");
103 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HB");
107 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HB");
109 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HB");
116 sprintf(
histo,
"HcalRecHitTask_M2Log10Chi2_of_rechits_HE");
119 sprintf(
histo,
"HcalRecHitTask_Log10Chi2_vs_energy_profile_HE");
122 sprintf(
histo,
"HcalRecHitTask_energy_of_rechits_HE");
125 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HE");
128 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_HE");
132 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HE");
134 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HE");
141 sprintf(
histo,
"HcalRecHitTask_energy_of_rechits_HO");
144 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_HO");
147 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HO");
151 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HO");
153 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HO");
160 sprintf(
histo,
"HcalRecHitTask_energy_of_rechits_HF");
163 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HF");
166 sprintf(
histo,
"HcalRecHitTask_timing_vs_energy_profile_HF");
170 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HF");
172 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HFL");
174 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HFS");
176 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HF");
178 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HFL");
180 sprintf(
histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HFS");
195 double eHcalConeHB = 0.;
196 double eHcalConeHE = 0.;
197 double eHcalConeHO = 0.;
198 double eHcalConeHF = 0.;
199 double eHcalConeHFL = 0.;
200 double eHcalConeHFS = 0.;
204 int nrechitsCone = 0;
205 int nrechitsThresh = 0;
208 double eEcalCone = 0.;
209 int numrechitsEcal = 0;
212 double phi_MC = -999999.;
213 double eta_MC = -999999.;
224 edm::LogVerbatim(
"HcalRecHitsValidation") <<
"*** source HepMCProduct found";
229 double maxPt = -99999.;
232 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
234 double phip = (*p)->momentum().phi();
235 double etap = (*p)->momentum().eta();
238 double pt = (*p)->momentum().perp();
279 for (; RecHit != RecHitEnd; ++RecHit) {
283 double eta = cellGeometry->getPosition().eta();
284 double phi = cellGeometry->getPosition().phi();
285 double en = RecHit->energy();
301 for (; RecHit != RecHitEnd; ++RecHit) {
305 double eta = cellGeometry->getPosition().eta();
306 double phi = cellGeometry->getPosition().phi();
307 double en = RecHit->energy();
331 double HcalCone = 0.;
338 for (
unsigned int i = 0;
i <
cen.size();
i++) {
348 double chi2_log10 = 9.99;
350 chi2_log10 = log10(
chi2);
375 float eta_diff = fabs(eta_MC -
eta);
435 double enSimHitsHB = 0.;
436 double enSimHitsHE = 0.;
437 double enSimHitsHO = 0.;
438 double enSimHitsHF = 0.;
439 double enSimHitsHFL = 0.;
440 double enSimHitsHFS = 0.;
443 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin(); SimHits != SimHitResult->end();
454 depth = cell.depth();
465 double en = SimHits->energy();
467 double r =
dR(eta_MC, phi_MC, etaS, phiS);
540 double eta = cellGeometry->getPosition(cell).eta();
541 double phi = cellGeometry->getPosition(cell).phi();
542 double zc = cellGeometry->getPosition(cell).z();
543 int sub = cell.subdet();
544 int depth = cell.depth();
545 int inteta = cell.ieta();
546 int intphi = cell.iphi() - 1;
547 double en =
j->energy();
548 double t =
j->time();
549 double chi2 =
j->chi2();
551 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
557 cieta.push_back(inteta);
558 ciphi.push_back(intphi);
575 double eta = cellGeometry->getPosition().eta();
576 double phi = cellGeometry->getPosition().phi();
577 double zc = cellGeometry->getPosition().z();
578 int sub = cell.subdet();
579 int depth = cell.depth();
580 int inteta = cell.ieta();
581 int intphi = cell.iphi() - 1;
582 double en =
j->energy();
583 double t =
j->time();
585 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
591 cieta.push_back(inteta);
592 ciphi.push_back(intphi);
609 double eta = cellGeometry->getPosition().eta();
610 double phi = cellGeometry->getPosition().phi();
611 double zc = cellGeometry->getPosition().z();
612 int sub = cell.subdet();
613 int depth = cell.depth();
614 int inteta = cell.ieta();
615 int intphi = cell.iphi() - 1;
616 double t =
j->time();
617 double en =
j->energy();
619 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
625 cieta.push_back(inteta);
626 ciphi.push_back(intphi);
637 double PI = 3.1415926535898;
638 double deltaphi = phi1 - phi2;
640 deltaphi = phi2 - phi1;
643 deltaphi = 2. *
PI - deltaphi;
646 double tmp =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
654 double PI = 3.1415926535898;
658 if (a1 > 0.5 *
PI &&
a2 < 0.)
660 if (
a2 > 0.5 *
PI && a1 < 0.)
662 tmp = (a1 * en1 +
a2 * en2) / (en1 + en2);
673 double PI = 3.1415926535898;
676 double tmp =
a2 - a1;
const edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tok_HRNDC_
Log< level::Info, true > LogVerbatim
std::vector< double > cchi2
const std::string ecalselector_
MonitorElement * meRecHitsM2Chi2HB
std::vector< PCaloHit > PCaloHitContainer
MonitorElement * meRecHitsEnergyHF
double phi12(double phi1, double en1, double phi2, double en2)
MonitorElement * meTEprofileHE_Low
Geom::Phi< T > phi() const
T const * product() const
std::vector< EcalRecHit >::const_iterator const_iterator
MonitorElement * meLog10Chi2profileHB
const std::string topFolderName_
MonitorElement * meEnConeEtaProfile
double dPhiWsign(double phi1, double phi2)
MonitorElement * meRecHitSimHitProfileHF
MonitorElement * meRecHitSimHitProfileHFS
MonitorElement * meRecHitsEnergyHB
std::vector< double > ceta
MonitorElement * meRecHitSimHitHF
MonitorElement * meRecHitsEnergyHE
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hh_
MonitorElement * meRecHitSimHitProfileHE
MonitorElement * meEnConeEtaProfile_E
const CaloGeometry * geometry_
MonitorElement * meRecHitSimHitHB
MonitorElement * meRecHitSimHitHFS
const std::string hcalselector_
constexpr HcalSubdetector subdet() const
get the subdetector
std::vector< double > cphi
MonitorElement * meRecHitsM2Chi2HE
MonitorElement * meTEprofileHB
const std::string outputFile_
virtual void fillRecHitsTmp(int subdet_, edm::Event const &ev)
double dR(double eta1, double phi1, double eta2, double phi2)
const edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
#define DEFINE_FWK_MODULE(type)
MonitorElement * meLog10Chi2profileHE
const_iterator begin() const
DetId relabel(const uint32_t testId) const
MonitorElement * meRecHitSimHitHO
const HepMC::GenEvent * GetEvent() const
MonitorElement * meRecHitSimHitProfileHB
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
const_iterator end() const
MonitorElement * meTEprofileHF_Low
const edm::EDGetTokenT< EBRecHitCollection > tok_EB_
MonitorElement * meTEprofileHO_High
MonitorElement * meTEprofileHE
const edm::EDGetTokenT< EERecHitCollection > tok_EE_
MonitorElement * meTEprofileHF
MonitorElement * meRecHitSimHitProfileHO
void analyze(edm::Event const &ev, edm::EventSetup const &c) override
std::vector< double > ctime
MonitorElement * meEnConeEtaProfile_EH
MonitorElement * meRecHitSimHitProfileHFL
std::vector< int > cdepth
MonitorElement * meRecHitsEnergyHO
GlobalPoint getPosition(const DetId &id) const
MonitorElement * meRecHitSimHitHFL
const edm::EDGetTokenT< edm::HepMCProduct > tok_evt_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meTEprofileHO
const edm::EDGetTokenT< HORecHitCollection > tok_ho_
const edm::EDGetTokenT< HFRecHitCollection > tok_hf_
MonitorElement * meTEprofileHB_Low
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_Geom_
MonitorElement * meRecHitSimHitHE
HcalRecHitsValidation(edm::ParameterSet const &conf)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
MonitorElement * meTEprofileHB_High
std::vector< double > cen