CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Types | Private Attributes
EcalRecHitsValidation Class Reference

#include <EcalRecHitsValidation.h>

Inheritance diagram for EcalRecHitsValidation:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 EcalRecHitsValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~EcalRecHitsValidation () override
 Destructor. More...
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
 
void findBarrelMatrix (int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &themap)
 
void findEndcapMatrix (int nCellInX, int nCellInY, int CentralX, int CentralY, int CentralZ, MapType &themap)
 
uint32_t getUnitWithMaxEnergy (MapType &themap)
 

Private Types

typedef std::map< uint32_t, float, std::less< uint32_t > > MapType
 

Private Attributes

std::vector< uint32_t > crystalMatrix
 
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
 
edm::InputTag EBrechitCollection_
 
edm::EDGetTokenT< EBRecHitCollectionEBrechitCollection_Token_
 
edm::InputTag EBuncalibrechitCollection_
 
edm::EDGetTokenT< EBUncalibratedRecHitCollectionEBuncalibrechitCollection_Token_
 
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
 
edm::InputTag EErechitCollection_
 
edm::EDGetTokenT< EERecHitCollectionEErechitCollection_Token_
 
edm::InputTag EEuncalibrechitCollection_
 
edm::EDGetTokenT< EEUncalibratedRecHitCollectionEEuncalibrechitCollection_Token_
 
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
 
edm::InputTag ESrechitCollection_
 
edm::EDGetTokenT< ESRecHitCollectionESrechitCollection_Token_
 
std::string HepMCLabel
 
edm::EDGetTokenT< edm::HepMCProductHepMCLabel_Token_
 
std::string hitsProducer_
 
MonitorElementmeEB5x5RecHitSimHitvsSimHitFlag8_
 
MonitorElementmeEBe5x5_
 
MonitorElementmeEBe5x5OverGun_
 
MonitorElementmeEBe5x5OverSimHits_
 
MonitorElementmeEBRecHitFlags_
 
MonitorElementmeEBRecHitLog10Energy5x5Contr_
 
MonitorElementmeEBRecHitLog10Energy_
 
MonitorElementmeEBRecHitLog10EnergyContr_
 
MonitorElementmeEBRecHitSimHitFlag6_
 
MonitorElementmeEBRecHitSimHitFlag7_
 
MonitorElementmeEBRecHitSimHitRatio1011_
 
MonitorElementmeEBRecHitSimHitRatio12_
 
MonitorElementmeEBRecHitSimHitRatio13_
 
MonitorElementmeEBRecHitSimHitRatio_
 
MonitorElementmeEBRecHitSimHitRatioGt35_
 
MonitorElementmeEBRecHitSimHitvsSimHitFlag5_6_
 
MonitorElementmeEBRecHitsOccupancyFlag5_6_
 
MonitorElementmeEBRecHitsOccupancyFlag8_9_
 
MonitorElementmeEBUnRecHitSimHitRatio_
 
MonitorElementmeEBUnRecHitSimHitRatioGt35_
 
MonitorElementmeEEe5x5_
 
MonitorElementmeEEe5x5OverGun_
 
MonitorElementmeEEe5x5OverSimHits_
 
MonitorElementmeEERecHitFlags_
 
MonitorElementmeEERecHitLog10Energy5x5Contr_
 
MonitorElementmeEERecHitLog10Energy_
 
MonitorElementmeEERecHitLog10EnergyContr_
 
MonitorElementmeEERecHitSimHitFlag6_
 
MonitorElementmeEERecHitSimHitFlag7_
 
MonitorElementmeEERecHitSimHitRatio1011_
 
MonitorElementmeEERecHitSimHitRatio12_
 
MonitorElementmeEERecHitSimHitRatio13_
 
MonitorElementmeEERecHitSimHitRatio_
 
MonitorElementmeEERecHitSimHitRatioGt35_
 
MonitorElementmeEERecHitSimHitvsSimHitFlag5_6_
 
MonitorElementmeEERecHitsOccupancyMinusFlag5_6_
 
MonitorElementmeEERecHitsOccupancyMinusFlag8_9_
 
MonitorElementmeEERecHitsOccupancyPlusFlag5_6_
 
MonitorElementmeEERecHitsOccupancyPlusFlag8_9_
 
MonitorElementmeEEUnRecHitSimHitRatio_
 
MonitorElementmeEEUnRecHitSimHitRatioGt35_
 
MonitorElementmeESRecHitLog10Energy_
 
MonitorElementmeESRecHitLog10EnergyContr_
 
MonitorElementmeESRecHitSimHitRatio_
 
MonitorElementmeGunEnergy_
 
MonitorElementmeGunEta_
 
MonitorElementmeGunPhi_
 
std::string outputFile_
 
bool verbose_
 

Detailed Description

Definition at line 44 of file EcalRecHitsValidation.h.

Member Typedef Documentation

typedef std::map<uint32_t, float, std::less<uint32_t> > EcalRecHitsValidation::MapType
private

Definition at line 45 of file EcalRecHitsValidation.h.

Constructor & Destructor Documentation

EcalRecHitsValidation::EcalRecHitsValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 23 of file EcalRecHitsValidation.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

23  {
24  // ----------------------
25  HepMCLabel = ps.getParameter<std::string>("moduleLabelMC");
26  hitsProducer_ = ps.getParameter<std::string>("hitsProducer");
27  EBrechitCollection_ = ps.getParameter<edm::InputTag>("EBrechitCollection");
28  EErechitCollection_ = ps.getParameter<edm::InputTag>("EErechitCollection");
29  ESrechitCollection_ = ps.getParameter<edm::InputTag>("ESrechitCollection");
30  EBuncalibrechitCollection_ = ps.getParameter<edm::InputTag>("EBuncalibrechitCollection");
31  EEuncalibrechitCollection_ = ps.getParameter<edm::InputTag>("EEuncalibrechitCollection");
32  // fix for consumes
33  HepMCLabel_Token_ = consumes<HepMCProduct>(ps.getParameter<std::string>("moduleLabelMC"));
34  EBrechitCollection_Token_ = consumes<EBRecHitCollection>(ps.getParameter<edm::InputTag>("EBrechitCollection"));
35  EErechitCollection_Token_ = consumes<EERecHitCollection>(ps.getParameter<edm::InputTag>("EErechitCollection"));
36  ESrechitCollection_Token_ = consumes<ESRecHitCollection>(ps.getParameter<edm::InputTag>("ESrechitCollection"));
38  consumes<EBUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EBuncalibrechitCollection"));
40  consumes<EEUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EEuncalibrechitCollection"));
41  EBHits_Token_ = consumes<CrossingFrame<PCaloHit>>(
42  edm::InputTag(std::string("mix"), ps.getParameter<std::string>("hitsProducer") + std::string("EcalHitsEB")));
43  EEHits_Token_ = consumes<CrossingFrame<PCaloHit>>(
44  edm::InputTag(std::string("mix"), ps.getParameter<std::string>("hitsProducer") + std::string("EcalHitsEE")));
45  ESHits_Token_ = consumes<CrossingFrame<PCaloHit>>(
46  edm::InputTag(std::string("mix"), ps.getParameter<std::string>("hitsProducer") + std::string("EcalHitsES")));
47 
48  // ----------------------
49  // DQM ROOT output
50  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
51 
52  if (!outputFile_.empty()) {
53  LogInfo("OutputInfo") << " Ecal RecHits Task histograms will be saved to '" << outputFile_.c_str() << "'";
54  } else {
55  LogInfo("OutputInfo") << " Ecal RecHits Task histograms will NOT be saved";
56  }
57 
58  // ----------------------
59  // verbosity switch
60  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
61 
62  // ----------------------
63  meGunEnergy_ = nullptr;
64  meGunEta_ = nullptr;
65  meGunPhi_ = nullptr;
66  meEBRecHitSimHitRatio_ = nullptr;
67  meEERecHitSimHitRatio_ = nullptr;
68  meESRecHitSimHitRatio_ = nullptr;
71  meEBRecHitSimHitRatio12_ = nullptr;
72  meEERecHitSimHitRatio12_ = nullptr;
73  meEBRecHitSimHitRatio13_ = nullptr;
74  meEERecHitSimHitRatio13_ = nullptr;
77  meEBUnRecHitSimHitRatio_ = nullptr;
78  meEEUnRecHitSimHitRatio_ = nullptr;
81  meEBe5x5_ = nullptr;
82  meEBe5x5OverSimHits_ = nullptr;
83  meEBe5x5OverGun_ = nullptr;
84  meEEe5x5_ = nullptr;
85  meEEe5x5OverSimHits_ = nullptr;
86  meEEe5x5OverGun_ = nullptr;
87 
88  meEBRecHitLog10Energy_ = nullptr;
89  meEERecHitLog10Energy_ = nullptr;
90  meESRecHitLog10Energy_ = nullptr;
96 
103 
104  meEBRecHitFlags_ = nullptr;
106  meEBRecHitSimHitFlag6_ = nullptr;
107  meEBRecHitSimHitFlag7_ = nullptr;
109 
110  meEERecHitFlags_ = nullptr;
112  meEERecHitSimHitFlag6_ = nullptr;
113  meEERecHitSimHitFlag7_ = nullptr;
114 }
MonitorElement * meEERecHitsOccupancyPlusFlag5_6_
MonitorElement * meEBRecHitSimHitRatio13_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meEBRecHitLog10Energy5x5Contr_
MonitorElement * meEBRecHitSimHitRatio1011_
MonitorElement * meEBRecHitSimHitFlag7_
MonitorElement * meEBRecHitSimHitRatio12_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
MonitorElement * meEERecHitSimHitRatio12_
MonitorElement * meEERecHitsOccupancyMinusFlag5_6_
edm::EDGetTokenT< ESRecHitCollection > ESrechitCollection_Token_
MonitorElement * meEERecHitSimHitRatio13_
MonitorElement * meEBe5x5OverSimHits_
MonitorElement * meEBRecHitSimHitFlag6_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
MonitorElement * meEB5x5RecHitSimHitvsSimHitFlag8_
edm::EDGetTokenT< EERecHitCollection > EErechitCollection_Token_
edm::InputTag EBuncalibrechitCollection_
MonitorElement * meEBUnRecHitSimHitRatio_
MonitorElement * meEBRecHitLog10EnergyContr_
MonitorElement * meEBRecHitsOccupancyFlag8_9_
MonitorElement * meEERecHitLog10EnergyContr_
MonitorElement * meGunEnergy_
MonitorElement * meEERecHitsOccupancyMinusFlag8_9_
MonitorElement * meEERecHitFlags_
MonitorElement * meEERecHitSimHitFlag6_
MonitorElement * meEEUnRecHitSimHitRatioGt35_
MonitorElement * meEEUnRecHitSimHitRatio_
MonitorElement * meEERecHitSimHitRatioGt35_
edm::InputTag EEuncalibrechitCollection_
MonitorElement * meEERecHitSimHitFlag7_
MonitorElement * meEBRecHitSimHitRatioGt35_
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_Token_
edm::EDGetTokenT< EBRecHitCollection > EBrechitCollection_Token_
MonitorElement * meESRecHitLog10Energy_
MonitorElement * meEBRecHitSimHitvsSimHitFlag5_6_
MonitorElement * meEERecHitSimHitvsSimHitFlag5_6_
MonitorElement * meEBRecHitFlags_
MonitorElement * meEERecHitLog10Energy_
MonitorElement * meEBRecHitLog10Energy_
edm::EDGetTokenT< EBUncalibratedRecHitCollection > EBuncalibrechitCollection_Token_
MonitorElement * meEBUnRecHitSimHitRatioGt35_
MonitorElement * meEERecHitLog10Energy5x5Contr_
MonitorElement * meESRecHitLog10EnergyContr_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
MonitorElement * meEERecHitsOccupancyPlusFlag8_9_
MonitorElement * meESRecHitSimHitRatio_
MonitorElement * meEBRecHitSimHitRatio_
MonitorElement * meEBRecHitsOccupancyFlag5_6_
MonitorElement * meEEe5x5OverGun_
MonitorElement * meEERecHitSimHitRatio1011_
MonitorElement * meEEe5x5OverSimHits_
edm::EDGetTokenT< edm::HepMCProduct > HepMCLabel_Token_
MonitorElement * meEBe5x5OverGun_
MonitorElement * meEERecHitSimHitRatio_
EcalRecHitsValidation::~EcalRecHitsValidation ( )
override

Destructor.

Definition at line 116 of file EcalRecHitsValidation.cc.

116 {}

Member Function Documentation

void EcalRecHitsValidation::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotected

Analyze.

Definition at line 276 of file EcalRecHitsValidation.cc.

References funct::abs(), cosmicBasicClusters_cfi::barrelHits, edm::SortedCollection< T, SORT >::begin(), EcalTrigTowerConstituentsMap::constituentsOf(), EcalCondObjectContainer< T >::end(), edm::SortedCollection< T, SORT >::end(), cosmicBasicClusters_cfi::endcapHits, edm::EventID::event(), EcalCondObjectContainer< T >::find(), edm::SortedCollection< T, SORT >::find(), RemoveAddSevLevel::flag, edm::EventSetup::get(), edm::Event::getByToken(), EcalADCToGeVConstant::getEBValue(), EcalADCToGeVConstant::getEEValue(), edm::HepMCProduct::GetEvent(), EcalChannelStatusCode::getStatusCode(), mps_fire::i, edm::EventBase::id(), EBDetId::ieta(), EBDetId::ietaAbs(), createfilelist::int, EBDetId::iphi(), edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), EcalRecHit::kDead, EcalRecHit::kLeadingEdgeRecovered, EcalRecHit::kNeighboursRecovered, EcalRecHit::kSaturated, EcalRecHit::kTowerRecovered, cmsBatch::log, LogDebug, M_PI, AlCaHLTBitMon_ParallelJobs::p, gedPhotons_cfi::preshowerHits, edm::Handle< T >::product(), edm::ESHandle< T >::product(), DetId::rawId(), rpcPointValidation_cfi::recHit, edm::EventID::run(), SimDataFormats::CaloAnalysis::sc, MixCollection< T >::size(), funct::tan(), EBDetId::tower(), EBDetId::zside(), and EEDetId::zside().

276  {
277  // Temporary stuff
278 
279  LogInfo("EcalRecHitsTask, EventInfo: ") << " Run = " << e.id().run() << " Event = " << e.id().event();
280 
281  // ADC -> GeV Scale
283  c.get<EcalADCToGeVConstantRcd>().get(pAgc);
284  const EcalADCToGeVConstant *agc = pAgc.product();
285  const double barrelADCtoGeV_ = agc->getEBValue();
286  const double endcapADCtoGeV_ = agc->getEEValue();
287 
288  Handle<HepMCProduct> MCEvt;
289  bool skipMC = false;
290  e.getByToken(HepMCLabel_Token_, MCEvt);
291  if (!MCEvt.isValid()) {
292  skipMC = true;
293  }
294 
296 
297  bool skipBarrel = false;
298  const EBUncalibratedRecHitCollection *EBUncalibRecHit = nullptr;
299  Handle<EBUncalibratedRecHitCollection> EcalUncalibRecHitEB;
300  e.getByToken(EBuncalibrechitCollection_Token_, EcalUncalibRecHitEB);
301  if (EcalUncalibRecHitEB.isValid()) {
302  EBUncalibRecHit = EcalUncalibRecHitEB.product();
303  } else {
304  skipBarrel = true;
305  }
306 
307  bool skipEndcap = false;
308  const EEUncalibratedRecHitCollection *EEUncalibRecHit = nullptr;
309  Handle<EEUncalibratedRecHitCollection> EcalUncalibRecHitEE;
310  e.getByToken(EEuncalibrechitCollection_Token_, EcalUncalibRecHitEE);
311  if (EcalUncalibRecHitEE.isValid()) {
312  EEUncalibRecHit = EcalUncalibRecHitEE.product();
313  } else {
314  skipEndcap = true;
315  }
316 
317  const EBRecHitCollection *EBRecHit = nullptr;
318  Handle<EBRecHitCollection> EcalRecHitEB;
319  e.getByToken(EBrechitCollection_Token_, EcalRecHitEB);
320  if (EcalRecHitEB.isValid()) {
321  EBRecHit = EcalRecHitEB.product();
322  } else {
323  skipBarrel = true;
324  }
325 
326  const EERecHitCollection *EERecHit = nullptr;
327  Handle<EERecHitCollection> EcalRecHitEE;
328  e.getByToken(EErechitCollection_Token_, EcalRecHitEE);
329  if (EcalRecHitEE.isValid()) {
330  EERecHit = EcalRecHitEE.product();
331  } else {
332  skipEndcap = true;
333  }
334 
335  bool skipPreshower = false;
336  const ESRecHitCollection *ESRecHit = nullptr;
337  Handle<ESRecHitCollection> EcalRecHitES;
338  e.getByToken(ESrechitCollection_Token_, EcalRecHitES);
339  if (EcalRecHitES.isValid()) {
340  ESRecHit = EcalRecHitES.product();
341  } else {
342  skipPreshower = true;
343  }
344 
345  // ----------------------
346  // gun
347  double eGun = 0.;
348  if (!skipMC) {
349  for (HepMC::GenEvent::particle_const_iterator p = MCEvt->GetEvent()->particles_begin();
350  p != MCEvt->GetEvent()->particles_end();
351  ++p) {
352  double htheta = (*p)->momentum().theta();
353  double heta = -99999.;
354  if (tan(htheta * 0.5) > 0) {
355  heta = -log(tan(htheta * 0.5));
356  }
357  double hphi = (*p)->momentum().phi();
358  hphi = (hphi >= 0) ? hphi : hphi + 2 * M_PI;
359  hphi = hphi / M_PI * 180.;
360 
361  LogDebug("EventInfo") << "EcalRecHitsTask: Particle gun type form MC = " << abs((*p)->pdg_id()) << "\n"
362  << "Energy = " << (*p)->momentum().e() << "\n"
363  << "Eta = " << heta << "\n"
364  << "Phi = " << hphi;
365 
366  if ((*p)->momentum().e() > eGun)
367  eGun = (*p)->momentum().e();
368 
369  if (meGunEnergy_)
370  meGunEnergy_->Fill((*p)->momentum().e());
371  if (meGunEta_)
372  meGunEta_->Fill(heta);
373  if (meGunPhi_)
374  meGunPhi_->Fill(hphi);
375  }
376  }
377 
378  // -------------------------------------------------------------------
379  // BARREL
380 
381  if (!skipBarrel) {
382  // 1) loop over simHits
383  e.getByToken(EBHits_Token_, crossingFrame);
384  const MixCollection<PCaloHit> barrelHits(crossingFrame.product());
385 
386  MapType ebSimMap;
387  MapType ebRecMap;
388  const int ebcSize = 90;
389  double ebcontr[ebcSize];
390  double ebcontr25[ebcSize];
391  for (int i = 0; i < ebcSize; i++) {
392  ebcontr[i] = 0.0;
393  ebcontr25[i] = 0.0;
394  }
395  double ebtotal = 0.;
396 
397  for (auto const &iHit : barrelHits) {
398  EBDetId ebid = EBDetId(iHit.id());
399 
400  LogDebug("SimHitInfo, barrel") << "CaloHit " << iHit.getName() << " DetID = " << iHit.id() << "\n"
401  << "Energy = " << iHit.energy() << " Time = " << iHit.time() << "\n"
402  << "EBDetId = " << ebid.ieta() << " " << ebid.iphi();
403 
404  uint32_t crystid = ebid.rawId();
405  ebSimMap[crystid] += iHit.energy();
406  }
407 
408  // 2) loop over RecHits
409  for (EcalUncalibratedRecHitCollection::const_iterator uncalibRecHit = EBUncalibRecHit->begin();
410  uncalibRecHit != EBUncalibRecHit->end();
411  ++uncalibRecHit) {
412  EBDetId EBid = EBDetId(uncalibRecHit->id());
413 
414  // Find corresponding recHit
415  EcalRecHitCollection::const_iterator myRecHit = EBRecHit->find(EBid);
416  if (myRecHit == EBRecHit->end())
417  continue;
418  ebRecMap[EBid.rawId()] += myRecHit->energy();
419 
420  // Fill log10(Energy) stuff...
421  ebtotal += myRecHit->energy();
422  if (myRecHit->energy() > 0) {
424  meEBRecHitLog10Energy_->Fill(log10(myRecHit->energy()));
425  int log10i = int((log10(myRecHit->energy()) + 5.) * 10.);
426  if (log10i >= 0 and log10i < ebcSize)
427  ebcontr[log10i] += myRecHit->energy();
428  }
429 
430  // comparison Rec/Sim hit
431  if (ebSimMap[EBid.rawId()] != 0.) {
432  double uncEnergy = uncalibRecHit->amplitude() * barrelADCtoGeV_;
434  meEBUnRecHitSimHitRatio_->Fill(uncEnergy / ebSimMap[EBid.rawId()]);
435  }
436  if (meEBUnRecHitSimHitRatioGt35_ && (myRecHit->energy() > 3.5)) {
437  meEBUnRecHitSimHitRatioGt35_->Fill(uncEnergy / ebSimMap[EBid.rawId()]);
438  }
439  }
440 
441  if (myRecHit != EBRecHit->end()) {
442  if (ebSimMap[EBid.rawId()] != 0.) {
444  meEBRecHitSimHitRatio_->Fill(myRecHit->energy() / ebSimMap[EBid.rawId()]);
445  }
446  if (meEBRecHitSimHitRatioGt35_ && (myRecHit->energy() > 3.5)) {
447  meEBRecHitSimHitRatioGt35_->Fill(myRecHit->energy() / ebSimMap[EBid.rawId()]);
448  }
449  uint16_t sc = 0;
451  c.get<EcalChannelStatusRcd>().get(pEcs);
452  const EcalChannelStatus *ecs = nullptr;
453  if (pEcs.isValid())
454  ecs = pEcs.product();
455  if (ecs != nullptr) {
456  EcalChannelStatusMap::const_iterator csmi = ecs->find(EBid.rawId());
458  if (csmi != ecs->end())
459  csc = *csmi;
460  sc = csc.getStatusCode();
461  }
462 
463  if (meEBRecHitSimHitRatio1011_ != nullptr && (sc == 10 || sc == 11)) {
464  meEBRecHitSimHitRatio1011_->Fill(myRecHit->energy() / ebSimMap[EBid.rawId()]);
465  }
466  if (meEBRecHitSimHitRatio12_ != nullptr && sc == 12) {
467  meEBRecHitSimHitRatio12_->Fill(myRecHit->energy() / ebSimMap[EBid.rawId()]);
468  }
469 
471  c.get<IdealGeometryRecord>().get(pttMap);
472  const EcalTrigTowerConstituentsMap *ttMap = nullptr;
473  if (pttMap.isValid())
474  ttMap = pttMap.product();
475  double ttSimEnergy = 0;
476  if (ttMap != nullptr) {
477  EcalTrigTowerDetId ttDetId = EBid.tower();
478  std::vector<DetId> vid = ttMap->constituentsOf(ttDetId);
479  for (std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); dit++) {
480  EBDetId ttEBid = EBDetId(*dit);
481  ttSimEnergy += ebSimMap[ttEBid.rawId()];
482  }
483  if (!vid.empty())
484  ttSimEnergy = ttSimEnergy / vid.size();
485  }
486  if (meEBRecHitSimHitRatio13_ != nullptr && sc == 13 && ttSimEnergy != 0)
487  meEBRecHitSimHitRatio13_->Fill(myRecHit->energy() / ttSimEnergy);
488 
489  int flag = myRecHit->recoFlag();
490  if (meEBRecHitFlags_ != nullptr)
491  meEBRecHitFlags_->Fill(flag);
494  meEBRecHitSimHitvsSimHitFlag5_6_->Fill(myRecHit->energy() / ebSimMap[EBid.rawId()], ebSimMap[EBid.rawId()]);
496  meEBRecHitSimHitFlag6_->Fill(myRecHit->energy() / ebSimMap[EBid.rawId()]);
498  meEBRecHitSimHitFlag6_->Fill(myRecHit->energy() / ebSimMap[EBid.rawId()]);
499  if (meEB5x5RecHitSimHitvsSimHitFlag8_ && (flag == EcalRecHit::kTowerRecovered) && ttSimEnergy != 0)
500  meEB5x5RecHitSimHitvsSimHitFlag8_->Fill(myRecHit->energy() / ttSimEnergy, ttSimEnergy);
501 
504  meEBRecHitsOccupancyFlag5_6_->Fill(EBid.ieta(), EBid.iphi());
506  meEBRecHitsOccupancyFlag8_9_->Fill(EBid.ieta(), EBid.iphi());
507  }
508  } else
509  continue;
510  } // loop over the UncalibratedRecHitCollection
511 
512  // RecHits matrix
513  uint32_t ebcenterid = getUnitWithMaxEnergy(ebRecMap);
514  EBDetId myEBid(ebcenterid);
515  int bx = myEBid.ietaAbs();
516  int by = myEBid.iphi();
517  int bz = myEBid.zside();
518  findBarrelMatrix(5, 5, bx, by, bz, ebRecMap);
519  double e5x5rec = 0.;
520  double e5x5sim = 0.;
521  for (unsigned int i = 0; i < crystalMatrix.size(); i++) {
522  e5x5rec += ebRecMap[crystalMatrix[i]];
523  e5x5sim += ebSimMap[crystalMatrix[i]];
524  if (ebRecMap[crystalMatrix[i]] > 0) {
525  int log10i25 = int((log10(ebRecMap[crystalMatrix[i]]) + 5.) * 10.);
526  if (log10i25 >= 0 && log10i25 < ebcSize)
527  ebcontr25[log10i25] += ebRecMap[crystalMatrix[i]];
528  }
529  }
530 
531  if (meEBe5x5_)
532  meEBe5x5_->Fill(e5x5rec);
533  if (e5x5sim > 0. && meEBe5x5OverSimHits_)
534  meEBe5x5OverSimHits_->Fill(e5x5rec / e5x5sim);
535  if (eGun > 0. && meEBe5x5OverGun_)
536  meEBe5x5OverGun_->Fill(e5x5rec / eGun);
537 
538  if (meEBRecHitLog10EnergyContr_ && ebtotal != 0) {
539  for (int i = 0; i < ebcSize; i++) {
540  meEBRecHitLog10EnergyContr_->Fill(-5. + (float(i) + 0.5) / 10., ebcontr[i] / ebtotal);
541  }
542  }
543 
544  if (meEBRecHitLog10Energy5x5Contr_ && e5x5rec != 0) {
545  for (int i = 0; i < ebcSize; i++) {
546  meEBRecHitLog10Energy5x5Contr_->Fill(-5. + (float(i) + 0.5) / 10., ebcontr25[i] / e5x5rec);
547  }
548  }
549  }
550 
551  // -------------------------------------------------------------------
552  // ENDCAP
553 
554  if (!skipEndcap) {
555  // 1) loop over simHits
556  e.getByToken(EEHits_Token_, crossingFrame);
557  const MixCollection<PCaloHit> endcapHits(crossingFrame.product());
558 
559  MapType eeSimMap;
560  MapType eeRecMap;
561  const int eecSize = 90;
562  double eecontr[eecSize];
563  double eecontr25[eecSize];
564  for (int i = 0; i < eecSize; i++) {
565  eecontr[i] = 0.0;
566  eecontr25[i] = 0.0;
567  }
568  double eetotal = 0.;
569 
570  for (auto const &iHit : endcapHits) {
571  EEDetId eeid(iHit.id());
572 
573  LogDebug("Endcap, HitInfo") << " CaloHit " << iHit.getName() << " DetID = " << iHit.id() << "\n"
574  << "Energy = " << iHit.energy() << " Time = " << iHit.time() << "\n"
575  << "EEDetId side " << eeid.zside() << " = " << eeid.ix() << " " << eeid.iy();
576 
577  uint32_t crystid = eeid.rawId();
578  eeSimMap[crystid] += iHit.energy();
579  }
580 
581  // 2) loop over RecHits
582  for (EcalUncalibratedRecHitCollection::const_iterator uncalibRecHit = EEUncalibRecHit->begin();
583  uncalibRecHit != EEUncalibRecHit->end();
584  ++uncalibRecHit) {
585  EEDetId EEid = EEDetId(uncalibRecHit->id());
586 
587  // Find corresponding recHit
588  EcalRecHitCollection::const_iterator myRecHit = EERecHit->find(EEid);
589  if (myRecHit == EERecHit->end())
590  continue;
591  eeRecMap[EEid.rawId()] += myRecHit->energy();
592 
593  // Fill log10(Energy) stuff...
594  eetotal += myRecHit->energy();
595  if (myRecHit->energy() > 0) {
597  meEERecHitLog10Energy_->Fill(log10(myRecHit->energy()));
598  int log10i = int((log10(myRecHit->energy()) + 5.) * 10.);
599  if (log10i >= 0 and log10i < eecSize)
600  eecontr[log10i] += myRecHit->energy();
601  }
602 
603  // comparison Rec/Sim hit
604  if (eeSimMap[EEid.rawId()] != 0.) {
605  double uncEnergy = uncalibRecHit->amplitude() * endcapADCtoGeV_;
607  meEEUnRecHitSimHitRatio_->Fill(uncEnergy / eeSimMap[EEid.rawId()]);
608  }
609  if (meEEUnRecHitSimHitRatioGt35_ && (myRecHit->energy() > 3.5)) {
610  meEEUnRecHitSimHitRatioGt35_->Fill(uncEnergy / eeSimMap[EEid.rawId()]);
611  }
612  }
613 
614  if (myRecHit != EERecHit->end()) {
615  if (eeSimMap[EEid.rawId()] != 0.) {
617  meEERecHitSimHitRatio_->Fill(myRecHit->energy() / eeSimMap[EEid.rawId()]);
618  }
619  if (meEERecHitSimHitRatioGt35_ && (myRecHit->energy() > 3.5)) {
620  meEERecHitSimHitRatioGt35_->Fill(myRecHit->energy() / eeSimMap[EEid.rawId()]);
621  }
622 
624  c.get<EcalChannelStatusRcd>().get(pEcs);
625  const EcalChannelStatus *ecs = nullptr;
626  if (pEcs.isValid())
627  ecs = pEcs.product();
628  if (ecs != nullptr) {
629  EcalChannelStatusMap::const_iterator csmi = ecs->find(EEid.rawId());
630  EcalChannelStatusCode csc = 0;
631  if (csmi != ecs->end())
632  csc = *csmi;
633  uint16_t sc = csc.getStatusCode();
634  if (meEERecHitSimHitRatio1011_ != nullptr && (sc == 10 || sc == 11)) {
635  meEERecHitSimHitRatio1011_->Fill(myRecHit->energy() / eeSimMap[EEid.rawId()]);
636  }
637  if (meEERecHitSimHitRatio12_ != nullptr && sc == 12) {
638  meEERecHitSimHitRatio12_->Fill(myRecHit->energy() / eeSimMap[EEid.rawId()]);
639  }
640  if (meEERecHitSimHitRatio13_ != nullptr && sc == 13) {
641  meEERecHitSimHitRatio13_->Fill(myRecHit->energy() / eeSimMap[EEid.rawId()]);
642  }
643  }
644 
645  int flag = myRecHit->recoFlag();
646  if (meEERecHitFlags_ != nullptr)
647  meEERecHitFlags_->Fill(flag);
650  meEERecHitSimHitvsSimHitFlag5_6_->Fill(myRecHit->energy() / eeSimMap[EEid.rawId()], eeSimMap[EEid.rawId()]);
652  meEERecHitSimHitFlag6_->Fill(myRecHit->energy() / eeSimMap[EEid.rawId()]);
654  meEERecHitSimHitFlag6_->Fill(myRecHit->energy() / eeSimMap[EEid.rawId()]);
655 
656  if (EEid.zside() > 0) {
659  meEERecHitsOccupancyPlusFlag5_6_->Fill(EEid.ix(), EEid.iy());
661  ((flag == EcalRecHit::kTowerRecovered) || (flag == EcalRecHit::kDead)))
662  meEERecHitsOccupancyPlusFlag8_9_->Fill(EEid.ix(), EEid.iy());
663  }
664  if (EEid.zside() < 0) {
667  meEERecHitsOccupancyMinusFlag5_6_->Fill(EEid.ix(), EEid.iy());
669  ((flag == EcalRecHit::kTowerRecovered) || (flag == EcalRecHit::kDead)))
670  meEERecHitsOccupancyMinusFlag8_9_->Fill(EEid.ix(), EEid.iy());
671  }
672  }
673  } else
674  continue;
675  } // loop over the UncalibratedechitCollection
676 
677  // RecHits matrix
678  uint32_t eecenterid = getUnitWithMaxEnergy(eeRecMap);
679  EEDetId myEEid(eecenterid);
680  int bx = myEEid.ix();
681  int by = myEEid.iy();
682  int bz = myEEid.zside();
683  findEndcapMatrix(5, 5, bx, by, bz, eeRecMap);
684  double e5x5rec = 0.;
685  double e5x5sim = 0.;
686  for (unsigned int i = 0; i < crystalMatrix.size(); i++) {
687  e5x5rec += eeRecMap[crystalMatrix[i]];
688  e5x5sim += eeSimMap[crystalMatrix[i]];
689  if (eeRecMap[crystalMatrix[i]] > 0) {
690  int log10i25 = int((log10(eeRecMap[crystalMatrix[i]]) + 5.) * 10.);
691  if (log10i25 >= 0 && log10i25 < eecSize)
692  eecontr25[log10i25] += eeRecMap[crystalMatrix[i]];
693  }
694  }
695 
696  if (meEEe5x5_)
697  meEEe5x5_->Fill(e5x5rec);
698  if (e5x5sim > 0. && meEEe5x5OverSimHits_)
699  meEEe5x5OverSimHits_->Fill(e5x5rec / e5x5sim);
700  if (eGun > 0. && meEEe5x5OverGun_)
701  meEEe5x5OverGun_->Fill(e5x5rec / eGun);
702 
703  if (meEERecHitLog10EnergyContr_ && eetotal != 0) {
704  for (int i = 0; i < eecSize; i++) {
705  meEERecHitLog10EnergyContr_->Fill(-5. + (float(i) + 0.5) / 10., eecontr[i] / eetotal);
706  }
707  }
708 
709  if (meEERecHitLog10Energy5x5Contr_ && e5x5rec != 0) {
710  for (int i = 0; i < eecSize; i++) {
711  meEERecHitLog10Energy5x5Contr_->Fill(-5. + (float(i) + 0.5) / 10., eecontr25[i] / e5x5rec);
712  }
713  }
714  }
715 
716  // -------------------------------------------------------------------
717  // PRESHOWER
718 
719  if (!skipPreshower) {
720  // 1) loop over simHits
721  e.getByToken(ESHits_Token_, crossingFrame);
722  const MixCollection<PCaloHit> preshowerHits(crossingFrame.product());
723 
724  MapType esSimMap;
725  const int escSize = 90;
726  double escontr[escSize];
727  for (int i = 0; i < escSize; i++) {
728  escontr[i] = 0.0;
729  }
730  double estotal = 0.;
731 
732  for (auto const &iHit : preshowerHits) {
733  ESDetId esid(iHit.id());
734  LogDebug("Preshower, HitInfo") << " CaloHit " << iHit.getName() << " DetID = " << iHit.id() << "\n"
735  << "Energy = " << iHit.energy() << " Time = " << iHit.time() << "\n"
736  << "ESDetId strip " << esid.strip() << " = " << esid.six() << " " << esid.siy();
737 
738  uint32_t crystid = esid.rawId();
739  esSimMap[crystid] += iHit.energy();
740  }
741 
742  // 2) loop over RecHits
743  for (EcalRecHitCollection::const_iterator recHit = ESRecHit->begin(); recHit != ESRecHit->end(); ++recHit) {
744  ESDetId ESid = ESDetId(recHit->id());
745  if (esSimMap[ESid.rawId()] != 0.) {
746  // Fill log10(Energy) stuff...
747  estotal += recHit->energy();
748  if (recHit->energy() > 0) {
750  meESRecHitLog10Energy_->Fill(log10(recHit->energy()));
751  int log10i = int((log10(recHit->energy()) + 5.) * 10.);
752  if (log10i >= 0 and log10i < escSize)
753  escontr[log10i] += recHit->energy();
754  }
755 
757  meESRecHitSimHitRatio_->Fill(recHit->energy() / esSimMap[ESid.rawId()]);
758  }
759  } else
760  continue;
761  } // loop over the RechitCollection
762 
763  if (meESRecHitLog10EnergyContr_ && estotal != 0) {
764  for (int i = 0; i < escSize; i++) {
765  meESRecHitLog10EnergyContr_->Fill(-5. + (float(i) + 0.5) / 10., escontr[i] / estotal);
766  }
767  }
768  }
769 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
MonitorElement * meEERecHitsOccupancyPlusFlag5_6_
MonitorElement * meEBRecHitSimHitRatio13_
EventNumber_t event() const
Definition: EventID.h:41
MonitorElement * meEBRecHitLog10Energy5x5Contr_
MonitorElement * meEBRecHitSimHitRatio1011_
int ix() const
Definition: EEDetId.h:77
MonitorElement * meEBRecHitSimHitFlag7_
MonitorElement * meEBRecHitSimHitRatio12_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
MonitorElement * meEERecHitSimHitRatio12_
Code getStatusCode() const
return decoded status
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
std::vector< T >::const_iterator const_iterator
MonitorElement * meEERecHitsOccupancyMinusFlag5_6_
edm::EDGetTokenT< ESRecHitCollection > ESrechitCollection_Token_
MonitorElement * meEERecHitSimHitRatio13_
MonitorElement * meEBe5x5OverSimHits_
uint32_t getUnitWithMaxEnergy(MapType &themap)
MonitorElement * meEBRecHitSimHitFlag6_
int size() const
Definition: MixCollection.h:20
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
MonitorElement * meEB5x5RecHitSimHitvsSimHitFlag8_
void Fill(long long x)
edm::EDGetTokenT< EERecHitCollection > EErechitCollection_Token_
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
std::map< uint32_t, float, std::less< uint32_t > > MapType
MonitorElement * meEBUnRecHitSimHitRatio_
MonitorElement * meEBRecHitLog10EnergyContr_
void findEndcapMatrix(int nCellInX, int nCellInY, int CentralX, int CentralY, int CentralZ, MapType &themap)
MonitorElement * meEBRecHitsOccupancyFlag8_9_
MonitorElement * meEERecHitLog10EnergyContr_
MonitorElement * meGunEnergy_
int zside() const
Definition: EEDetId.h:71
MonitorElement * meEERecHitsOccupancyMinusFlag8_9_
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * meEERecHitFlags_
int iy() const
Definition: EEDetId.h:83
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
Definition: EBDetId.h:57
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
MonitorElement * meEERecHitSimHitFlag6_
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * meEEUnRecHitSimHitRatioGt35_
std::vector< DetId > constituentsOf(const EcalTrigTowerDetId &id) const
Get the constituent detids for this tower id.
MonitorElement * meEEUnRecHitSimHitRatio_
Definition: L1Track.h:19
MonitorElement * meEERecHitSimHitRatioGt35_
#define M_PI
MonitorElement * meEERecHitSimHitFlag7_
const_iterator end() const
MonitorElement * meEBRecHitSimHitRatioGt35_
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_Token_
edm::EDGetTokenT< EBRecHitCollection > EBrechitCollection_Token_
MonitorElement * meESRecHitLog10Energy_
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:38
T const * product() const
Definition: Handle.h:74
MonitorElement * meEBRecHitSimHitvsSimHitFlag5_6_
std::vector< Item >::const_iterator const_iterator
MonitorElement * meEERecHitSimHitvsSimHitFlag5_6_
MonitorElement * meEBRecHitFlags_
MonitorElement * meEERecHitLog10Energy_
MonitorElement * meEBRecHitLog10Energy_
edm::EDGetTokenT< EBUncalibratedRecHitCollection > EBuncalibrechitCollection_Token_
edm::EventID id() const
Definition: EventBase.h:59
iterator find(key_type k)
MonitorElement * meEBUnRecHitSimHitRatioGt35_
void findBarrelMatrix(int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &themap)
std::vector< uint32_t > crystalMatrix
MonitorElement * meEERecHitLog10Energy5x5Contr_
T get() const
Definition: EventSetup.h:71
MonitorElement * meESRecHitLog10EnergyContr_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
const_iterator find(uint32_t rawId) const
const_iterator end() const
MonitorElement * meEERecHitsOccupancyPlusFlag8_9_
MonitorElement * meESRecHitSimHitRatio_
MonitorElement * meEBRecHitSimHitRatio_
MonitorElement * meEBRecHitsOccupancyFlag5_6_
bool isValid() const
Definition: ESHandle.h:44
MonitorElement * meEEe5x5OverGun_
T const * product() const
Definition: ESHandle.h:86
MonitorElement * meEERecHitSimHitRatio1011_
MonitorElement * meEEe5x5OverSimHits_
edm::EDGetTokenT< edm::HepMCProduct > HepMCLabel_Token_
MonitorElement * meEBe5x5OverGun_
const_iterator begin() const
MonitorElement * meEERecHitSimHitRatio_
void EcalRecHitsValidation::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 118 of file EcalRecHitsValidation.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookProfile(), trackerHits::histo, DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

118  {
120 
121  ibooker.setCurrentFolder("EcalRecHitsV/EcalRecHitsTask");
122 
123  histo = "EcalRecHitsTask Gun Momentum";
124  meGunEnergy_ = ibooker.book1D(histo.c_str(), histo.c_str(), 100, 0., 1000.);
125 
126  histo = "EcalRecHitsTask Gun Eta";
127  meGunEta_ = ibooker.book1D(histo.c_str(), histo.c_str(), 700, -3.5, 3.5);
128 
129  histo = "EcalRecHitsTask Gun Phi";
130  meGunPhi_ = ibooker.book1D(histo.c_str(), histo.c_str(), 360, 0., 360.);
131 
132  histo = "EcalRecHitsTask Barrel RecSimHit Ratio";
133  meEBRecHitSimHitRatio_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
134 
135  histo = "EcalRecHitsTask Endcap RecSimHit Ratio";
136  meEERecHitSimHitRatio_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
137 
138  histo = "EcalRecHitsTask Preshower RecSimHit Ratio";
139  meESRecHitSimHitRatio_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
140 
141  histo = "EcalRecHitsTask Barrel RecSimHit Ratio gt 3p5 GeV";
142  meEBRecHitSimHitRatioGt35_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
143 
144  histo = "EcalRecHitsTask Endcap RecSimHit Ratio gt 3p5 GeV";
145  meEERecHitSimHitRatioGt35_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
146 
147  histo = "EcalRecHitsTask Barrel Unc RecSimHit Ratio";
148  meEBUnRecHitSimHitRatio_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
149 
150  histo = "EcalRecHitsTask Endcap Unc RecSimHit Ratio";
151  meEEUnRecHitSimHitRatio_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
152 
153  histo = "EcalRecHitsTask Barrel RecSimHit Ratio Channel Status=10 11";
154  meEBRecHitSimHitRatio1011_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
155 
156  histo = "EcalRecHitsTask Endcap RecSimHit Ratio Channel Status=10 11";
157  meEERecHitSimHitRatio1011_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
158 
159  histo = "EcalRecHitsTask Barrel RecSimHit Ratio Channel Status=12";
160  meEBRecHitSimHitRatio12_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
161 
162  histo = "EcalRecHitsTask Endcap RecSimHit Ratio Channel Status=12";
163  meEERecHitSimHitRatio12_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
164 
165  histo = "EcalRecHitsTask Barrel RecSimHit Ratio Channel Status=13";
166  meEBRecHitSimHitRatio13_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
167 
168  histo = "EcalRecHitsTask Endcap RecSimHit Ratio Channel Status=13";
169  meEERecHitSimHitRatio13_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
170 
171  histo = "EcalRecHitsTask Barrel Unc RecSimHit Ratio gt 3p5 GeV";
172  meEBUnRecHitSimHitRatioGt35_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
173 
174  histo = "EcalRecHitsTask Endcap Unc RecSimHit Ratio gt 3p5 GeV";
175  meEEUnRecHitSimHitRatioGt35_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
176 
177  histo = "EcalRecHitsTask Barrel Rec E5x5";
178  meEBe5x5_ = ibooker.book1D(histo.c_str(), histo.c_str(), 4000, 0., 400.);
179 
180  histo = "EcalRecHitsTask Barrel Rec E5x5 over Sim E5x5";
181  meEBe5x5OverSimHits_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
182 
183  histo = "EcalRecHitsTask Barrel Rec E5x5 over gun energy";
184  meEBe5x5OverGun_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
185 
186  histo = "EcalRecHitsTask Endcap Rec E5x5";
187  meEEe5x5_ = ibooker.book1D(histo.c_str(), histo.c_str(), 4000, 0., 400.);
188 
189  histo = "EcalRecHitsTask Endcap Rec E5x5 over Sim E5x5";
190  meEEe5x5OverSimHits_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
191 
192  histo = "EcalRecHitsTask Endcap Rec E5x5 over gun energy";
193  meEEe5x5OverGun_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
194 
196  ibooker.book1D("EcalRecHitsTask Barrel Log10 Energy", "EcalRecHitsTask Barrel Log10 Energy", 90, -5., 4.);
198  ibooker.book1D("EcalRecHitsTask Endcap Log10 Energy", "EcalRecHitsTask Endcap Log10 Energy", 90, -5., 4.);
200  ibooker.book1D("EcalRecHitsTask Preshower Log10 Energy", "EcalRecHitsTask Preshower Log10 Energy", 90, -5., 4.);
201  meEBRecHitLog10EnergyContr_ = ibooker.bookProfile("EcalRecHits Barrel Log10En vs Hit Contribution",
202  "EcalRecHits Barrel Log10En vs Hit Contribution",
203  90,
204  -5.,
205  4.,
206  100,
207  0.,
208  1.);
209  meEERecHitLog10EnergyContr_ = ibooker.bookProfile("EcalRecHits Endcap Log10En vs Hit Contribution",
210  "EcalRecHits Endcap Log10En vs Hit Contribution",
211  90,
212  -5.,
213  4.,
214  100,
215  0.,
216  1.);
217  meESRecHitLog10EnergyContr_ = ibooker.bookProfile("EcalRecHits Preshower Log10En vs Hit Contribution",
218  "EcalRecHits Preshower Log10En vs Hit Contribution",
219  90,
220  -5.,
221  4.,
222  100,
223  0.,
224  1.);
225  meEBRecHitLog10Energy5x5Contr_ = ibooker.bookProfile("EcalRecHits Barrel Log10En5x5 vs Hit Contribution",
226  "EcalRecHits Barrel Log10En5x5 vs Hit Contribution",
227  90,
228  -5.,
229  4.,
230  100,
231  0.,
232  1.);
233  meEERecHitLog10Energy5x5Contr_ = ibooker.bookProfile("EcalRecHits Endcap Log10En5x5 vs Hit Contribution",
234  "EcalRecHits Endcap Log10En5x5 vs Hit Contribution",
235  90,
236  -5.,
237  4.,
238  100,
239  0.,
240  1.);
241 
242  histo = "EB Occupancy Flag=5 6";
243  meEBRecHitsOccupancyFlag5_6_ = ibooker.book2D(histo, histo, 170, -85., 85., 360, 0., 360.);
244  histo = "EB Occupancy Flag=8 9";
245  meEBRecHitsOccupancyFlag8_9_ = ibooker.book2D(histo, histo, 170, -85., 85., 360, 0., 360.);
246 
247  histo = "EE+ Occupancy Flag=5 6";
248  meEERecHitsOccupancyPlusFlag5_6_ = ibooker.book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
249  histo = "EE- Occupancy Flag=5 6";
250  meEERecHitsOccupancyMinusFlag5_6_ = ibooker.book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
251  histo = "EE+ Occupancy Flag=8 9";
252  meEERecHitsOccupancyPlusFlag8_9_ = ibooker.book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
253  histo = "EE- Occupancy Flag=8 9";
254  meEERecHitsOccupancyMinusFlag8_9_ = ibooker.book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
255 
256  histo = "EcalRecHitsTask Barrel Reco Flags";
257  meEBRecHitFlags_ = ibooker.book1D(histo.c_str(), histo.c_str(), 10, 0., 10.);
258  histo = "EcalRecHitsTask Endcap Reco Flags";
259  meEERecHitFlags_ = ibooker.book1D(histo.c_str(), histo.c_str(), 10, 0., 10.);
260  histo = "EcalRecHitsTask Barrel RecSimHit Ratio vs SimHit Flag=5 6";
261  meEBRecHitSimHitvsSimHitFlag5_6_ = ibooker.book2D(histo.c_str(), histo.c_str(), 80, 0., 2., 4000, 0., 400.);
262  histo = "EcalRecHitsTask Endcap RecSimHit Ratio vs SimHit Flag=5 6";
263  meEERecHitSimHitvsSimHitFlag5_6_ = ibooker.book2D(histo.c_str(), histo.c_str(), 80, 0., 2., 4000, 0., 400.);
264  histo = "EcalRecHitsTask Barrel RecSimHit Ratio Flag=6";
265  meEBRecHitSimHitFlag6_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
266  histo = "EcalRecHitsTask Endcap RecSimHit Ratio Flag=6";
267  meEERecHitSimHitFlag6_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
268  histo = "EcalRecHitsTask Barrel RecSimHit Ratio Flag=7";
269  meEBRecHitSimHitFlag7_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
270  histo = "EcalRecHitsTask Endcap RecSimHit Ratio Flag=7";
271  meEERecHitSimHitFlag7_ = ibooker.book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
272  histo = "EcalRecHitsTask Barrel 5x5 RecSimHit Ratio vs SimHit Flag=8";
273  meEB5x5RecHitSimHitvsSimHitFlag8_ = ibooker.book2D(histo.c_str(), histo.c_str(), 80, 0., 2., 4000, 0., 400.);
274 }
MonitorElement * meEERecHitsOccupancyPlusFlag5_6_
MonitorElement * meEBRecHitSimHitRatio13_
MonitorElement * meEBRecHitLog10Energy5x5Contr_
MonitorElement * meEBRecHitSimHitRatio1011_
MonitorElement * meEBRecHitSimHitFlag7_
MonitorElement * meEBRecHitSimHitRatio12_
MonitorElement * meEERecHitSimHitRatio12_
MonitorElement * meEERecHitsOccupancyMinusFlag5_6_
MonitorElement * meEERecHitSimHitRatio13_
MonitorElement * meEBe5x5OverSimHits_
MonitorElement * meEBRecHitSimHitFlag6_
MonitorElement * meEB5x5RecHitSimHitvsSimHitFlag8_
MonitorElement * meEBUnRecHitSimHitRatio_
MonitorElement * meEBRecHitLog10EnergyContr_
MonitorElement * meEBRecHitsOccupancyFlag8_9_
MonitorElement * meEERecHitLog10EnergyContr_
MonitorElement * meGunEnergy_
MonitorElement * meEERecHitsOccupancyMinusFlag8_9_
MonitorElement * meEERecHitFlags_
MonitorElement * meEERecHitSimHitFlag6_
MonitorElement * meEEUnRecHitSimHitRatioGt35_
MonitorElement * meEEUnRecHitSimHitRatio_
MonitorElement * meEERecHitSimHitRatioGt35_
MonitorElement * meEERecHitSimHitFlag7_
MonitorElement * meEBRecHitSimHitRatioGt35_
MonitorElement * meESRecHitLog10Energy_
MonitorElement * meEBRecHitSimHitvsSimHitFlag5_6_
MonitorElement * meEERecHitSimHitvsSimHitFlag5_6_
MonitorElement * meEBRecHitFlags_
MonitorElement * meEERecHitLog10Energy_
MonitorElement * meEBRecHitLog10Energy_
MonitorElement * meEBUnRecHitSimHitRatioGt35_
MonitorElement * meEERecHitLog10Energy5x5Contr_
MonitorElement * meESRecHitLog10EnergyContr_
MonitorElement * meEERecHitsOccupancyPlusFlag8_9_
MonitorElement * meESRecHitSimHitRatio_
MonitorElement * meEBRecHitSimHitRatio_
MonitorElement * meEBRecHitsOccupancyFlag5_6_
MonitorElement * meEEe5x5OverGun_
MonitorElement * meEERecHitSimHitRatio1011_
MonitorElement * meEEe5x5OverSimHits_
MonitorElement * meEBe5x5OverGun_
MonitorElement * meEERecHitSimHitRatio_
void EcalRecHitsValidation::findBarrelMatrix ( int  nCellInEta,
int  nCellInPhi,
int  CentralEta,
int  CentralPhi,
int  CentralZ,
MapType themap 
)
protected

Definition at line 787 of file EcalRecHitsValidation.cc.

References funct::abs(), mps_fire::i, and DetId::rawId().

788  {
789  int goBackInEta = nCellInEta / 2;
790  int goBackInPhi = nCellInPhi / 2;
791  int matrixSize = nCellInEta * nCellInPhi;
792  crystalMatrix.clear();
793  crystalMatrix.resize(matrixSize);
794 
795  int startEta = CentralZ * CentralEta - goBackInEta;
796  int startPhi = CentralPhi - goBackInPhi;
797 
798  int i = 0;
799  for (int ieta = startEta; ieta < startEta + nCellInEta; ieta++) {
800  for (int iphi = startPhi; iphi < startPhi + nCellInPhi; iphi++) {
801  uint32_t index;
802  if (abs(ieta) > 85 || abs(ieta) < 1) {
803  continue;
804  }
805  if (iphi < 1) {
806  index = EBDetId(ieta, iphi + 360).rawId();
807  } else if (iphi > 360) {
808  index = EBDetId(ieta, iphi - 360).rawId();
809  } else {
810  index = EBDetId(ieta, iphi).rawId();
811  }
812  crystalMatrix[i++] = index;
813  }
814  }
815 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< uint32_t > crystalMatrix
void EcalRecHitsValidation::findEndcapMatrix ( int  nCellInX,
int  nCellInY,
int  CentralX,
int  CentralY,
int  CentralZ,
MapType themap 
)
protected

Definition at line 817 of file EcalRecHitsValidation.cc.

References DetId::rawId(), and EEDetId::validDetId().

818  {
819  int goBackInX = nCellInX / 2;
820  int goBackInY = nCellInY / 2;
821  crystalMatrix.clear();
822 
823  int startX = CentralX - goBackInX;
824  int startY = CentralY - goBackInY;
825 
826  for (int ix = startX; ix < startX + nCellInX; ix++) {
827  for (int iy = startY; iy < startY + nCellInY; iy++) {
828  uint32_t index;
829 
830  if (EEDetId::validDetId(ix, iy, CentralZ)) {
831  index = EEDetId(ix, iy, CentralZ).rawId();
832  } else {
833  continue;
834  }
835  crystalMatrix.push_back(index);
836  }
837  }
838 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
std::vector< uint32_t > crystalMatrix
uint32_t EcalRecHitsValidation::getUnitWithMaxEnergy ( MapType themap)
protected

Definition at line 771 of file EcalRecHitsValidation.cc.

References particleFlowClusterECALTimeSelected_cfi::maxEnergy.

771  {
772  // look for max
773  uint32_t unitWithMaxEnergy = 0;
774  float maxEnergy = 0.;
775 
776  MapType::iterator iter;
777  for (iter = themap.begin(); iter != themap.end(); iter++) {
778  if (maxEnergy < (*iter).second) {
779  maxEnergy = (*iter).second;
780  unitWithMaxEnergy = (*iter).first;
781  }
782  }
783 
784  return unitWithMaxEnergy;
785 }

Member Data Documentation

std::vector<uint32_t> EcalRecHitsValidation::crystalMatrix
private

Definition at line 140 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<CrossingFrame<PCaloHit> > EcalRecHitsValidation::EBHits_Token_
private

Definition at line 83 of file EcalRecHitsValidation.h.

edm::InputTag EcalRecHitsValidation::EBrechitCollection_
private

Definition at line 71 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<EBRecHitCollection> EcalRecHitsValidation::EBrechitCollection_Token_
private

Definition at line 78 of file EcalRecHitsValidation.h.

edm::InputTag EcalRecHitsValidation::EBuncalibrechitCollection_
private

Definition at line 74 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<EBUncalibratedRecHitCollection> EcalRecHitsValidation::EBuncalibrechitCollection_Token_
private

Definition at line 81 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<CrossingFrame<PCaloHit> > EcalRecHitsValidation::EEHits_Token_
private

Definition at line 84 of file EcalRecHitsValidation.h.

edm::InputTag EcalRecHitsValidation::EErechitCollection_
private

Definition at line 72 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<EERecHitCollection> EcalRecHitsValidation::EErechitCollection_Token_
private

Definition at line 79 of file EcalRecHitsValidation.h.

edm::InputTag EcalRecHitsValidation::EEuncalibrechitCollection_
private

Definition at line 75 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<EEUncalibratedRecHitCollection> EcalRecHitsValidation::EEuncalibrechitCollection_Token_
private

Definition at line 82 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<CrossingFrame<PCaloHit> > EcalRecHitsValidation::ESHits_Token_
private

Definition at line 85 of file EcalRecHitsValidation.h.

edm::InputTag EcalRecHitsValidation::ESrechitCollection_
private

Definition at line 73 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<ESRecHitCollection> EcalRecHitsValidation::ESrechitCollection_Token_
private

Definition at line 80 of file EcalRecHitsValidation.h.

std::string EcalRecHitsValidation::HepMCLabel
private

Definition at line 64 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<edm::HepMCProduct> EcalRecHitsValidation::HepMCLabel_Token_
private

Definition at line 77 of file EcalRecHitsValidation.h.

std::string EcalRecHitsValidation::hitsProducer_
private

Definition at line 65 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEB5x5RecHitSimHitvsSimHitFlag8_
private

Definition at line 133 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBe5x5_
private

Definition at line 105 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBe5x5OverGun_
private

Definition at line 107 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBe5x5OverSimHits_
private

Definition at line 106 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitFlags_
private

Definition at line 129 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitLog10Energy5x5Contr_
private

Definition at line 118 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitLog10Energy_
private

Definition at line 112 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitLog10EnergyContr_
private

Definition at line 115 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitFlag6_
private

Definition at line 131 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitFlag7_
private

Definition at line 132 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitRatio1011_
private

Definition at line 93 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitRatio12_
private

Definition at line 95 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitRatio13_
private

Definition at line 97 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitRatio_
private

Definition at line 90 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitRatioGt35_
private

Definition at line 99 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitvsSimHitFlag5_6_
private

Definition at line 130 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitsOccupancyFlag5_6_
private

Definition at line 121 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitsOccupancyFlag8_9_
private

Definition at line 122 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBUnRecHitSimHitRatio_
private

Definition at line 101 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBUnRecHitSimHitRatioGt35_
private

Definition at line 103 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEEe5x5_
private

Definition at line 108 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEEe5x5OverGun_
private

Definition at line 110 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEEe5x5OverSimHits_
private

Definition at line 109 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitFlags_
private

Definition at line 135 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitLog10Energy5x5Contr_
private

Definition at line 119 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitLog10Energy_
private

Definition at line 113 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitLog10EnergyContr_
private

Definition at line 116 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitFlag6_
private

Definition at line 137 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitFlag7_
private

Definition at line 138 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitRatio1011_
private

Definition at line 94 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitRatio12_
private

Definition at line 96 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitRatio13_
private

Definition at line 98 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitRatio_
private

Definition at line 91 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitRatioGt35_
private

Definition at line 100 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitvsSimHitFlag5_6_
private

Definition at line 136 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitsOccupancyMinusFlag5_6_
private

Definition at line 125 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitsOccupancyMinusFlag8_9_
private

Definition at line 127 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitsOccupancyPlusFlag5_6_
private

Definition at line 124 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitsOccupancyPlusFlag8_9_
private

Definition at line 126 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEEUnRecHitSimHitRatio_
private

Definition at line 102 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEEUnRecHitSimHitRatioGt35_
private

Definition at line 104 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meESRecHitLog10Energy_
private

Definition at line 114 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meESRecHitLog10EnergyContr_
private

Definition at line 117 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meESRecHitSimHitRatio_
private

Definition at line 92 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meGunEnergy_
private

Definition at line 87 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meGunEta_
private

Definition at line 88 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meGunPhi_
private

Definition at line 89 of file EcalRecHitsValidation.h.

std::string EcalRecHitsValidation::outputFile_
private

Definition at line 69 of file EcalRecHitsValidation.h.

bool EcalRecHitsValidation::verbose_
private

Definition at line 67 of file EcalRecHitsValidation.h.