CMS 3D CMS Logo

EcalPreshowerDigisValidation.cc
Go to the documentation of this file.
1 /*
2  * \file EcalPreshowerDigisValidation.cc
3  *
4  * \author F. Cossutti
5  *
6 */
7 
9 
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 }
21 
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 }
35 
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 }
mps_fire.i
i
Definition: mps_fire.py:428
edm::Handle::product
T const * product() const
Definition: Handle.h:70
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
ESDetId::strip
int strip() const
Definition: ESDetId.h:47
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
ESDataFrame::size
int size() const
Definition: ESDataFrame.h:21
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
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
EcalPreshowerDigisValidation::EcalPreshowerDigisValidation
EcalPreshowerDigisValidation(const edm::ParameterSet &ps)
Constructor.
Definition: EcalPreshowerDigisValidation.cc:10
EcalPreshowerDigisValidation::bookHistograms
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
Definition: EcalPreshowerDigisValidation.cc:22
EcalPreshowerDigisValidation.h
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:82
ESSample
Definition: ESSample.h:7
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
ecalTB2006H4_GenSimDigiReco_cfg.mySample
mySample
Definition: ecalTB2006H4_GenSimDigiReco_cfg.py:5
edm::EventSetup
Definition: EventSetup.h:58
ESDetId::plane
int plane() const
Definition: ESDetId.h:41
ESDetId::six
int six() const
Definition: ESDetId.h:43
EcalPreshowerDigisValidation::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
Definition: EcalPreshowerDigisValidation.cc:36
EcalPreshowerDigisValidation::verbose_
bool verbose_
Definition: EcalPreshowerDigisValidation.h:48
ESDetId::siy
int siy() const
Definition: ESDetId.h:45
dqm::implementation::IBooker
Definition: DQMStore.h:43
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
ESDetId::zside
int zside() const
Definition: ESDetId.h:39
ESDataFrame::id
const ESDetId & id() const
Definition: ESDataFrame.h:19
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
edm::DataFrameContainer::size
size_type size() const
Definition: DataFrameContainer.h:162
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37