CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
EcalPreshowerRecHitsValidation Class Reference

#include <EcalPreshowerRecHitsValidation.h>

Inheritance diagram for EcalPreshowerRecHitsValidation:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EcalPreshowerRecHitsValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~EcalPreshowerRecHitsValidation ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob ()
 
void endJob (void)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

DQMStoredbe_
 
edm::EDGetTokenT
< EERecHitCollection
EErechitCollection_token_
 
edm::EDGetTokenT
< EEUncalibratedRecHitCollection
EEuncalibrechitCollection_token_
 
edm::EDGetTokenT
< ESRecHitCollection
ESrechitCollection_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 edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 34 of file EcalPreshowerRecHitsValidation.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 18 of file EcalPreshowerRecHitsValidation.cc.

References dbe_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), timingPdfMaker::histo, GetRecoTauVFromDQM_MC_cff::kk, and cppFunctionSkipper::operator.

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  // get hold of back-end interface
33  dbe_ = 0;
35  if ( dbe_ ) {
36  if ( verbose_ ) {
37  dbe_->setVerbose(1);
38  } else {
39  dbe_->setVerbose(0);
40  }
41  }
42  if ( dbe_ ) {
43  if ( verbose_ ) dbe_->showDirStructure();
44  }
45 
46 
47  // ----------------------
48  meESRecHitsEnergy_ = 0; // total energy
53  meESRecHitsMultip_ = 0; // total multiplicity
58  meESEERecHitsEnergy_zp_ = 0; // versus EE energy
60 
61  for (int kk=0; kk<32; kk++)
62  {
67  }
68 
69 
70  // ----------------------
71  Char_t histo[200];
72  if ( dbe_ )
73  {
74  dbe_->setCurrentFolder("EcalRecHitsV/EcalPreshowerRecHitsTask");
75 
76  sprintf (histo, "ES Energy" );
77  meESRecHitsEnergy_ = dbe_->book1D(histo, histo, 210, -0.0005, 0.01);
78 
79  sprintf (histo, "ES Energy Plane1 Side+" );
80  meESRecHitsEnergy_zp1st_ = dbe_->book1D(histo, histo, 210, -0.0005, 0.01);
81 
82  sprintf (histo, "ES Energy Plane2 Side+");
83  meESRecHitsEnergy_zp2nd_ = dbe_->book1D(histo, histo, 210, -0.0005, 0.01);
84 
85  sprintf (histo, "ES Energy Plane1 Side-");
86  meESRecHitsEnergy_zm1st_ = dbe_->book1D(histo, histo, 210, -0.0005, 0.01);
87 
88  sprintf (histo, "ES Energy Plane2 Side-");
89  meESRecHitsEnergy_zm2nd_ = dbe_->book1D(histo, histo, 210, -0.0005, 0.01);
90 
91  sprintf (histo, "ES Multiplicity" );
92  meESRecHitsMultip_ = dbe_->book1D(histo, histo, 100, 0., 700.);
93 
94  sprintf (histo, "ES Multiplicity Plane1 Side+");
95  meESRecHitsMultip_zp1st_ = dbe_->book1D(histo, histo, 100, 0., 700.);
96 
97  sprintf (histo, "ES Multiplicity Plane2 Side+");
98  meESRecHitsMultip_zp2nd_ = dbe_->book1D(histo, histo, 100, 0., 700.);
99 
100  sprintf (histo, "ES Multiplicity Plane1 Side-");
101  meESRecHitsMultip_zm1st_ = dbe_->book1D(histo, histo, 100, 0., 700.);
102 
103  sprintf (histo, "ES Multiplicity Plane2 Side-");
104  meESRecHitsMultip_zm2nd_ = dbe_->book1D(histo, histo, 100, 0., 700.);
105 
106  sprintf (histo, "Preshower EE vs ES energy Side+");
107  meESEERecHitsEnergy_zp_ = dbe_->book2D(histo, histo, 100, 0., 0.2, 100, 0., 150.);
108 
109  sprintf (histo, "Preshower EE vs ES energy Side-");
110  meESEERecHitsEnergy_zm_ = dbe_->book2D(histo, histo, 100, 0., 0.2, 100, 0., 150.);
111 
112  for (int kk=0; kk<32; kk++)
113  {
114  sprintf(histo, "ES Occupancy Plane1 Side+ Strip%02d", kk+1);
115  meESRecHitsStripOccupancy_zp1st_[kk] = dbe_->book2D(histo, histo, 40, 0., 40., 40, 0., 40.);
116 
117  sprintf(histo, "ES Occupancy Plane2 Side+ Strip%02d", kk+1);
118  meESRecHitsStripOccupancy_zp2nd_[kk] = dbe_->book2D(histo, histo, 40, 0., 40., 40, 0., 40.);
119 
120  sprintf(histo, "ES Occupancy Plane1 Side- Strip%02d", kk+1);
121  meESRecHitsStripOccupancy_zm1st_[kk] = dbe_->book2D(histo, histo, 40, 0., 40., 40, 0., 40.);
122 
123  sprintf(histo, "ES Occupancy Plane2 Side- Strip%02d", kk+1);
124  meESRecHitsStripOccupancy_zm2nd_[kk] = dbe_->book2D(histo, histo, 40, 0., 40., 40, 0., 40.);
125  }
126  }
127 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_token_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
edm::EDGetTokenT< EERecHitCollection > EErechitCollection_token_
void setVerbose(unsigned level)
Definition: DQMStore.cc:619
edm::EDGetTokenT< ESRecHitCollection > ESrechitCollection_token_
void showDirStructure(void) const
Definition: DQMStore.cc:3282
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
EcalPreshowerRecHitsValidation::~EcalPreshowerRecHitsValidation ( )

Destructor.

Definition at line 129 of file EcalPreshowerRecHitsValidation.cc.

129  {
130 
131 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 141 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(), ESDetId::six(), ESDetId::siy(), ESDetId::strip(), ESDetId::zside(), EEDetId::zside(), and ecaldqm::zside().

141  {
142 
143  const ESRecHitCollection *ESRecHit = 0;
144  Handle<ESRecHitCollection> EcalRecHitES;
145  e.getByToken( ESrechitCollection_token_, EcalRecHitES);
146  if (EcalRecHitES.isValid()) {
147  ESRecHit = EcalRecHitES.product ();
148  } else {
149  return;
150  }
151 
152  bool skipEE = false;
153  const EERecHitCollection *EERecHit = 0;
154  Handle<EERecHitCollection> EcalRecHitEE;
155  e.getByToken( EErechitCollection_token_, EcalRecHitEE);
156  if (EcalRecHitEE.isValid()){
157  EERecHit = EcalRecHitEE.product ();
158  } else {
159  skipEE = true;
160  }
161 
162  const EEUncalibratedRecHitCollection *EEUncalibRecHit = 0;
163  Handle< EEUncalibratedRecHitCollection > EcalUncalibRecHitEE;
164  e.getByToken( EEuncalibrechitCollection_token_, EcalUncalibRecHitEE);
165  if (EcalUncalibRecHitEE.isValid()) {
166  EEUncalibRecHit = EcalUncalibRecHitEE.product() ;
167  } else {
168  skipEE = true;
169  }
170 
171 
172 
173  // ----------------------
174  // loop over RecHits
175  // multiplicities
176  int mult_tot = 0;
177  int mult_zp1st = 0;
178  int mult_zp2nd = 0;
179  int mult_zm1st = 0;
180  int mult_zm2nd = 0;
181 
182  // energies
183  float ene_zp1st = 0.;
184  float ene_zp2nd = 0.;
185  float ene_zm1st = 0.;
186  float ene_zm2nd = 0.;
187 
188 
189  // ES
190  for (ESRecHitCollection::const_iterator recHit = ESRecHit->begin(); recHit != ESRecHit->end() ; ++recHit)
191  {
192  ESDetId ESid = ESDetId(recHit->id());
193 
194  int zside = ESid.zside();
195  int plane = ESid.plane();
196  int six = ESid.six();
197  int siy = ESid.siy();
198  int strip = ESid.strip();
199 
200  // global
201  mult_tot++;
202  if (meESRecHitsEnergy_) meESRecHitsEnergy_ ->Fill(recHit->energy());
203 
204  // side +, plane 1
205  if ( (zside == +1) && (plane == 1) )
206  {
207  mult_zp1st++;
208  ene_zp1st += recHit->energy();
209  if ( meESRecHitsEnergy_zp1st_ ) { meESRecHitsEnergy_zp1st_ -> Fill(recHit->energy()); }
210  if ( meESRecHitsStripOccupancy_zp1st_[strip-1] ){ meESRecHitsStripOccupancy_zp1st_[strip-1]-> Fill( six, siy ); }
211  }
212 
213 
214  // side +, plane 2
215  if ( (zside == +1) && (plane == 2) )
216  {
217  mult_zp2nd++;
218  ene_zp2nd += recHit->energy();
219  if ( meESRecHitsEnergy_zp2nd_ ) { meESRecHitsEnergy_zp2nd_ -> Fill(recHit->energy()); }
220  if ( meESRecHitsStripOccupancy_zp2nd_[strip-1] ){ meESRecHitsStripOccupancy_zp2nd_[strip-1]-> Fill( six, siy ); }
221  }
222 
223 
224  // side -, plane 1
225  if ( (zside == -1) && (plane == 1) )
226  {
227  mult_zm1st++;
228  ene_zm1st += recHit->energy();
229  if ( meESRecHitsEnergy_zm1st_ ) { meESRecHitsEnergy_zm1st_ -> Fill(recHit->energy()); }
230  if ( meESRecHitsStripOccupancy_zm1st_[strip-1] ){ meESRecHitsStripOccupancy_zm1st_[strip-1]-> Fill( six, siy ); }
231  }
232 
233 
234  // side +, plane 2
235  if ( (zside == -1) && (plane == 2) )
236  {
237  mult_zm2nd ++;
238  ene_zm2nd += recHit->energy();
239  if ( meESRecHitsEnergy_zm2nd_ ) { meESRecHitsEnergy_zm2nd_ -> Fill(recHit->energy()); }
240  if ( meESRecHitsStripOccupancy_zm2nd_[strip-1] ){ meESRecHitsStripOccupancy_zm2nd_[strip-1]-> Fill( six, siy ); }
241  }
242 
243  } // loop over the ES RecHitCollection
244 
245 
246 
247  // EE
248  double zpEE = 0.;
249  double zmEE = 0.;
250  if ( ! skipEE ) {
251 
252  for (EcalUncalibratedRecHitCollection::const_iterator uncalibRecHit = EEUncalibRecHit->begin(); uncalibRecHit != EEUncalibRecHit->end() ; ++uncalibRecHit)
253  {
254  EEDetId EEid = EEDetId(uncalibRecHit->id());
255  int mySide = EEid.zside();
256 
257  // Find corresponding recHit
258  EcalRecHitCollection::const_iterator myRecHit = EERecHit->find(EEid);
259 
260  if (myRecHit != EERecHit->end() )
261  {
262  if (mySide > 0) { zpEE = zpEE + myRecHit->energy(); }
263  if (mySide < 0) { zmEE = zmEE + myRecHit->energy(); }
264  }
265  }
266  }
267 
268 
269  // filling histos
270  if (meESRecHitsMultip_) { meESRecHitsMultip_ -> Fill(mult_tot); }
271  if (meESRecHitsMultip_zp1st_ ) { meESRecHitsMultip_zp1st_ -> Fill(mult_zp1st); }
272  if (meESRecHitsMultip_zp2nd_ ) { meESRecHitsMultip_zp2nd_ -> Fill(mult_zp2nd); }
273  if (meESRecHitsMultip_zm1st_ ) { meESRecHitsMultip_zm1st_ -> Fill(mult_zm1st); }
274  if (meESRecHitsMultip_zm2nd_ ) { meESRecHitsMultip_zm2nd_ -> Fill(mult_zm2nd); }
275  if (meESEERecHitsEnergy_zp_) { meESEERecHitsEnergy_zp_ -> Fill( (ene_zp1st + 0.7*ene_zp2nd)/0.09, zpEE ); }
276  if (meESEERecHitsEnergy_zm_) { meESEERecHitsEnergy_zm_ -> Fill( (ene_zm1st + 0.7*ene_zm2nd)/0.09, zmEE ); }
277 }
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_token_
int strip() const
Definition: ESDetId.h:52
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< EcalRecHit >::const_iterator const_iterator
int six() const
Definition: ESDetId.h:48
int zside(DetId const &)
void Fill(long long x)
int siy() const
Definition: ESDetId.h:50
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:44
bool isValid() const
Definition: HandleBase.h:76
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:46
const_iterator begin() const
void EcalPreshowerRecHitsValidation::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 133 of file EcalPreshowerRecHitsValidation.cc.

133  {
134 
135 }
void EcalPreshowerRecHitsValidation::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 137 of file EcalPreshowerRecHitsValidation.cc.

137  {
138 
139 }

Member Data Documentation

DQMStore* EcalPreshowerRecHitsValidation::dbe_
private

Definition at line 59 of file EcalPreshowerRecHitsValidation.h.

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

Definition at line 62 of file EcalPreshowerRecHitsValidation.h.

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

Definition at line 61 of file EcalPreshowerRecHitsValidation.h.

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

Definition at line 63 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESEERecHitsEnergy_zm_
private

Definition at line 76 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESEERecHitsEnergy_zp_
private

Definition at line 75 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_
private

Definition at line 65 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_zm1st_
private

Definition at line 68 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_zm2nd_
private

Definition at line 69 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_zp1st_
private

Definition at line 66 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsEnergy_zp2nd_
private

Definition at line 67 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_
private

Definition at line 70 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_zm1st_
private

Definition at line 73 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_zm2nd_
private

Definition at line 74 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_zp1st_
private

Definition at line 71 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsMultip_zp2nd_
private

Definition at line 72 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsStripOccupancy_zm1st_[36]
private

Definition at line 78 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsStripOccupancy_zm2nd_[36]
private

Definition at line 80 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsStripOccupancy_zp1st_[36]
private

Definition at line 77 of file EcalPreshowerRecHitsValidation.h.

MonitorElement* EcalPreshowerRecHitsValidation::meESRecHitsStripOccupancy_zp2nd_[36]
private

Definition at line 79 of file EcalPreshowerRecHitsValidation.h.

bool EcalPreshowerRecHitsValidation::verbose_
private

Definition at line 57 of file EcalPreshowerRecHitsValidation.h.