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

#include <EcalPreshowerNoiseDistrib.h>

Inheritance diagram for EcalPreshowerNoiseDistrib:
edm::EDAnalyzer

Public Member Functions

 EcalPreshowerNoiseDistrib (const edm::ParameterSet &ps)
 Constructor. 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...
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Types

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

Private Attributes

DQMStoredbe_
 
edm::InputTag ESdigiCollection_
 
MonitorElementmeESDigi3D_
 
MonitorElementmeESDigiADC_ [3]
 
MonitorElementmeESDigiCorr_ [3]
 
MonitorElementmeESDigiMultiplicity_
 
std::string outputFile_
 
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 27 of file EcalPreshowerNoiseDistrib.h.

Member Typedef Documentation

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

Definition at line 29 of file EcalPreshowerNoiseDistrib.h.

Constructor & Destructor Documentation

EcalPreshowerNoiseDistrib::EcalPreshowerNoiseDistrib ( const edm::ParameterSet ps)

Constructor.

Definition at line 12 of file EcalPreshowerNoiseDistrib.cc.

References dbe_, edm::ParameterSet::getUntrackedParameter(), interpolateCardsSimple::histo, meESDigi3D_, meESDigiADC_, meESDigiCorr_, meESDigiMultiplicity_, cppFunctionSkipper::operator, and verbose_.

12  :
13  ESdigiCollection_(ps.getParameter<edm::InputTag>("ESdigiCollection"))
14 {
15 
16  // verbosity switch
17  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
18 
19  dbe_ = 0;
20 
21  // get hold of back-end interface
22  dbe_ = Service<DQMStore>().operator->();
23 
24  if ( dbe_ ) {
25  if ( verbose_ ) {
26  dbe_->setVerbose(1);
27  } else {
28  dbe_->setVerbose(0);
29  }
30  }
31 
32  if ( dbe_ ) {
33  if ( verbose_ ) dbe_->showDirStructure();
34  }
35 
36  // histos
38  for (int ii=0; ii<3; ii++ ) { meESDigiADC_[ii] = 0; }
39 
40  Char_t histo[200];
41  if ( dbe_ ) {
42  sprintf (histo, "multiplicity" ) ;
43  meESDigiMultiplicity_ = dbe_->book1D(histo, histo, 1000, 0., 137728);
44 
45  for ( int ii = 0; ii < 3 ; ii++ ) {
46  sprintf (histo, "esRefHistos%02d", ii) ;
47  meESDigiADC_[ii] = dbe_->book1D(histo, histo, 35, 983.5, 1018.5) ;
48  }
49 
50  for ( int ii = 0; ii < 3 ; ii++ ) {
51  sprintf (histo, "esRefHistosCorr%02d", ii) ;
52  meESDigiCorr_[ii] = dbe_->book2D(histo, histo, 35, 983.5, 1018.5, 35, 983.5, 1018.5) ;
53  }
54 
55  meESDigi3D_ = dbe_->book3D("meESDigi3D_", "meESDigi3D_", 35, 983.5, 1018.5, 35, 983.5, 1018.5, 35, 983.5, 1018.5) ;
56  }
57 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
Definition: DQMStore.cc:979
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
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

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 60 of file EcalPreshowerNoiseDistrib.cc.

References ecalMGPA::adc(), ESSample::adc(), ESdigiCollection_, MonitorElement::Fill(), HcalObjRepresent::Fill(), edm::Event::getByLabel(), edm::HandleBase::isValid(), ESDataFrame::MAXSAMPLES, meESDigi3D_, meESDigiADC_, meESDigiCorr_, meESDigiMultiplicity_, ecalTB2006H4_GenSimDigiReco_cfg::mySample, edm::Handle< T >::product(), compare_using_db::sample, and ESDataFrame::size().

60  {
61 
62  Handle<ESDigiCollection> EcalDigiES;
63 
64  e.getByLabel( ESdigiCollection_ , EcalDigiES );
65 
66  // retrun if no data
67  if( !EcalDigiES.isValid() ) return;
68 
69  // loop over Digis
70  const ESDigiCollection * preshowerDigi = EcalDigiES.product () ;
71 
72  std::vector<double> esADCCounts ;
73  esADCCounts.reserve(ESDataFrame::MAXSAMPLES);
74 
75  int nDigis = 0;
76 
77  for (unsigned int digis=0; digis<EcalDigiES->size(); ++digis) {
78  nDigis++;
79  ESDataFrame esdf=(*preshowerDigi)[digis];
80  int nrSamples=esdf.size();
81  for (int sample = 0 ; sample < nrSamples; ++sample) {
82  ESSample mySample = esdf[sample];
83  if (meESDigiADC_[sample]) { meESDigiADC_[sample] ->Fill(mySample.adc()); }
84  }
85 
86  // to study correlations
87  if(meESDigiCorr_[0]){ meESDigiCorr_[0]->Fill(esdf[0].adc(),esdf[1].adc()); }
88  if(meESDigiCorr_[1]){ meESDigiCorr_[1]->Fill(esdf[0].adc(),esdf[2].adc()); }
89  if(meESDigiCorr_[2]){ meESDigiCorr_[2]->Fill(esdf[1].adc(),esdf[2].adc()); }
90 
91  // reference histo: sample0, sample1, sample2
92  if ( meESDigi3D_ ) meESDigi3D_ -> Fill(esdf[0].adc(),esdf[1].adc(),esdf[2].adc());
93  }
94 
96 
97 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int size() const
Definition: ESDataFrame.h:23
void Fill(long long x)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
static const int MAXSAMPLES
Definition: ESDataFrame.h:32
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
T const * product() const
Definition: Handle.h:74
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:18

Member Data Documentation

DQMStore* EcalPreshowerNoiseDistrib::dbe_
private

Definition at line 45 of file EcalPreshowerNoiseDistrib.h.

Referenced by EcalPreshowerNoiseDistrib().

edm::InputTag EcalPreshowerNoiseDistrib::ESdigiCollection_
private

Definition at line 49 of file EcalPreshowerNoiseDistrib.h.

Referenced by analyze().

MonitorElement* EcalPreshowerNoiseDistrib::meESDigi3D_
private

Definition at line 54 of file EcalPreshowerNoiseDistrib.h.

Referenced by analyze(), and EcalPreshowerNoiseDistrib().

MonitorElement* EcalPreshowerNoiseDistrib::meESDigiADC_[3]
private

Definition at line 52 of file EcalPreshowerNoiseDistrib.h.

Referenced by analyze(), and EcalPreshowerNoiseDistrib().

MonitorElement* EcalPreshowerNoiseDistrib::meESDigiCorr_[3]
private

Definition at line 53 of file EcalPreshowerNoiseDistrib.h.

Referenced by analyze(), and EcalPreshowerNoiseDistrib().

MonitorElement* EcalPreshowerNoiseDistrib::meESDigiMultiplicity_
private

Definition at line 55 of file EcalPreshowerNoiseDistrib.h.

Referenced by analyze(), and EcalPreshowerNoiseDistrib().

std::string EcalPreshowerNoiseDistrib::outputFile_
private

Definition at line 47 of file EcalPreshowerNoiseDistrib.h.

bool EcalPreshowerNoiseDistrib::verbose_
private

Definition at line 43 of file EcalPreshowerNoiseDistrib.h.

Referenced by EcalPreshowerNoiseDistrib().