CMS 3D CMS Logo

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

#include <EcalBarrelRecHitsValidation.h>

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

Public Member Functions

 EcalBarrelRecHitsValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~EcalBarrelRecHitsValidation () 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
 
void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
 Analyze. More...
 

Private Attributes

edm::EDGetTokenT< EBDigiCollectionEBdigiCollection_token_
 
edm::EDGetTokenT< EBUncalibratedRecHitCollectionEBuncalibrechitCollection_token_
 
MonitorElementmeEBUncalibRecHitAmplMap_ [36]
 
MonitorElementmeEBUncalibRecHitMaxSampleRatio_
 
MonitorElementmeEBUncalibRecHitMaxSampleRatioGt100adc_
 
MonitorElementmeEBUncalibRecHitPedMap_ [36]
 
MonitorElementmeEBUncalibRecHitsAmpFullMap_
 
MonitorElementmeEBUncalibRecHitsAmplitude_
 
MonitorElementmeEBUncalibRecHitsAmplitudeGt100adc_
 
MonitorElementmeEBUncalibRecHitsChi2_
 
MonitorElementmeEBUncalibRecHitsChi2Gt100adc_
 
MonitorElementmeEBUncalibRecHitsJitter_
 
MonitorElementmeEBUncalibRecHitsJitterGt100adc_
 
MonitorElementmeEBUncalibRecHitsOccupancy_
 
MonitorElementmeEBUncalibRecHitsOccupancyGt100adc_
 
MonitorElementmeEBUncalibRecHitsPedestal_
 
MonitorElementmeEBUncalibRecHitsPedestalGt100adc_
 
MonitorElementmeEBUncalibRecHitsPedFullMap_
 
bool verbose_
 

Detailed Description

Definition at line 38 of file EcalBarrelRecHitsValidation.h.

Constructor & Destructor Documentation

EcalBarrelRecHitsValidation::EcalBarrelRecHitsValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 16 of file EcalBarrelRecHitsValidation.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and mps_fire::i.

16  {
17  // ----------------------
18  EBdigiCollection_token_ = consumes<EBDigiCollection>(ps.getParameter<edm::InputTag>("EBdigiCollection"));
20  consumes<EBUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EBuncalibrechitCollection"));
21 
22  // ----------------------
23  // verbosity switch
24  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
25 
26  // ----------------------
30  meEBUncalibRecHitsJitter_ = nullptr;
31  meEBUncalibRecHitsChi2_ = nullptr;
41  for (int i = 0; i < 36; i++) {
42  meEBUncalibRecHitAmplMap_[i] = nullptr;
43  meEBUncalibRecHitPedMap_[i] = nullptr;
44  }
45 }
MonitorElement * meEBUncalibRecHitsOccupancyGt100adc_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< EBUncalibratedRecHitCollection > EBuncalibrechitCollection_token_
MonitorElement * meEBUncalibRecHitAmplMap_[36]
MonitorElement * meEBUncalibRecHitPedMap_[36]
MonitorElement * meEBUncalibRecHitsAmplitudeGt100adc_
MonitorElement * meEBUncalibRecHitMaxSampleRatioGt100adc_
edm::EDGetTokenT< EBDigiCollection > EBdigiCollection_token_
MonitorElement * meEBUncalibRecHitsPedestalGt100adc_
EcalBarrelRecHitsValidation::~EcalBarrelRecHitsValidation ( )
override

Destructor.

Definition at line 47 of file EcalBarrelRecHitsValidation.cc.

47 {}

Member Function Documentation

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

Definition at line 107 of file EcalBarrelRecHitsValidation.cc.

References EcalMGPASample::adc(), edm::SortedCollection< T, SORT >::begin(), photonPostprocessing_cfi::eMax, EcalCondObjectContainer< T >::end(), edm::SortedCollection< T, SORT >::end(), edm::DataFrameContainer::end(), EcalCondObjectContainer< T >::find(), edm::DataFrameContainer::find(), edm::EventSetup::get(), edm::Event::getByToken(), EcalCondObjectContainer< T >::getMap(), EBDetId::ic(), EBDetId::ieta(), EBDetId::iphi(), ecalpyutils::ism(), EBDetId::ism(), edm::HandleBase::isValid(), LogDebug, edm::Handle< T >::product(), edm::ESHandle< T >::product(), and simplePhotonAnalyzer_cfi::sample.

107  {
108  const EBUncalibratedRecHitCollection *EBUncalibRecHit = nullptr;
109  Handle<EBUncalibratedRecHitCollection> EcalUncalibRecHitEB;
110  e.getByToken(EBuncalibrechitCollection_token_, EcalUncalibRecHitEB);
111  if (EcalUncalibRecHitEB.isValid()) {
112  EBUncalibRecHit = EcalUncalibRecHitEB.product();
113  } else {
114  return;
115  }
116 
117  bool skipDigis = false;
118  const EBDigiCollection *EBDigi = nullptr;
119  Handle<EBDigiCollection> EcalDigiEB;
120  e.getByToken(EBdigiCollection_token_, EcalDigiEB);
121  if (EcalDigiEB.isValid()) {
122  EBDigi = EcalDigiEB.product();
123  } else {
124  skipDigis = true;
125  }
126 
128  c.get<EcalPedestalsRcd>().get(ecalPeds);
129 
130  // ----------------------
131  // loop over UncalibRecHits
132  for (EcalUncalibratedRecHitCollection::const_iterator uncalibRecHit = EBUncalibRecHit->begin();
133  uncalibRecHit != EBUncalibRecHit->end();
134  ++uncalibRecHit) {
135  EBDetId EBid = EBDetId(uncalibRecHit->id());
136 
137  // general checks
139  meEBUncalibRecHitsOccupancy_->Fill(EBid.ieta(), EBid.iphi());
141  meEBUncalibRecHitsAmplitude_->Fill(uncalibRecHit->amplitude());
143  meEBUncalibRecHitsPedestal_->Fill(uncalibRecHit->pedestal());
145  meEBUncalibRecHitsJitter_->Fill(uncalibRecHit->jitter());
147  meEBUncalibRecHitsChi2_->Fill(uncalibRecHit->chi2());
149  meEBUncalibRecHitsAmpFullMap_->Fill(EBid.ieta(), EBid.iphi(), uncalibRecHit->amplitude());
151  meEBUncalibRecHitsPedFullMap_->Fill(EBid.ieta(), EBid.iphi(), uncalibRecHit->pedestal());
152 
153  // general checks, with threshold at 3.5 GeV = 100 ADC counts
154  if (uncalibRecHit->amplitude() > 100) {
158  meEBUncalibRecHitsAmplitudeGt100adc_->Fill(uncalibRecHit->amplitude());
160  meEBUncalibRecHitsPedestalGt100adc_->Fill(uncalibRecHit->pedestal());
162  meEBUncalibRecHitsJitterGt100adc_->Fill(uncalibRecHit->jitter());
164  meEBUncalibRecHitsChi2Gt100adc_->Fill(uncalibRecHit->chi2());
165  }
166 
167  // supermodule maps
168  int ic = EBid.ic();
169  int ie = (ic - 1) / 20 + 1;
170  int ip = (ic - 1) % 20 + 1;
171  int ism = EBid.ism();
172  float xie = ie - 0.5;
173  float xip = ip - 0.5;
174  if (meEBUncalibRecHitPedMap_[ism - 1])
175  meEBUncalibRecHitPedMap_[ism - 1]->Fill(xie, xip, uncalibRecHit->pedestal());
176  if (meEBUncalibRecHitAmplMap_[ism - 1])
177  meEBUncalibRecHitAmplMap_[ism - 1]->Fill(xie, xip, uncalibRecHit->amplitude());
178 
179  if (!skipDigis) {
180  // find the rechit corresponding digi and the max sample
181  EBDigiCollection::const_iterator myDigi = EBDigi->find(EBid);
182  // int sMax = -1; // UNUSED
183  double eMax = 0.;
184  if (myDigi != EBDigi->end()) {
185  for (unsigned int sample = 0; sample < myDigi->size(); ++sample) {
186  EcalMGPASample thisSample = (*myDigi)[sample];
187  double analogSample = thisSample.adc();
188  if (eMax < analogSample) {
189  eMax = analogSample;
190  // sMax = sample; // UNUSED
191  }
192  }
193  } else
194  continue;
195 
196  // ratio uncalibratedRecHit amplitude + ped / max energy digi
197  const EcalPedestals *myped = ecalPeds.product();
198  EcalPedestalsMap::const_iterator it = myped->getMap().find(EBid);
199  if (it != myped->getMap().end()) {
200  if (eMax > (*it).mean_x1 + 5 * (*it).rms_x1 && eMax != 0) { // only real signal RecHit
201 
203  meEBUncalibRecHitMaxSampleRatio_->Fill((uncalibRecHit->amplitude() + uncalibRecHit->pedestal()) / eMax);
204  if (meEBUncalibRecHitMaxSampleRatioGt100adc_ && (uncalibRecHit->amplitude() > 100))
205  meEBUncalibRecHitMaxSampleRatioGt100adc_->Fill((uncalibRecHit->amplitude() + uncalibRecHit->pedestal()) /
206  eMax);
207  LogDebug("EcalRecHitsTaskInfo")
208  << "barrel, eMax = " << eMax << " Amplitude = " << uncalibRecHit->amplitude() + uncalibRecHit->pedestal();
209  } else
210  continue;
211  } else
212  continue;
213  }
214 
215  } // loop over the UncalibratedRecHitCollection
216 }
#define LogDebug(id)
MonitorElement * meEBUncalibRecHitsOccupancyGt100adc_
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
const self & getMap() const
edm::EDGetTokenT< EBUncalibratedRecHitCollection > EBuncalibrechitCollection_token_
std::vector< T >::const_iterator const_iterator
int ism() const
get the ECAL/SM id
Definition: EBDetId.h:59
void Fill(long long x)
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
const_iterator find(id_type i) const
MonitorElement * meEBUncalibRecHitAmplMap_[36]
MonitorElement * meEBUncalibRecHitPedMap_[36]
MonitorElement * meEBUncalibRecHitsAmplitudeGt100adc_
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
bool isValid() const
Definition: HandleBase.h:74
int ic() const
get ECAL/crystal number inside SM
Definition: EBDetId.cc:41
const_iterator end() const
T const * product() const
Definition: Handle.h:74
std::vector< Item >::const_iterator const_iterator
const_iterator end() const
T get() const
Definition: EventSetup.h:71
const_iterator find(uint32_t rawId) const
const_iterator end() const
MonitorElement * meEBUncalibRecHitMaxSampleRatioGt100adc_
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< EBDigiCollection > EBdigiCollection_token_
const_iterator begin() const
MonitorElement * meEBUncalibRecHitsPedestalGt100adc_
int adc() const
get the ADC sample (12 bits)
void EcalBarrelRecHitsValidation::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Analyze.

Definition at line 49 of file EcalBarrelRecHitsValidation.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookProfile2D(), trackerHits::histo, mps_fire::i, and DQMStore::IBooker::setCurrentFolder().

51  {
52  Char_t histo[200];
53 
54  ibooker.setCurrentFolder("EcalRecHitsV/EcalBarrelRecHitsTask");
55 
56  sprintf(histo, "EB Occupancy");
57  meEBUncalibRecHitsOccupancy_ = ibooker.book2D(histo, histo, 170, -85., 85., 360, 0., 360.);
58 
59  sprintf(histo, "EB Amplitude");
60  meEBUncalibRecHitsAmplitude_ = ibooker.book1D(histo, histo, 201, -20., 4000.);
61 
62  sprintf(histo, "EB Pedestal");
63  meEBUncalibRecHitsPedestal_ = ibooker.book1D(histo, histo, 50, 190., 210.);
64 
65  sprintf(histo, "EB Jitter");
66  meEBUncalibRecHitsJitter_ = ibooker.book1D(histo, histo, 100, 0., 100.);
67 
68  sprintf(histo, "EB Chi2");
69  meEBUncalibRecHitsChi2_ = ibooker.book1D(histo, histo, 100, 18000., 22000.);
70 
71  sprintf(histo, "EB RecHit Max Sample Ratio");
72  meEBUncalibRecHitMaxSampleRatio_ = ibooker.book1D(histo, histo, 120, 0.90, 1.05);
73 
74  sprintf(histo, "EB Occupancy gt 100 adc counts");
75  meEBUncalibRecHitsOccupancyGt100adc_ = ibooker.book2D(histo, histo, 170, -85., 85., 360, 0., 360.);
76 
77  sprintf(histo, "EB Amplitude gt 100 adc counts");
78  meEBUncalibRecHitsAmplitudeGt100adc_ = ibooker.book1D(histo, histo, 200, 0., 4000.);
79 
80  sprintf(histo, "EB Pedestal gt 100 adc counts");
81  meEBUncalibRecHitsPedestalGt100adc_ = ibooker.book1D(histo, histo, 50, 190., 210.);
82 
83  sprintf(histo, "EB Jitter gt 100 adc counts");
84  meEBUncalibRecHitsJitterGt100adc_ = ibooker.book1D(histo, histo, 100, 0., 100.);
85 
86  sprintf(histo, "EB Chi2 gt 100 adc counts");
87  meEBUncalibRecHitsChi2Gt100adc_ = ibooker.book1D(histo, histo, 100, 18000., 22000.);
88 
89  sprintf(histo, "EB RecHit Max Sample Ratio gt 100 adc counts");
90  meEBUncalibRecHitMaxSampleRatioGt100adc_ = ibooker.book1D(histo, histo, 120, 0.90, 1.05);
91 
92  sprintf(histo, "EB Amplitude Full Map");
93  meEBUncalibRecHitsAmpFullMap_ = ibooker.bookProfile2D(histo, histo, 170, -85., 85., 360, 0., 360., 200, 0., 4000.);
94 
95  sprintf(histo, "EB Pedestal Full Map");
96  meEBUncalibRecHitsPedFullMap_ = ibooker.bookProfile2D(histo, histo, 170, -85., 85., 360, 0., 360., 50, 194., 201.);
97 
98  for (int i = 0; i < 36; i++) {
99  sprintf(histo, "EB Amp SM%02d", i + 1);
100  meEBUncalibRecHitAmplMap_[i] = ibooker.bookProfile2D(histo, histo, 85, 0., 85., 20, 0., 20., 200, 0., 4000.);
101 
102  sprintf(histo, "EB Ped SM%02d", i + 1);
103  meEBUncalibRecHitPedMap_[i] = ibooker.bookProfile2D(histo, histo, 85, 0., 85., 20, 0., 20., 50, 194., 201.);
104  }
105 }
MonitorElement * meEBUncalibRecHitsOccupancyGt100adc_
MonitorElement * meEBUncalibRecHitAmplMap_[36]
MonitorElement * meEBUncalibRecHitPedMap_[36]
MonitorElement * meEBUncalibRecHitsAmplitudeGt100adc_
MonitorElement * meEBUncalibRecHitMaxSampleRatioGt100adc_
MonitorElement * meEBUncalibRecHitsPedestalGt100adc_

Member Data Documentation

edm::EDGetTokenT<EBDigiCollection> EcalBarrelRecHitsValidation::EBdigiCollection_token_
private

Definition at line 55 of file EcalBarrelRecHitsValidation.h.

edm::EDGetTokenT<EBUncalibratedRecHitCollection> EcalBarrelRecHitsValidation::EBuncalibrechitCollection_token_
private

Definition at line 56 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitAmplMap_[36]
private

Definition at line 72 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitMaxSampleRatio_
private

Definition at line 63 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitMaxSampleRatioGt100adc_
private

Definition at line 69 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitPedMap_[36]
private

Definition at line 73 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsAmpFullMap_
private

Definition at line 70 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsAmplitude_
private

Definition at line 59 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsAmplitudeGt100adc_
private

Definition at line 65 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsChi2_
private

Definition at line 62 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsChi2Gt100adc_
private

Definition at line 68 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsJitter_
private

Definition at line 61 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsJitterGt100adc_
private

Definition at line 67 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsOccupancy_
private

Definition at line 58 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsOccupancyGt100adc_
private

Definition at line 64 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsPedestal_
private

Definition at line 60 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsPedestalGt100adc_
private

Definition at line 66 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsPedFullMap_
private

Definition at line 71 of file EcalBarrelRecHitsValidation.h.

bool EcalBarrelRecHitsValidation::verbose_
private

Definition at line 52 of file EcalBarrelRecHitsValidation.h.