CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Types | Private Attributes
EcalPreshowerDigisValidation Class Reference

#include <EcalPreshowerDigisValidation.h>

Inheritance diagram for EcalPreshowerDigisValidation:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
 
 EcalPreshowerDigisValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 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

edm::EDGetTokenT< ESDigiCollectionESdigiCollectionToken_
 
MonitorElementmeESDigiADC_ [3]
 
MonitorElementmeESDigiMultiplicity_
 
std::string outputFile_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 35 of file EcalPreshowerDigisValidation.h.

Member Typedef Documentation

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

Definition at line 37 of file EcalPreshowerDigisValidation.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 10 of file EcalPreshowerDigisValidation.cc.

References edm::ParameterSet::getUntrackedParameter(), mps_fire::i, meESDigiADC_, meESDigiMultiplicity_, 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  meESDigiMultiplicity_=nullptr;
18 
19  for (int i = 0; i < 3 ; i++ ) {
20  meESDigiADC_[i] = nullptr;
21  }
22 
23 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< ESDigiCollection > ESdigiCollectionToken_

Member Function Documentation

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

Analyze.

Definition at line 41 of file EcalPreshowerDigisValidation.cc.

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

41  {
42 
43  //LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
44 
46 
47  e.getByToken( ESdigiCollectionToken_ , EcalDigiES );
48 
49  // Return if no preshower data
50  if( !EcalDigiES.isValid() ) return;
51 
52  // PRESHOWER
53 
54  // loop over Digis
55 
56  const ESDigiCollection * preshowerDigi = EcalDigiES.product () ;
57 
58  std::vector<double> esADCCounts ;
59  esADCCounts.reserve(ESDataFrame::MAXSAMPLES);
60 
61  int nDigis = 0;
62 
63  for (unsigned int digis=0; digis<EcalDigiES->size(); ++digis) {
64 
65  ESDataFrame esdf=(*preshowerDigi)[digis];
66  int nrSamples=esdf.size();
67 
68  ESDetId esid = esdf.id () ;
69 
70  nDigis++;
71 
72  for (int sample = 0 ; sample < nrSamples; ++sample) {
73  esADCCounts[sample] = 0.;
74  }
75 
76  for (int sample = 0 ; sample < nrSamples; ++sample) {
77  ESSample mySample = esdf[sample];
78  esADCCounts[sample] = (mySample.adc()) ;
79  }
80  if (verbose_) {
81  LogDebug("DigiInfo") << "Preshower Digi for ESDetId: z side " << esid.zside() << " plane " << esid.plane() << esid.six() << ',' << esid.siy() << ':' << esid.strip();
82  for ( int i = 0; i < 3 ; i++ ) {
83  LogDebug("DigiInfo") << "sample " << i << " ADC = " << esADCCounts[i];
84  }
85  }
86 
87  for ( int i = 0 ; i < 3 ; i++ ) {
88  if (meESDigiADC_[i]) meESDigiADC_[i]->Fill( esADCCounts[i] ) ;
89  }
90 
91  }
92 
94 
95 }
#define LogDebug(id)
int strip() const
Definition: ESDetId.h:53
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
const ESDetId & id() const
Definition: ESDataFrame.h:21
int six() const
Definition: ESDetId.h:49
int size() const
Definition: ESDataFrame.h:23
void Fill(long long x)
int siy() const
Definition: ESDetId.h:51
static const int MAXSAMPLES
Definition: ESDataFrame.h:32
int zside() const
Definition: ESDetId.h:45
bool isValid() const
Definition: HandleBase.h:74
void reserve(size_t isize)
edm::EDGetTokenT< ESDigiCollection > ESdigiCollectionToken_
T const * product() const
Definition: Handle.h:81
int plane() const
Definition: ESDetId.h:47
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:18
void EcalPreshowerDigisValidation::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 25 of file EcalPreshowerDigisValidation.cc.

References DQMStore::IBooker::book1D(), trackerHits::histo, mps_fire::i, meESDigiADC_, meESDigiMultiplicity_, and DQMStore::IBooker::setCurrentFolder().

25  {
26 
27  Char_t histo[200];
28 
29  ibooker.setCurrentFolder("EcalDigisV/EcalDigiTask");
30 
31  sprintf (histo, "EcalDigiTask Preshower digis multiplicity" ) ;
32  meESDigiMultiplicity_ = ibooker.book1D(histo, histo, 1000, 0., 137728);
33 
34  for ( int i = 0; i < 3 ; i++ ) {
35 
36  sprintf (histo, "EcalDigiTask Preshower ADC pulse %02d", i+1) ;
37  meESDigiADC_[i] = ibooker.book1D(histo, histo, 4096, -0.5, 4095.5) ;
38  }
39 }

Member Data Documentation

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

Definition at line 57 of file EcalPreshowerDigisValidation.h.

Referenced by analyze().

MonitorElement* EcalPreshowerDigisValidation::meESDigiADC_[3]
private
MonitorElement* EcalPreshowerDigisValidation::meESDigiMultiplicity_
private
std::string EcalPreshowerDigisValidation::outputFile_
private

Definition at line 55 of file EcalPreshowerDigisValidation.h.

bool EcalPreshowerDigisValidation::verbose_
private

Definition at line 53 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().