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:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

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

Detailed Description

Definition at line 35 of file EcalPreshowerRecHitsValidation.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 18 of file EcalPreshowerRecHitsValidation.cc.

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

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

Destructor.

Definition at line 54 of file EcalPreshowerRecHitsValidation.cc.

54  {
55 
56 }

Member Function Documentation

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

Analyze.

Definition at line 116 of file EcalPreshowerRecHitsValidation.cc.

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), HcalObjRepresent::Fill(), edm::SortedCollection< T, SORT >::find(), edm::Event::getByToken(), edm::HandleBase::isValid(), ESDetId::plane(), edm::Handle< T >::product(), rpcPointValidation_cfi::recHit, ESDetId::six(), ESDetId::siy(), digitizers_cfi::strip, ESDetId::strip(), ESDetId::zside(), EEDetId::zside(), and ecaldqm::zside().

116  {
117 
118  const ESRecHitCollection *ESRecHit = nullptr;
119  Handle<ESRecHitCollection> EcalRecHitES;
120  e.getByToken( ESrechitCollection_token_, EcalRecHitES);
121  if (EcalRecHitES.isValid()) {
122  ESRecHit = EcalRecHitES.product ();
123  } else {
124  return;
125  }
126 
127  bool skipEE = false;
128  const EERecHitCollection *EERecHit = nullptr;
129  Handle<EERecHitCollection> EcalRecHitEE;
130  e.getByToken( EErechitCollection_token_, EcalRecHitEE);
131  if (EcalRecHitEE.isValid()){
132  EERecHit = EcalRecHitEE.product ();
133  } else {
134  skipEE = true;
135  }
136 
137  const EEUncalibratedRecHitCollection *EEUncalibRecHit = nullptr;
138  Handle< EEUncalibratedRecHitCollection > EcalUncalibRecHitEE;
139  e.getByToken( EEuncalibrechitCollection_token_, EcalUncalibRecHitEE);
140  if (EcalUncalibRecHitEE.isValid()) {
141  EEUncalibRecHit = EcalUncalibRecHitEE.product() ;
142  } else {
143  skipEE = true;
144  }
145 
146 
147 
148  // ----------------------
149  // loop over RecHits
150  // multiplicities
151  int mult_tot = 0;
152  int mult_zp1st = 0;
153  int mult_zp2nd = 0;
154  int mult_zm1st = 0;
155  int mult_zm2nd = 0;
156 
157  // energies
158  float ene_zp1st = 0.;
159  float ene_zp2nd = 0.;
160  float ene_zm1st = 0.;
161  float ene_zm2nd = 0.;
162 
163 
164  // ES
165  for (ESRecHitCollection::const_iterator recHit = ESRecHit->begin(); recHit != ESRecHit->end() ; ++recHit)
166  {
167  ESDetId ESid = ESDetId(recHit->id());
168 
169  int zside = ESid.zside();
170  int plane = ESid.plane();
171  int six = ESid.six();
172  int siy = ESid.siy();
173  int strip = ESid.strip();
174 
175  // global
176  mult_tot++;
178 
179  // side +, plane 1
180  if ( (zside == +1) && (plane == 1) )
181  {
182  mult_zp1st++;
183  ene_zp1st += recHit->energy();
185  if ( meESRecHitsStripOccupancy_zp1st_[strip-1] ){ meESRecHitsStripOccupancy_zp1st_[strip-1]-> Fill( six, siy ); }
186  }
187 
188 
189  // side +, plane 2
190  if ( (zside == +1) && (plane == 2) )
191  {
192  mult_zp2nd++;
193  ene_zp2nd += recHit->energy();
195  if ( meESRecHitsStripOccupancy_zp2nd_[strip-1] ){ meESRecHitsStripOccupancy_zp2nd_[strip-1]-> Fill( six, siy ); }
196  }
197 
198 
199  // side -, plane 1
200  if ( (zside == -1) && (plane == 1) )
201  {
202  mult_zm1st++;
203  ene_zm1st += recHit->energy();
205  if ( meESRecHitsStripOccupancy_zm1st_[strip-1] ){ meESRecHitsStripOccupancy_zm1st_[strip-1]-> Fill( six, siy ); }
206  }
207 
208 
209  // side +, plane 2
210  if ( (zside == -1) && (plane == 2) )
211  {
212  mult_zm2nd ++;
213  ene_zm2nd += recHit->energy();
215  if ( meESRecHitsStripOccupancy_zm2nd_[strip-1] ){ meESRecHitsStripOccupancy_zm2nd_[strip-1]-> Fill( six, siy ); }
216  }
217 
218  } // loop over the ES RecHitCollection
219 
220 
221 
222  // EE
223  double zpEE = 0.;
224  double zmEE = 0.;
225  if ( ! skipEE ) {
226 
227  for (EcalUncalibratedRecHitCollection::const_iterator uncalibRecHit = EEUncalibRecHit->begin(); uncalibRecHit != EEUncalibRecHit->end() ; ++uncalibRecHit)
228  {
229  EEDetId EEid = EEDetId(uncalibRecHit->id());
230  int mySide = EEid.zside();
231 
232  // Find corresponding recHit
233  EcalRecHitCollection::const_iterator myRecHit = EERecHit->find(EEid);
234 
235  if (myRecHit != EERecHit->end() )
236  {
237  if (mySide > 0) { zpEE = zpEE + myRecHit->energy(); }
238  if (mySide < 0) { zmEE = zmEE + myRecHit->energy(); }
239  }
240  }
241  }
242 
243 
244  // filling histos
245  if (meESRecHitsMultip_) { meESRecHitsMultip_ -> Fill(mult_tot); }
246  if (meESRecHitsMultip_zp1st_ ) { meESRecHitsMultip_zp1st_ -> Fill(mult_zp1st); }
247  if (meESRecHitsMultip_zp2nd_ ) { meESRecHitsMultip_zp2nd_ -> Fill(mult_zp2nd); }
248  if (meESRecHitsMultip_zm1st_ ) { meESRecHitsMultip_zm1st_ -> Fill(mult_zm1st); }
249  if (meESRecHitsMultip_zm2nd_ ) { meESRecHitsMultip_zm2nd_ -> Fill(mult_zm2nd); }
250  if (meESEERecHitsEnergy_zp_) { meESEERecHitsEnergy_zp_ -> Fill( (ene_zp1st + 0.7*ene_zp2nd)/0.09, zpEE ); }
251  if (meESEERecHitsEnergy_zm_) { meESEERecHitsEnergy_zm_ -> Fill( (ene_zm1st + 0.7*ene_zm2nd)/0.09, zmEE ); }
252 }
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_token_
int strip() const
Definition: ESDetId.h:53
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
std::vector< EcalRecHit >::const_iterator const_iterator
int six() const
Definition: ESDetId.h:49
int zside(DetId const &)
void Fill(long long x)
int siy() const
Definition: ESDetId.h:51
edm::EDGetTokenT< EERecHitCollection > EErechitCollection_token_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int zside() const
Definition: EEDetId.h:70
int zside() const
Definition: ESDetId.h:45
bool isValid() const
Definition: HandleBase.h:74
const_iterator end() const
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< ESRecHitCollection > ESrechitCollection_token_
iterator find(key_type k)
int plane() const
Definition: ESDetId.h:47
const_iterator begin() const
void EcalPreshowerRecHitsValidation::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 58 of file EcalPreshowerRecHitsValidation.cc.

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

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

Member Data Documentation

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

Definition at line 56 of file EcalPreshowerRecHitsValidation.h.

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

Definition at line 55 of file EcalPreshowerRecHitsValidation.h.

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

Definition at line 57 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESEERecHitsEnergy_zm_
private

Definition at line 70 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESEERecHitsEnergy_zp_
private

Definition at line 69 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_
private

Definition at line 59 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_zm1st_
private

Definition at line 62 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_zm2nd_
private

Definition at line 63 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_zp1st_
private

Definition at line 60 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_zp2nd_
private

Definition at line 61 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_
private

Definition at line 64 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_zm1st_
private

Definition at line 67 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_zm2nd_
private

Definition at line 68 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_zp1st_
private

Definition at line 65 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_zp2nd_
private

Definition at line 66 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsStripOccupancy_zm1st_[36]
private

Definition at line 72 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsStripOccupancy_zm2nd_[36]
private

Definition at line 74 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsStripOccupancy_zp1st_[36]
private

Definition at line 71 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsStripOccupancy_zp2nd_[36]
private

Definition at line 73 of file EcalPreshowerRecHitsValidation.h.

bool EcalPreshowerRecHitsValidation::verbose_
private

Definition at line 53 of file EcalPreshowerRecHitsValidation.h.