CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSCStripDigiValidation.cc
Go to the documentation of this file.
5 
7  : CSCBaseValidation(ps),
8  thePedestalSum(0),
9  thePedestalCovarianceSum(0),
10  thePedestalCount(0),
11  thePedestalTimeCorrelationPlot(nullptr),
12  thePedestalNeighborCorrelationPlot(nullptr),
13  theNDigisPerChamberPlot(nullptr) {
14  const auto &pset = ps.getParameterSet("cscStripDigi");
15  inputTag_ = pset.getParameter<edm::InputTag>("inputTag");
17 }
18 
20 
22  iBooker.setCurrentFolder("MuonCSCDigisV/CSCDigiTask/Strip/Occupancy");
23 
24  thePedestalPlot = iBooker.book1D("CSCPedestal", "CSC Pedestal;ADC Counts;Entries", 400, 550, 650);
25  theAmplitudePlot = iBooker.book1D("CSCStripAmplitude", "CSC Strip Amplitude;Strip Amplitude;Entries", 200, 0, 2000);
26  theRatio4to5Plot = iBooker.book1D("CSCStrip4to5", "CSC Strip Ratio tbin 4 to tbin 5;Strip Ratio;Entries", 100, 0, 1);
28  iBooker.book1D("CSCStrip6to5", "CSC Strip Ratio tbin 6 to tbin 5;Strip Ratio;Entries", 120, 0, 1.2);
30  iBooker.book1D("CSCStripDigisPerLayer",
31  "Number of CSC Strip Digis per layer;Number of CSC Strip Digis per layer;Entries",
32  48,
33  0,
34  48);
36  iBooker.book1D("CSCStripDigisPerEvent",
37  "Number of CSC Strip Digis per event;Number of CSC Strip Digis per event;Entries",
38  100,
39  0,
40  500);
41 }
42 
45  e.getByToken(strips_Token_, strips);
46  if (!strips.isValid()) {
47  edm::LogError("CSCStripDigiValidation") << "Cannot get strips by label " << inputTag_.encode();
48  }
49 
50  unsigned nDigisPerEvent = 0;
51 
52  for (auto j = strips->begin(); j != strips->end(); j++) {
53  auto digiItr = (*j).second.first;
54  auto last = (*j).second.second;
55 
56  int nDigis = last - digiItr;
57  nDigisPerEvent += nDigis;
58  theNDigisPerLayerPlot->Fill(nDigis);
59 
60  double maxAmplitude = 0.;
61 
62  for (; digiItr != last; ++digiItr) {
63  // average up the pedestals
64  std::vector<int> adcCounts = digiItr->getADCCounts();
65  thePedestalSum += adcCounts[0];
66  thePedestalSum += adcCounts[1];
67  thePedestalCount += 2;
69  if (adcCounts[4] - pedestal > maxAmplitude) {
70  maxAmplitude = adcCounts[4] - pedestal;
71  }
72 
73  // if we have enough pedestal statistics
74  if (thePedestalCount > 100) {
75  fillPedestalPlots(*digiItr);
76 
77  // see if it's big enough to count as "signal"
78  if (adcCounts[5] > (thePedestalSum / thePedestalCount + 100)) {
79  fillSignalPlots(*digiItr);
80  }
81  }
82  }
83  } // loop over digis
84 
85  theNDigisPerEventPlot->Fill(nDigisPerEvent);
86 }
87 
89  std::vector<int> adcCounts = digi.getADCCounts();
90  thePedestalPlot->Fill(adcCounts[0]);
91  thePedestalPlot->Fill(adcCounts[1]);
92 }
93 
95  std::vector<int> adcCounts = digi.getADCCounts();
97  theAmplitudePlot->Fill(adcCounts[4] - pedestal);
98  theRatio4to5Plot->Fill((adcCounts[3] - pedestal) / (adcCounts[4] - pedestal));
99  theRatio6to5Plot->Fill((adcCounts[5] - pedestal) / (adcCounts[4] - pedestal));
100 }
MonitorElement * theNDigisPerEventPlot
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * theRatio4to5Plot
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:47
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
MonitorElement * theRatio6to5Plot
CSCStripDigiValidation(const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
Log< level::Error, false > LogError
void fillSignalPlots(const CSCStripDigi &digi)
std::string encode() const
Definition: InputTag.cc:159
void Fill(long long x)
edm::EDGetTokenT< CSCStripDigiCollection > strips_Token_
tuple strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
Definition: DigiDM_cff.py:32
MonitorElement * thePedestalPlot
MonitorElement * theNDigisPerLayerPlot
void bookHistograms(DQMStore::IBooker &)
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * theAmplitudePlot
ParameterSet const & getParameterSet(std::string const &) const
void analyze(const edm::Event &e, const edm::EventSetup &) override
void fillPedestalPlots(const CSCStripDigi &digi)
tuple last
Definition: dqmdumpme.py:56
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98