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
EcalBarrelRecHitsValidation Class Reference

#include <EcalBarrelRecHitsValidation.h>

Inheritance diagram for EcalBarrelRecHitsValidation:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EcalBarrelRecHitsValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~EcalBarrelRecHitsValidation ()
 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
< EBDigiCollection
EBdigiCollection_token_
 
edm::EDGetTokenT
< EBUncalibratedRecHitCollection
EBuncalibrechitCollection_token_
 
MonitorElementmeEBUncalibRecHitAmplMap_ [36]
 
MonitorElementmeEBUncalibRecHitMaxSampleRatio_
 
MonitorElementmeEBUncalibRecHitMaxSampleRatioGt100adc_
 
MonitorElementmeEBUncalibRecHitPedMap_ [36]
 
MonitorElementmeEBUncalibRecHitsAmpFullMap_
 
MonitorElementmeEBUncalibRecHitsAmplitude_
 
MonitorElementmeEBUncalibRecHitsAmplitudeGt100adc_
 
MonitorElementmeEBUncalibRecHitsChi2_
 
MonitorElementmeEBUncalibRecHitsChi2Gt100adc_
 
MonitorElementmeEBUncalibRecHitsJitter_
 
MonitorElementmeEBUncalibRecHitsJitterGt100adc_
 
MonitorElementmeEBUncalibRecHitsOccupancy_
 
MonitorElementmeEBUncalibRecHitsOccupancyGt100adc_
 
MonitorElementmeEBUncalibRecHitsPedestal_
 
MonitorElementmeEBUncalibRecHitsPedestalGt100adc_
 
MonitorElementmeEBUncalibRecHitsPedFullMap_
 
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 37 of file EcalBarrelRecHitsValidation.h.

Constructor & Destructor Documentation

EcalBarrelRecHitsValidation::EcalBarrelRecHitsValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 16 of file EcalBarrelRecHitsValidation.cc.

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

16  {
17 
18  // ----------------------
19  EBdigiCollection_token_ = consumes< EBDigiCollection > (ps.getParameter<edm::InputTag>("EBdigiCollection") );
20  EBuncalibrechitCollection_token_ = consumes< EBUncalibratedRecHitCollection > (ps.getParameter<edm::InputTag>("EBuncalibrechitCollection") );
21 
22  // ----------------------
23  // verbosity switch
24  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
25 
26  // ----------------------
27  // get hold of back-end interface
28  dbe_ = 0;
30  if ( dbe_ ) {
31  if ( verbose_ ) {
32  dbe_->setVerbose(1);
33  } else {
34  dbe_->setVerbose(0);
35  }
36  }
37  if ( dbe_ ) {
38  if ( verbose_ ) dbe_->showDirStructure();
39  }
40 
41 
42  // ----------------------
57  for (int i=0; i<36 ; i++)
58  {
61  }
62 
63  // ----------------------
64  Char_t histo[200];
65 
66  if ( dbe_ )
67  {
68  dbe_->setCurrentFolder("EcalRecHitsV/EcalBarrelRecHitsTask");
69 
70  sprintf (histo, "EB Occupancy" );
71  meEBUncalibRecHitsOccupancy_ = dbe_->book2D(histo, histo, 170, -85., 85., 360, 0., 360.);
72 
73  sprintf (histo, "EB Amplitude" );
74  meEBUncalibRecHitsAmplitude_ = dbe_->book1D(histo, histo, 201, -20., 4000.);
75 
76  sprintf (histo, "EB Pedestal" );
77  meEBUncalibRecHitsPedestal_ = dbe_->book1D(histo, histo, 50, 190., 210.);
78 
79  sprintf (histo, "EB Jitter" );
80  meEBUncalibRecHitsJitter_ = dbe_->book1D(histo, histo, 100, 0., 100.);
81 
82  sprintf (histo, "EB Chi2" );
83  meEBUncalibRecHitsChi2_ = dbe_->book1D(histo, histo, 100, 18000., 22000.);
84 
85  sprintf (histo, "EB RecHit Max Sample Ratio");
86  meEBUncalibRecHitMaxSampleRatio_ = dbe_->book1D(histo, histo, 120, 0.90, 1.05);
87 
88  sprintf (histo, "EB Occupancy gt 100 adc counts" );
89  meEBUncalibRecHitsOccupancyGt100adc_ = dbe_->book2D(histo, histo, 170, -85., 85., 360, 0., 360.);
90 
91  sprintf (histo, "EB Amplitude gt 100 adc counts" );
92  meEBUncalibRecHitsAmplitudeGt100adc_ = dbe_->book1D(histo, histo, 200, 0., 4000.);
93 
94  sprintf (histo, "EB Pedestal gt 100 adc counts" );
95  meEBUncalibRecHitsPedestalGt100adc_ = dbe_->book1D(histo, histo, 50, 190., 210.);
96 
97  sprintf (histo, "EB Jitter gt 100 adc counts" );
98  meEBUncalibRecHitsJitterGt100adc_ = dbe_->book1D(histo, histo, 100, 0., 100.);
99 
100  sprintf (histo, "EB Chi2 gt 100 adc counts" );
101  meEBUncalibRecHitsChi2Gt100adc_ = dbe_->book1D(histo, histo, 100, 18000., 22000.);
102 
103  sprintf (histo, "EB RecHit Max Sample Ratio gt 100 adc counts");
104  meEBUncalibRecHitMaxSampleRatioGt100adc_ = dbe_->book1D(histo, histo, 120, 0.90, 1.05);
105 
106  sprintf (histo, "EB Amplitude Full Map");
107  meEBUncalibRecHitsAmpFullMap_ = dbe_->bookProfile2D(histo, histo, 170, -85., 85., 360, 0., 360., 200, 0., 4000.);
108 
109  sprintf (histo, "EB Pedestal Full Map");
110  meEBUncalibRecHitsPedFullMap_ = dbe_->bookProfile2D(histo, histo, 170, -85., 85., 360, 0., 360., 50, 194., 201.);
111 
112  for (int i=0; i<36 ; i++)
113  {
114  sprintf(histo, "EB Amp SM%02d", i+1);
115  meEBUncalibRecHitAmplMap_[i] = dbe_->bookProfile2D(histo, histo, 85, 0., 85., 20, 0., 20., 200, 0., 4000.);
116 
117  sprintf(histo, "EB Ped SM%02d", i+1);
118  meEBUncalibRecHitPedMap_[i] = dbe_->bookProfile2D(histo, histo, 85, 0., 85., 20, 0., 20., 50, 194., 201.);
119  }
120  }
121 }
MonitorElement * meEBUncalibRecHitsOccupancyGt100adc_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
edm::EDGetTokenT< EBDigiCollection > EBdigiCollection_token_
MonitorElement * meEBUncalibRecHitAmplMap_[36]
MonitorElement * meEBUncalibRecHitPedMap_[36]
MonitorElement * meEBUncalibRecHitsAmplitudeGt100adc_
void setVerbose(unsigned level)
Definition: DQMStore.cc:631
MonitorElement * meEBUncalibRecHitMaxSampleRatioGt100adc_
void showDirStructure(void) const
Definition: DQMStore.cc:3332
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:1082
edm::EDGetTokenT< EBUncalibratedRecHitCollection > EBuncalibrechitCollection_token_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
MonitorElement * meEBUncalibRecHitsPedestalGt100adc_
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1412
EcalBarrelRecHitsValidation::~EcalBarrelRecHitsValidation ( )

Destructor.

Definition at line 123 of file EcalBarrelRecHitsValidation.cc.

123  {
124 
125 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 135 of file EcalBarrelRecHitsValidation.cc.

References EcalMGPASample::adc(), edm::SortedCollection< T, SORT >::begin(), EcalCondObjectContainer< T >::end(), edm::SortedCollection< T, SORT >::end(), edm::DataFrameContainer::end(), HcalObjRepresent::Fill(), EcalCondObjectContainer< T >::find(), edm::DataFrameContainer::find(), edm::EventSetup::get(), edm::Event::getByToken(), EcalCondObjectContainer< T >::getMap(), EBDetId::ic(), EBDetId::ieta(), EBDetId::iphi(), ecalpyutils::ism(), EBDetId::ism(), edm::HandleBase::isValid(), LogDebug, edm::Handle< T >::product(), edm::ESHandle< class >::product(), and compare_using_db::sample.

135  {
136 
137 
138  const EBUncalibratedRecHitCollection *EBUncalibRecHit = 0;
139  Handle< EBUncalibratedRecHitCollection > EcalUncalibRecHitEB;
140  e.getByToken( EBuncalibrechitCollection_token_, EcalUncalibRecHitEB);
141  if (EcalUncalibRecHitEB.isValid()) {
142  EBUncalibRecHit = EcalUncalibRecHitEB.product();
143  } else {
144  return;
145  }
146 
147  bool skipDigis = false;
148  const EBDigiCollection *EBDigi = 0;
149  Handle< EBDigiCollection > EcalDigiEB;
150  e.getByToken( EBdigiCollection_token_, EcalDigiEB);
151  if (EcalDigiEB.isValid()) {
152  EBDigi = EcalDigiEB.product();
153  } else {
154  skipDigis = true;
155  }
156 
158  c.get<EcalPedestalsRcd>().get(ecalPeds);
159 
160  // ----------------------
161  // loop over UncalibRecHits
162  for (EcalUncalibratedRecHitCollection::const_iterator uncalibRecHit = EBUncalibRecHit->begin(); uncalibRecHit != EBUncalibRecHit->end() ; ++uncalibRecHit)
163  {
164  EBDetId EBid = EBDetId(uncalibRecHit->id());
165 
166  // general checks
168  if (meEBUncalibRecHitsAmplitude_) meEBUncalibRecHitsAmplitude_ -> Fill(uncalibRecHit->amplitude());
169  if (meEBUncalibRecHitsPedestal_) meEBUncalibRecHitsPedestal_ -> Fill(uncalibRecHit->pedestal());
170  if (meEBUncalibRecHitsJitter_) meEBUncalibRecHitsJitter_ -> Fill(uncalibRecHit->jitter());
171  if (meEBUncalibRecHitsChi2_) meEBUncalibRecHitsChi2_ -> Fill(uncalibRecHit->chi2());
172  if (meEBUncalibRecHitsAmpFullMap_) meEBUncalibRecHitsAmpFullMap_ -> Fill(EBid.ieta(), EBid.iphi(), uncalibRecHit->amplitude());
173  if (meEBUncalibRecHitsPedFullMap_) meEBUncalibRecHitsPedFullMap_ -> Fill(EBid.ieta(), EBid.iphi(), uncalibRecHit->pedestal());
174 
175  // general checks, with threshold at 3.5 GeV = 100 ADC counts
176  if ( uncalibRecHit->amplitude() > 100 )
177  {
183  }
184 
185  // supermodule maps
186  int ic = EBid.ic();
187  int ie = (ic-1)/20 + 1;
188  int ip = (ic-1)%20 + 1;
189  int ism = EBid.ism();
190  float xie = ie - 0.5;
191  float xip = ip - 0.5;
192  if( meEBUncalibRecHitPedMap_[ism-1] ) meEBUncalibRecHitPedMap_[ism-1]->Fill(xie, xip, uncalibRecHit->pedestal());
193  if( meEBUncalibRecHitAmplMap_[ism-1] ) meEBUncalibRecHitAmplMap_[ism-1]->Fill(xie, xip, uncalibRecHit->amplitude());
194 
195  if ( ! skipDigis ) {
196  // find the rechit corresponding digi and the max sample
197  EBDigiCollection::const_iterator myDigi = EBDigi->find(EBid);
198  // int sMax = -1; // UNUSED
199  double eMax = 0.;
200  if (myDigi != EBDigi->end()){
201  for (unsigned int sample = 0 ; sample < myDigi->size(); ++sample){
202  EcalMGPASample thisSample = (*myDigi)[sample];
203  double analogSample = thisSample.adc();
204  if ( eMax < analogSample ){
205  eMax = analogSample;
206  // sMax = sample; // UNUSED
207  }
208  }
209  }
210  else
211  continue;
212 
213  // ratio uncalibratedRecHit amplitude + ped / max energy digi
214  const EcalPedestals* myped = ecalPeds.product();
215  EcalPedestalsMap::const_iterator it=myped->getMap().find( EBid );
216  if( it != myped->getMap().end() ){
217 
218  if (eMax > (*it).mean_x1 + 5 * (*it).rms_x1 && eMax != 0 ) {//only real signal RecHit
219 
220  if ( meEBUncalibRecHitMaxSampleRatio_ ) meEBUncalibRecHitMaxSampleRatio_->Fill( (uncalibRecHit->amplitude()+uncalibRecHit->pedestal())/eMax);
221  if ( meEBUncalibRecHitMaxSampleRatioGt100adc_ && (uncalibRecHit->amplitude()>100) ) meEBUncalibRecHitMaxSampleRatioGt100adc_->Fill( (uncalibRecHit->amplitude()+uncalibRecHit->pedestal())/eMax);
222  LogDebug("EcalRecHitsTaskInfo") << "barrel, eMax = " << eMax << " Amplitude = " << uncalibRecHit->amplitude()+uncalibRecHit->pedestal();
223  }
224  else
225  continue;
226  }
227  else
228  continue;
229  }
230 
231  } // loop over the UncalibratedRecHitCollection
232 }
#define LogDebug(id)
MonitorElement * meEBUncalibRecHitsOccupancyGt100adc_
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
const self & getMap() const
std::vector< EcalUncalibratedRecHit >::const_iterator const_iterator
int ism() const
get the ECAL/SM id
Definition: EBDetId.h:61
void Fill(long long x)
int iphi() const
get the crystal iphi
Definition: EBDetId.h:53
const_iterator find(id_type i) const
edm::EDGetTokenT< EBDigiCollection > EBdigiCollection_token_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * meEBUncalibRecHitAmplMap_[36]
MonitorElement * meEBUncalibRecHitPedMap_[36]
MonitorElement * meEBUncalibRecHitsAmplitudeGt100adc_
int ieta() const
get the crystal ieta
Definition: EBDetId.h:51
bool isValid() const
Definition: HandleBase.h:76
int ic() const
get ECAL/crystal number inside SM
Definition: EBDetId.cc:46
const_iterator end() const
const T & get() const
Definition: EventSetup.h:55
std::vector< Item >::const_iterator const_iterator
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:81
const_iterator end() const
const_iterator find(uint32_t rawId) const
const_iterator end() const
MonitorElement * meEBUncalibRecHitMaxSampleRatioGt100adc_
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
edm::EDGetTokenT< EBUncalibratedRecHitCollection > EBuncalibrechitCollection_token_
const_iterator begin() const
MonitorElement * meEBUncalibRecHitsPedestalGt100adc_
int adc() const
get the ADC sample (12 bits)
void EcalBarrelRecHitsValidation::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 127 of file EcalBarrelRecHitsValidation.cc.

127  {
128 
129 }
void EcalBarrelRecHitsValidation::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 131 of file EcalBarrelRecHitsValidation.cc.

131  {
132 
133 }

Member Data Documentation

DQMStore* EcalBarrelRecHitsValidation::dbe_
private

Definition at line 62 of file EcalBarrelRecHitsValidation.h.

edm::EDGetTokenT< EBDigiCollection > EcalBarrelRecHitsValidation::EBdigiCollection_token_
private

Definition at line 65 of file EcalBarrelRecHitsValidation.h.

edm::EDGetTokenT< EBUncalibratedRecHitCollection > EcalBarrelRecHitsValidation::EBuncalibrechitCollection_token_
private

Definition at line 66 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitAmplMap_[36]
private

Definition at line 82 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitMaxSampleRatio_
private

Definition at line 73 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitMaxSampleRatioGt100adc_
private

Definition at line 79 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitPedMap_[36]
private

Definition at line 83 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsAmpFullMap_
private

Definition at line 80 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsAmplitude_
private

Definition at line 69 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsAmplitudeGt100adc_
private

Definition at line 75 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsChi2_
private

Definition at line 72 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsChi2Gt100adc_
private

Definition at line 78 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsJitter_
private

Definition at line 71 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsJitterGt100adc_
private

Definition at line 77 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsOccupancy_
private

Definition at line 68 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsOccupancyGt100adc_
private

Definition at line 74 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsPedestal_
private

Definition at line 70 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsPedestalGt100adc_
private

Definition at line 76 of file EcalBarrelRecHitsValidation.h.

MonitorElement* EcalBarrelRecHitsValidation::meEBUncalibRecHitsPedFullMap_
private

Definition at line 81 of file EcalBarrelRecHitsValidation.h.

bool EcalBarrelRecHitsValidation::verbose_
private

Definition at line 60 of file EcalBarrelRecHitsValidation.h.