CMS 3D CMS Logo

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

#include <EcalEndcapRecHitsValidation.h>

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

Public Member Functions

 EcalEndcapRecHitsValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~EcalEndcapRecHitsValidation () 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
 

Private Attributes

edm::EDGetTokenT< EEDigiCollectionEEdigiCollection_token_
 
edm::EDGetTokenT< EEUncalibratedRecHitCollectionEEuncalibrechitCollection_token_
 
MonitorElementmeEEUncalibRecHitMaxSampleRatio_
 
MonitorElementmeEEUncalibRecHitMaxSampleRatioGt60adc_
 
MonitorElementmeEEUncalibRecHitsAmpFullMap_
 
MonitorElementmeEEUncalibRecHitsAmplitude_
 
MonitorElementmeEEUncalibRecHitsAmplitudeGt60adc_
 
MonitorElementmeEEUncalibRecHitsChi2_
 
MonitorElementmeEEUncalibRecHitsChi2Gt60adc_
 
MonitorElementmeEEUncalibRecHitsJitter_
 
MonitorElementmeEEUncalibRecHitsJitterGt60adc_
 
MonitorElementmeEEUncalibRecHitsOccupancyMinus_
 
MonitorElementmeEEUncalibRecHitsOccupancyMinusGt60adc_
 
MonitorElementmeEEUncalibRecHitsOccupancyPlus_
 
MonitorElementmeEEUncalibRecHitsOccupancyPlusGt60adc_
 
MonitorElementmeEEUncalibRecHitsPedestal_
 
MonitorElementmeEEUncalibRecHitsPedestalGt60adc_
 
MonitorElementmeEEUncalibRecHitsPedFullMap_
 
bool verbose_
 

Detailed Description

Definition at line 38 of file EcalEndcapRecHitsValidation.h.

Constructor & Destructor Documentation

EcalEndcapRecHitsValidation::EcalEndcapRecHitsValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 16 of file EcalEndcapRecHitsValidation.cc.

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

16  {
17  // ----------------------
18  EEdigiCollection_token_ = consumes<EEDigiCollection>(ps.getParameter<edm::InputTag>("EEdigiCollection"));
20  consumes<EEUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EEuncalibrechitCollection"));
21 
22  // ----------------------
23  // verbosity switch
24  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
25 
26  // ----------------------
31  meEEUncalibRecHitsJitter_ = nullptr;
32  meEEUncalibRecHitsChi2_ = nullptr;
43 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meEEUncalibRecHitsOccupancyPlusGt60adc_
MonitorElement * meEEUncalibRecHitMaxSampleRatioGt60adc_
MonitorElement * meEEUncalibRecHitsOccupancyMinusGt60adc_
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_token_
edm::EDGetTokenT< EEDigiCollection > EEdigiCollection_token_
MonitorElement * meEEUncalibRecHitsAmplitudeGt60adc_
EcalEndcapRecHitsValidation::~EcalEndcapRecHitsValidation ( )
override

Destructor.

Definition at line 45 of file EcalEndcapRecHitsValidation.cc.

45 {}

Member Function Documentation

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

Analyze.

Definition at line 103 of file EcalEndcapRecHitsValidation.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(), edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), LogDebug, edm::Handle< T >::product(), edm::ESHandle< T >::product(), simplePhotonAnalyzer_cfi::sample, and EEDetId::zside().

103  {
104  const EEUncalibratedRecHitCollection *EEUncalibRecHit = nullptr;
105  Handle<EEUncalibratedRecHitCollection> EcalUncalibRecHitEE;
106  e.getByToken(EEuncalibrechitCollection_token_, EcalUncalibRecHitEE);
107  if (EcalUncalibRecHitEE.isValid()) {
108  EEUncalibRecHit = EcalUncalibRecHitEE.product();
109  } else {
110  return;
111  }
112 
113  bool skipDigis = false;
114  const EEDigiCollection *EEDigi = nullptr;
115  Handle<EEDigiCollection> EcalDigiEE;
116  e.getByToken(EEdigiCollection_token_, EcalDigiEE);
117  if (EcalDigiEE.isValid()) {
118  EEDigi = EcalDigiEE.product();
119  } else {
120  skipDigis = true;
121  }
122 
124  c.get<EcalPedestalsRcd>().get(ecalPeds);
125 
126  // ----------------------
127  // loop over UncalibRecHits
128  for (EcalUncalibratedRecHitCollection::const_iterator uncalibRecHit = EEUncalibRecHit->begin();
129  uncalibRecHit != EEUncalibRecHit->end();
130  ++uncalibRecHit) {
131  EEDetId EEid = EEDetId(uncalibRecHit->id());
132 
133  int mySide = EEid.zside();
134 
135  // general checks
136  if (mySide > 0) {
138  meEEUncalibRecHitsOccupancyPlus_->Fill(EEid.ix(), EEid.iy());
139  }
140  if (mySide < 0) {
142  meEEUncalibRecHitsOccupancyMinus_->Fill(EEid.ix(), EEid.iy());
143  }
145  meEEUncalibRecHitsAmplitude_->Fill(uncalibRecHit->amplitude());
147  meEEUncalibRecHitsPedestal_->Fill(uncalibRecHit->pedestal());
149  meEEUncalibRecHitsJitter_->Fill(uncalibRecHit->jitter());
151  meEEUncalibRecHitsChi2_->Fill(uncalibRecHit->chi2());
153  meEEUncalibRecHitsAmpFullMap_->Fill(EEid.ix(), EEid.iy(), uncalibRecHit->amplitude());
155  meEEUncalibRecHitsPedFullMap_->Fill(EEid.ix(), EEid.iy(), uncalibRecHit->pedestal());
156 
157  // general checks, with threshold at 60 ADC counts
158  if (uncalibRecHit->amplitude() > 60) {
159  if (mySide > 0) {
162  }
163  if (mySide < 0) {
166  }
168  meEEUncalibRecHitsAmplitudeGt60adc_->Fill(uncalibRecHit->amplitude());
170  meEEUncalibRecHitsPedestalGt60adc_->Fill(uncalibRecHit->pedestal());
172  meEEUncalibRecHitsJitterGt60adc_->Fill(uncalibRecHit->jitter());
174  meEEUncalibRecHitsChi2Gt60adc_->Fill(uncalibRecHit->chi2());
175  }
176 
177  if (!skipDigis) {
178  // Find the rechit corresponding digi
179  EEDigiCollection::const_iterator myDigi = EEDigi->find(EEid);
180  // int sMax = -1; // UNUSED
181  double eMax = 0.;
182  if (myDigi != EEDigi->end()) {
183  for (unsigned int sample = 0; sample < myDigi->size(); ++sample) {
184  EcalMGPASample thisSample = (*myDigi)[sample];
185  double analogSample = thisSample.adc();
186  if (eMax < analogSample) {
187  eMax = analogSample;
188  // sMax = sample; // UNUSED
189  }
190  }
191  } else
192  continue;
193 
194  // ratio uncalibratedRecHit amplitude + ped / max energy digi
195  const EcalPedestals *myped = ecalPeds.product();
196  EcalPedestalsMap::const_iterator it = myped->getMap().find(EEid);
197  if (it != myped->getMap().end()) {
198  if (eMax > (*it).mean_x1 + 5 * (*it).rms_x1 && eMax != 0) { // only real signal RecHit
199 
201  meEEUncalibRecHitMaxSampleRatio_->Fill((uncalibRecHit->amplitude() + uncalibRecHit->pedestal()) / eMax);
202  }
203 
204  if (meEEUncalibRecHitMaxSampleRatioGt60adc_ && (uncalibRecHit->amplitude() > 60)) {
205  meEEUncalibRecHitMaxSampleRatioGt60adc_->Fill((uncalibRecHit->amplitude() + uncalibRecHit->pedestal()) /
206  eMax);
207  }
208 
209  LogDebug("EcalRecHitsTaskInfo")
210  << "endcap, eMax = " << eMax << " Amplitude = " << uncalibRecHit->amplitude() + uncalibRecHit->pedestal();
211  } else
212  continue;
213  } else
214  continue;
215  }
216  } // loop over the UncalibratedRecHitCollection
217 }
#define LogDebug(id)
int ix() const
Definition: EEDetId.h:77
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
std::vector< T >::const_iterator const_iterator
MonitorElement * meEEUncalibRecHitsOccupancyPlusGt60adc_
MonitorElement * meEEUncalibRecHitMaxSampleRatioGt60adc_
void Fill(long long x)
const_iterator find(id_type i) const
int zside() const
Definition: EEDetId.h:71
MonitorElement * meEEUncalibRecHitsOccupancyMinusGt60adc_
int iy() const
Definition: EEDetId.h:83
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_token_
const_iterator end() const
T const * product() const
Definition: Handle.h:74
edm::EDGetTokenT< EEDigiCollection > EEdigiCollection_token_
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
T const * product() const
Definition: ESHandle.h:86
const_iterator begin() const
MonitorElement * meEEUncalibRecHitsAmplitudeGt60adc_
int adc() const
get the ADC sample (12 bits)
void EcalEndcapRecHitsValidation::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 47 of file EcalEndcapRecHitsValidation.cc.

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

49  {
50  Char_t histo[200];
51 
52  ibooker.setCurrentFolder("EcalRecHitsV/EcalEndcapRecHitsTask");
53 
54  sprintf(histo, "EE+ Occupancy");
55  meEEUncalibRecHitsOccupancyPlus_ = ibooker.book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
56 
57  sprintf(histo, "EE- Occupancy");
58  meEEUncalibRecHitsOccupancyMinus_ = ibooker.book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
59 
60  sprintf(histo, "EE Amplitude");
61  meEEUncalibRecHitsAmplitude_ = ibooker.book1D(histo, histo, 201, -20., 4000.);
62 
63  sprintf(histo, "EE Pedestal");
64  meEEUncalibRecHitsPedestal_ = ibooker.book1D(histo, histo, 50, 190., 210.);
65 
66  sprintf(histo, "EE Jitter");
67  meEEUncalibRecHitsJitter_ = ibooker.book1D(histo, histo, 100, 0., 100.);
68 
69  sprintf(histo, "EE Chi2");
70  meEEUncalibRecHitsChi2_ = ibooker.book1D(histo, histo, 100, 18000., 22000.);
71 
72  sprintf(histo, "EE RecHit Max Sample Ratio");
73  meEEUncalibRecHitMaxSampleRatio_ = ibooker.book1D(histo, histo, 120, 0.90, 1.05);
74 
75  sprintf(histo, "EE+ Occupancy gt 60 adc counts");
76  meEEUncalibRecHitsOccupancyPlusGt60adc_ = ibooker.book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
77 
78  sprintf(histo, "EE- Occupancy gt 60 adc counts");
79  meEEUncalibRecHitsOccupancyMinusGt60adc_ = ibooker.book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
80 
81  sprintf(histo, "EE Amplitude gt 60 adc counts");
82  meEEUncalibRecHitsAmplitudeGt60adc_ = ibooker.book1D(histo, histo, 200, 0., 4000.);
83 
84  sprintf(histo, "EE Pedestal gt 60 adc counts");
85  meEEUncalibRecHitsPedestalGt60adc_ = ibooker.book1D(histo, histo, 50, 190., 210.);
86 
87  sprintf(histo, "EE Jitter gt 60 adc counts");
88  meEEUncalibRecHitsJitterGt60adc_ = ibooker.book1D(histo, histo, 100, 0., 100.);
89 
90  sprintf(histo, "EE Chi2 gt 60 adc counts");
91  meEEUncalibRecHitsChi2Gt60adc_ = ibooker.book1D(histo, histo, 100, 18000., 22000.);
92 
93  sprintf(histo, "EE RecHit Max Sample Ratio gt 60 adc counts");
94  meEEUncalibRecHitMaxSampleRatioGt60adc_ = ibooker.book1D(histo, histo, 120, 0.90, 1.05);
95 
96  sprintf(histo, "EE Amplitude Full Map");
97  meEEUncalibRecHitsAmpFullMap_ = ibooker.bookProfile2D(histo, histo, 100, 0., 100., 100, 0., 100., 200, 0., 4000.);
98 
99  sprintf(histo, "EE Pedestal Full Map");
100  meEEUncalibRecHitsPedFullMap_ = ibooker.bookProfile2D(histo, histo, 100, 0., 100., 100, 0., 100., 50, 194., 201.);
101 }
MonitorElement * meEEUncalibRecHitsOccupancyPlusGt60adc_
MonitorElement * meEEUncalibRecHitMaxSampleRatioGt60adc_
MonitorElement * meEEUncalibRecHitsOccupancyMinusGt60adc_
MonitorElement * meEEUncalibRecHitsAmplitudeGt60adc_

Member Data Documentation

edm::EDGetTokenT<EEDigiCollection> EcalEndcapRecHitsValidation::EEdigiCollection_token_
private

Definition at line 56 of file EcalEndcapRecHitsValidation.h.

edm::EDGetTokenT<EEUncalibratedRecHitCollection> EcalEndcapRecHitsValidation::EEuncalibrechitCollection_token_
private

Definition at line 57 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitMaxSampleRatio_
private

Definition at line 65 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitMaxSampleRatioGt60adc_
private

Definition at line 72 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsAmpFullMap_
private

Definition at line 73 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsAmplitude_
private

Definition at line 61 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsAmplitudeGt60adc_
private

Definition at line 68 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsChi2_
private

Definition at line 64 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsChi2Gt60adc_
private

Definition at line 71 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsJitter_
private

Definition at line 63 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsJitterGt60adc_
private

Definition at line 70 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsOccupancyMinus_
private

Definition at line 60 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsOccupancyMinusGt60adc_
private

Definition at line 67 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsOccupancyPlus_
private

Definition at line 59 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsOccupancyPlusGt60adc_
private

Definition at line 66 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsPedestal_
private

Definition at line 62 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsPedestalGt60adc_
private

Definition at line 69 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsPedFullMap_
private

Definition at line 74 of file EcalEndcapRecHitsValidation.h.

bool EcalEndcapRecHitsValidation::verbose_
private

Definition at line 53 of file EcalEndcapRecHitsValidation.h.