CMS 3D CMS Logo

EcalEndcapRecHitsValidation.cc
Go to the documentation of this file.
1 /*
2  * \file EcalEndcapRecHitsValidation.cc
3  *
4  * \author C. Rovelli
5  *
6  */
7 
11 
12 using namespace cms;
13 using namespace edm;
14 using namespace std;
15 
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 }
44 
46 
48  edm::Run const &,
49  edm::EventSetup const &) {
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 }
102 
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 
123  // ----------------------
124  // loop over UncalibRecHits
126  uncalibRecHit != EEUncalibRecHit->end();
127  ++uncalibRecHit) {
128  EEDetId EEid = EEDetId(uncalibRecHit->id());
129 
130  int mySide = EEid.zside();
131 
132  // general checks
133  if (mySide > 0) {
135  meEEUncalibRecHitsOccupancyPlus_->Fill(EEid.ix(), EEid.iy());
136  }
137  if (mySide < 0) {
139  meEEUncalibRecHitsOccupancyMinus_->Fill(EEid.ix(), EEid.iy());
140  }
142  meEEUncalibRecHitsAmplitude_->Fill(uncalibRecHit->amplitude());
144  meEEUncalibRecHitsPedestal_->Fill(uncalibRecHit->pedestal());
146  meEEUncalibRecHitsJitter_->Fill(uncalibRecHit->jitter());
148  meEEUncalibRecHitsChi2_->Fill(uncalibRecHit->chi2());
150  meEEUncalibRecHitsAmpFullMap_->Fill(EEid.ix(), EEid.iy(), uncalibRecHit->amplitude());
152  meEEUncalibRecHitsPedFullMap_->Fill(EEid.ix(), EEid.iy(), uncalibRecHit->pedestal());
153 
154  // general checks, with threshold at 60 ADC counts
155  if (uncalibRecHit->amplitude() > 60) {
156  if (mySide > 0) {
159  }
160  if (mySide < 0) {
163  }
165  meEEUncalibRecHitsAmplitudeGt60adc_->Fill(uncalibRecHit->amplitude());
167  meEEUncalibRecHitsPedestalGt60adc_->Fill(uncalibRecHit->pedestal());
169  meEEUncalibRecHitsJitterGt60adc_->Fill(uncalibRecHit->jitter());
171  meEEUncalibRecHitsChi2Gt60adc_->Fill(uncalibRecHit->chi2());
172  }
173 
174  if (!skipDigis) {
175  // Find the rechit corresponding digi
176  EEDigiCollection::const_iterator myDigi = EEDigi->find(EEid);
177  // int sMax = -1; // UNUSED
178  double eMax = 0.;
179  if (myDigi != EEDigi->end()) {
180  for (unsigned int sample = 0; sample < myDigi->size(); ++sample) {
181  EcalMGPASample thisSample = (*myDigi)[sample];
182  double analogSample = thisSample.adc();
183  if (eMax < analogSample) {
184  eMax = analogSample;
185  // sMax = sample; // UNUSED
186  }
187  }
188  } else
189  continue;
190 
191  // ratio uncalibratedRecHit amplitude + ped / max energy digi
192  const EcalPedestals *myped = &c.getData(ecalPeds);
193  EcalPedestalsMap::const_iterator it = myped->getMap().find(EEid);
194  if (it != myped->getMap().end()) {
195  if (eMax > (*it).mean_x1 + 5 * (*it).rms_x1 && eMax != 0) { // only real signal RecHit
196 
198  meEEUncalibRecHitMaxSampleRatio_->Fill((uncalibRecHit->amplitude() + uncalibRecHit->pedestal()) / eMax);
199  }
200 
201  if (meEEUncalibRecHitMaxSampleRatioGt60adc_ && (uncalibRecHit->amplitude() > 60)) {
202  meEEUncalibRecHitMaxSampleRatioGt60adc_->Fill((uncalibRecHit->amplitude() + uncalibRecHit->pedestal()) /
203  eMax);
204  }
205 
206  LogDebug("EcalRecHitsTaskInfo")
207  << "endcap, eMax = " << eMax << " Amplitude = " << uncalibRecHit->amplitude() + uncalibRecHit->pedestal();
208  } else
209  continue;
210  } else
211  continue;
212  }
213  } // loop over the UncalibratedRecHitCollection
214 }
EcalEndcapRecHitsValidation::meEEUncalibRecHitsJitter_
MonitorElement * meEEUncalibRecHitsJitter_
Definition: EcalEndcapRecHitsValidation.h:63
EcalCondObjectContainer::getMap
const self & getMap() const
Definition: EcalCondObjectContainer.h:78
EcalCondObjectContainer::end
const_iterator end() const
Definition: EcalCondObjectContainer.h:74
EcalEndcapRecHitsValidation::meEEUncalibRecHitsPedestal_
MonitorElement * meEEUncalibRecHitsPedestal_
Definition: EcalEndcapRecHitsValidation.h:62
EcalEndcapRecHitsValidation::verbose_
bool verbose_
Definition: EcalEndcapRecHitsValidation.h:52
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
EcalEndcapRecHitsValidation::meEEUncalibRecHitsOccupancyPlusGt60adc_
MonitorElement * meEEUncalibRecHitsOccupancyPlusGt60adc_
Definition: EcalEndcapRecHitsValidation.h:66
edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm::DataFrameContainer::const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Definition: DataFrameContainer.h:61
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
EcalEndcapRecHitsValidation::meEEUncalibRecHitsChi2Gt60adc_
MonitorElement * meEEUncalibRecHitsChi2Gt60adc_
Definition: EcalEndcapRecHitsValidation.h:71
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
dqm::implementation::IBooker::bookProfile2D
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
EEDetId.h
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:278
EcalEndcapRecHitsValidation::meEEUncalibRecHitsOccupancyMinus_
MonitorElement * meEEUncalibRecHitsOccupancyMinus_
Definition: EcalEndcapRecHitsValidation.h:60
edm::SortedCollection
Definition: SortedCollection.h:49
DQMStore.h
EcalEndcapRecHitsValidation::meEEUncalibRecHitsOccupancyPlus_
MonitorElement * meEEUncalibRecHitsOccupancyPlus_
Definition: EcalEndcapRecHitsValidation.h:59
EcalEndcapRecHitsValidation::meEEUncalibRecHitMaxSampleRatioGt60adc_
MonitorElement * meEEUncalibRecHitMaxSampleRatioGt60adc_
Definition: EcalEndcapRecHitsValidation.h:72
EcalEndcapRecHitsValidation::meEEUncalibRecHitsAmplitudeGt60adc_
MonitorElement * meEEUncalibRecHitsAmplitudeGt60adc_
Definition: EcalEndcapRecHitsValidation.h:68
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
EEDetId::ix
int ix() const
Definition: EEDetId.h:77
edm::Handle
Definition: AssociativeIterator.h:50
EcalEndcapRecHitsValidation::EEdigiCollection_token_
edm::EDGetTokenT< EEDigiCollection > EEdigiCollection_token_
Definition: EcalEndcapRecHitsValidation.h:55
EcalMGPASample::adc
int adc() const
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:31
CollectionTags_cfi.EEDigi
EEDigi
Definition: CollectionTags_cfi.py:28
EcalEndcapRecHitsValidation::meEEUncalibRecHitsJitterGt60adc_
MonitorElement * meEEUncalibRecHitsJitterGt60adc_
Definition: EcalEndcapRecHitsValidation.h:70
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
EcalCondObjectContainer::find
const_iterator find(uint32_t rawId) const
Definition: EcalCondObjectContainer.h:53
EEDetId::zside
int zside() const
Definition: EEDetId.h:71
EcalEndcapRecHitsValidation::EEuncalibrechitCollection_token_
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_token_
Definition: EcalEndcapRecHitsValidation.h:56
EcalEndcapRecHitsValidation::meEEUncalibRecHitsAmpFullMap_
MonitorElement * meEEUncalibRecHitsAmpFullMap_
Definition: EcalEndcapRecHitsValidation.h:73
EEDetId
Definition: EEDetId.h:14
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
cosmicPhotonAnalyzer_cfi.eMax
eMax
Definition: cosmicPhotonAnalyzer_cfi.py:10
CollectionTags_cfi.EEUncalibRecHit
EEUncalibRecHit
Definition: CollectionTags_cfi.py:33
EEDigiCollection
Definition: EcalDigiCollections.h:69
EcalEndcapRecHitsValidation::meEEUncalibRecHitsOccupancyMinusGt60adc_
MonitorElement * meEEUncalibRecHitsOccupancyMinusGt60adc_
Definition: EcalEndcapRecHitsValidation.h:67
EcalEndcapRecHitsValidation::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
Definition: EcalEndcapRecHitsValidation.cc:103
EcalEndcapRecHitsValidation::ecalPeds
edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > ecalPeds
Definition: EcalEndcapRecHitsValidation.h:57
edm::EventSetup
Definition: EventSetup.h:58
EcalEndcapRecHitsValidation.h
EcalEndcapRecHitsValidation::meEEUncalibRecHitsChi2_
MonitorElement * meEEUncalibRecHitsChi2_
Definition: EcalEndcapRecHitsValidation.h:64
EEDetId::iy
int iy() const
Definition: EEDetId.h:83
EcalMGPASample
Definition: EcalMGPASample.h:22
EcalEndcapRecHitsValidation::meEEUncalibRecHitsPedestalGt60adc_
MonitorElement * meEEUncalibRecHitsPedestalGt60adc_
Definition: EcalEndcapRecHitsValidation.h:69
std
Definition: JetResolutionObject.h:76
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
EcalEndcapRecHitsValidation::meEEUncalibRecHitsAmplitude_
MonitorElement * meEEUncalibRecHitsAmplitude_
Definition: EcalEndcapRecHitsValidation.h:61
EcalEndcapRecHitsValidation::EcalEndcapRecHitsValidation
EcalEndcapRecHitsValidation(const edm::ParameterSet &ps)
Constructor.
Definition: EcalEndcapRecHitsValidation.cc:16
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EcalEndcapRecHitsValidation::bookHistograms
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
Definition: EcalEndcapRecHitsValidation.cc:47
dqm::implementation::IBooker
Definition: DQMStore.h:43
EcalCondObjectContainer::const_iterator
std::vector< Item >::const_iterator const_iterator
Definition: EcalCondObjectContainer.h:19
EcalEndcapRecHitsValidation::meEEUncalibRecHitsPedFullMap_
MonitorElement * meEEUncalibRecHitsPedFullMap_
Definition: EcalEndcapRecHitsValidation.h:74
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
EcalEndcapRecHitsValidation::~EcalEndcapRecHitsValidation
~EcalEndcapRecHitsValidation() override
Destructor.
Definition: EcalEndcapRecHitsValidation.cc:45
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
EcalEndcapRecHitsValidation::meEEUncalibRecHitMaxSampleRatio_
MonitorElement * meEEUncalibRecHitMaxSampleRatio_
Definition: EcalEndcapRecHitsValidation.h:65
edm::InputTag
Definition: InputTag.h:15
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37