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

#include <EcalPreshowerDigisValidation.h>

Inheritance diagram for EcalPreshowerDigisValidation:
edm::EDAnalyzer

Public Member Functions

 EcalPreshowerDigisValidation (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_
 
MonitorElementmeESDigiADC_ [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 36 of file EcalPreshowerDigisValidation.h.

Member Typedef Documentation

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

Definition at line 38 of file EcalPreshowerDigisValidation.h.

Constructor & Destructor Documentation

EcalPreshowerDigisValidation::EcalPreshowerDigisValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 17 of file EcalPreshowerDigisValidation.cc.

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

17  :
18  ESdigiCollection_(ps.getParameter<edm::InputTag>("ESdigiCollection"))
19 {
20 
21  // verbosity switch
22  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
23 
24  dbe_ = 0;
25 
26  // get hold of back-end interface
27  dbe_ = Service<DQMStore>().operator->();
28 
29  if ( dbe_ ) {
30  if ( verbose_ ) {
31  dbe_->setVerbose(1);
32  } else {
33  dbe_->setVerbose(0);
34  }
35  }
36 
37  if ( dbe_ ) {
38  if ( verbose_ ) dbe_->showDirStructure();
39  }
40 
42 
43  for (int i = 0; i < 3 ; i++ ) {
44  meESDigiADC_[i] = 0;
45  }
46 
47  Char_t histo[200];
48 
49  if ( dbe_ ) {
50  dbe_->setCurrentFolder("EcalDigisV/EcalDigiTask");
51 
52  sprintf (histo, "EcalDigiTask Preshower digis multiplicity" ) ;
53  meESDigiMultiplicity_ = dbe_->book1D(histo, histo, 1000, 0., 137728);
54 
55  for ( int i = 0; i < 3 ; i++ ) {
56 
57  sprintf (histo, "EcalDigiTask Preshower ADC pulse %02d", i+1) ;
58  meESDigiADC_[i] = dbe_->book1D(histo, histo, 4096, -0.5, 4095.5) ;
59  }
60 
61  }
62 
63 }
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
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
void showDirStructure(void) const
Definition: DQMStore.cc:2761
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 65 of file EcalPreshowerDigisValidation.cc.

References ESSample::adc(), ESdigiCollection_, MonitorElement::Fill(), edm::Event::getByLabel(), i, ESDataFrame::id(), edm::HandleBase::isValid(), LogDebug, ESDataFrame::MAXSAMPLES, meESDigiADC_, meESDigiMultiplicity_, ecalTB2006H4_GenSimDigiReco_cfg::mySample, ESDetId::plane(), edm::Handle< T >::product(), compare_using_db::sample, ESDetId::six(), ESDetId::siy(), ESDataFrame::size(), ESDetId::strip(), verbose_, and ESDetId::zside().

65  {
66 
67  //LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
68 
69  Handle<ESDigiCollection> EcalDigiES;
70 
71  e.getByLabel( ESdigiCollection_ , EcalDigiES );
72 
73  // Return if no preshower data
74  if( !EcalDigiES.isValid() ) return;
75 
76  // PRESHOWER
77 
78  // loop over Digis
79 
80  const ESDigiCollection * preshowerDigi = EcalDigiES.product () ;
81 
82  std::vector<double> esADCCounts ;
83  esADCCounts.reserve(ESDataFrame::MAXSAMPLES);
84 
85  int nDigis = 0;
86 
87  for (unsigned int digis=0; digis<EcalDigiES->size(); ++digis) {
88 
89  ESDataFrame esdf=(*preshowerDigi)[digis];
90  int nrSamples=esdf.size();
91 
92  ESDetId esid = esdf.id () ;
93 
94  nDigis++;
95 
96  for (int sample = 0 ; sample < nrSamples; ++sample) {
97  esADCCounts[sample] = 0.;
98  }
99 
100  for (int sample = 0 ; sample < nrSamples; ++sample) {
101  ESSample mySample = esdf[sample];
102  esADCCounts[sample] = (mySample.adc()) ;
103  }
104  if (verbose_) {
105  LogDebug("DigiInfo") << "Preshower Digi for ESDetId: z side " << esid.zside() << " plane " << esid.plane() << esid.six() << ',' << esid.siy() << ':' << esid.strip();
106  for ( int i = 0; i < 3 ; i++ ) {
107  LogDebug("DigiInfo") << "sample " << i << " ADC = " << esADCCounts[i];
108  }
109  }
110 
111  for ( int i = 0 ; i < 3 ; i++ ) {
112  if (meESDigiADC_[i]) meESDigiADC_[i]->Fill( esADCCounts[i] ) ;
113  }
114 
115  }
116 
118 
119 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
int strip() const
Definition: ESDetId.h:41
const ESDetId & id() const
Definition: ESDataFrame.h:21
int six() const
Definition: ESDetId.h:37
int size() const
Definition: ESDataFrame.h:23
void Fill(long long x)
int siy() const
Definition: ESDetId.h:39
static const int MAXSAMPLES
Definition: ESDataFrame.h:32
int zside() const
Definition: ESDetId.h:33
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 plane() const
Definition: ESDetId.h:35
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:18

Member Data Documentation

DQMStore* EcalPreshowerDigisValidation::dbe_
private

Definition at line 54 of file EcalPreshowerDigisValidation.h.

Referenced by EcalPreshowerDigisValidation().

edm::InputTag EcalPreshowerDigisValidation::ESdigiCollection_
private

Definition at line 58 of file EcalPreshowerDigisValidation.h.

Referenced by analyze().

MonitorElement* EcalPreshowerDigisValidation::meESDigiADC_[3]
private

Definition at line 62 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().

MonitorElement* EcalPreshowerDigisValidation::meESDigiMultiplicity_
private

Definition at line 60 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().

std::string EcalPreshowerDigisValidation::outputFile_
private

Definition at line 56 of file EcalPreshowerDigisValidation.h.

bool EcalPreshowerDigisValidation::verbose_
private

Definition at line 52 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().