CMS 3D CMS Logo

EcalPreshowerNoiseDistrib.cc
Go to the documentation of this file.
1 /*
2  * \file EcalPreshowerNoiseDistrib.cc
3  *
4 */
5 
7 
9  : ESdigiCollectionToken_(consumes<ESDigiCollection>(ps.getParameter<edm::InputTag>("ESdigiCollection"))) {
10  // verbosity switch
11  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
12 
13  // histos
14  meESDigiMultiplicity_ = nullptr;
15  for (int ii = 0; ii < 3; ii++) {
16  meESDigiADC_[ii] = nullptr;
17  }
18 }
19 
21  Char_t histo[200];
22 
23  sprintf(histo, "multiplicity");
24  meESDigiMultiplicity_ = ibooker.book1D(histo, histo, 1000, 0., 137728);
25 
26  for (int ii = 0; ii < 3; ii++) {
27  sprintf(histo, "esRefHistos%02d", ii);
28  meESDigiADC_[ii] = ibooker.book1D(histo, histo, 35, 983.5, 1018.5);
29  }
30 
31  for (int ii = 0; ii < 3; ii++) {
32  sprintf(histo, "esRefHistosCorr%02d", ii);
33  meESDigiCorr_[ii] = ibooker.book2D(histo, histo, 35, 983.5, 1018.5, 35, 983.5, 1018.5);
34  }
35 
36  meESDigi3D_ = ibooker.book3D("meESDigi3D_", "meESDigi3D_", 35, 983.5, 1018.5, 35, 983.5, 1018.5, 35, 983.5, 1018.5);
37 }
38 
41 
42  e.getByToken(ESdigiCollectionToken_, EcalDigiES);
43 
44  // retrun if no data
45  if (!EcalDigiES.isValid())
46  return;
47 
48  // loop over Digis
49  const ESDigiCollection* preshowerDigi = EcalDigiES.product();
50 
51  std::vector<double> esADCCounts;
52  esADCCounts.reserve(ESDataFrame::MAXSAMPLES);
53 
54  int nDigis = 0;
55 
56  for (unsigned int digis = 0; digis < EcalDigiES->size(); ++digis) {
57  nDigis++;
58  ESDataFrame esdf = (*preshowerDigi)[digis];
59  int nrSamples = esdf.size();
60  for (int sample = 0; sample < nrSamples; ++sample) {
61  ESSample mySample = esdf[sample];
62  if (meESDigiADC_[sample]) {
64  }
65  }
66 
67  // to study correlations
68  if (meESDigiCorr_[0]) {
69  meESDigiCorr_[0]->Fill(esdf[0].adc(), esdf[1].adc());
70  }
71  if (meESDigiCorr_[1]) {
72  meESDigiCorr_[1]->Fill(esdf[0].adc(), esdf[2].adc());
73  }
74  if (meESDigiCorr_[2]) {
75  meESDigiCorr_[2]->Fill(esdf[1].adc(), esdf[2].adc());
76  }
77 
78  // reference histo: sample0, sample1, sample2
79  if (meESDigi3D_)
80  meESDigi3D_->Fill(esdf[0].adc(), esdf[1].adc(), esdf[2].adc());
81  }
82 
84  meESDigiMultiplicity_->Fill(nDigis);
85 }
int size() const
Definition: ESDataFrame.h:21
T const * product() const
Definition: Handle.h:70
EcalPreshowerNoiseDistrib(const edm::ParameterSet &ps)
Constructor.
T getUntrackedParameter(std::string const &, T const &) const
void Fill(long long x)
static const int MAXSAMPLES
Definition: ESDataFrame.h:30
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
ii
Definition: cuy.py:589
void reserve(size_t isize)
edm::EDGetTokenT< ESDigiCollection > ESdigiCollectionToken_
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * book3D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, FUNC onbooking=NOOP())
Definition: DQMStore.h:376
Definition: Run.h:45
uint16_t *__restrict__ uint16_t const *__restrict__ adc