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

Public Member Functions

 EcalBarrelRecHitsValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~EcalBarrelRecHitsValidation ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

DQMStoredbe_
 
edm::InputTag EBdigiCollection_
 
edm::InputTag EBuncalibrechitCollection_
 
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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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 38 of file EcalBarrelRecHitsValidation.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 17 of file EcalBarrelRecHitsValidation.cc.

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

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

Destructor.

Definition at line 124 of file EcalBarrelRecHitsValidation.cc.

124  {
125 
126 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 136 of file EcalBarrelRecHitsValidation.cc.

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

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 132 of file EcalBarrelRecHitsValidation.cc.

132  {
133 
134 }

Member Data Documentation

DQMStore* EcalBarrelRecHitsValidation::dbe_
private

Definition at line 63 of file EcalBarrelRecHitsValidation.h.

edm::InputTag EcalBarrelRecHitsValidation::EBdigiCollection_
private

Definition at line 65 of file EcalBarrelRecHitsValidation.h.

edm::InputTag EcalBarrelRecHitsValidation::EBuncalibrechitCollection_
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 61 of file EcalBarrelRecHitsValidation.h.