CMS 3D CMS Logo

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

#include <EcalPreshowerRecHitsValidation.h>

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

Public Member Functions

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

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
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Attributes

edm::EDGetTokenT< EERecHitCollectionEErechitCollection_token_
 
edm::EDGetTokenT< EEUncalibratedRecHitCollectionEEuncalibrechitCollection_token_
 
edm::EDGetTokenT< ESRecHitCollectionESrechitCollection_token_
 
MonitorElementmeESEERecHitsEnergy_zm_
 
MonitorElementmeESEERecHitsEnergy_zp_
 
MonitorElementmeESRecHitsEnergy_
 
MonitorElementmeESRecHitsEnergy_zm1st_
 
MonitorElementmeESRecHitsEnergy_zm2nd_
 
MonitorElementmeESRecHitsEnergy_zp1st_
 
MonitorElementmeESRecHitsEnergy_zp2nd_
 
MonitorElementmeESRecHitsMultip_
 
MonitorElementmeESRecHitsMultip_zm1st_
 
MonitorElementmeESRecHitsMultip_zm2nd_
 
MonitorElementmeESRecHitsMultip_zp1st_
 
MonitorElementmeESRecHitsMultip_zp2nd_
 
MonitorElementmeESRecHitsStripOccupancy_zm1st_ [36]
 
MonitorElementmeESRecHitsStripOccupancy_zm2nd_ [36]
 
MonitorElementmeESRecHitsStripOccupancy_zp1st_ [36]
 
MonitorElementmeESRecHitsStripOccupancy_zp2nd_ [36]
 
bool verbose_
 

Additional Inherited Members

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

Detailed Description

Definition at line 33 of file EcalPreshowerRecHitsValidation.h.

Constructor & Destructor Documentation

◆ EcalPreshowerRecHitsValidation()

EcalPreshowerRecHitsValidation::EcalPreshowerRecHitsValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 17 of file EcalPreshowerRecHitsValidation.cc.

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

17  {
18  // ----------------------
20  consumes<EEUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EEuncalibrechitCollection"));
21  EErechitCollection_token_ = consumes<EERecHitCollection>(ps.getParameter<edm::InputTag>("EErechitCollection"));
22  ESrechitCollection_token_ = consumes<ESRecHitCollection>(ps.getParameter<edm::InputTag>("ESrechitCollection"));
23 
24  // ----------------------
25  // verbosity switch
26  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
27 
28  // ----------------------
29  meESRecHitsEnergy_ = nullptr; // total energy
30  meESRecHitsEnergy_zp1st_ = nullptr;
31  meESRecHitsEnergy_zp2nd_ = nullptr;
32  meESRecHitsEnergy_zm1st_ = nullptr;
33  meESRecHitsEnergy_zm2nd_ = nullptr;
34  meESRecHitsMultip_ = nullptr; // total multiplicity
35  meESRecHitsMultip_zp1st_ = nullptr;
36  meESRecHitsMultip_zp2nd_ = nullptr;
37  meESRecHitsMultip_zm1st_ = nullptr;
38  meESRecHitsMultip_zm2nd_ = nullptr;
39  meESEERecHitsEnergy_zp_ = nullptr; // versus EE energy
40  meESEERecHitsEnergy_zm_ = nullptr;
41 
42  for (int kk = 0; kk < 32; kk++) {
47  }
48 }
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_token_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< EERecHitCollection > EErechitCollection_token_
edm::EDGetTokenT< ESRecHitCollection > ESrechitCollection_token_

◆ ~EcalPreshowerRecHitsValidation()

EcalPreshowerRecHitsValidation::~EcalPreshowerRecHitsValidation ( )
override

Destructor.

Definition at line 50 of file EcalPreshowerRecHitsValidation.cc.

50 {}

Member Function Documentation

◆ analyze()

void EcalPreshowerRecHitsValidation::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotectedvirtual

Analyze.

Reimplemented from DQMEDAnalyzer.

Definition at line 110 of file EcalPreshowerRecHitsValidation.cc.

References edm::SortedCollection< T, SORT >::begin(), MillePedeFileConverter_cfg::e, CollectionTags_cfi::EERecHit, CollectionTags_cfi::EEUncalibRecHit, edm::SortedCollection< T, SORT >::end(), edm::HandleBase::isValid(), ESDetId::plane(), edm::Handle< T >::product(), rpcPointValidation_cfi::recHit, ESDetId::six(), ESDetId::siy(), nano_mu_digi_cff::strip, ESDetId::strip(), ESDetId::zside(), EEDetId::zside(), and ecaldqm::zside().

110  {
111  const ESRecHitCollection *ESRecHit = nullptr;
112  Handle<ESRecHitCollection> EcalRecHitES;
113  e.getByToken(ESrechitCollection_token_, EcalRecHitES);
114  if (EcalRecHitES.isValid()) {
115  ESRecHit = EcalRecHitES.product();
116  } else {
117  return;
118  }
119 
120  bool skipEE = false;
121  const EERecHitCollection *EERecHit = nullptr;
122  Handle<EERecHitCollection> EcalRecHitEE;
123  e.getByToken(EErechitCollection_token_, EcalRecHitEE);
124  if (EcalRecHitEE.isValid()) {
125  EERecHit = EcalRecHitEE.product();
126  } else {
127  skipEE = true;
128  }
129 
131  Handle<EEUncalibratedRecHitCollection> EcalUncalibRecHitEE;
132  e.getByToken(EEuncalibrechitCollection_token_, EcalUncalibRecHitEE);
133  if (EcalUncalibRecHitEE.isValid()) {
134  EEUncalibRecHit = EcalUncalibRecHitEE.product();
135  } else {
136  skipEE = true;
137  }
138 
139  // ----------------------
140  // loop over RecHits
141  // multiplicities
142  int mult_tot = 0;
143  int mult_zp1st = 0;
144  int mult_zp2nd = 0;
145  int mult_zm1st = 0;
146  int mult_zm2nd = 0;
147 
148  // energies
149  float ene_zp1st = 0.;
150  float ene_zp2nd = 0.;
151  float ene_zm1st = 0.;
152  float ene_zm2nd = 0.;
153 
154  // ES
155  for (ESRecHitCollection::const_iterator recHit = ESRecHit->begin(); recHit != ESRecHit->end(); ++recHit) {
156  ESDetId ESid = ESDetId(recHit->id());
157 
158  int zside = ESid.zside();
159  int plane = ESid.plane();
160  int six = ESid.six();
161  int siy = ESid.siy();
162  int strip = ESid.strip();
163 
164  // global
165  mult_tot++;
166  if (meESRecHitsEnergy_)
167  meESRecHitsEnergy_->Fill(recHit->energy());
168 
169  // side +, plane 1
170  if ((zside == +1) && (plane == 1)) {
171  mult_zp1st++;
172  ene_zp1st += recHit->energy();
175  }
178  }
179  }
180 
181  // side +, plane 2
182  if ((zside == +1) && (plane == 2)) {
183  mult_zp2nd++;
184  ene_zp2nd += recHit->energy();
187  }
190  }
191  }
192 
193  // side -, plane 1
194  if ((zside == -1) && (plane == 1)) {
195  mult_zm1st++;
196  ene_zm1st += recHit->energy();
199  }
202  }
203  }
204 
205  // side +, plane 2
206  if ((zside == -1) && (plane == 2)) {
207  mult_zm2nd++;
208  ene_zm2nd += recHit->energy();
211  }
214  }
215  }
216 
217  } // loop over the ES RecHitCollection
218 
219  // EE
220  double zpEE = 0.;
221  double zmEE = 0.;
222  if (!skipEE) {
224  uncalibRecHit != EEUncalibRecHit->end();
225  ++uncalibRecHit) {
226  EEDetId EEid = EEDetId(uncalibRecHit->id());
227  int mySide = EEid.zside();
228 
229  // Find corresponding recHit
230  EcalRecHitCollection::const_iterator myRecHit = EERecHit->find(EEid);
231 
232  if (myRecHit != EERecHit->end()) {
233  if (mySide > 0) {
234  zpEE = zpEE + myRecHit->energy();
235  }
236  if (mySide < 0) {
237  zmEE = zmEE + myRecHit->energy();
238  }
239  }
240  }
241  }
242 
243  // filling histos
244  if (meESRecHitsMultip_) {
245  meESRecHitsMultip_->Fill(mult_tot);
246  }
248  meESRecHitsMultip_zp1st_->Fill(mult_zp1st);
249  }
251  meESRecHitsMultip_zp2nd_->Fill(mult_zp2nd);
252  }
254  meESRecHitsMultip_zm1st_->Fill(mult_zm1st);
255  }
257  meESRecHitsMultip_zm2nd_->Fill(mult_zm2nd);
258  }
260  meESEERecHitsEnergy_zp_->Fill((ene_zp1st + 0.7 * ene_zp2nd) / 0.09, zpEE);
261  }
263  meESEERecHitsEnergy_zm_->Fill((ene_zm1st + 0.7 * ene_zm2nd) / 0.09, zmEE);
264  }
265 }
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_token_
T const * product() const
Definition: Handle.h:70
std::vector< EcalRecHit >::const_iterator const_iterator
int zside() const
Definition: ESDetId.h:39
int zside(DetId const &)
void Fill(long long x)
edm::EDGetTokenT< EERecHitCollection > EErechitCollection_token_
int plane() const
Definition: ESDetId.h:41
const_iterator begin() const
const_iterator end() const
int zside() const
Definition: EEDetId.h:71
int siy() const
Definition: ESDetId.h:45
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< ESRecHitCollection > ESrechitCollection_token_
int six() const
Definition: ESDetId.h:43
int strip() const
Definition: ESDetId.h:47

◆ bookHistograms()

void EcalPreshowerRecHitsValidation::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 52 of file EcalPreshowerRecHitsValidation.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), timingPdfMaker::histo, GetRecoTauVFromDQM_MC_cff::kk, and dqm::implementation::NavigatorBase::setCurrentFolder().

54  {
55  Char_t histo[200];
56 
57  ibooker.setCurrentFolder("EcalRecHitsV/EcalPreshowerRecHitsTask");
58 
59  sprintf(histo, "ES Energy");
60  meESRecHitsEnergy_ = ibooker.book1D(histo, histo, 210, -0.0005, 0.01);
61 
62  sprintf(histo, "ES Energy Plane1 Side+");
63  meESRecHitsEnergy_zp1st_ = ibooker.book1D(histo, histo, 210, -0.0005, 0.01);
64 
65  sprintf(histo, "ES Energy Plane2 Side+");
66  meESRecHitsEnergy_zp2nd_ = ibooker.book1D(histo, histo, 210, -0.0005, 0.01);
67 
68  sprintf(histo, "ES Energy Plane1 Side-");
69  meESRecHitsEnergy_zm1st_ = ibooker.book1D(histo, histo, 210, -0.0005, 0.01);
70 
71  sprintf(histo, "ES Energy Plane2 Side-");
72  meESRecHitsEnergy_zm2nd_ = ibooker.book1D(histo, histo, 210, -0.0005, 0.01);
73 
74  sprintf(histo, "ES Multiplicity");
75  meESRecHitsMultip_ = ibooker.book1D(histo, histo, 100, 0., 700.);
76 
77  sprintf(histo, "ES Multiplicity Plane1 Side+");
78  meESRecHitsMultip_zp1st_ = ibooker.book1D(histo, histo, 100, 0., 700.);
79 
80  sprintf(histo, "ES Multiplicity Plane2 Side+");
81  meESRecHitsMultip_zp2nd_ = ibooker.book1D(histo, histo, 100, 0., 700.);
82 
83  sprintf(histo, "ES Multiplicity Plane1 Side-");
84  meESRecHitsMultip_zm1st_ = ibooker.book1D(histo, histo, 100, 0., 700.);
85 
86  sprintf(histo, "ES Multiplicity Plane2 Side-");
87  meESRecHitsMultip_zm2nd_ = ibooker.book1D(histo, histo, 100, 0., 700.);
88 
89  sprintf(histo, "Preshower EE vs ES energy Side+");
90  meESEERecHitsEnergy_zp_ = ibooker.book2D(histo, histo, 100, 0., 0.2, 100, 0., 150.);
91 
92  sprintf(histo, "Preshower EE vs ES energy Side-");
93  meESEERecHitsEnergy_zm_ = ibooker.book2D(histo, histo, 100, 0., 0.2, 100, 0., 150.);
94 
95  for (int kk = 0; kk < 32; kk++) {
96  sprintf(histo, "ES Occupancy Plane1 Side+ Strip%02d", kk + 1);
97  meESRecHitsStripOccupancy_zp1st_[kk] = ibooker.book2D(histo, histo, 40, 0., 40., 40, 0., 40.);
98 
99  sprintf(histo, "ES Occupancy Plane2 Side+ Strip%02d", kk + 1);
100  meESRecHitsStripOccupancy_zp2nd_[kk] = ibooker.book2D(histo, histo, 40, 0., 40., 40, 0., 40.);
101 
102  sprintf(histo, "ES Occupancy Plane1 Side- Strip%02d", kk + 1);
103  meESRecHitsStripOccupancy_zm1st_[kk] = ibooker.book2D(histo, histo, 40, 0., 40., 40, 0., 40.);
104 
105  sprintf(histo, "ES Occupancy Plane2 Side- Strip%02d", kk + 1);
106  meESRecHitsStripOccupancy_zm2nd_[kk] = ibooker.book2D(histo, histo, 40, 0., 40., 40, 0., 40.);
107  }
108 }

Member Data Documentation

◆ EErechitCollection_token_

edm::EDGetTokenT<EERecHitCollection> EcalPreshowerRecHitsValidation::EErechitCollection_token_
private

Definition at line 50 of file EcalPreshowerRecHitsValidation.h.

◆ EEuncalibrechitCollection_token_

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

Definition at line 49 of file EcalPreshowerRecHitsValidation.h.

◆ ESrechitCollection_token_

edm::EDGetTokenT<ESRecHitCollection> EcalPreshowerRecHitsValidation::ESrechitCollection_token_
private

Definition at line 51 of file EcalPreshowerRecHitsValidation.h.

◆ meESEERecHitsEnergy_zm_

MonitorElement* EcalPreshowerRecHitsValidation::meESEERecHitsEnergy_zm_
private

Definition at line 64 of file EcalPreshowerRecHitsValidation.h.

◆ meESEERecHitsEnergy_zp_

MonitorElement* EcalPreshowerRecHitsValidation::meESEERecHitsEnergy_zp_
private

Definition at line 63 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsEnergy_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_
private

Definition at line 53 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsEnergy_zm1st_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_zm1st_
private

Definition at line 56 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsEnergy_zm2nd_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_zm2nd_
private

Definition at line 57 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsEnergy_zp1st_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_zp1st_
private

Definition at line 54 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsEnergy_zp2nd_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_zp2nd_
private

Definition at line 55 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsMultip_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_
private

Definition at line 58 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsMultip_zm1st_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_zm1st_
private

Definition at line 61 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsMultip_zm2nd_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_zm2nd_
private

Definition at line 62 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsMultip_zp1st_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_zp1st_
private

Definition at line 59 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsMultip_zp2nd_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_zp2nd_
private

Definition at line 60 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsStripOccupancy_zm1st_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsStripOccupancy_zm1st_[36]
private

Definition at line 66 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsStripOccupancy_zm2nd_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsStripOccupancy_zm2nd_[36]
private

Definition at line 68 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsStripOccupancy_zp1st_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsStripOccupancy_zp1st_[36]
private

Definition at line 65 of file EcalPreshowerRecHitsValidation.h.

◆ meESRecHitsStripOccupancy_zp2nd_

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsStripOccupancy_zp2nd_[36]
private

Definition at line 67 of file EcalPreshowerRecHitsValidation.h.

◆ verbose_

bool EcalPreshowerRecHitsValidation::verbose_
private

Definition at line 47 of file EcalPreshowerRecHitsValidation.h.