CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalRecHitsValidation Class Reference

#include <HcalRecHitsValidation.h>

Inheritance diagram for HcalRecHitsValidation:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (edm::Event const &ev, edm::EventSetup const &c) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 HcalRecHitsValidation (edm::ParameterSet const &conf)
 
 ~HcalRecHitsValidation () override=default
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

double dPhiWsign (double phi1, double phi2)
 
double dR (double eta1, double phi1, double eta2, double phi2)
 
virtual void fillRecHitsTmp (int subdet_, edm::Event const &ev)
 
double phi12 (double phi1, double en1, double phi2, double en2)
 

Private Attributes

std::vector< uint32_t > cauxstwd
 
std::vector< double > cchi2
 
std::vector< int > cdepth
 
std::vector< double > cen
 
std::vector< double > ceta
 
std::vector< int > cieta
 
std::vector< int > ciphi
 
std::vector< double > cphi
 
std::vector< uint32_t > cstwd
 
std::vector< int > csub
 
std::vector< double > ctime
 
std::vector< double > cz
 
const edm::InputTag EBRecHitCollectionLabel_
 
const std::string ecalselector_
 
const edm::InputTag EERecHitCollectionLabel_
 
const CaloGeometrygeometry_
 
const std::string hcalselector_
 
int imc
 
int iz
 
const std::string mc_
 
MonitorElementmeEnConeEtaProfile
 
MonitorElementmeEnConeEtaProfile_E
 
MonitorElementmeEnConeEtaProfile_EH
 
MonitorElementmeEnergyHcalVsEcalHB
 
MonitorElementmeEnergyHcalVsEcalHE
 
MonitorElementmeLog10Chi2profileHB
 
MonitorElementmeLog10Chi2profileHE
 
MonitorElementmeRecHitsEnergyHB
 
MonitorElementmeRecHitsEnergyHE
 
MonitorElementmeRecHitsEnergyHF
 
MonitorElementmeRecHitsEnergyHO
 
MonitorElementmeRecHitSimHitHB
 
MonitorElementmeRecHitSimHitHE
 
MonitorElementmeRecHitSimHitHF
 
MonitorElementmeRecHitSimHitHFL
 
MonitorElementmeRecHitSimHitHFS
 
MonitorElementmeRecHitSimHitHO
 
MonitorElementmeRecHitSimHitProfileHB
 
MonitorElementmeRecHitSimHitProfileHE
 
MonitorElementmeRecHitSimHitProfileHF
 
MonitorElementmeRecHitSimHitProfileHFL
 
MonitorElementmeRecHitSimHitProfileHFS
 
MonitorElementmeRecHitSimHitProfileHO
 
MonitorElementmeRecHitsM2Chi2HB
 
MonitorElementmeRecHitsM2Chi2HE
 
MonitorElementmeTEprofileHB
 
MonitorElementmeTEprofileHB_High
 
MonitorElementmeTEprofileHB_Low
 
MonitorElementmeTEprofileHE
 
MonitorElementmeTEprofileHE_Low
 
MonitorElementmeTEprofileHF
 
MonitorElementmeTEprofileHF_Low
 
MonitorElementmeTEprofileHO
 
MonitorElementmeTEprofileHO_High
 
int nevtot
 
const std::string outputFile_
 
const std::string sign_
 
int subdet_
 
const bool testNumber_
 
const edm::EDGetTokenT< EBRecHitCollectiontok_EB_
 
const edm::EDGetTokenT< EERecHitCollectiontok_EE_
 
const edm::EDGetTokenT< edm::HepMCProducttok_evt_
 
const edm::ESGetToken< CaloGeometry, CaloGeometryRecordtok_Geom_
 
const edm::EDGetTokenT< HBHERecHitCollectiontok_hbhe_
 
const edm::EDGetTokenT< HFRecHitCollectiontok_hf_
 
const edm::EDGetTokenT< edm::PCaloHitContainertok_hh_
 
const edm::EDGetTokenT< HORecHitCollectiontok_ho_
 
const edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecordtok_HRNDC_
 
const std::string topFolderName_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 57 of file HcalRecHitsValidation.h.

Constructor & Destructor Documentation

◆ HcalRecHitsValidation()

HcalRecHitsValidation::HcalRecHitsValidation ( edm::ParameterSet const &  conf)

Definition at line 8 of file HcalRecHitsValidation.cc.

References hcalselector_, imc, iz, mc_, nevtot, outputFile_, sign_, and subdet_.

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")),
18  tok_evt_(consumes<edm::HepMCProduct>(edm::InputTag("generatorSmeared"))),
19  tok_EB_(consumes<EBRecHitCollection>(EBRecHitCollectionLabel_)),
20  tok_EE_(consumes<EERecHitCollection>(EERecHitCollectionLabel_)),
21  tok_hh_(consumes<edm::PCaloHitContainer>(conf.getUntrackedParameter<edm::InputTag>("SimHitCollectionLabel"))),
22  tok_hbhe_(consumes<HBHERecHitCollection>(conf.getUntrackedParameter<edm::InputTag>("HBHERecHitCollectionLabel"))),
23  tok_hf_(consumes<HFRecHitCollection>(conf.getUntrackedParameter<edm::InputTag>("HFRecHitCollectionLabel"))),
24  tok_ho_(consumes<HORecHitCollection>(conf.getUntrackedParameter<edm::InputTag>("HORecHitCollectionLabel"))),
25  tok_HRNDC_(esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord>()),
26  tok_Geom_(esConsumes<CaloGeometry, CaloGeometryRecord>()) {
27  // DQM ROOT output
28  if (!outputFile_.empty()) {
29  edm::LogVerbatim("OutputInfo") << " Hcal RecHit Task histograms will be saved to '" << outputFile_.c_str() << "'";
30  } else {
31  edm::LogVerbatim("OutputInfo") << " Hcal RecHit Task histograms will NOT be saved";
32  }
33 
34  nevtot = 0;
35 
36  // Collections
37 
38  // register for data access
39 
40  subdet_ = 5;
41  if (hcalselector_ == "noise")
42  subdet_ = 0;
43  if (hcalselector_ == "HB")
44  subdet_ = 1;
45  if (hcalselector_ == "HE")
46  subdet_ = 2;
47  if (hcalselector_ == "HO")
48  subdet_ = 3;
49  if (hcalselector_ == "HF")
50  subdet_ = 4;
51  if (hcalselector_ == "all")
52  subdet_ = 5;
53  if (hcalselector_ == "ZS")
54  subdet_ = 6;
55 
56  iz = 1;
57  if (sign_ == "-")
58  iz = -1;
59  if (sign_ == "*")
60  iz = 0;
61 
62  imc = 1;
63  if (mc_ == "no")
64  imc = 0;
65 }
const edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tok_HRNDC_
Log< level::Info, true > LogVerbatim
const edm::InputTag EBRecHitCollectionLabel_
const std::string ecalselector_
const edm::InputTag EERecHitCollectionLabel_
const std::string topFolderName_
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hh_
const std::string hcalselector_
const std::string outputFile_
const edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
const edm::EDGetTokenT< EBRecHitCollection > tok_EB_
const edm::EDGetTokenT< EERecHitCollection > tok_EE_
const edm::EDGetTokenT< edm::HepMCProduct > tok_evt_
const edm::EDGetTokenT< HORecHitCollection > tok_ho_
const edm::EDGetTokenT< HFRecHitCollection > tok_hf_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_Geom_

◆ ~HcalRecHitsValidation()

HcalRecHitsValidation::~HcalRecHitsValidation ( )
overridedefault

Member Function Documentation

◆ analyze()

void HcalRecHitsValidation::analyze ( edm::Event const &  ev,
edm::EventSetup const &  c 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 186 of file HcalRecHitsValidation.cc.

References edm::SortedCollection< T, SORT >::begin(), c, cchi2, cdepth, cen, ceta, hltPixelTracks_cff::chi2, cieta, cphi, csub, ctime, LEDCalibrationChannels::depth, dR(), ecalselector_, edm::SortedCollection< T, SORT >::end(), PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), ALCARECOTkAlBeamHalo_cff::etaMax, makeMEIFBenchmarkPlots::ev, dqm::impl::MonitorElement::Fill(), fillRecHitsTmp(), geometry_, edm::HepMCProduct::GetEvent(), CaloSubdetectorGeometry::getGeometry(), HcalGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, mps_fire::i, LEDCalibrationChannels::ieta, imc, edm::HandleBase::isValid(), L1TPhase2Offline_cfi::maxPt, meEnConeEtaProfile, meEnConeEtaProfile_E, meEnConeEtaProfile_EH, meLog10Chi2profileHB, meLog10Chi2profileHE, meRecHitsEnergyHB, meRecHitsEnergyHE, meRecHitsEnergyHF, meRecHitsEnergyHO, meRecHitSimHitHB, meRecHitSimHitHE, meRecHitSimHitHF, meRecHitSimHitHFL, meRecHitSimHitHFS, meRecHitSimHitHO, meRecHitSimHitProfileHB, meRecHitSimHitProfileHE, meRecHitSimHitProfileHF, meRecHitSimHitProfileHFL, meRecHitSimHitProfileHFS, meRecHitSimHitProfileHO, meRecHitsM2Chi2HB, meRecHitsM2Chi2HE, meTEprofileHB, meTEprofileHB_High, meTEprofileHB_Low, meTEprofileHE, meTEprofileHE_Low, meTEprofileHF, meTEprofileHF_Low, meTEprofileHO, meTEprofileHO_High, nevtot, npart, AlCaHLTBitMon_ParallelJobs::p, phi, PV3DBase< T, PVType, FrameType >::phi(), edm::Handle< T >::product(), DiDispStaMuonMonitor_cfi::pt, alignCSCRings::r, HcalHitRelabeller::relabel(), HcalDetId::subdet(), subdet_, submitPVValidationJobs::t, testNumber_, tok_EB_, tok_EE_, tok_evt_, tok_Geom_, tok_hh_, and tok_HRNDC_.

186  {
187  using namespace edm;
188 
189  const HcalDDDRecConstants *hcons = &c.getData(tok_HRNDC_);
190 
191  // cuts for each subdet_ector mimiking "Scheme B"
192  // double cutHB = 0.9, cutHE = 1.4, cutHO = 1.1, cutHFL = 1.2, cutHFS = 1.8;
193 
194  // energy in HCAL
195  double eHcal = 0.;
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.;
203 
204  // Total numbet of RecHits in HCAL, in the cone, above 1 GeV theshold
205  int nrechits = 0;
206  int nrechitsCone = 0;
207  int nrechitsThresh = 0;
208 
209  // energy in ECAL
210  double eEcal = 0.;
211  double eEcalB = 0.;
212  double eEcalE = 0.;
213  double eEcalCone = 0.;
214  int numrechitsEcal = 0;
215 
216  // MC info
217  double phi_MC = -999999.; // phi of initial particle from HepMC
218  double eta_MC = -999999.; // eta of initial particle from HepMC
219 
220  // HCAL energy around MC eta-phi at all depths;
221  double partR = 0.3;
222 
223  if (imc != 0) {
224  const edm::Handle<edm::HepMCProduct> &evtMC = ev.getHandle(tok_evt_); // generator in late 310_preX
225  if (!evtMC.isValid()) {
226  edm::LogVerbatim("HcalRecHitsValidation") << "no HepMCProduct found";
227  } else {
228 #ifdef EDM_ML_DEBUG
229  edm::LogVerbatim("HcalRecHitsValidation") << "*** source HepMCProduct found";
230 #endif
231  }
232 
233  // MC particle with highest pt is taken as a direction reference
234  double maxPt = -99999.;
235  int npart = 0;
236  const HepMC::GenEvent *myGenEvent = evtMC->GetEvent();
237  for (HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end();
238  ++p) {
239  double phip = (*p)->momentum().phi();
240  double etap = (*p)->momentum().eta();
241  // phi_MC = phip;
242  // eta_MC = etap;
243  double pt = (*p)->momentum().perp();
244  if (pt > maxPt) {
245  npart++;
246  maxPt = pt;
247  phi_MC = phip;
248  eta_MC = etap;
249  }
250  }
251 #ifdef EDM_ML_DEBUG
252  edm::LogVerbatim("HcalRecHitsValidation") << "*** Max pT = " << maxPt;
253 #endif
254  }
255 
256 #ifdef EDM_ML_DEBUG
257  edm::LogVerbatim("HcalRecHitsValidation") << "*** 2";
258 #endif
259 
260  geometry_ = &c.getData(tok_Geom_);
261 
262  // Fill working vectors of HCAL RecHits quantities (all of these are drawn)
264 
265 #ifdef EDM_ML_DEBUG
266  edm::LogVerbatim("HcalRecHitsValidation") << "*** 3";
267 #endif
268 
269  //===========================================================================
270  // IN ALL other CASES : ieta-iphi maps
271  //===========================================================================
272 
273  // ECAL
274  if (ecalselector_ == "yes" && (subdet_ == 1 || subdet_ == 2 || subdet_ == 5)) {
275  const edm::Handle<EBRecHitCollection> &rhitEB = ev.getHandle(tok_EB_);
276 
279 
280  if (rhitEB.isValid()) {
281  RecHit = rhitEB.product()->begin();
282  RecHitEnd = rhitEB.product()->end();
283 
284  for (; RecHit != RecHitEnd; ++RecHit) {
285  EBDetId EBid = EBDetId(RecHit->id());
286 
287  auto cellGeometry = geometry_->getSubdetectorGeometry(EBid)->getGeometry(EBid);
288  double eta = cellGeometry->getPosition().eta();
289  double phi = cellGeometry->getPosition().phi();
290  double en = RecHit->energy();
291  eEcal += en;
292  eEcalB += en;
293 
294  double r = dR(eta_MC, phi_MC, eta, phi);
295  if (r < partR) {
296  eEcalCone += en;
297  numrechitsEcal++;
298  }
299  }
300  }
301 
302  const edm::Handle<EERecHitCollection> &rhitEE = ev.getHandle(tok_EE_);
303 
304  if (rhitEE.isValid()) {
305  RecHit = rhitEE.product()->begin();
306  RecHitEnd = rhitEE.product()->end();
307 
308  for (; RecHit != RecHitEnd; ++RecHit) {
309  EEDetId EEid = EEDetId(RecHit->id());
310 
311  auto cellGeometry = geometry_->getSubdetectorGeometry(EEid)->getGeometry(EEid);
312  double eta = cellGeometry->getPosition().eta();
313  double phi = cellGeometry->getPosition().phi();
314  double en = RecHit->energy();
315  eEcal += en;
316  eEcalE += en;
317 
318  double r = dR(eta_MC, phi_MC, eta, phi);
319  if (r < partR) {
320  eEcalCone += en;
321  numrechitsEcal++;
322  }
323  }
324  }
325  } // end of ECAL selection
326 
327 #ifdef EDM_ML_DEBUG
328  edm::LogVerbatim("HcalRecHitsValidation") << "*** 4";
329 #endif
330 
331  //===========================================================================
332  // SUBSYSTEMS,
333  //===========================================================================
334 
335  if ((subdet_ != 6) && (subdet_ != 0)) {
336 #ifdef EDM_ML_DEBUG
337  edm::LogVerbatim("HcalRecHitsValidation") << "*** 6";
338 #endif
339 
340  double HcalCone = 0.;
341 
342  int ietaMax = 9999;
343  double etaMax = 9999.;
344 
345  // CYCLE over cells ====================================================
346 
347  for (unsigned int i = 0; i < cen.size(); i++) {
348  int sub = csub[i];
349  int depth = cdepth[i];
350  double eta = ceta[i];
351  double phi = cphi[i];
352  double en = cen[i];
353  double t = ctime[i];
354  int ieta = cieta[i];
355  double chi2 = cchi2[i];
356 
357  double chi2_log10 = 9.99; // initial value above histos limits , keep it if chi2 <= 0.
358  if (chi2 > 0.)
359  chi2_log10 = log10(chi2);
360 
361  nrechits++;
362  eHcal += en;
363  if (en > 1.)
364  nrechitsThresh++;
365 
366  double r = dR(eta_MC, phi_MC, eta, phi);
367  if (r < partR) {
368  if (sub == 1)
369  eHcalConeHB += en;
370  if (sub == 2)
371  eHcalConeHE += en;
372  if (sub == 3)
373  eHcalConeHO += en;
374  if (sub == 4) {
375  eHcalConeHF += en;
376  if (depth == 1)
377  eHcalConeHFL += en;
378  else
379  eHcalConeHFS += en;
380  }
381  eHcalCone += en;
382  nrechitsCone++;
383 
384  HcalCone += en;
385 
386  // alternative: ietamax -> closest to MC eta !!!
387  float eta_diff = fabs(eta_MC - eta);
388  if (eta_diff < etaMax) {
389  etaMax = eta_diff;
390  ietaMax = ieta;
391  }
392  }
393 
394  // The energy and overall timing histos are drawn while
395  // the ones split by depth are not
396  if (sub == 1 && (subdet_ == 1 || subdet_ == 5)) {
397  meRecHitsM2Chi2HB->Fill(chi2_log10);
398  meLog10Chi2profileHB->Fill(en, chi2_log10);
399 
400  meRecHitsEnergyHB->Fill(en);
401 
402  meTEprofileHB_Low->Fill(en, t);
403  meTEprofileHB->Fill(en, t);
404  meTEprofileHB_High->Fill(en, t);
405  }
406  if (sub == 2 && (subdet_ == 2 || subdet_ == 5)) {
407  meRecHitsM2Chi2HE->Fill(chi2_log10);
408  meLog10Chi2profileHE->Fill(en, chi2_log10);
409 
410  meRecHitsEnergyHE->Fill(en);
411 
412  meTEprofileHE_Low->Fill(en, t);
413  meTEprofileHE->Fill(en, t);
414  }
415  if (sub == 4 && (subdet_ == 4 || subdet_ == 5)) {
416  meRecHitsEnergyHF->Fill(en);
417 
418  meTEprofileHF_Low->Fill(en, t);
419  meTEprofileHF->Fill(en, t);
420  }
421  if (sub == 3 && (subdet_ == 3 || subdet_ == 5)) {
422  meRecHitsEnergyHO->Fill(en);
423 
424  meTEprofileHO->Fill(en, t);
425  meTEprofileHO_High->Fill(en, t);
426  }
427  }
428 
429  if (imc != 0) {
430  meEnConeEtaProfile->Fill(double(ietaMax), HcalCone); //
431  meEnConeEtaProfile_E->Fill(double(ietaMax), eEcalCone);
432  meEnConeEtaProfile_EH->Fill(double(ietaMax), HcalCone + eEcalCone);
433  }
434 
435 #ifdef EDM_ML_DEBUG
436  edm::LogVerbatim("HcalRecHitsValidation") << "*** 7";
437 #endif
438  }
439 
440  // SimHits vs. RecHits
441  if (subdet_ > 0 && subdet_ < 6 && imc != 0) { // not noise
442 
443  const edm::Handle<PCaloHitContainer> &hcalHits = ev.getHandle(tok_hh_);
444  if (hcalHits.isValid()) {
445  const PCaloHitContainer *SimHitResult = hcalHits.product();
446 
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.;
454  // sum of SimHits in the cone
455 
456  for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin(); SimHits != SimHitResult->end();
457  ++SimHits) {
458  int sub, depth;
459  HcalDetId cell;
460 
461  if (testNumber_)
462  cell = HcalHitRelabeller::relabel(SimHits->id(), hcons);
463  else
464  cell = HcalDetId(SimHits->id());
465 
466  sub = cell.subdet();
467  depth = cell.depth();
468 
469  if (sub != subdet_ && subdet_ != 5)
470  continue; // If we are not looking at all of the subdetectors and the
471  // simhit doesn't come from the specific subdetector of
472  // interest, then we won't do any thing with it
473 
474  const HcalGeometry *cellGeometry =
475  dynamic_cast<const HcalGeometry *>(geometry_->getSubdetectorGeometry(DetId::Hcal, cell.subdet()));
476  double etaS = cellGeometry->getPosition(cell).eta();
477  double phiS = cellGeometry->getPosition(cell).phi();
478  double en = SimHits->energy();
479 
480  double r = dR(eta_MC, phi_MC, etaS, phiS);
481 
482  if (r < partR) { // just energy in the small cone
483 
484  enSimHits += en;
485  if (sub == static_cast<int>(HcalBarrel))
486  enSimHitsHB += en;
487  if (sub == static_cast<int>(HcalEndcap))
488  enSimHitsHE += en;
489  if (sub == static_cast<int>(HcalOuter))
490  enSimHitsHO += en;
491  if (sub == static_cast<int>(HcalForward)) {
492  enSimHitsHF += en;
493  if (depth == 1)
494  enSimHitsHFL += en;
495  else
496  enSimHitsHFS += en;
497  }
498  }
499  }
500 
501  // Now some histos with SimHits
502 
503  if (subdet_ == 4 || subdet_ == 5) {
504  meRecHitSimHitHF->Fill(enSimHitsHF, eHcalConeHF);
505  meRecHitSimHitProfileHF->Fill(enSimHitsHF, eHcalConeHF);
506 
507  meRecHitSimHitHFL->Fill(enSimHitsHFL, eHcalConeHFL);
508  meRecHitSimHitProfileHFL->Fill(enSimHitsHFL, eHcalConeHFL);
509  meRecHitSimHitHFS->Fill(enSimHitsHFS, eHcalConeHFS);
510  meRecHitSimHitProfileHFS->Fill(enSimHitsHFS, eHcalConeHFS);
511  }
512  if (subdet_ == 1 || subdet_ == 5) {
513  meRecHitSimHitHB->Fill(enSimHitsHB, eHcalConeHB);
514  meRecHitSimHitProfileHB->Fill(enSimHitsHB, eHcalConeHB);
515  }
516  if (subdet_ == 2 || subdet_ == 5) {
517  meRecHitSimHitHE->Fill(enSimHitsHE, eHcalConeHE);
518  meRecHitSimHitProfileHE->Fill(enSimHitsHE, eHcalConeHE);
519  }
520  if (subdet_ == 3 || subdet_ == 5) {
521  meRecHitSimHitHO->Fill(enSimHitsHO, eHcalConeHO);
522  meRecHitSimHitProfileHO->Fill(enSimHitsHO, eHcalConeHO);
523  }
524  }
525  }
526 
527  nevtot++;
528 }
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
MonitorElement * meTEprofileHE_Low
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T eta() const
Definition: PV3DBase.h:73
T const * product() const
Definition: Handle.h:70
std::vector< EcalRecHit >::const_iterator const_iterator
MonitorElement * meLog10Chi2profileHB
MonitorElement * meEnConeEtaProfile
double npart
Definition: HydjetWrapper.h:46
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
void Fill(long long x)
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
std::vector< double > cphi
MonitorElement * meRecHitsM2Chi2HE
MonitorElement * meTEprofileHB
virtual void fillRecHitsTmp(int subdet_, edm::Event const &ev)
double dR(double eta1, double phi1, double eta2, double phi2)
MonitorElement * meLog10Chi2profileHE
const_iterator begin() const
DetId relabel(const uint32_t testId) const
MonitorElement * meRecHitSimHitHO
MonitorElement * meRecHitSimHitProfileHB
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:37
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
std::vector< double > ctime
MonitorElement * meEnConeEtaProfile_EH
MonitorElement * meRecHitSimHitProfileHFL
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * meRecHitsEnergyHO
HLT enums.
GlobalPoint getPosition(const DetId &id) const
MonitorElement * meRecHitSimHitHFL
const edm::EDGetTokenT< edm::HepMCProduct > tok_evt_
MonitorElement * meTEprofileHO
MonitorElement * meTEprofileHB_Low
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_Geom_
MonitorElement * meRecHitSimHitHE
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
MonitorElement * meTEprofileHB_High
std::vector< double > cen

◆ bookHistograms()

void HcalRecHitsValidation::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  run,
edm::EventSetup const &  es 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 67 of file HcalRecHitsValidation.cc.

References timingPdfMaker::histo, cuy::ib, imc, meEnConeEtaProfile, meEnConeEtaProfile_E, meEnConeEtaProfile_EH, meLog10Chi2profileHB, meLog10Chi2profileHE, meRecHitsEnergyHB, meRecHitsEnergyHE, meRecHitsEnergyHF, meRecHitsEnergyHO, meRecHitSimHitHB, meRecHitSimHitHE, meRecHitSimHitHF, meRecHitSimHitHFL, meRecHitSimHitHFS, meRecHitSimHitHO, meRecHitSimHitProfileHB, meRecHitSimHitProfileHE, meRecHitSimHitProfileHF, meRecHitSimHitProfileHFL, meRecHitSimHitProfileHFS, meRecHitSimHitProfileHO, meRecHitsM2Chi2HB, meRecHitsM2Chi2HE, meTEprofileHB, meTEprofileHB_High, meTEprofileHB_Low, meTEprofileHE, meTEprofileHE_Low, meTEprofileHF, meTEprofileHF_Low, meTEprofileHO, meTEprofileHO_High, subdet_, and topFolderName_.

67  {
68  Char_t histo[200];
69 
70  ib.setCurrentFolder(topFolderName_);
71 
72  //======================= Now various cases one by one ===================
73 
74  // Histograms drawn for single pion scan
75  if (subdet_ != 0 && imc != 0) { // just not for noise
76  sprintf(histo, "HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths");
77  meEnConeEtaProfile = ib.bookProfile(histo, histo, 83, -41.5, 41.5, -100., 2000., " ");
78 
79  sprintf(histo, "HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_E");
80  meEnConeEtaProfile_E = ib.bookProfile(histo, histo, 83, -41.5, 41.5, -100., 2000., " ");
81 
82  sprintf(histo, "HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_EH");
83  meEnConeEtaProfile_EH = ib.bookProfile(histo, histo, 83, -41.5, 41.5, -100., 2000., " ");
84  }
85 
86  // ************** HB **********************************
87  if (subdet_ == 1 || subdet_ == 5) {
88  sprintf(histo, "HcalRecHitTask_M2Log10Chi2_of_rechits_HB"); // Chi2
89  meRecHitsM2Chi2HB = ib.book1D(histo, histo, 120, -2., 10.);
90 
91  sprintf(histo, "HcalRecHitTask_Log10Chi2_vs_energy_profile_HB");
92  meLog10Chi2profileHB = ib.bookProfile(histo, histo, 300, -5., 295., -2., 9.9, " ");
93 
94  sprintf(histo, "HcalRecHitTask_energy_of_rechits_HB");
95  meRecHitsEnergyHB = ib.book1D(histo, histo, 2010, -10., 2000.);
96 
97  sprintf(histo, "HcalRecHitTask_timing_vs_energy_profile_HB");
98  meTEprofileHB = ib.bookProfile(histo, histo, 150, -5., 295., -48., 92., " ");
99 
100  sprintf(histo, "HcalRecHitTask_timing_vs_energy_profile_Low_HB");
101  meTEprofileHB_Low = ib.bookProfile(histo, histo, 150, -5., 295., -48., 92., " ");
102 
103  sprintf(histo, "HcalRecHitTask_timing_vs_energy_profile_High_HB");
104  meTEprofileHB_High = ib.bookProfile(histo, histo, 150, -5., 295., 48., 92., " ");
105 
106  if (imc != 0) {
107  sprintf(histo, "HcalRecHitTask_energy_rechits_vs_simhits_HB");
108  meRecHitSimHitHB = ib.book2D(histo, histo, 120, 0., 1.2, 300, 0., 150.);
109  sprintf(histo, "HcalRecHitTask_energy_rechits_vs_simhits_profile_HB");
110  meRecHitSimHitProfileHB = ib.bookProfile(histo, histo, 120, 0., 1.2, 0., 500., " ");
111  }
112  }
113 
114  // ********************** HE ************************************
115  if (subdet_ == 2 || subdet_ == 5) {
116  sprintf(histo, "HcalRecHitTask_M2Log10Chi2_of_rechits_HE"); // Chi2
117  meRecHitsM2Chi2HE = ib.book1D(histo, histo, 120, -2., 10.);
118 
119  sprintf(histo, "HcalRecHitTask_Log10Chi2_vs_energy_profile_HE");
120  meLog10Chi2profileHE = ib.bookProfile(histo, histo, 1000, -5., 995., -2., 9.9, " ");
121 
122  sprintf(histo, "HcalRecHitTask_energy_of_rechits_HE");
123  meRecHitsEnergyHE = ib.book1D(histo, histo, 2010, -10., 2000.);
124 
125  sprintf(histo, "HcalRecHitTask_timing_vs_energy_profile_Low_HE");
126  meTEprofileHE_Low = ib.bookProfile(histo, histo, 80, -5., 75., -48., 92., " ");
127 
128  sprintf(histo, "HcalRecHitTask_timing_vs_energy_profile_HE");
129  meTEprofileHE = ib.bookProfile(histo, histo, 200, -5., 2995., -48., 92., " ");
130 
131  if (imc != 0) {
132  sprintf(histo, "HcalRecHitTask_energy_rechits_vs_simhits_HE");
133  meRecHitSimHitHE = ib.book2D(histo, histo, 120, 0., 0.6, 300, 0., 150.);
134  sprintf(histo, "HcalRecHitTask_energy_rechits_vs_simhits_profile_HE");
135  meRecHitSimHitProfileHE = ib.bookProfile(histo, histo, 120, 0., 0.6, 0., 500., " ");
136  }
137  }
138 
139  // ************** HO ****************************************
140  if (subdet_ == 3 || subdet_ == 5) {
141  sprintf(histo, "HcalRecHitTask_energy_of_rechits_HO");
142  meRecHitsEnergyHO = ib.book1D(histo, histo, 2010, -10., 2000.);
143 
144  sprintf(histo, "HcalRecHitTask_timing_vs_energy_profile_HO");
145  meTEprofileHO = ib.bookProfile(histo, histo, 60, -5., 55., -48., 92., " ");
146 
147  sprintf(histo, "HcalRecHitTask_timing_vs_energy_profile_High_HO");
148  meTEprofileHO_High = ib.bookProfile(histo, histo, 100, -5., 995., -48., 92., " ");
149 
150  if (imc != 0) {
151  sprintf(histo, "HcalRecHitTask_energy_rechits_vs_simhits_HO");
152  meRecHitSimHitHO = ib.book2D(histo, histo, 150, 0., 1.5, 350, 0., 350.);
153  sprintf(histo, "HcalRecHitTask_energy_rechits_vs_simhits_profile_HO");
154  meRecHitSimHitProfileHO = ib.bookProfile(histo, histo, 150, 0., 1.5, 0., 500., " ");
155  }
156  }
157 
158  // ********************** HF ************************************
159  if (subdet_ == 4 || subdet_ == 5) {
160  sprintf(histo, "HcalRecHitTask_energy_of_rechits_HF");
161  meRecHitsEnergyHF = ib.book1D(histo, histo, 2010, -10., 2000.);
162 
163  sprintf(histo, "HcalRecHitTask_timing_vs_energy_profile_Low_HF");
164  meTEprofileHF_Low = ib.bookProfile(histo, histo, 100, -5., 195., -48., 92., " ");
165 
166  sprintf(histo, "HcalRecHitTask_timing_vs_energy_profile_HF");
167  meTEprofileHF = ib.bookProfile(histo, histo, 200, -5., 995., -48., 92., " ");
168 
169  if (imc != 0) {
170  sprintf(histo, "HcalRecHitTask_energy_rechits_vs_simhits_HF");
171  meRecHitSimHitHF = ib.book2D(histo, histo, 50, 0., 50., 150, 0., 150.);
172  sprintf(histo, "HcalRecHitTask_energy_rechits_vs_simhits_HFL");
173  meRecHitSimHitHFL = ib.book2D(histo, histo, 50, 0., 50., 150, 0., 150.);
174  sprintf(histo, "HcalRecHitTask_energy_rechits_vs_simhits_HFS");
175  meRecHitSimHitHFS = ib.book2D(histo, histo, 50, 0., 50., 150, 0., 150.);
176  sprintf(histo, "HcalRecHitTask_energy_rechits_vs_simhits_profile_HF");
177  meRecHitSimHitProfileHF = ib.bookProfile(histo, histo, 50, 0., 50., 0., 500., " ");
178  sprintf(histo, "HcalRecHitTask_energy_rechits_vs_simhits_profile_HFL");
179  meRecHitSimHitProfileHFL = ib.bookProfile(histo, histo, 50, 0., 50., 0., 500., " ");
180  sprintf(histo, "HcalRecHitTask_energy_rechits_vs_simhits_profile_HFS");
181  meRecHitSimHitProfileHFS = ib.bookProfile(histo, histo, 50, 0., 50., 0., 500., " ");
182  }
183  }
184 }
MonitorElement * meRecHitsM2Chi2HB
MonitorElement * meRecHitsEnergyHF
MonitorElement * meTEprofileHE_Low
MonitorElement * meLog10Chi2profileHB
const std::string topFolderName_
MonitorElement * meEnConeEtaProfile
MonitorElement * meRecHitSimHitProfileHF
MonitorElement * meRecHitSimHitProfileHFS
MonitorElement * meRecHitsEnergyHB
MonitorElement * meRecHitSimHitHF
MonitorElement * meRecHitsEnergyHE
MonitorElement * meRecHitSimHitProfileHE
MonitorElement * meEnConeEtaProfile_E
MonitorElement * meRecHitSimHitHB
MonitorElement * meRecHitSimHitHFS
MonitorElement * meRecHitsM2Chi2HE
MonitorElement * meTEprofileHB
MonitorElement * meLog10Chi2profileHE
MonitorElement * meRecHitSimHitHO
MonitorElement * meRecHitSimHitProfileHB
MonitorElement * meTEprofileHF_Low
MonitorElement * meTEprofileHO_High
MonitorElement * meTEprofileHE
MonitorElement * meTEprofileHF
MonitorElement * meRecHitSimHitProfileHO
MonitorElement * meEnConeEtaProfile_EH
MonitorElement * meRecHitSimHitProfileHFL
MonitorElement * meRecHitsEnergyHO
MonitorElement * meRecHitSimHitHFL
MonitorElement * meTEprofileHO
MonitorElement * meTEprofileHB_Low
MonitorElement * meRecHitSimHitHE
MonitorElement * meTEprofileHB_High
ib
Definition: cuy.py:661

◆ dPhiWsign()

double HcalRecHitsValidation::dPhiWsign ( double  phi1,
double  phi2 
)
private

Definition at line 683 of file HcalRecHitsValidation.cc.

References testProducerWithPsetDescEmpty_cfi::a2, PI, and createJobs::tmp.

683  {
684  // clockwise phi2 w.r.t phi1 means "+" phi distance
685  // anti-clockwise phi2 w.r.t phi1 means "-" phi distance
686 
687  double PI = 3.1415926535898;
688  double a1 = phi1;
689  double a2 = phi2;
690  double tmp = a2 - a1;
691  if (a1 * a2 < 0.) {
692  if (a1 > 0.5 * PI)
693  tmp += 2. * PI;
694  if (a2 > 0.5 * PI)
695  tmp -= 2. * PI;
696  }
697  return tmp;
698 }
#define PI
Definition: QcdUeDQM.h:37
tmp
align.sh
Definition: createJobs.py:716

◆ dR()

double HcalRecHitsValidation::dR ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
)
private

Definition at line 650 of file HcalRecHitsValidation.cc.

References HLT_2022v12_cff::eta1, HLT_2022v12_cff::eta2, mathSSE::sqrt(), and createJobs::tmp.

Referenced by analyze().

650  {
651  double PI = 3.1415926535898;
652  double deltaphi = phi1 - phi2;
653  if (phi2 > phi1) {
654  deltaphi = phi2 - phi1;
655  }
656  if (deltaphi > PI) {
657  deltaphi = 2. * PI - deltaphi;
658  }
659  double deltaeta = eta2 - eta1;
660  double tmp = sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
661  return tmp;
662 }
T sqrt(T t)
Definition: SSEVec.h:19
tmp
align.sh
Definition: createJobs.py:716

◆ fillRecHitsTmp()

void HcalRecHitsValidation::fillRecHitsTmp ( int  subdet_,
edm::Event const &  ev 
)
privatevirtual

Definition at line 531 of file HcalRecHitsValidation.cc.

References edm::SortedCollection< T, SORT >::begin(), cchi2, cdepth, cen, ceta, hltPixelTracks_cff::chi2, cieta, ciphi, cphi, csub, ctime, cz, LEDCalibrationChannels::depth, edm::SortedCollection< T, SORT >::end(), PVValHelper::eta, makeMEIFBenchmarkPlots::ev, geometry_, CaloSubdetectorGeometry::getGeometry(), CaloGeometry::getSubdetectorGeometry(), DetId::Hcal, edm::HandleBase::isValid(), iz, dqmiolumiharvest::j, phi, subdet_, submitPVValidationJobs::t, tok_hbhe_, tok_hf_, and tok_ho_.

Referenced by analyze().

531  {
532  using namespace edm;
533 
534  // initialize data vectors
535  csub.clear();
536  cen.clear();
537  ceta.clear();
538  cphi.clear();
539  ctime.clear();
540  cieta.clear();
541  ciphi.clear();
542  cdepth.clear();
543  cz.clear();
544  cchi2.clear();
545 
546  if (subdet_ == 1 || subdet_ == 2 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
547  // HBHE
548  const edm::Handle<HBHERecHitCollection> &hbhecoll = ev.getHandle(tok_hbhe_);
549  if (hbhecoll.isValid()) {
550  for (HBHERecHitCollection::const_iterator j = hbhecoll->begin(); j != hbhecoll->end(); j++) {
551  HcalDetId cell(j->id());
552  const HcalGeometry *cellGeometry =
553  dynamic_cast<const HcalGeometry *>(geometry_->getSubdetectorGeometry(DetId::Hcal, cell.subdet()));
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();
564 
565  if ((iz > 0 && eta > 0.) || (iz < 0 && eta < 0.) || iz == 0) {
566  csub.push_back(sub);
567  cen.push_back(en);
568  ceta.push_back(eta);
569  cphi.push_back(phi);
570  ctime.push_back(t);
571  cieta.push_back(inteta);
572  ciphi.push_back(intphi);
573  cdepth.push_back(depth);
574  cz.push_back(zc);
575  cchi2.push_back(chi2);
576  }
577  }
578  }
579  }
580 
581  if (subdet_ == 4 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
582  // HF
583  const edm::Handle<HFRecHitCollection> &hfcoll = ev.getHandle(tok_hf_);
584  if (hfcoll.isValid()) {
585  for (HFRecHitCollection::const_iterator j = hfcoll->begin(); j != hfcoll->end(); j++) {
586  HcalDetId cell(j->id());
587  auto cellGeometry = geometry_->getSubdetectorGeometry(cell)->getGeometry(cell);
588 
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();
598 
599  if ((iz > 0 && eta > 0.) || (iz < 0 && eta < 0.) || iz == 0) {
600  csub.push_back(sub);
601  cen.push_back(en);
602  ceta.push_back(eta);
603  cphi.push_back(phi);
604  ctime.push_back(t);
605  cieta.push_back(inteta);
606  ciphi.push_back(intphi);
607  cdepth.push_back(depth);
608  cz.push_back(zc);
609  cchi2.push_back(0.);
610  }
611  }
612  }
613  }
614 
615  // HO
616  if (subdet_ == 3 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
617  const edm::Handle<HORecHitCollection> &hocoll = ev.getHandle(tok_ho_);
618  if (hocoll.isValid()) {
619  for (HORecHitCollection::const_iterator j = hocoll->begin(); j != hocoll->end(); j++) {
620  HcalDetId cell(j->id());
621  auto cellGeometry = geometry_->getSubdetectorGeometry(cell)->getGeometry(cell);
622 
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();
632 
633  if ((iz > 0 && eta > 0.) || (iz < 0 && eta < 0.) || iz == 0) {
634  csub.push_back(sub);
635  cen.push_back(en);
636  ceta.push_back(eta);
637  cphi.push_back(phi);
638  ctime.push_back(t);
639  cieta.push_back(inteta);
640  ciphi.push_back(intphi);
641  cdepth.push_back(depth);
642  cz.push_back(zc);
643  cchi2.push_back(0.);
644  }
645  }
646  }
647  }
648 }
std::vector< double > cchi2
std::vector< T >::const_iterator const_iterator
std::vector< double > ceta
const CaloGeometry * geometry_
std::vector< double > cphi
const edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
const_iterator begin() const
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
std::vector< double > ctime
std::vector< double > cz
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
const edm::EDGetTokenT< HORecHitCollection > tok_ho_
const edm::EDGetTokenT< HFRecHitCollection > tok_hf_
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
std::vector< double > cen

◆ phi12()

double HcalRecHitsValidation::phi12 ( double  phi1,
double  en1,
double  phi2,
double  en2 
)
private

Definition at line 664 of file HcalRecHitsValidation.cc.

References testProducerWithPsetDescEmpty_cfi::a2, PI, and createJobs::tmp.

664  {
665  // weighted mean value of phi1 and phi2
666 
667  double tmp;
668  double PI = 3.1415926535898;
669  double a1 = phi1;
670  double a2 = phi2;
671 
672  if (a1 > 0.5 * PI && a2 < 0.)
673  a2 += 2 * PI;
674  if (a2 > 0.5 * PI && a1 < 0.)
675  a1 += 2 * PI;
676  tmp = (a1 * en1 + a2 * en2) / (en1 + en2);
677  if (tmp > PI)
678  tmp -= 2. * PI;
679 
680  return tmp;
681 }
#define PI
Definition: QcdUeDQM.h:37
tmp
align.sh
Definition: createJobs.py:716

Member Data Documentation

◆ cauxstwd

std::vector<uint32_t> HcalRecHitsValidation::cauxstwd
private

Definition at line 167 of file HcalRecHitsValidation.h.

◆ cchi2

std::vector<double> HcalRecHitsValidation::cchi2
private

Definition at line 168 of file HcalRecHitsValidation.h.

Referenced by analyze(), and fillRecHitsTmp().

◆ cdepth

std::vector<int> HcalRecHitsValidation::cdepth
private

Definition at line 160 of file HcalRecHitsValidation.h.

Referenced by analyze(), and fillRecHitsTmp().

◆ cen

std::vector<double> HcalRecHitsValidation::cen
private

Definition at line 161 of file HcalRecHitsValidation.h.

Referenced by analyze(), and fillRecHitsTmp().

◆ ceta

std::vector<double> HcalRecHitsValidation::ceta
private

Definition at line 162 of file HcalRecHitsValidation.h.

Referenced by analyze(), and fillRecHitsTmp().

◆ cieta

std::vector<int> HcalRecHitsValidation::cieta
private

Definition at line 158 of file HcalRecHitsValidation.h.

Referenced by analyze(), and fillRecHitsTmp().

◆ ciphi

std::vector<int> HcalRecHitsValidation::ciphi
private

Definition at line 159 of file HcalRecHitsValidation.h.

Referenced by fillRecHitsTmp().

◆ cphi

std::vector<double> HcalRecHitsValidation::cphi
private

Definition at line 163 of file HcalRecHitsValidation.h.

Referenced by analyze(), and fillRecHitsTmp().

◆ cstwd

std::vector<uint32_t> HcalRecHitsValidation::cstwd
private

Definition at line 166 of file HcalRecHitsValidation.h.

◆ csub

std::vector<int> HcalRecHitsValidation::csub
private

Definition at line 157 of file HcalRecHitsValidation.h.

Referenced by analyze(), and fillRecHitsTmp().

◆ ctime

std::vector<double> HcalRecHitsValidation::ctime
private

Definition at line 164 of file HcalRecHitsValidation.h.

Referenced by analyze(), and fillRecHitsTmp().

◆ cz

std::vector<double> HcalRecHitsValidation::cz
private

Definition at line 165 of file HcalRecHitsValidation.h.

Referenced by fillRecHitsTmp().

◆ EBRecHitCollectionLabel_

const edm::InputTag HcalRecHitsValidation::EBRecHitCollectionLabel_
private

Definition at line 80 of file HcalRecHitsValidation.h.

◆ ecalselector_

const std::string HcalRecHitsValidation::ecalselector_
private

Definition at line 74 of file HcalRecHitsValidation.h.

Referenced by analyze().

◆ EERecHitCollectionLabel_

const edm::InputTag HcalRecHitsValidation::EERecHitCollectionLabel_
private

Definition at line 81 of file HcalRecHitsValidation.h.

◆ geometry_

const CaloGeometry* HcalRecHitsValidation::geometry_
private

Definition at line 154 of file HcalRecHitsValidation.h.

Referenced by analyze(), and fillRecHitsTmp().

◆ hcalselector_

const std::string HcalRecHitsValidation::hcalselector_
private

Definition at line 73 of file HcalRecHitsValidation.h.

Referenced by HcalRecHitsValidation().

◆ imc

int HcalRecHitsValidation::imc
private

Definition at line 98 of file HcalRecHitsValidation.h.

Referenced by analyze(), bookHistograms(), and HcalRecHitsValidation().

◆ iz

int HcalRecHitsValidation::iz
private

Definition at line 97 of file HcalRecHitsValidation.h.

Referenced by fillRecHitsTmp(), and HcalRecHitsValidation().

◆ mc_

const std::string HcalRecHitsValidation::mc_
private

Definition at line 76 of file HcalRecHitsValidation.h.

Referenced by HcalRecHitsValidation().

◆ meEnConeEtaProfile

MonitorElement* HcalRecHitsValidation::meEnConeEtaProfile
private

Definition at line 105 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEnConeEtaProfile_E

MonitorElement* HcalRecHitsValidation::meEnConeEtaProfile_E
private

Definition at line 106 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEnConeEtaProfile_EH

MonitorElement* HcalRecHitsValidation::meEnConeEtaProfile_EH
private

Definition at line 107 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meEnergyHcalVsEcalHB

MonitorElement* HcalRecHitsValidation::meEnergyHcalVsEcalHB
private

Definition at line 144 of file HcalRecHitsValidation.h.

◆ meEnergyHcalVsEcalHE

MonitorElement* HcalRecHitsValidation::meEnergyHcalVsEcalHE
private

Definition at line 145 of file HcalRecHitsValidation.h.

◆ meLog10Chi2profileHB

MonitorElement* HcalRecHitsValidation::meLog10Chi2profileHB
private

Definition at line 151 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meLog10Chi2profileHE

MonitorElement* HcalRecHitsValidation::meLog10Chi2profileHE
private

Definition at line 152 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitsEnergyHB

MonitorElement* HcalRecHitsValidation::meRecHitsEnergyHB
private

Definition at line 110 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitsEnergyHE

MonitorElement* HcalRecHitsValidation::meRecHitsEnergyHE
private

Definition at line 111 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitsEnergyHF

MonitorElement* HcalRecHitsValidation::meRecHitsEnergyHF
private

Definition at line 113 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitsEnergyHO

MonitorElement* HcalRecHitsValidation::meRecHitsEnergyHO
private

Definition at line 112 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitSimHitHB

MonitorElement* HcalRecHitsValidation::meRecHitSimHitHB
private

Definition at line 129 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitSimHitHE

MonitorElement* HcalRecHitsValidation::meRecHitSimHitHE
private

Definition at line 130 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitSimHitHF

MonitorElement* HcalRecHitsValidation::meRecHitSimHitHF
private

Definition at line 132 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitSimHitHFL

MonitorElement* HcalRecHitsValidation::meRecHitSimHitHFL
private

Definition at line 133 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitSimHitHFS

MonitorElement* HcalRecHitsValidation::meRecHitSimHitHFS
private

Definition at line 134 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitSimHitHO

MonitorElement* HcalRecHitsValidation::meRecHitSimHitHO
private

Definition at line 131 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitSimHitProfileHB

MonitorElement* HcalRecHitsValidation::meRecHitSimHitProfileHB
private

Definition at line 136 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitSimHitProfileHE

MonitorElement* HcalRecHitsValidation::meRecHitSimHitProfileHE
private

Definition at line 137 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitSimHitProfileHF

MonitorElement* HcalRecHitsValidation::meRecHitSimHitProfileHF
private

Definition at line 139 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitSimHitProfileHFL

MonitorElement* HcalRecHitsValidation::meRecHitSimHitProfileHFL
private

Definition at line 140 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitSimHitProfileHFS

MonitorElement* HcalRecHitsValidation::meRecHitSimHitProfileHFS
private

Definition at line 141 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitSimHitProfileHO

MonitorElement* HcalRecHitsValidation::meRecHitSimHitProfileHO
private

Definition at line 138 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitsM2Chi2HB

MonitorElement* HcalRecHitsValidation::meRecHitsM2Chi2HB
private

Definition at line 148 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meRecHitsM2Chi2HE

MonitorElement* HcalRecHitsValidation::meRecHitsM2Chi2HE
private

Definition at line 149 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meTEprofileHB

MonitorElement* HcalRecHitsValidation::meTEprofileHB
private

Definition at line 116 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meTEprofileHB_High

MonitorElement* HcalRecHitsValidation::meTEprofileHB_High
private

Definition at line 117 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meTEprofileHB_Low

MonitorElement* HcalRecHitsValidation::meTEprofileHB_Low
private

Definition at line 115 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meTEprofileHE

MonitorElement* HcalRecHitsValidation::meTEprofileHE
private

Definition at line 120 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meTEprofileHE_Low

MonitorElement* HcalRecHitsValidation::meTEprofileHE_Low
private

Definition at line 119 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meTEprofileHF

MonitorElement* HcalRecHitsValidation::meTEprofileHF
private

Definition at line 126 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meTEprofileHF_Low

MonitorElement* HcalRecHitsValidation::meTEprofileHF_Low
private

Definition at line 125 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meTEprofileHO

MonitorElement* HcalRecHitsValidation::meTEprofileHO
private

Definition at line 122 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ meTEprofileHO_High

MonitorElement* HcalRecHitsValidation::meTEprofileHO_High
private

Definition at line 123 of file HcalRecHitsValidation.h.

Referenced by analyze(), and bookHistograms().

◆ nevtot

int HcalRecHitsValidation::nevtot
private

Definition at line 171 of file HcalRecHitsValidation.h.

Referenced by analyze(), and HcalRecHitsValidation().

◆ outputFile_

const std::string HcalRecHitsValidation::outputFile_
private

Definition at line 72 of file HcalRecHitsValidation.h.

Referenced by HcalRecHitsValidation().

◆ sign_

const std::string HcalRecHitsValidation::sign_
private

Definition at line 75 of file HcalRecHitsValidation.h.

Referenced by HcalRecHitsValidation().

◆ subdet_

int HcalRecHitsValidation::subdet_
private

◆ testNumber_

const bool HcalRecHitsValidation::testNumber_
private

Definition at line 77 of file HcalRecHitsValidation.h.

Referenced by analyze().

◆ tok_EB_

const edm::EDGetTokenT<EBRecHitCollection> HcalRecHitsValidation::tok_EB_
private

Definition at line 83 of file HcalRecHitsValidation.h.

Referenced by analyze().

◆ tok_EE_

const edm::EDGetTokenT<EERecHitCollection> HcalRecHitsValidation::tok_EE_
private

Definition at line 84 of file HcalRecHitsValidation.h.

Referenced by analyze().

◆ tok_evt_

const edm::EDGetTokenT<edm::HepMCProduct> HcalRecHitsValidation::tok_evt_
private

Definition at line 82 of file HcalRecHitsValidation.h.

Referenced by analyze().

◆ tok_Geom_

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> HcalRecHitsValidation::tok_Geom_
private

Definition at line 91 of file HcalRecHitsValidation.h.

Referenced by analyze().

◆ tok_hbhe_

const edm::EDGetTokenT<HBHERecHitCollection> HcalRecHitsValidation::tok_hbhe_
private

Definition at line 86 of file HcalRecHitsValidation.h.

Referenced by fillRecHitsTmp().

◆ tok_hf_

const edm::EDGetTokenT<HFRecHitCollection> HcalRecHitsValidation::tok_hf_
private

Definition at line 87 of file HcalRecHitsValidation.h.

Referenced by fillRecHitsTmp().

◆ tok_hh_

const edm::EDGetTokenT<edm::PCaloHitContainer> HcalRecHitsValidation::tok_hh_
private

Definition at line 85 of file HcalRecHitsValidation.h.

Referenced by analyze().

◆ tok_ho_

const edm::EDGetTokenT<HORecHitCollection> HcalRecHitsValidation::tok_ho_
private

Definition at line 88 of file HcalRecHitsValidation.h.

Referenced by fillRecHitsTmp().

◆ tok_HRNDC_

const edm::ESGetToken<HcalDDDRecConstants, HcalRecNumberingRecord> HcalRecHitsValidation::tok_HRNDC_
private

Definition at line 90 of file HcalRecHitsValidation.h.

Referenced by analyze().

◆ topFolderName_

const std::string HcalRecHitsValidation::topFolderName_
private

Definition at line 71 of file HcalRecHitsValidation.h.

Referenced by bookHistograms().