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

#include <EcalEndcapRecHitsValidation.h>

Inheritance diagram for EcalEndcapRecHitsValidation:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EcalEndcapRecHitsValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~EcalEndcapRecHitsValidation ()
 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)
 
- 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
< EEDigiCollection
EEdigiCollection_token_
 
edm::EDGetTokenT
< EEUncalibratedRecHitCollection
EEuncalibrechitCollection_token_
 
MonitorElementmeEEUncalibRecHitMaxSampleRatio_
 
MonitorElementmeEEUncalibRecHitMaxSampleRatioGt60adc_
 
MonitorElementmeEEUncalibRecHitsAmpFullMap_
 
MonitorElementmeEEUncalibRecHitsAmplitude_
 
MonitorElementmeEEUncalibRecHitsAmplitudeGt60adc_
 
MonitorElementmeEEUncalibRecHitsChi2_
 
MonitorElementmeEEUncalibRecHitsChi2Gt60adc_
 
MonitorElementmeEEUncalibRecHitsJitter_
 
MonitorElementmeEEUncalibRecHitsJitterGt60adc_
 
MonitorElementmeEEUncalibRecHitsOccupancyMinus_
 
MonitorElementmeEEUncalibRecHitsOccupancyMinusGt60adc_
 
MonitorElementmeEEUncalibRecHitsOccupancyPlus_
 
MonitorElementmeEEUncalibRecHitsOccupancyPlusGt60adc_
 
MonitorElementmeEEUncalibRecHitsPedestal_
 
MonitorElementmeEEUncalibRecHitsPedestalGt60adc_
 
MonitorElementmeEEUncalibRecHitsPedFullMap_
 
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 EcalEndcapRecHitsValidation.h.

Constructor & Destructor Documentation

EcalEndcapRecHitsValidation::EcalEndcapRecHitsValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 16 of file EcalEndcapRecHitsValidation.cc.

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

16  {
17 
18  // ----------------------
19  EEdigiCollection_token_ = consumes< EEDigiCollection > (ps.getParameter<edm::InputTag>("EEdigiCollection") );
20  EEuncalibrechitCollection_token_ = consumes< EEUncalibratedRecHitCollection > (ps.getParameter<edm::InputTag>("EEuncalibrechitCollection") );
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  // ----------------------
59 
60  // ----------------------
61  Char_t histo[200];
62 
63  if ( dbe_ )
64  {
65  dbe_->setCurrentFolder("EcalRecHitsV/EcalEndcapRecHitsTask");
66 
67  sprintf (histo, "EE+ Occupancy" );
68  meEEUncalibRecHitsOccupancyPlus_ = dbe_->book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
69 
70  sprintf (histo, "EE- Occupancy" );
71  meEEUncalibRecHitsOccupancyMinus_ = dbe_->book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
72 
73  sprintf (histo, "EE Amplitude" );
74  meEEUncalibRecHitsAmplitude_ = dbe_->book1D(histo, histo, 201, -20., 4000.);
75 
76  sprintf (histo, "EE Pedestal" );
77  meEEUncalibRecHitsPedestal_ = dbe_->book1D(histo, histo, 50, 190., 210.);
78 
79  sprintf (histo, "EE Jitter" );
80  meEEUncalibRecHitsJitter_ = dbe_->book1D(histo, histo, 100, 0., 100.);
81 
82  sprintf (histo, "EE Chi2" );
83  meEEUncalibRecHitsChi2_ = dbe_->book1D(histo, histo, 100, 18000., 22000.);
84 
85  sprintf (histo, "EE RecHit Max Sample Ratio");
86  meEEUncalibRecHitMaxSampleRatio_ = dbe_->book1D(histo, histo, 120, 0.90, 1.05);
87 
88  sprintf (histo, "EE+ Occupancy gt 60 adc counts" );
89  meEEUncalibRecHitsOccupancyPlusGt60adc_ = dbe_->book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
90 
91  sprintf (histo, "EE- Occupancy gt 60 adc counts" );
92  meEEUncalibRecHitsOccupancyMinusGt60adc_ = dbe_->book2D(histo, histo, 100, 0., 100., 100, 0., 100.);
93 
94  sprintf (histo, "EE Amplitude gt 60 adc counts" );
95  meEEUncalibRecHitsAmplitudeGt60adc_ = dbe_->book1D(histo, histo, 200, 0., 4000.);
96 
97  sprintf (histo, "EE Pedestal gt 60 adc counts" );
98  meEEUncalibRecHitsPedestalGt60adc_ = dbe_->book1D(histo, histo, 50, 190., 210.);
99 
100  sprintf (histo, "EE Jitter gt 60 adc counts" );
101  meEEUncalibRecHitsJitterGt60adc_ = dbe_->book1D(histo, histo, 100, 0., 100.);
102 
103  sprintf (histo, "EE Chi2 gt 60 adc counts" );
104  meEEUncalibRecHitsChi2Gt60adc_ = dbe_->book1D(histo, histo, 100, 18000., 22000.);
105 
106  sprintf (histo, "EE RecHit Max Sample Ratio gt 60 adc counts");
107  meEEUncalibRecHitMaxSampleRatioGt60adc_ = dbe_->book1D(histo, histo, 120, 0.90, 1.05);
108 
109  sprintf (histo, "EE Amplitude Full Map");
110  meEEUncalibRecHitsAmpFullMap_ = dbe_->bookProfile2D(histo, histo, 100, 0., 100., 100, 0., 100., 200, 0., 4000.);
111 
112  sprintf (histo, "EE Pedestal Full Map");
113  meEEUncalibRecHitsPedFullMap_ = dbe_->bookProfile2D(histo, histo, 100, 0., 100., 100, 0., 100., 50, 194., 201.);
114  }
115 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meEEUncalibRecHitsOccupancyPlusGt60adc_
MonitorElement * meEEUncalibRecHitMaxSampleRatioGt60adc_
MonitorElement * meEEUncalibRecHitsOccupancyMinusGt60adc_
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_token_
edm::EDGetTokenT< EEDigiCollection > EEdigiCollection_token_
MonitorElement * meEEUncalibRecHitsAmplitudeGt60adc_
EcalEndcapRecHitsValidation::~EcalEndcapRecHitsValidation ( )

Destructor.

Definition at line 117 of file EcalEndcapRecHitsValidation.cc.

117  {
118 
119 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 129 of file EcalEndcapRecHitsValidation.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(), edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), LogDebug, edm::Handle< T >::product(), edm::ESHandle< class >::product(), compare_using_db::sample, and EEDetId::zside().

129  {
130 
131  const EEUncalibratedRecHitCollection *EEUncalibRecHit = 0;
132  Handle< EEUncalibratedRecHitCollection > EcalUncalibRecHitEE;
133  e.getByToken( EEuncalibrechitCollection_token_, EcalUncalibRecHitEE);
134  if (EcalUncalibRecHitEE.isValid()) {
135  EEUncalibRecHit = EcalUncalibRecHitEE.product() ;
136  } else {
137  return;
138  }
139 
140  bool skipDigis = false;
141  const EEDigiCollection *EEDigi = 0;
142  Handle< EEDigiCollection > EcalDigiEE;
143  e.getByToken( EEdigiCollection_token_, EcalDigiEE);
144  if (EcalDigiEE.isValid()) {
145  EEDigi = EcalDigiEE.product();
146  } else {
147  skipDigis = true;
148  }
149 
151  c.get<EcalPedestalsRcd>().get(ecalPeds);
152 
153  // ----------------------
154  // loop over UncalibRecHits
155  for (EcalUncalibratedRecHitCollection::const_iterator uncalibRecHit = EEUncalibRecHit->begin(); uncalibRecHit != EEUncalibRecHit->end() ; ++uncalibRecHit)
156  {
157  EEDetId EEid = EEDetId(uncalibRecHit->id());
158 
159  int mySide = EEid.zside();
160 
161  // general checks
162  if (mySide > 0) { if (meEEUncalibRecHitsOccupancyPlus_) meEEUncalibRecHitsOccupancyPlus_ ->Fill(EEid.ix(), EEid.iy()); }
163  if (mySide < 0) { if (meEEUncalibRecHitsOccupancyMinus_) meEEUncalibRecHitsOccupancyMinus_ ->Fill(EEid.ix(), EEid.iy()); }
164  if (meEEUncalibRecHitsAmplitude_) meEEUncalibRecHitsAmplitude_ -> Fill(uncalibRecHit->amplitude());
165  if (meEEUncalibRecHitsPedestal_) meEEUncalibRecHitsPedestal_ -> Fill(uncalibRecHit->pedestal());
166  if (meEEUncalibRecHitsJitter_) meEEUncalibRecHitsJitter_ -> Fill(uncalibRecHit->jitter());
167  if (meEEUncalibRecHitsChi2_) meEEUncalibRecHitsChi2_ -> Fill(uncalibRecHit->chi2());
168  if (meEEUncalibRecHitsAmpFullMap_) meEEUncalibRecHitsAmpFullMap_ -> Fill(EEid.ix(), EEid.iy(), uncalibRecHit->amplitude());
169  if (meEEUncalibRecHitsPedFullMap_) meEEUncalibRecHitsPedFullMap_ -> Fill(EEid.ix(), EEid.iy(), uncalibRecHit->pedestal());
170 
171 
172  // general checks, with threshold at 60 ADC counts
173  if ( uncalibRecHit->amplitude() > 60 )
174  {
181  }
182 
183  if ( ! skipDigis ) {
184  // Find the rechit corresponding digi
185  EEDigiCollection::const_iterator myDigi = EEDigi->find(EEid);
186  // int sMax = -1; // UNUSED
187  double eMax = 0.;
188  if (myDigi != EEDigi->end()){
189  for (unsigned int sample = 0 ; sample < myDigi->size(); ++sample){
190  EcalMGPASample thisSample = (*myDigi)[sample];
191  double analogSample = thisSample.adc();
192  if ( eMax < analogSample ){
193  eMax = analogSample;
194  // sMax = sample; // UNUSED
195  }
196  }
197  }
198  else
199  continue;
200 
201  // ratio uncalibratedRecHit amplitude + ped / max energy digi
202  const EcalPedestals* myped = ecalPeds.product();
203  EcalPedestalsMap::const_iterator it=myped->getMap().find( EEid );
204  if( it != myped->getMap().end() ){
205 
206  if (eMax > (*it).mean_x1 + 5 * (*it).rms_x1 && eMax != 0 ){ //only real signal RecHit
207 
209  { meEEUncalibRecHitMaxSampleRatio_->Fill( (uncalibRecHit->amplitude()+uncalibRecHit->pedestal())/eMax); }
210 
211  if ( meEEUncalibRecHitMaxSampleRatioGt60adc_ && (uncalibRecHit->amplitude() > 60) )
212  { meEEUncalibRecHitMaxSampleRatioGt60adc_->Fill( (uncalibRecHit->amplitude()+uncalibRecHit->pedestal())/eMax); }
213 
214  LogDebug("EcalRecHitsTaskInfo") << "endcap, eMax = " << eMax << " Amplitude = " << uncalibRecHit->amplitude()+uncalibRecHit->pedestal();
215  }
216  else
217  continue;
218  }
219  else
220  continue;
221  }
222  } // loop over the UncalibratedRecHitCollection
223 
224 }
#define LogDebug(id)
int ix() const
Definition: EEDetId.h:76
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
const self & getMap() const
std::vector< EcalUncalibratedRecHit >::const_iterator const_iterator
MonitorElement * meEEUncalibRecHitsOccupancyPlusGt60adc_
MonitorElement * meEEUncalibRecHitMaxSampleRatioGt60adc_
void Fill(long long x)
const_iterator find(id_type i) const
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int zside() const
Definition: EEDetId.h:70
MonitorElement * meEEUncalibRecHitsOccupancyMinusGt60adc_
int iy() const
Definition: EEDetId.h:82
bool isValid() const
Definition: HandleBase.h:75
const_iterator end() const
edm::EDGetTokenT< EEUncalibratedRecHitCollection > EEuncalibrechitCollection_token_
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:55
std::vector< Item >::const_iterator const_iterator
T const * product() const
Definition: ESHandle.h:86
const_iterator end() const
edm::EDGetTokenT< EEDigiCollection > EEdigiCollection_token_
const_iterator find(uint32_t rawId) const
const_iterator end() const
const_iterator begin() const
MonitorElement * meEEUncalibRecHitsAmplitudeGt60adc_
int adc() const
get the ADC sample (12 bits)
void EcalEndcapRecHitsValidation::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 121 of file EcalEndcapRecHitsValidation.cc.

121  {
122 
123 }
void EcalEndcapRecHitsValidation::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 125 of file EcalEndcapRecHitsValidation.cc.

125  {
126 
127 }

Member Data Documentation

DQMStore* EcalEndcapRecHitsValidation::dbe_
private

Definition at line 62 of file EcalEndcapRecHitsValidation.h.

edm::EDGetTokenT< EEDigiCollection > EcalEndcapRecHitsValidation::EEdigiCollection_token_
private

Definition at line 65 of file EcalEndcapRecHitsValidation.h.

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

Definition at line 66 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitMaxSampleRatio_
private

Definition at line 74 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitMaxSampleRatioGt60adc_
private

Definition at line 81 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsAmpFullMap_
private

Definition at line 82 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsAmplitude_
private

Definition at line 70 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsAmplitudeGt60adc_
private

Definition at line 77 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsChi2_
private

Definition at line 73 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsChi2Gt60adc_
private

Definition at line 80 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsJitter_
private

Definition at line 72 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsJitterGt60adc_
private

Definition at line 79 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsOccupancyMinus_
private

Definition at line 69 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsOccupancyMinusGt60adc_
private

Definition at line 76 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsOccupancyPlus_
private

Definition at line 68 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsOccupancyPlusGt60adc_
private

Definition at line 75 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsPedestal_
private

Definition at line 71 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsPedestalGt60adc_
private

Definition at line 78 of file EcalEndcapRecHitsValidation.h.

MonitorElement* EcalEndcapRecHitsValidation::meEEUncalibRecHitsPedFullMap_
private

Definition at line 83 of file EcalEndcapRecHitsValidation.h.

bool EcalEndcapRecHitsValidation::verbose_
private

Definition at line 60 of file EcalEndcapRecHitsValidation.h.