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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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 >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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 33 of file EcalPreshowerDigisValidation.h.

Member Typedef Documentation

◆ MapType

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

Definition at line 34 of file EcalPreshowerDigisValidation.h.

Constructor & Destructor Documentation

◆ EcalPreshowerDigisValidation()

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_.

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< ESDigiCollection > ESdigiCollectionToken_

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.

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(), ecalGpuTask_cfi::sample, ESDetId::six(), ESDetId::siy(), ESDataFrame::size(), edm::DataFrameContainer::size(), ESDetId::strip(), verbose_, and ESDetId::zside().

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 }
const ESDetId & id() const
Definition: ESDataFrame.h:19
int size() const
Definition: ESDataFrame.h:21
T const * product() const
Definition: Handle.h:70
int zside() const
Definition: ESDetId.h:39
void Fill(long long x)
int plane() const
Definition: ESDetId.h:41
static const int MAXSAMPLES
Definition: ESDataFrame.h:30
void reserve(size_t isize)
edm::EDGetTokenT< ESDigiCollection > ESdigiCollectionToken_
int siy() const
Definition: ESDetId.h:45
bool isValid() const
Definition: HandleBase.h:70
int six() const
Definition: ESDetId.h:43
int strip() const
Definition: ESDetId.h:47
#define LogDebug(id)

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 22 of file EcalPreshowerDigisValidation.cc.

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

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 }

Member Data Documentation

◆ ESdigiCollectionToken_

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

Definition at line 51 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 49 of file EcalPreshowerDigisValidation.h.

◆ verbose_

bool EcalPreshowerDigisValidation::verbose_
private

Definition at line 47 of file EcalPreshowerDigisValidation.h.

Referenced by analyze(), and EcalPreshowerDigisValidation().