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::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

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 &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

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 DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 34 of file EcalPreshowerDigisValidation.h.

Member Typedef Documentation

◆ MapType

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

Definition at line 35 of file EcalPreshowerDigisValidation.h.

Constructor & Destructor Documentation

◆ EcalPreshowerDigisValidation()

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

Constructor.

Definition at line 10 of file EcalPreshowerDigisValidation.cc.

11  : ESdigiCollectionToken_(consumes<ESDigiCollection>(ps.getParameter<edm::InputTag>("ESdigiCollection"))) {
12  // verbosity switch
13  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
14 
15  meESDigiMultiplicity_ = nullptr;
16 
17  for (int i = 0; i < 3; i++) {
18  meESDigiADC_[i] = nullptr;
19  }
20 }

References edm::ParameterSet::getUntrackedParameter(), mps_fire::i, meESDigiADC_, meESDigiMultiplicity_, and verbose_.

Member Function Documentation

◆ analyze()

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

Analyze.

Reimplemented from DQMEDAnalyzer.

Definition at line 36 of file EcalPreshowerDigisValidation.cc.

36  {
37  //LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
38 
40 
41  e.getByToken(ESdigiCollectionToken_, EcalDigiES);
42 
43  // Return if no preshower data
44  if (!EcalDigiES.isValid())
45  return;
46 
47  // PRESHOWER
48 
49  // loop over Digis
50 
51  const ESDigiCollection* preshowerDigi = EcalDigiES.product();
52 
53  std::vector<double> esADCCounts;
54  esADCCounts.reserve(ESDataFrame::MAXSAMPLES);
55 
56  int nDigis = 0;
57 
58  for (unsigned int digis = 0; digis < EcalDigiES->size(); ++digis) {
59  ESDataFrame esdf = (*preshowerDigi)[digis];
60  int nrSamples = esdf.size();
61 
62  ESDetId esid = esdf.id();
63 
64  nDigis++;
65 
66  for (int sample = 0; sample < nrSamples; ++sample) {
67  esADCCounts[sample] = 0.;
68  }
69 
70  for (int sample = 0; sample < nrSamples; ++sample) {
71  ESSample mySample = esdf[sample];
72  esADCCounts[sample] = (mySample.adc());
73  }
74  if (verbose_) {
75  LogDebug("DigiInfo") << "Preshower Digi for ESDetId: z side " << esid.zside() << " plane " << esid.plane()
76  << esid.six() << ',' << esid.siy() << ':' << esid.strip();
77  for (int i = 0; i < 3; i++) {
78  LogDebug("DigiInfo") << "sample " << i << " ADC = " << esADCCounts[i];
79  }
80  }
81 
82  for (int i = 0; i < 3; i++) {
83  if (meESDigiADC_[i])
84  meESDigiADC_[i]->Fill(esADCCounts[i]);
85  }
86  }
87 
89  meESDigiMultiplicity_->Fill(nDigis);
90 }

References MillePedeFileConverter_cfg::e, ESdigiCollectionToken_, dqm::impl::MonitorElement::Fill(), 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().

◆ bookHistograms()

void EcalPreshowerDigisValidation::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 22 of file EcalPreshowerDigisValidation.cc.

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

References dqm::implementation::IBooker::book1D(), timingPdfMaker::histo, mps_fire::i, meESDigiADC_, meESDigiMultiplicity_, and dqm::implementation::NavigatorBase::setCurrentFolder().

Member Data Documentation

◆ ESdigiCollectionToken_

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

Definition at line 52 of file EcalPreshowerDigisValidation.h.

Referenced by analyze().

◆ meESDigiADC_

MonitorElement* EcalPreshowerDigisValidation::meESDigiADC_[3]
private

◆ meESDigiMultiplicity_

MonitorElement* EcalPreshowerDigisValidation::meESDigiMultiplicity_
private

◆ outputFile_

std::string EcalPreshowerDigisValidation::outputFile_
private

Definition at line 50 of file EcalPreshowerDigisValidation.h.

◆ verbose_

bool EcalPreshowerDigisValidation::verbose_
private

Definition at line 48 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().

mps_fire.i
i
Definition: mps_fire.py:355
edm::Handle::product
T const * product() const
Definition: Handle.h:70
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
ESDetId::strip
int strip() const
Definition: ESDetId.h:47
ESDataFrame::size
int size() const
Definition: ESDataFrame.h:21
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
ESDetId
Definition: ESDetId.h:15
edm::Handle
Definition: AssociativeIterator.h:50
ESDataFrame
Definition: ESDataFrame.h:10
EcalPreshowerDigisValidation::meESDigiADC_
MonitorElement * meESDigiADC_[3]
Definition: EcalPreshowerDigisValidation.h:56
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
EcalPreshowerDigisValidation::ESdigiCollectionToken_
edm::EDGetTokenT< ESDigiCollection > ESdigiCollectionToken_
Definition: EcalPreshowerDigisValidation.h:52
ESDataFrame::MAXSAMPLES
static const int MAXSAMPLES
Definition: ESDataFrame.h:30
EcalPreshowerDigisValidation::meESDigiMultiplicity_
MonitorElement * meESDigiMultiplicity_
Definition: EcalPreshowerDigisValidation.h:54
edm::DataFrameContainer::reserve
void reserve(size_t isize)
Definition: DataFrameContainer.h:86
ESDigiCollection
Definition: EcalDigiCollections.h:58
ESSample
Definition: ESSample.h:7
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
ecalTB2006H4_GenSimDigiReco_cfg.mySample
mySample
Definition: ecalTB2006H4_GenSimDigiReco_cfg.py:5
ESDetId::plane
int plane() const
Definition: ESDetId.h:41
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ESDetId::six
int six() const
Definition: ESDetId.h:43
EcalPreshowerDigisValidation::verbose_
bool verbose_
Definition: EcalPreshowerDigisValidation.h:48
ESDetId::siy
int siy() const
Definition: ESDetId.h:45
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
ESDetId::zside
int zside() const
Definition: ESDetId.h:39
ESDataFrame::id
const ESDetId & id() const
Definition: ESDataFrame.h:19
edm::DataFrameContainer::size
size_type size() const
Definition: DataFrameContainer.h:162
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37