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 Types | Private Attributes
EcalRecHitsValidation Class Reference

#include <EcalRecHitsValidation.h>

Inheritance diagram for EcalRecHitsValidation:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EcalRecHitsValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~EcalRecHitsValidation ()
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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)
 
void findBarrelMatrix (int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &themap)
 
void findEndcapMatrix (int nCellInX, int nCellInY, int CentralX, int CentralY, int CentralZ, MapType &themap)
 
uint32_t getUnitWithMaxEnergy (MapType &themap)
 
- 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 Types

typedef std::map< uint32_t,
float, std::less< uint32_t > > 
MapType
 

Private Attributes

std::vector< uint32_t > crystalMatrix
 
DQMStoredbe_
 
edm::EDGetTokenT
< CrossingFrame< PCaloHit > > 
EBHits_Token_
 
edm::InputTag EBrechitCollection_
 
edm::EDGetTokenT
< EBRecHitCollection
EBrechitCollection_Token_
 
edm::InputTag EBuncalibrechitCollection_
 
edm::EDGetTokenT
< EBUncalibratedRecHitCollection
EBuncalibrechitCollection_Token_
 
edm::EDGetTokenT
< CrossingFrame< PCaloHit > > 
EEHits_Token_
 
edm::InputTag EErechitCollection_
 
edm::EDGetTokenT
< EERecHitCollection
EErechitCollection_Token_
 
edm::InputTag EEuncalibrechitCollection_
 
edm::EDGetTokenT
< EEUncalibratedRecHitCollection
EEuncalibrechitCollection_Token_
 
edm::EDGetTokenT
< CrossingFrame< PCaloHit > > 
ESHits_Token_
 
edm::InputTag ESrechitCollection_
 
edm::EDGetTokenT
< ESRecHitCollection
ESrechitCollection_Token_
 
std::string HepMCLabel
 
edm::EDGetTokenT
< edm::HepMCProduct
HepMCLabel_Token_
 
std::string hitsProducer_
 
MonitorElementmeEB5x5RecHitSimHitvsSimHitFlag8_
 
MonitorElementmeEBe5x5_
 
MonitorElementmeEBe5x5OverGun_
 
MonitorElementmeEBe5x5OverSimHits_
 
MonitorElementmeEBRecHitFlags_
 
MonitorElementmeEBRecHitLog10Energy5x5Contr_
 
MonitorElementmeEBRecHitLog10Energy_
 
MonitorElementmeEBRecHitLog10EnergyContr_
 
MonitorElementmeEBRecHitSimHitFlag6_
 
MonitorElementmeEBRecHitSimHitFlag7_
 
MonitorElementmeEBRecHitSimHitRatio1011_
 
MonitorElementmeEBRecHitSimHitRatio12_
 
MonitorElementmeEBRecHitSimHitRatio13_
 
MonitorElementmeEBRecHitSimHitRatio_
 
MonitorElementmeEBRecHitSimHitRatioGt35_
 
MonitorElementmeEBRecHitSimHitvsSimHitFlag5_6_
 
MonitorElementmeEBRecHitsOccupancyFlag5_6_
 
MonitorElementmeEBRecHitsOccupancyFlag8_9_
 
MonitorElementmeEBUnRecHitSimHitRatio_
 
MonitorElementmeEBUnRecHitSimHitRatioGt35_
 
MonitorElementmeEEe5x5_
 
MonitorElementmeEEe5x5OverGun_
 
MonitorElementmeEEe5x5OverSimHits_
 
MonitorElementmeEERecHitFlags_
 
MonitorElementmeEERecHitLog10Energy5x5Contr_
 
MonitorElementmeEERecHitLog10Energy_
 
MonitorElementmeEERecHitLog10EnergyContr_
 
MonitorElementmeEERecHitSimHitFlag6_
 
MonitorElementmeEERecHitSimHitFlag7_
 
MonitorElementmeEERecHitSimHitRatio1011_
 
MonitorElementmeEERecHitSimHitRatio12_
 
MonitorElementmeEERecHitSimHitRatio13_
 
MonitorElementmeEERecHitSimHitRatio_
 
MonitorElementmeEERecHitSimHitRatioGt35_
 
MonitorElementmeEERecHitSimHitvsSimHitFlag5_6_
 
MonitorElementmeEERecHitsOccupancyMinusFlag5_6_
 
MonitorElementmeEERecHitsOccupancyMinusFlag8_9_
 
MonitorElementmeEERecHitsOccupancyPlusFlag5_6_
 
MonitorElementmeEERecHitsOccupancyPlusFlag8_9_
 
MonitorElementmeEEUnRecHitSimHitRatio_
 
MonitorElementmeEEUnRecHitSimHitRatioGt35_
 
MonitorElementmeESRecHitLog10Energy_
 
MonitorElementmeESRecHitLog10EnergyContr_
 
MonitorElementmeESRecHitSimHitRatio_
 
MonitorElementmeGunEnergy_
 
MonitorElementmeGunEta_
 
MonitorElementmeGunPhi_
 
std::string outputFile_
 
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 43 of file EcalRecHitsValidation.h.

Member Typedef Documentation

typedef std::map<uint32_t,float,std::less<uint32_t> > EcalRecHitsValidation::MapType
private

Definition at line 45 of file EcalRecHitsValidation.h.

Constructor & Destructor Documentation

EcalRecHitsValidation::EcalRecHitsValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 23 of file EcalRecHitsValidation.cc.

References dbe_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), timingPdfMaker::histo, HLT_25ns14e33_v1_cff::InputTag, cppFunctionSkipper::operator, and AlCaHLTBitMon_QueryRunRegistry::string.

23  {
24 
25  // ----------------------
26  HepMCLabel = ps.getParameter<std::string>("moduleLabelMC");
27  hitsProducer_ = ps.getParameter<std::string>("hitsProducer");
28  EBrechitCollection_ = ps.getParameter<edm::InputTag>("EBrechitCollection");
29  EErechitCollection_ = ps.getParameter<edm::InputTag>("EErechitCollection");
30  ESrechitCollection_ = ps.getParameter<edm::InputTag>("ESrechitCollection");
31  EBuncalibrechitCollection_ = ps.getParameter<edm::InputTag>("EBuncalibrechitCollection");
32  EEuncalibrechitCollection_ = ps.getParameter<edm::InputTag>("EEuncalibrechitCollection");
33  // fix for consumes
34  HepMCLabel_Token_ = consumes<HepMCProduct>(ps.getParameter<std::string>("moduleLabelMC"));
35  EBrechitCollection_Token_ = consumes<EBRecHitCollection>(ps.getParameter<edm::InputTag>("EBrechitCollection"));
36  EErechitCollection_Token_ = consumes<EERecHitCollection>(ps.getParameter<edm::InputTag>("EErechitCollection"));
37  ESrechitCollection_Token_ = consumes<ESRecHitCollection>(ps.getParameter<edm::InputTag>("ESrechitCollection"));
38  EBuncalibrechitCollection_Token_ = consumes<EBUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EBuncalibrechitCollection"));
39  EEuncalibrechitCollection_Token_ = consumes<EEUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("EEuncalibrechitCollection"));
40  EBHits_Token_ = consumes<CrossingFrame<PCaloHit> >(edm::InputTag(std::string("mix"), ps.getParameter<std::string>("hitsProducer") + std::string("EcalHitsEB")));
41  EEHits_Token_ = consumes<CrossingFrame<PCaloHit> >(edm::InputTag(std::string("mix"), ps.getParameter<std::string>("hitsProducer") + std::string("EcalHitsEE")));
42  ESHits_Token_ = consumes<CrossingFrame<PCaloHit> >(edm::InputTag(std::string("mix"), ps.getParameter<std::string>("hitsProducer") + std::string("EcalHitsES")));
43 
44  // ----------------------
45  // DQM ROOT output
46  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
47 
48  if ( outputFile_.size() != 0 ) {
49  LogInfo("OutputInfo") << " Ecal RecHits Task histograms will be saved to '" << outputFile_.c_str() << "'";
50  } else {
51  LogInfo("OutputInfo") << " Ecal RecHits Task histograms will NOT be saved";
52  }
53 
54  // ----------------------
55  // verbosity switch
56  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
57 
58  // ----------------------
59  // get hold of back-end interface
60  dbe_ = 0;
61  dbe_ = Service<DQMStore>().operator->();
62  if ( dbe_ ) {
63  if ( verbose_ ) {
64  dbe_->setVerbose(1);
65  } else {
66  dbe_->setVerbose(0);
67  }
68  }
69  if ( dbe_ ) {
70  if ( verbose_ ) dbe_->showDirStructure();
71  }
72 
73 
74  // ----------------------
75  meGunEnergy_ = 0;
76  meGunEta_ = 0;
77  meGunPhi_ = 0;
93  meEBe5x5_ = 0;
95  meEBe5x5OverGun_ = 0;
96  meEEe5x5_ = 0;
98  meEEe5x5OverGun_ = 0;
99 
108 
115 
116  meEBRecHitFlags_ = 0;
121 
122  meEERecHitFlags_ = 0;
126 
127 
128  // ----------------------
130 
131  if ( dbe_ ) {
132  dbe_->setCurrentFolder("EcalRecHitsV/EcalRecHitsTask");
133 
134  histo = "EcalRecHitsTask Gun Momentum";
135  meGunEnergy_ = dbe_->book1D(histo.c_str(), histo.c_str(), 100, 0., 1000.);
136 
137  histo = "EcalRecHitsTask Gun Eta";
138  meGunEta_ = dbe_->book1D(histo.c_str(), histo.c_str(), 700, -3.5, 3.5);
139 
140  histo = "EcalRecHitsTask Gun Phi";
141  meGunPhi_ = dbe_->book1D(histo.c_str(), histo.c_str(), 360, 0., 360.);
142 
143  histo = "EcalRecHitsTask Barrel RecSimHit Ratio";
144  meEBRecHitSimHitRatio_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
145 
146  histo = "EcalRecHitsTask Endcap RecSimHit Ratio";
147  meEERecHitSimHitRatio_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
148 
149  histo = "EcalRecHitsTask Preshower RecSimHit Ratio";
150  meESRecHitSimHitRatio_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
151 
152  histo = "EcalRecHitsTask Barrel RecSimHit Ratio gt 3p5 GeV";
153  meEBRecHitSimHitRatioGt35_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
154 
155  histo = "EcalRecHitsTask Endcap RecSimHit Ratio gt 3p5 GeV";
156  meEERecHitSimHitRatioGt35_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
157 
158  histo = "EcalRecHitsTask Barrel Unc RecSimHit Ratio";
159  meEBUnRecHitSimHitRatio_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
160 
161  histo = "EcalRecHitsTask Endcap Unc RecSimHit Ratio";
162  meEEUnRecHitSimHitRatio_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
163 
164  histo = "EcalRecHitsTask Barrel RecSimHit Ratio Channel Status=10 11";
165  meEBRecHitSimHitRatio1011_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
166 
167  histo = "EcalRecHitsTask Endcap RecSimHit Ratio Channel Status=10 11";
168  meEERecHitSimHitRatio1011_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
169 
170  histo = "EcalRecHitsTask Barrel RecSimHit Ratio Channel Status=12";
171  meEBRecHitSimHitRatio12_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
172 
173  histo = "EcalRecHitsTask Endcap RecSimHit Ratio Channel Status=12";
174  meEERecHitSimHitRatio12_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
175 
176  histo = "EcalRecHitsTask Barrel RecSimHit Ratio Channel Status=13";
177  meEBRecHitSimHitRatio13_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
178 
179  histo = "EcalRecHitsTask Endcap RecSimHit Ratio Channel Status=13";
180  meEERecHitSimHitRatio13_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
181 
182  histo = "EcalRecHitsTask Barrel Unc RecSimHit Ratio gt 3p5 GeV";
183  meEBUnRecHitSimHitRatioGt35_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
184 
185  histo = "EcalRecHitsTask Endcap Unc RecSimHit Ratio gt 3p5 GeV";
186  meEEUnRecHitSimHitRatioGt35_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
187 
188  histo = "EcalRecHitsTask Barrel Rec E5x5";
189  meEBe5x5_ = dbe_->book1D(histo.c_str(), histo.c_str(), 4000, 0., 400.);
190 
191  histo = "EcalRecHitsTask Barrel Rec E5x5 over Sim E5x5";
192  meEBe5x5OverSimHits_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
193 
194  histo = "EcalRecHitsTask Barrel Rec E5x5 over gun energy";
195  meEBe5x5OverGun_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
196 
197  histo = "EcalRecHitsTask Endcap Rec E5x5";
198  meEEe5x5_ = dbe_->book1D(histo.c_str(), histo.c_str(), 4000, 0., 400.);
199 
200  histo = "EcalRecHitsTask Endcap Rec E5x5 over Sim E5x5";
201  meEEe5x5OverSimHits_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
202 
203  histo = "EcalRecHitsTask Endcap Rec E5x5 over gun energy";
204  meEEe5x5OverGun_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0.9, 1.1);
205 
206  meEBRecHitLog10Energy_ = dbe_->book1D( "EcalRecHitsTask Barrel Log10 Energy", "EcalRecHitsTask Barrel Log10 Energy", 90, -5., 4. );
207  meEERecHitLog10Energy_ = dbe_->book1D( "EcalRecHitsTask Endcap Log10 Energy", "EcalRecHitsTask Endcap Log10 Energy", 90, -5., 4. );
208  meESRecHitLog10Energy_ = dbe_->book1D( "EcalRecHitsTask Preshower Log10 Energy", "EcalRecHitsTask Preshower Log10 Energy", 90, -5., 4. );
209  meEBRecHitLog10EnergyContr_ = dbe_->bookProfile( "EcalRecHits Barrel Log10En vs Hit Contribution", "EcalRecHits Barrel Log10En vs Hit Contribution", 90, -5., 4., 100, 0., 1. );
210  meEERecHitLog10EnergyContr_ = dbe_->bookProfile( "EcalRecHits Endcap Log10En vs Hit Contribution", "EcalRecHits Endcap Log10En vs Hit Contribution", 90, -5., 4., 100, 0., 1. );
211  meESRecHitLog10EnergyContr_ = dbe_->bookProfile( "EcalRecHits Preshower Log10En vs Hit Contribution", "EcalRecHits Preshower Log10En vs Hit Contribution", 90, -5., 4., 100, 0., 1. );
212  meEBRecHitLog10Energy5x5Contr_ = dbe_->bookProfile( "EcalRecHits Barrel Log10En5x5 vs Hit Contribution", "EcalRecHits Barrel Log10En5x5 vs Hit Contribution", 90, -5., 4., 100, 0., 1. );
213  meEERecHitLog10Energy5x5Contr_ = dbe_->bookProfile( "EcalRecHits Endcap Log10En5x5 vs Hit Contribution", "EcalRecHits Endcap Log10En5x5 vs Hit Contribution", 90, -5., 4., 100, 0., 1. );
214 
215 
216  histo = "EB Occupancy Flag=5 6";
217  meEBRecHitsOccupancyFlag5_6_ = dbe_->book2D(histo, histo, 170, -85., 85., 360, 0., 360.);
218  histo = "EB Occupancy Flag=8 9";
219  meEBRecHitsOccupancyFlag8_9_ = dbe_->book2D(histo, histo, 170, -85., 85., 360, 0., 360.);
220 
221  histo = "EE+ Occupancy Flag=5 6";
222  meEERecHitsOccupancyPlusFlag5_6_ = dbe_->book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
223  histo = "EE- Occupancy Flag=5 6";
224  meEERecHitsOccupancyMinusFlag5_6_ = dbe_->book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
225  histo = "EE+ Occupancy Flag=8 9";
226  meEERecHitsOccupancyPlusFlag8_9_ = dbe_->book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
227  histo = "EE- Occupancy Flag=8 9";
228  meEERecHitsOccupancyMinusFlag8_9_ = dbe_->book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
229 
230 
231  histo = "EcalRecHitsTask Barrel Reco Flags";
232  meEBRecHitFlags_ = dbe_->book1D(histo.c_str(), histo.c_str(), 10, 0., 10.);
233  histo = "EcalRecHitsTask Endcap Reco Flags";
234  meEERecHitFlags_ = dbe_->book1D(histo.c_str(), histo.c_str(), 10, 0., 10.);
235  histo = "EcalRecHitsTask Barrel RecSimHit Ratio vs SimHit Flag=5 6";
236  meEBRecHitSimHitvsSimHitFlag5_6_ = dbe_->book2D(histo.c_str(), histo.c_str(), 80, 0., 2., 4000, 0., 400. );
237  histo = "EcalRecHitsTask Endcap RecSimHit Ratio vs SimHit Flag=5 6";
238  meEERecHitSimHitvsSimHitFlag5_6_ = dbe_->book2D(histo.c_str(), histo.c_str(), 80, 0., 2., 4000, 0., 400. );
239  histo = "EcalRecHitsTask Barrel RecSimHit Ratio Flag=6";
240  meEBRecHitSimHitFlag6_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
241  histo = "EcalRecHitsTask Endcap RecSimHit Ratio Flag=6";
242  meEERecHitSimHitFlag6_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
243  histo = "EcalRecHitsTask Barrel RecSimHit Ratio Flag=7";
244  meEBRecHitSimHitFlag7_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
245  histo = "EcalRecHitsTask Endcap RecSimHit Ratio Flag=7";
246  meEERecHitSimHitFlag7_ = dbe_->book1D(histo.c_str(), histo.c_str(), 80, 0., 2.);
247  histo = "EcalRecHitsTask Barrel 5x5 RecSimHit Ratio vs SimHit Flag=8";
248  meEB5x5RecHitSimHitvsSimHitFlag8_ = dbe_->book2D(histo.c_str(), histo.c_str(), 80, 0., 2., 4000, 0., 400. );
249 
250  }
251 }
MonitorElement * meEERecHitsOccupancyPlusFlag5_6_
MonitorElement * meEBRecHitSimHitRatio13_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meEBRecHitLog10Energy5x5Contr_
MonitorElement * meEBRecHitSimHitRatio1011_
MonitorElement * meEBRecHitSimHitFlag7_
MonitorElement * meEBRecHitSimHitRatio12_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
MonitorElement * meEERecHitSimHitRatio12_
MonitorElement * meEERecHitsOccupancyMinusFlag5_6_
edm::EDGetTokenT< ESRecHitCollection > ESrechitCollection_Token_
MonitorElement * meEERecHitSimHitRatio13_
MonitorElement * meEBe5x5OverSimHits_
MonitorElement * meEBRecHitSimHitFlag6_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
MonitorElement * meEB5x5RecHitSimHitvsSimHitFlag8_
edm::EDGetTokenT< EERecHitCollection > EErechitCollection_Token_
edm::InputTag EBuncalibrechitCollection_
MonitorElement * meEBUnRecHitSimHitRatio_
MonitorElement * meEBRecHitLog10EnergyContr_
MonitorElement * meEBRecHitsOccupancyFlag8_9_
MonitorElement * meEERecHitLog10EnergyContr_
MonitorElement * meEERecHitsOccupancyMinusFlag8_9_
MonitorElement * meEERecHitFlags_
MonitorElement * meEERecHitSimHitFlag6_
MonitorElement * meEEUnRecHitSimHitRatioGt35_
MonitorElement * meEEUnRecHitSimHitRatio_
MonitorElement * meEERecHitSimHitRatioGt35_
edm::InputTag EEuncalibrechitCollection_
MonitorElement * meEERecHitSimHitFlag7_
MonitorElement * meEBRecHitSimHitRatioGt35_
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_Token_
edm::EDGetTokenT< EBRecHitCollection > EBrechitCollection_Token_
MonitorElement * meESRecHitLog10Energy_
MonitorElement * meEBRecHitSimHitvsSimHitFlag5_6_
MonitorElement * meEERecHitSimHitvsSimHitFlag5_6_
MonitorElement * meEBRecHitFlags_
MonitorElement * meEERecHitLog10Energy_
MonitorElement * meEBRecHitLog10Energy_
edm::EDGetTokenT< EBUncalibratedRecHitCollection > EBuncalibrechitCollection_Token_
MonitorElement * meEBUnRecHitSimHitRatioGt35_
MonitorElement * meEERecHitLog10Energy5x5Contr_
MonitorElement * meESRecHitLog10EnergyContr_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
MonitorElement * meEERecHitsOccupancyPlusFlag8_9_
MonitorElement * meESRecHitSimHitRatio_
MonitorElement * meEBRecHitSimHitRatio_
MonitorElement * meEBRecHitsOccupancyFlag5_6_
MonitorElement * meEEe5x5OverGun_
MonitorElement * meEERecHitSimHitRatio1011_
MonitorElement * meEEe5x5OverSimHits_
edm::EDGetTokenT< edm::HepMCProduct > HepMCLabel_Token_
MonitorElement * meEBe5x5OverGun_
MonitorElement * meEERecHitSimHitRatio_
EcalRecHitsValidation::~EcalRecHitsValidation ( )

Destructor.

Definition at line 253 of file EcalRecHitsValidation.cc.

References dbe_.

253  {
254 
255  if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
256 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 266 of file EcalRecHitsValidation.cc.

References funct::abs(), HLT_50ns_5e33_v1_cff::barrelHits, edm::SortedCollection< T, SORT >::begin(), EcalTrigTowerConstituentsMap::constituentsOf(), EcalCondObjectContainer< T >::end(), edm::SortedCollection< T, SORT >::end(), HLT_50ns_5e33_v1_cff::endcapHits, edm::EventID::event(), HcalObjRepresent::Fill(), EcalCondObjectContainer< T >::find(), edm::SortedCollection< T, SORT >::find(), archive::flag, edm::EventSetup::get(), edm::Event::getByToken(), EcalADCToGeVConstant::getEBValue(), EcalADCToGeVConstant::getEEValue(), EcalChannelStatusCode::getStatusCode(), i, edm::EventBase::id(), EBDetId::ieta(), EBDetId::ietaAbs(), EBDetId::iphi(), edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), EcalRecHit::kDead, EcalRecHit::kLeadingEdgeRecovered, EcalRecHit::kNeighboursRecovered, EcalRecHit::kSaturated, EcalRecHit::kTowerRecovered, cmsBatch::log, LogDebug, M_PI, AlCaHLTBitMon_ParallelJobs::p, edm::Handle< T >::product(), edm::ESHandle< class >::product(), DetId::rawId(), edm::EventID::run(), ESDetId::six(), ESDetId::siy(), ESDetId::strip(), funct::tan(), EBDetId::tower(), EBDetId::zside(), and EEDetId::zside().

266  {
267 
268  //Temporary stuff
269 
270 
271 
272  LogInfo("EcalRecHitsTask, EventInfo: ") << " Run = " << e.id().run() << " Event = " << e.id().event();
273 
274  // ADC -> GeV Scale
276  c.get<EcalADCToGeVConstantRcd>().get(pAgc);
277  const EcalADCToGeVConstant* agc = pAgc.product();
278  const double barrelADCtoGeV_ = agc->getEBValue();
279  const double endcapADCtoGeV_ = agc->getEEValue();
280 
281  Handle<HepMCProduct> MCEvt;
282  bool skipMC = false;
283  e.getByToken(HepMCLabel_Token_, MCEvt);
284  if (!MCEvt.isValid()) { skipMC = true; }
285 
286  edm::Handle<CrossingFrame<PCaloHit> > crossingFrame;
287 
288  bool skipBarrel = false;
289  const EBUncalibratedRecHitCollection *EBUncalibRecHit =0;
290  Handle< EBUncalibratedRecHitCollection > EcalUncalibRecHitEB;
291  e.getByToken( EBuncalibrechitCollection_Token_, EcalUncalibRecHitEB);
292  if (EcalUncalibRecHitEB.isValid()) {
293  EBUncalibRecHit = EcalUncalibRecHitEB.product() ;
294  } else {
295  skipBarrel = true;
296  }
297 
298  bool skipEndcap = false;
299  const EEUncalibratedRecHitCollection *EEUncalibRecHit = 0;
300  Handle< EEUncalibratedRecHitCollection > EcalUncalibRecHitEE;
301  e.getByToken( EEuncalibrechitCollection_Token_, EcalUncalibRecHitEE);
302  if (EcalUncalibRecHitEE.isValid()){
303  EEUncalibRecHit = EcalUncalibRecHitEE.product () ;
304  } else {
305  skipEndcap = true;
306  }
307 
308  const EBRecHitCollection *EBRecHit = 0;
309  Handle<EBRecHitCollection> EcalRecHitEB;
310  e.getByToken( EBrechitCollection_Token_, EcalRecHitEB);
311  if (EcalRecHitEB.isValid()){
312  EBRecHit = EcalRecHitEB.product();
313  } else {
314  skipBarrel = true;
315  }
316 
317  const EERecHitCollection *EERecHit = 0;
318  Handle<EERecHitCollection> EcalRecHitEE;
319  e.getByToken( EErechitCollection_Token_, EcalRecHitEE);
320  if (EcalRecHitEE.isValid()){
321  EERecHit = EcalRecHitEE.product ();
322  } else {
323  skipEndcap = true;
324  }
325 
326  bool skipPreshower = false;
327  const ESRecHitCollection *ESRecHit = 0;
328  Handle<ESRecHitCollection> EcalRecHitES;
329  e.getByToken( ESrechitCollection_Token_, EcalRecHitES);
330  if (EcalRecHitES.isValid()) {
331  ESRecHit = EcalRecHitES.product ();
332  } else {
333  skipPreshower = true;
334  }
335 
336 
337  // ----------------------
338  // gun
339  double eGun = 0.;
340  if ( ! skipMC ) {
341  for ( HepMC::GenEvent::particle_const_iterator p = MCEvt->GetEvent()->particles_begin(); p != MCEvt->GetEvent()->particles_end(); ++p ) {
342  double htheta = (*p)->momentum().theta();
343  double heta = -99999.;
344  if( tan(htheta * 0.5) > 0 ) {
345  heta = -log(tan(htheta * 0.5));
346  }
347  double hphi = (*p)->momentum().phi();
348  hphi = (hphi>=0) ? hphi : hphi+2*M_PI;
349  hphi = hphi / M_PI * 180.;
350 
351  LogDebug("EventInfo") << "EcalRecHitsTask: Particle gun type form MC = " << abs((*p)->pdg_id())
352  << "\n" << "Energy = "<< (*p)->momentum().e()
353  << "\n" << "Eta = " << heta
354  << "\n" << "Phi = " << hphi;
355 
356  if ( (*p)->momentum().e() > eGun ) eGun = (*p)->momentum().e();
357 
358  if (meGunEnergy_) meGunEnergy_->Fill((*p)->momentum().e());
359  if (meGunEta_) meGunEta_ ->Fill(heta);
360  if (meGunPhi_) meGunPhi_ ->Fill(hphi);
361  }
362  }
363 
364  // -------------------------------------------------------------------
365  // BARREL
366 
367  if ( ! skipBarrel) {
368 
369  // 1) loop over simHits
370  e.getByToken(EBHits_Token_,crossingFrame);
371  std::auto_ptr<MixCollection<PCaloHit> >
372  barrelHits (new MixCollection<PCaloHit>(crossingFrame.product ()));
373 
374  MapType ebSimMap;
375  MapType ebRecMap;
376  const int ebcSize = 90;
377  double ebcontr[ebcSize];
378  double ebcontr25[ebcSize];
379  for( int i=0; i<ebcSize; i++ ) { ebcontr[i] = 0.0; ebcontr25[i] = 0.0; }
380  double ebtotal = 0.;
381 
382  for (MixCollection<PCaloHit>::MixItr hitItr = barrelHits->begin (); hitItr != barrelHits->end (); ++hitItr) {
383  EBDetId ebid = EBDetId(hitItr->id());
384 
385  LogDebug("SimHitInfo, barrel")
386  << "CaloHit " << hitItr->getName() << " DetID = " << hitItr->id() << "\n"
387  << "Energy = " << hitItr->energy() << " Time = " << hitItr->time() << "\n"
388  << "EBDetId = " << ebid.ieta() << " " << ebid.iphi();
389 
390  uint32_t crystid = ebid.rawId();
391  ebSimMap[crystid] += hitItr->energy();
392  }
393 
394 
395 
396  // 2) loop over RecHits
397  for (EcalUncalibratedRecHitCollection::const_iterator uncalibRecHit = EBUncalibRecHit->begin(); uncalibRecHit != EBUncalibRecHit->end() ; ++uncalibRecHit) {
398  EBDetId EBid = EBDetId(uncalibRecHit->id());
399 
400  // Find corresponding recHit
401  EcalRecHitCollection::const_iterator myRecHit = EBRecHit->find(EBid);
402  if( myRecHit == EBRecHit->end() ) continue;
403  ebRecMap[EBid.rawId()] += myRecHit->energy();
404 
405  // Fill log10(Energy) stuff...
406  ebtotal += myRecHit->energy();
407  if( myRecHit->energy() > 0 ) {
408  if( meEBRecHitLog10Energy_ ) meEBRecHitLog10Energy_->Fill( log10( myRecHit->energy() ) );
409  int log10i = int( ( log10( myRecHit->energy() ) + 5. ) * 10. );
410  if( log10i >=0 and log10i < ebcSize ) ebcontr[ log10i ] += myRecHit->energy();
411  }
412 
413  // comparison Rec/Sim hit
414  if ( ebSimMap[EBid.rawId()] != 0. ) {
415  double uncEnergy = uncalibRecHit->amplitude()*barrelADCtoGeV_;
416  if (meEBUnRecHitSimHitRatio_) {meEBUnRecHitSimHitRatio_ ->Fill(uncEnergy/ebSimMap[EBid.rawId()]);}
417  if (meEBUnRecHitSimHitRatioGt35_ && (myRecHit->energy()>3.5)){meEBUnRecHitSimHitRatioGt35_->Fill(uncEnergy/ebSimMap[EBid.rawId()]);}
418  }
419 
420  if (myRecHit != EBRecHit->end()) {
421  if ( ebSimMap[EBid.rawId()] != 0. ) {
422  if (meEBRecHitSimHitRatio_) {meEBRecHitSimHitRatio_ ->Fill(myRecHit->energy()/ebSimMap[EBid.rawId()]);}
423  if (meEBRecHitSimHitRatioGt35_ && (myRecHit->energy()>3.5)){meEBRecHitSimHitRatioGt35_->Fill(myRecHit->energy()/ebSimMap[EBid.rawId()]);}
424  uint16_t sc = 0;
426  c.get<EcalChannelStatusRcd>().get(pEcs);
427  const EcalChannelStatus* ecs = 0;
428  if( pEcs.isValid() ) ecs = pEcs.product();
429  if( ecs != 0 ) {
430  EcalChannelStatusMap::const_iterator csmi = ecs->find(EBid.rawId());
431  EcalChannelStatusCode csc = 0;
432  if( csmi != ecs->end() ) csc = *csmi;
433  sc = csc.getStatusCode();
434  }
435 
436  if( meEBRecHitSimHitRatio1011_ != 0 &&
437  ( sc == 10 || sc == 11 ) ) { meEBRecHitSimHitRatio1011_->Fill(myRecHit->energy()/ebSimMap[EBid.rawId()]); }
438  if( meEBRecHitSimHitRatio12_ != 0 && sc == 12 ) { meEBRecHitSimHitRatio12_->Fill(myRecHit->energy()/ebSimMap[EBid.rawId()]); }
439 
441  c.get<IdealGeometryRecord>().get(pttMap);
442  const EcalTrigTowerConstituentsMap* ttMap = 0;
443  if( pttMap.isValid() ) ttMap = pttMap.product();
444  double ttSimEnergy = 0;
445  if( ttMap != 0 ) {
446  EcalTrigTowerDetId ttDetId = EBid.tower();
447  std::vector<DetId> vid = ttMap->constituentsOf( ttDetId );
448  for( std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); dit++ ) {
449  EBDetId ttEBid = EBDetId(*dit);
450  ttSimEnergy += ebSimMap[ttEBid.rawId()];
451  }
452  if( vid.size() != 0 ) ttSimEnergy = ttSimEnergy / vid.size();
453  }
454  if( meEBRecHitSimHitRatio13_ != 0 && sc == 13 && ttSimEnergy != 0 )
455  meEBRecHitSimHitRatio13_->Fill(myRecHit->energy()/ttSimEnergy);
456 
457  int flag = myRecHit->recoFlag();
458  if( meEBRecHitFlags_ != 0 ) meEBRecHitFlags_->Fill( flag );
460  meEBRecHitSimHitvsSimHitFlag5_6_->Fill( myRecHit->energy()/ebSimMap[EBid.rawId()], ebSimMap[EBid.rawId()] );
462  meEBRecHitSimHitFlag6_->Fill( myRecHit->energy()/ebSimMap[EBid.rawId()] );
464  meEBRecHitSimHitFlag6_->Fill( myRecHit->energy()/ebSimMap[EBid.rawId()] );
465  if( meEB5x5RecHitSimHitvsSimHitFlag8_ && ( flag == EcalRecHit::kTowerRecovered ) && ttSimEnergy != 0 )
466  meEB5x5RecHitSimHitvsSimHitFlag8_->Fill( myRecHit->energy()/ttSimEnergy, ttSimEnergy );
467 
469  meEBRecHitsOccupancyFlag5_6_ -> Fill(EBid.ieta(), EBid.iphi());
471  meEBRecHitsOccupancyFlag8_9_ -> Fill(EBid.ieta(), EBid.iphi());
472 
473  }
474  }
475  else
476  continue;
477  } // loop over the UncalibratedRecHitCollection
478 
479  // RecHits matrix
480  uint32_t ebcenterid = getUnitWithMaxEnergy(ebRecMap);
481  EBDetId myEBid(ebcenterid);
482  int bx = myEBid.ietaAbs();
483  int by = myEBid.iphi();
484  int bz = myEBid.zside();
485  findBarrelMatrix(5,5,bx,by,bz,ebRecMap);
486  double e5x5rec = 0.;
487  double e5x5sim = 0.;
488  for ( unsigned int i = 0; i < crystalMatrix.size(); i++ ) {
489  e5x5rec += ebRecMap[crystalMatrix[i]];
490  e5x5sim += ebSimMap[crystalMatrix[i]];
491  if( ebRecMap[crystalMatrix[i]] > 0 ) {
492  int log10i25 = int( ( log10( ebRecMap[crystalMatrix[i]] ) + 5. ) * 10. );
493  if( log10i25 >=0 && log10i25 < ebcSize ) ebcontr25[ log10i25 ] += ebRecMap[crystalMatrix[i]];
494  }
495  }
496 
497  if( meEBe5x5_ ) meEBe5x5_->Fill(e5x5rec);
498  if ( e5x5sim > 0. && meEBe5x5OverSimHits_ ) meEBe5x5OverSimHits_->Fill(e5x5rec/e5x5sim);
499  if ( eGun > 0. && meEBe5x5OverGun_ ) meEBe5x5OverGun_->Fill(e5x5rec/eGun);
500 
501  if( meEBRecHitLog10EnergyContr_ && ebtotal != 0 ) {
502  for( int i=0; i<ebcSize; i++ ) {
503  meEBRecHitLog10EnergyContr_->Fill( -5.+(float(i)+0.5)/10., ebcontr[i]/ebtotal );
504  }
505  }
506 
507  if( meEBRecHitLog10Energy5x5Contr_ && e5x5rec != 0 ) {
508  for( int i=0; i<ebcSize; i++ ) {
509  meEBRecHitLog10Energy5x5Contr_->Fill( -5.+(float(i)+0.5)/10., ebcontr25[i]/e5x5rec );
510  }
511  }
512  }
513 
514  // -------------------------------------------------------------------
515  // ENDCAP
516 
517  if ( ! skipEndcap ) {
518 
519  // 1) loop over simHits
520  e.getByToken(EEHits_Token_,crossingFrame);
521  std::auto_ptr<MixCollection<PCaloHit> >
522  endcapHits (new MixCollection<PCaloHit>(crossingFrame.product ()));
523 
524  MapType eeSimMap;
525  MapType eeRecMap;
526  const int eecSize = 90;
527  double eecontr[eecSize];
528  double eecontr25[eecSize];
529  for( int i=0; i<eecSize; i++ ) { eecontr[i] = 0.0; eecontr25[i] = 0.0; }
530  double eetotal = 0.;
531 
532  for (MixCollection<PCaloHit>::MixItr hitItr = endcapHits->begin(); hitItr != endcapHits->end(); ++hitItr) {
533  EEDetId eeid = EEDetId(hitItr->id()) ;
534 
535  LogDebug("Endcap, HitInfo")
536  <<" CaloHit " << hitItr->getName() << " DetID = " << hitItr->id() << "\n"
537  << "Energy = " << hitItr->energy() << " Time = " << hitItr->time() << "\n"
538  << "EEDetId side " << eeid.zside() << " = " << eeid.ix() << " " << eeid.iy();
539 
540  uint32_t crystid = eeid.rawId();
541  eeSimMap[crystid] += hitItr->energy();
542  }
543 
544 
545 
546  // 2) loop over RecHits
547  for (EcalUncalibratedRecHitCollection::const_iterator uncalibRecHit = EEUncalibRecHit->begin(); uncalibRecHit != EEUncalibRecHit->end(); ++uncalibRecHit) {
548  EEDetId EEid = EEDetId(uncalibRecHit->id());
549 
550  // Find corresponding recHit
551  EcalRecHitCollection::const_iterator myRecHit = EERecHit->find(EEid);
552  if( myRecHit == EERecHit->end() ) continue;
553  eeRecMap[EEid.rawId()] += myRecHit->energy();
554 
555  // Fill log10(Energy) stuff...
556  eetotal += myRecHit->energy();
557  if( myRecHit->energy() > 0 ) {
558  if( meEERecHitLog10Energy_ ) meEERecHitLog10Energy_->Fill( log10( myRecHit->energy() ) );
559  int log10i = int( ( log10( myRecHit->energy() ) + 5. ) * 10. );
560  if( log10i >=0 and log10i < eecSize ) eecontr[ log10i ] += myRecHit->energy();
561  }
562 
563  // comparison Rec/Sim hit
564  if ( eeSimMap[EEid.rawId()] != 0. ) {
565  double uncEnergy = uncalibRecHit->amplitude()*endcapADCtoGeV_;
566  if (meEEUnRecHitSimHitRatio_) {meEEUnRecHitSimHitRatio_ ->Fill(uncEnergy/eeSimMap[EEid.rawId()]);}
567  if (meEEUnRecHitSimHitRatioGt35_ && (myRecHit->energy()>3.5)){meEEUnRecHitSimHitRatioGt35_->Fill(uncEnergy/eeSimMap[EEid.rawId()]);}
568  }
569 
570  if (myRecHit != EERecHit->end()) {
571  if ( eeSimMap[EEid.rawId()] != 0. ) {
572  if (meEERecHitSimHitRatio_) {meEERecHitSimHitRatio_ ->Fill(myRecHit->energy()/eeSimMap[EEid.rawId()]); }
573  if (meEERecHitSimHitRatioGt35_ && (myRecHit->energy()>3.5)){meEERecHitSimHitRatioGt35_->Fill(myRecHit->energy()/eeSimMap[EEid.rawId()]); }
574 
576  c.get<EcalChannelStatusRcd>().get(pEcs);
577  const EcalChannelStatus* ecs = 0;
578  if( pEcs.isValid() ) ecs = pEcs.product();
579  if( ecs != 0 ) {
580  EcalChannelStatusMap::const_iterator csmi = ecs->find(EEid.rawId());
581  EcalChannelStatusCode csc = 0;
582  if( csmi != ecs->end() ) csc = *csmi;
583  uint16_t sc = csc.getStatusCode();
584  if( meEERecHitSimHitRatio1011_ != 0 &&
585  ( sc == 10 || sc == 11 ) ) { meEERecHitSimHitRatio1011_->Fill(myRecHit->energy()/eeSimMap[EEid.rawId()]); }
586  if( meEERecHitSimHitRatio12_ != 0 && sc == 12 ) { meEERecHitSimHitRatio12_->Fill(myRecHit->energy()/eeSimMap[EEid.rawId()]); }
587  if( meEERecHitSimHitRatio13_ != 0 && sc == 13 ) { meEERecHitSimHitRatio13_->Fill(myRecHit->energy()/eeSimMap[EEid.rawId()]); }
588  }
589 
590  int flag = myRecHit->recoFlag();
591  if( meEERecHitFlags_ != 0 ) meEERecHitFlags_->Fill( flag );
593  meEERecHitSimHitvsSimHitFlag5_6_->Fill( myRecHit->energy()/eeSimMap[EEid.rawId()], eeSimMap[EEid.rawId()] );
595  meEERecHitSimHitFlag6_->Fill( myRecHit->energy()/eeSimMap[EEid.rawId()] );
597  meEERecHitSimHitFlag6_->Fill( myRecHit->energy()/eeSimMap[EEid.rawId()] );
598 
599  if (EEid.zside() > 0) {
601  meEERecHitsOccupancyPlusFlag5_6_ ->Fill(EEid.ix(), EEid.iy());
603  meEERecHitsOccupancyPlusFlag8_9_ ->Fill(EEid.ix(), EEid.iy());
604  }
605  if (EEid.zside() < 0) {
607  meEERecHitsOccupancyMinusFlag5_6_ ->Fill(EEid.ix(), EEid.iy());
609  meEERecHitsOccupancyMinusFlag8_9_ ->Fill(EEid.ix(), EEid.iy());
610  }
611  }
612  }
613  else
614  continue;
615  } // loop over the UncalibratedechitCollection
616 
617  // RecHits matrix
618  uint32_t eecenterid = getUnitWithMaxEnergy(eeRecMap);
619  EEDetId myEEid(eecenterid);
620  int bx = myEEid.ix();
621  int by = myEEid.iy();
622  int bz = myEEid.zside();
623  findEndcapMatrix(5,5,bx,by,bz,eeRecMap);
624  double e5x5rec = 0.;
625  double e5x5sim = 0.;
626  for ( unsigned int i = 0; i < crystalMatrix.size(); i++ ) {
627  e5x5rec += eeRecMap[crystalMatrix[i]];
628  e5x5sim += eeSimMap[crystalMatrix[i]];
629  if( eeRecMap[crystalMatrix[i]] > 0 ) {
630  int log10i25 = int( ( log10( eeRecMap[crystalMatrix[i]] ) + 5. ) * 10. );
631  if( log10i25 >=0 && log10i25 < eecSize ) eecontr25[ log10i25 ] += eeRecMap[crystalMatrix[i]];
632  }
633  }
634 
635  if( meEEe5x5_ ) meEEe5x5_->Fill(e5x5rec);
636  if ( e5x5sim > 0. && meEEe5x5OverSimHits_ ) meEEe5x5OverSimHits_->Fill(e5x5rec/e5x5sim);
637  if ( eGun > 0. && meEEe5x5OverGun_ ) meEEe5x5OverGun_->Fill(e5x5rec/eGun);
638 
639 
640  if( meEERecHitLog10EnergyContr_ && eetotal != 0 ) {
641  for( int i=0; i<eecSize; i++ ) {
642  meEERecHitLog10EnergyContr_->Fill( -5.+(float(i)+0.5)/10., eecontr[i]/eetotal );
643  }
644  }
645 
646  if( meEERecHitLog10Energy5x5Contr_ && e5x5rec != 0 ) {
647  for( int i=0; i<eecSize; i++ ) {
648  meEERecHitLog10Energy5x5Contr_->Fill( -5.+(float(i)+0.5)/10., eecontr25[i]/e5x5rec );
649  }
650  }
651  }
652 
653  // -------------------------------------------------------------------
654  // PRESHOWER
655 
656  if ( ! skipPreshower ) {
657 
658  // 1) loop over simHits
659  e.getByToken(ESHits_Token_,crossingFrame);
660  std::auto_ptr<MixCollection<PCaloHit> >
661  preshowerHits (new MixCollection<PCaloHit>(crossingFrame.product ()));
662 
663  MapType esSimMap;
664  const int escSize = 90;
665  double escontr[escSize];
666  for( int i=0; i<escSize; i++ ) { escontr[i] = 0.0; }
667  double estotal = 0.;
668 
669 
670  for (MixCollection<PCaloHit>::MixItr hitItr = preshowerHits->begin(); hitItr != preshowerHits->end(); ++hitItr) {
671  ESDetId esid = ESDetId(hitItr->id()) ;
672 
673  LogDebug("Preshower, HitInfo")
674  <<" CaloHit " << hitItr->getName() << " DetID = " << hitItr->id() << "\n"
675  << "Energy = " << hitItr->energy() << " Time = " << hitItr->time() << "\n"
676  << "ESDetId strip " << esid.strip() << " = " << esid.six() << " " << esid.siy();
677 
678  uint32_t crystid = esid.rawId();
679  esSimMap[crystid] += hitItr->energy();
680  }
681 
682 
683  // 2) loop over RecHits
684  for (EcalRecHitCollection::const_iterator recHit = ESRecHit->begin(); recHit != ESRecHit->end(); ++recHit) {
685  ESDetId ESid = ESDetId(recHit->id());
686  if ( esSimMap[ESid.rawId()] != 0. ) {
687 
688  // Fill log10(Energy) stuff...
689  estotal += recHit->energy();
690  if( recHit->energy() > 0 ) {
691  if( meESRecHitLog10Energy_ ) meESRecHitLog10Energy_->Fill( log10( recHit->energy() ) );
692  int log10i = int( ( log10( recHit->energy() ) + 5. ) * 10. );
693  if( log10i >=0 and log10i < escSize ) escontr[ log10i ] += recHit->energy();
694  }
695 
696  if (meESRecHitSimHitRatio_) {
697  meESRecHitSimHitRatio_ ->Fill(recHit->energy()/esSimMap[ESid.rawId()]);
698  }
699  }
700  else
701  continue;
702  } // loop over the RechitCollection
703 
704  if( meESRecHitLog10EnergyContr_ && estotal != 0 ) {
705  for( int i=0; i<escSize; i++ ) {
706  meESRecHitLog10EnergyContr_->Fill( -5.+(float(i)+0.5)/10., escontr[i]/estotal );
707  }
708  }
709 
710 
711  }
712 
713 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
MonitorElement * meEERecHitsOccupancyPlusFlag5_6_
MonitorElement * meEBRecHitSimHitRatio13_
EventNumber_t event() const
Definition: EventID.h:41
int i
Definition: DBlmapReader.cc:9
int strip() const
Definition: ESDetId.h:52
MonitorElement * meEBRecHitLog10Energy5x5Contr_
MonitorElement * meEBRecHitSimHitRatio1011_
int ix() const
Definition: EEDetId.h:76
MonitorElement * meEBRecHitSimHitFlag7_
MonitorElement * meEBRecHitSimHitRatio12_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
MonitorElement * meEERecHitSimHitRatio12_
Code getStatusCode() const
return decoded status
std::vector< EcalUncalibratedRecHit >::const_iterator const_iterator
int six() const
Definition: ESDetId.h:48
MonitorElement * meEERecHitsOccupancyMinusFlag5_6_
edm::EDGetTokenT< ESRecHitCollection > ESrechitCollection_Token_
MonitorElement * meEERecHitSimHitRatio13_
MonitorElement * meEBe5x5OverSimHits_
uint32_t getUnitWithMaxEnergy(MapType &themap)
MonitorElement * meEBRecHitSimHitFlag6_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
MonitorElement * meEB5x5RecHitSimHitvsSimHitFlag8_
void Fill(long long x)
edm::EDGetTokenT< EERecHitCollection > EErechitCollection_Token_
int iphi() const
get the crystal iphi
Definition: EBDetId.h:53
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
MonitorElement * meEBUnRecHitSimHitRatio_
int siy() const
Definition: ESDetId.h:50
MonitorElement * meEBRecHitLog10EnergyContr_
void findEndcapMatrix(int nCellInX, int nCellInY, int CentralX, int CentralY, int CentralZ, MapType &themap)
MonitorElement * meEBRecHitsOccupancyFlag8_9_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * meEERecHitLog10EnergyContr_
int zside() const
Definition: EEDetId.h:70
MonitorElement * meEERecHitsOccupancyMinusFlag8_9_
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * meEERecHitFlags_
int iy() const
Definition: EEDetId.h:82
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
Definition: EBDetId.h:59
int ieta() const
get the crystal ieta
Definition: EBDetId.h:51
MonitorElement * meEERecHitSimHitFlag6_
bool isValid() const
Definition: HandleBase.h:75
MonitorElement * meEEUnRecHitSimHitRatioGt35_
std::vector< DetId > constituentsOf(const EcalTrigTowerDetId &id) const
Get the constituent detids for this tower id.
MonitorElement * meEEUnRecHitSimHitRatio_
#define M_PI
MonitorElement * meEERecHitSimHitRatioGt35_
MonitorElement * meEERecHitSimHitFlag7_
const_iterator end() const
MonitorElement * meEBRecHitSimHitRatioGt35_
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_Token_
edm::EDGetTokenT< EBRecHitCollection > EBrechitCollection_Token_
MonitorElement * meESRecHitLog10Energy_
T const * product() const
Definition: Handle.h:81
MonitorElement * meEBRecHitSimHitvsSimHitFlag5_6_
const T & get() const
Definition: EventSetup.h:55
std::vector< Item >::const_iterator const_iterator
T const * product() const
Definition: ESHandle.h:86
MonitorElement * meEERecHitSimHitvsSimHitFlag5_6_
MonitorElement * meEBRecHitFlags_
MonitorElement * meEERecHitLog10Energy_
MonitorElement * meEBRecHitLog10Energy_
edm::EDGetTokenT< EBUncalibratedRecHitCollection > EBuncalibrechitCollection_Token_
edm::EventID id() const
Definition: EventBase.h:60
iterator find(key_type k)
MonitorElement * meEBUnRecHitSimHitRatioGt35_
void findBarrelMatrix(int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &themap)
std::vector< uint32_t > crystalMatrix
MonitorElement * meEERecHitLog10Energy5x5Contr_
MonitorElement * meESRecHitLog10EnergyContr_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
const_iterator find(uint32_t rawId) const
const_iterator end() const
MonitorElement * meEERecHitsOccupancyPlusFlag8_9_
std::map< uint32_t, float, std::less< uint32_t > > MapType
MonitorElement * meESRecHitSimHitRatio_
MonitorElement * meEBRecHitSimHitRatio_
MonitorElement * meEBRecHitsOccupancyFlag5_6_
bool isValid() const
Definition: ESHandle.h:47
MonitorElement * meEEe5x5OverGun_
MonitorElement * meEERecHitSimHitRatio1011_
MonitorElement * meEEe5x5OverSimHits_
edm::EDGetTokenT< edm::HepMCProduct > HepMCLabel_Token_
MonitorElement * meEBe5x5OverGun_
const_iterator begin() const
MonitorElement * meEERecHitSimHitRatio_
tuple log
Definition: cmsBatch.py:347
void EcalRecHitsValidation::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 258 of file EcalRecHitsValidation.cc.

258  {
259 
260 }
void EcalRecHitsValidation::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 262 of file EcalRecHitsValidation.cc.

262  {
263 
264 }
void EcalRecHitsValidation::findBarrelMatrix ( int  nCellInEta,
int  nCellInPhi,
int  CentralEta,
int  CentralPhi,
int  CentralZ,
MapType themap 
)
protected

Definition at line 734 of file EcalRecHitsValidation.cc.

References funct::abs(), i, cmsHarvester::index, and DetId::rawId().

736  {
737 
738  int goBackInEta = nCellInEta/2;
739  int goBackInPhi = nCellInPhi/2;
740  int matrixSize = nCellInEta*nCellInPhi;
741  crystalMatrix.clear();
742  crystalMatrix.resize(matrixSize);
743 
744  int startEta = CentralZ*CentralEta - goBackInEta;
745  int startPhi = CentralPhi - goBackInPhi;
746 
747  int i = 0 ;
748  for ( int ieta = startEta; ieta < startEta+nCellInEta; ieta ++ ) {
749  for( int iphi = startPhi; iphi < startPhi + nCellInPhi; iphi++ ) {
750  uint32_t index;
751  if (abs(ieta) > 85 || abs(ieta)<1 ) { continue; }
752  if (iphi< 1) { index = EBDetId(ieta,iphi+360).rawId(); }
753  else if(iphi>360) { index = EBDetId(ieta,iphi-360).rawId(); }
754  else { index = EBDetId(ieta,iphi).rawId(); }
755  crystalMatrix[i++] = index;
756  }
757  }
758 
759 }
int i
Definition: DBlmapReader.cc:9
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< uint32_t > crystalMatrix
void EcalRecHitsValidation::findEndcapMatrix ( int  nCellInX,
int  nCellInY,
int  CentralX,
int  CentralY,
int  CentralZ,
MapType themap 
)
protected

Definition at line 761 of file EcalRecHitsValidation.cc.

References cmsHarvester::index, DetId::rawId(), and EEDetId::validDetId().

763  {
764  int goBackInX = nCellInX/2;
765  int goBackInY = nCellInY/2;
766  crystalMatrix.clear();
767 
768  int startX = CentralX - goBackInX;
769  int startY = CentralY - goBackInY;
770 
771  for ( int ix = startX; ix < startX+nCellInX; ix ++ ) {
772 
773  for( int iy = startY; iy < startY + nCellInY; iy++ ) {
774 
775  uint32_t index ;
776 
777  if(EEDetId::validDetId(ix,iy,CentralZ)) {
778  index = EEDetId(ix,iy,CentralZ).rawId();
779  }
780  else { continue; }
781  crystalMatrix.push_back(index);
782  }
783  }
784 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
std::vector< uint32_t > crystalMatrix
uint32_t EcalRecHitsValidation::getUnitWithMaxEnergy ( MapType themap)
protected

Definition at line 716 of file EcalRecHitsValidation.cc.

References getDQMSummary::iter.

716  {
717 
718  //look for max
719  uint32_t unitWithMaxEnergy = 0;
720  float maxEnergy = 0.;
721 
722  MapType::iterator iter;
723  for (iter = themap.begin(); iter != themap.end(); iter++) {
724 
725  if (maxEnergy < (*iter).second) {
726  maxEnergy = (*iter).second;
727  unitWithMaxEnergy = (*iter).first;
728  }
729  }
730 
731  return unitWithMaxEnergy;
732 }

Member Data Documentation

std::vector<uint32_t> EcalRecHitsValidation::crystalMatrix
private

Definition at line 154 of file EcalRecHitsValidation.h.

DQMStore* EcalRecHitsValidation::dbe_
private

Definition at line 81 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<CrossingFrame<PCaloHit> > EcalRecHitsValidation::EBHits_Token_
private

Definition at line 97 of file EcalRecHitsValidation.h.

edm::InputTag EcalRecHitsValidation::EBrechitCollection_
private

Definition at line 85 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<EBRecHitCollection> EcalRecHitsValidation::EBrechitCollection_Token_
private

Definition at line 92 of file EcalRecHitsValidation.h.

edm::InputTag EcalRecHitsValidation::EBuncalibrechitCollection_
private

Definition at line 88 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<EBUncalibratedRecHitCollection> EcalRecHitsValidation::EBuncalibrechitCollection_Token_
private

Definition at line 95 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<CrossingFrame<PCaloHit> > EcalRecHitsValidation::EEHits_Token_
private

Definition at line 98 of file EcalRecHitsValidation.h.

edm::InputTag EcalRecHitsValidation::EErechitCollection_
private

Definition at line 86 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<EERecHitCollection> EcalRecHitsValidation::EErechitCollection_Token_
private

Definition at line 93 of file EcalRecHitsValidation.h.

edm::InputTag EcalRecHitsValidation::EEuncalibrechitCollection_
private

Definition at line 89 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<EEUncalibratedRecHitCollection> EcalRecHitsValidation::EEuncalibrechitCollection_Token_
private

Definition at line 96 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<CrossingFrame<PCaloHit> > EcalRecHitsValidation::ESHits_Token_
private

Definition at line 99 of file EcalRecHitsValidation.h.

edm::InputTag EcalRecHitsValidation::ESrechitCollection_
private

Definition at line 87 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<ESRecHitCollection> EcalRecHitsValidation::ESrechitCollection_Token_
private

Definition at line 94 of file EcalRecHitsValidation.h.

std::string EcalRecHitsValidation::HepMCLabel
private

Definition at line 76 of file EcalRecHitsValidation.h.

edm::EDGetTokenT<edm::HepMCProduct> EcalRecHitsValidation::HepMCLabel_Token_
private

Definition at line 91 of file EcalRecHitsValidation.h.

std::string EcalRecHitsValidation::hitsProducer_
private

Definition at line 77 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEB5x5RecHitSimHitvsSimHitFlag8_
private

Definition at line 147 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBe5x5_
private

Definition at line 119 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBe5x5OverGun_
private

Definition at line 121 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBe5x5OverSimHits_
private

Definition at line 120 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitFlags_
private

Definition at line 143 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitLog10Energy5x5Contr_
private

Definition at line 132 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitLog10Energy_
private

Definition at line 126 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitLog10EnergyContr_
private

Definition at line 129 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitFlag6_
private

Definition at line 145 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitFlag7_
private

Definition at line 146 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitRatio1011_
private

Definition at line 107 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitRatio12_
private

Definition at line 109 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitRatio13_
private

Definition at line 111 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitRatio_
private

Definition at line 104 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitRatioGt35_
private

Definition at line 113 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitSimHitvsSimHitFlag5_6_
private

Definition at line 144 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitsOccupancyFlag5_6_
private

Definition at line 135 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBRecHitsOccupancyFlag8_9_
private

Definition at line 136 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBUnRecHitSimHitRatio_
private

Definition at line 115 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEBUnRecHitSimHitRatioGt35_
private

Definition at line 117 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEEe5x5_
private

Definition at line 122 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEEe5x5OverGun_
private

Definition at line 124 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEEe5x5OverSimHits_
private

Definition at line 123 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitFlags_
private

Definition at line 149 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitLog10Energy5x5Contr_
private

Definition at line 133 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitLog10Energy_
private

Definition at line 127 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitLog10EnergyContr_
private

Definition at line 130 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitFlag6_
private

Definition at line 151 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitFlag7_
private

Definition at line 152 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitRatio1011_
private

Definition at line 108 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitRatio12_
private

Definition at line 110 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitRatio13_
private

Definition at line 112 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitRatio_
private

Definition at line 105 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitRatioGt35_
private

Definition at line 114 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitSimHitvsSimHitFlag5_6_
private

Definition at line 150 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitsOccupancyMinusFlag5_6_
private

Definition at line 139 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitsOccupancyMinusFlag8_9_
private

Definition at line 141 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitsOccupancyPlusFlag5_6_
private

Definition at line 138 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEERecHitsOccupancyPlusFlag8_9_
private

Definition at line 140 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEEUnRecHitSimHitRatio_
private

Definition at line 116 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meEEUnRecHitSimHitRatioGt35_
private

Definition at line 118 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meESRecHitLog10Energy_
private

Definition at line 128 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meESRecHitLog10EnergyContr_
private

Definition at line 131 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meESRecHitSimHitRatio_
private

Definition at line 106 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meGunEnergy_
private

Definition at line 101 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meGunEta_
private

Definition at line 102 of file EcalRecHitsValidation.h.

MonitorElement* EcalRecHitsValidation::meGunPhi_
private

Definition at line 103 of file EcalRecHitsValidation.h.

std::string EcalRecHitsValidation::outputFile_
private

Definition at line 83 of file EcalRecHitsValidation.h.

bool EcalRecHitsValidation::verbose_
private

Definition at line 79 of file EcalRecHitsValidation.h.