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.;
203 double eEcalCone = 0.;
206 double phi_MC = -999999.;
207 double eta_MC = -999999.;
218 edm::LogVerbatim(
"HcalRecHitsValidation") <<
"*** source HepMCProduct found";
223 double maxPt = -99999.;
225 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
227 double phip = (*p)->momentum().phi();
228 double etap = (*p)->momentum().eta();
231 double pt = (*p)->momentum().perp();
271 for (; RecHit != RecHitEnd; ++RecHit) {
275 double eta = cellGeometry->getPosition().eta();
276 double phi = cellGeometry->getPosition().phi();
277 double en = RecHit->energy();
292 for (; RecHit != RecHitEnd; ++RecHit) {
296 double eta = cellGeometry->getPosition().eta();
297 double phi = cellGeometry->getPosition().phi();
298 double en = RecHit->energy();
321 double HcalCone = 0.;
328 for (
unsigned int i = 0;
i <
cen.size();
i++) {
338 double chi2_log10 = 9.99;
340 chi2_log10 = log10(
chi2);
360 float eta_diff = fabs(eta_MC -
eta);
420 double enSimHitsHB = 0.;
421 double enSimHitsHE = 0.;
422 double enSimHitsHO = 0.;
423 double enSimHitsHF = 0.;
424 double enSimHitsHFL = 0.;
425 double enSimHitsHFS = 0.;
428 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin(); SimHits != SimHitResult->end();
439 depth = cell.depth();
450 double en = SimHits->energy();
452 double r =
dR(eta_MC, phi_MC, etaS, phiS);
525 double eta = cellGeometry->getPosition(cell).eta();
526 double phi = cellGeometry->getPosition(cell).phi();
527 double zc = cellGeometry->getPosition(cell).z();
528 int sub = cell.subdet();
529 int depth = cell.depth();
530 int inteta = cell.ieta();
531 int intphi = cell.iphi() - 1;
532 double en =
j->energy();
533 double t =
j->time();
534 double chi2 =
j->chi2();
536 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
542 cieta.push_back(inteta);
543 ciphi.push_back(intphi);
560 double eta = cellGeometry->getPosition().eta();
561 double phi = cellGeometry->getPosition().phi();
562 double zc = cellGeometry->getPosition().z();
563 int sub = cell.subdet();
564 int depth = cell.depth();
565 int inteta = cell.ieta();
566 int intphi = cell.iphi() - 1;
567 double en =
j->energy();
568 double t =
j->time();
570 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
576 cieta.push_back(inteta);
577 ciphi.push_back(intphi);
594 double eta = cellGeometry->getPosition().eta();
595 double phi = cellGeometry->getPosition().phi();
596 double zc = cellGeometry->getPosition().z();
597 int sub = cell.subdet();
598 int depth = cell.depth();
599 int inteta = cell.ieta();
600 int intphi = cell.iphi() - 1;
601 double t =
j->time();
602 double en =
j->energy();
604 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
610 cieta.push_back(inteta);
611 ciphi.push_back(intphi);
622 double PI = 3.1415926535898;
623 double deltaphi = phi1 - phi2;
625 deltaphi = phi2 - phi1;
628 deltaphi = 2. *
PI - deltaphi;
631 double tmp =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
639 double PI = 3.1415926535898;
643 if (a1 > 0.5 *
PI &&
a2 < 0.)
645 if (
a2 > 0.5 *
PI && a1 < 0.)
647 tmp = (a1 * en1 +
a2 * en2) / (en1 + en2);
658 double PI = 3.1415926535898;
661 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