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 edm::EDConsumerBase

Public Member Functions

 EcalPreshowerDigisValidation (const edm::ParameterSet &ps)
 Constructor. 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
 
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...
 
- 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 Types

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

Private Attributes

DQMStoredbe_
 
edm::EDGetTokenT
< ESDigiCollection
ESdigiCollectionToken_
 
MonitorElementmeESDigiADC_ [3]
 
MonitorElementmeESDigiMultiplicity_
 
std::string outputFile_
 
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 34 of file EcalPreshowerDigisValidation.h.

Member Typedef Documentation

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

Definition at line 36 of file EcalPreshowerDigisValidation.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 10 of file EcalPreshowerDigisValidation.cc.

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

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

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 58 of file EcalPreshowerDigisValidation.cc.

References ESSample::adc(), ESdigiCollectionToken_, MonitorElement::Fill(), edm::Event::getByToken(), 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().

58  {
59 
60  //LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
61 
63 
64  e.getByToken( ESdigiCollectionToken_ , EcalDigiES );
65 
66  // Return if no preshower data
67  if( !EcalDigiES.isValid() ) return;
68 
69  // PRESHOWER
70 
71  // loop over Digis
72 
73  const ESDigiCollection * preshowerDigi = EcalDigiES.product () ;
74 
75  std::vector<double> esADCCounts ;
76  esADCCounts.reserve(ESDataFrame::MAXSAMPLES);
77 
78  int nDigis = 0;
79 
80  for (unsigned int digis=0; digis<EcalDigiES->size(); ++digis) {
81 
82  ESDataFrame esdf=(*preshowerDigi)[digis];
83  int nrSamples=esdf.size();
84 
85  ESDetId esid = esdf.id () ;
86 
87  nDigis++;
88 
89  for (int sample = 0 ; sample < nrSamples; ++sample) {
90  esADCCounts[sample] = 0.;
91  }
92 
93  for (int sample = 0 ; sample < nrSamples; ++sample) {
94  ESSample mySample = esdf[sample];
95  esADCCounts[sample] = (mySample.adc()) ;
96  }
97  if (verbose_) {
98  LogDebug("DigiInfo") << "Preshower Digi for ESDetId: z side " << esid.zside() << " plane " << esid.plane() << esid.six() << ',' << esid.siy() << ':' << esid.strip();
99  for ( int i = 0; i < 3 ; i++ ) {
100  LogDebug("DigiInfo") << "sample " << i << " ADC = " << esADCCounts[i];
101  }
102  }
103 
104  for ( int i = 0 ; i < 3 ; i++ ) {
105  if (meESDigiADC_[i]) meESDigiADC_[i]->Fill( esADCCounts[i] ) ;
106  }
107 
108  }
109 
111 
112 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
int strip() const
Definition: ESDetId.h:52
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
const ESDetId & id() const
Definition: ESDataFrame.h:21
int six() const
Definition: ESDetId.h:48
int size() const
Definition: ESDataFrame.h:23
void Fill(long long x)
int siy() const
Definition: ESDetId.h:50
static const int MAXSAMPLES
Definition: ESDataFrame.h:32
int zside() const
Definition: ESDetId.h:44
bool isValid() const
Definition: HandleBase.h:76
edm::EDGetTokenT< ESDigiCollection > ESdigiCollectionToken_
T const * product() const
Definition: Handle.h:81
int plane() const
Definition: ESDetId.h:46
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:18

Member Data Documentation

DQMStore* EcalPreshowerDigisValidation::dbe_
private

Definition at line 52 of file EcalPreshowerDigisValidation.h.

Referenced by EcalPreshowerDigisValidation().

edm::EDGetTokenT<ESDigiCollection> EcalPreshowerDigisValidation::ESdigiCollectionToken_
private

Definition at line 56 of file EcalPreshowerDigisValidation.h.

Referenced by analyze().

MonitorElement* EcalPreshowerDigisValidation::meESDigiADC_[3]
private

Definition at line 60 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().

MonitorElement* EcalPreshowerDigisValidation::meESDigiMultiplicity_
private

Definition at line 58 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().

std::string EcalPreshowerDigisValidation::outputFile_
private

Definition at line 54 of file EcalPreshowerDigisValidation.h.

bool EcalPreshowerDigisValidation::verbose_
private

Definition at line 50 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().