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");
196 double eHcalCone = 0.;
197 double eHcalConeHB = 0.;
198 double eHcalConeHE = 0.;
199 double eHcalConeHO = 0.;
200 double eHcalConeHF = 0.;
201 double eHcalConeHFL = 0.;
202 double eHcalConeHFS = 0.;
206 int nrechitsCone = 0;
207 int nrechitsThresh = 0;
213 double eEcalCone = 0.;
214 int numrechitsEcal = 0;
217 double phi_MC = -999999.;
218 double eta_MC = -999999.;
229 edm::LogVerbatim(
"HcalRecHitsValidation") <<
"*** source HepMCProduct found";
234 double maxPt = -99999.;
237 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
239 double phip = (*p)->momentum().phi();
240 double etap = (*p)->momentum().eta();
243 double pt = (*p)->momentum().perp();
284 for (; RecHit != RecHitEnd; ++RecHit) {
288 double eta = cellGeometry->getPosition().eta();
289 double phi = cellGeometry->getPosition().phi();
290 double en = RecHit->energy();
308 for (; RecHit != RecHitEnd; ++RecHit) {
312 double eta = cellGeometry->getPosition().eta();
313 double phi = cellGeometry->getPosition().phi();
314 double en = RecHit->energy();
340 double HcalCone = 0.;
347 for (
unsigned int i = 0;
i <
cen.size();
i++) {
357 double chi2_log10 = 9.99;
359 chi2_log10 = log10(
chi2);
387 float eta_diff = fabs(eta_MC -
eta);
447 double enSimHits = 0.;
448 double enSimHitsHB = 0.;
449 double enSimHitsHE = 0.;
450 double enSimHitsHO = 0.;
451 double enSimHitsHF = 0.;
452 double enSimHitsHFL = 0.;
453 double enSimHitsHFS = 0.;
456 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin(); SimHits != SimHitResult->end();
467 depth = cell.depth();
478 double en = SimHits->energy();
480 double r =
dR(eta_MC, phi_MC, etaS, phiS);
554 double eta = cellGeometry->getPosition(cell).eta();
555 double phi = cellGeometry->getPosition(cell).phi();
556 double zc = cellGeometry->getPosition(cell).z();
557 int sub = cell.subdet();
558 int depth = cell.depth();
559 int inteta = cell.ieta();
560 int intphi = cell.iphi() - 1;
561 double en =
j->energy();
562 double t =
j->time();
563 double chi2 =
j->chi2();
565 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
571 cieta.push_back(inteta);
572 ciphi.push_back(intphi);
589 double eta = cellGeometry->getPosition().eta();
590 double phi = cellGeometry->getPosition().phi();
591 double zc = cellGeometry->getPosition().z();
592 int sub = cell.subdet();
593 int depth = cell.depth();
594 int inteta = cell.ieta();
595 int intphi = cell.iphi() - 1;
596 double en =
j->energy();
597 double t =
j->time();
599 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
605 cieta.push_back(inteta);
606 ciphi.push_back(intphi);
623 double eta = cellGeometry->getPosition().eta();
624 double phi = cellGeometry->getPosition().phi();
625 double zc = cellGeometry->getPosition().z();
626 int sub = cell.subdet();
627 int depth = cell.depth();
628 int inteta = cell.ieta();
629 int intphi = cell.iphi() - 1;
630 double t =
j->time();
631 double en =
j->energy();
633 if ((
iz > 0 &&
eta > 0.) || (
iz < 0 &&
eta < 0.) ||
iz == 0) {
639 cieta.push_back(inteta);
640 ciphi.push_back(intphi);
651 double PI = 3.1415926535898;
652 double deltaphi = phi1 - phi2;
654 deltaphi = phi2 - phi1;
657 deltaphi = 2. *
PI - deltaphi;
660 double tmp =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
668 double PI = 3.1415926535898;
672 if (a1 > 0.5 *
PI &&
a2 < 0.)
674 if (
a2 > 0.5 *
PI && a1 < 0.)
676 tmp = (a1 * en1 +
a2 * en2) / (en1 + en2);
687 double PI = 3.1415926535898;
690 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
#define DEFINE_FWK_MODULE(type)
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_
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