CMS 3D CMS Logo

CSCStripDigiValidation.cc
Go to the documentation of this file.
5 
8  thePedestalSum(0),
9  thePedestalCovarianceSum(0),
10  thePedestalCount(0),
11  thePedestalTimeCorrelationPlot(nullptr),
12  thePedestalNeighborCorrelationPlot(nullptr),
13  theNDigisPerChamberPlot(nullptr) {
15 }
16 
18 
20  thePedestalPlot = iBooker.book1D("CSCPedestal", "CSC Pedestal ", 400, 550, 650);
21  theAmplitudePlot = iBooker.book1D("CSCStripAmplitude", "CSC Strip Amplitude", 200, 0, 2000);
22  theRatio4to5Plot = iBooker.book1D("CSCStrip4to5", "CSC Strip Ratio tbin 4 to tbin 5", 100, 0, 1);
23  theRatio6to5Plot = iBooker.book1D("CSCStrip6to5", "CSC Strip Ratio tbin 6 to tbin 5", 120, 0, 1.2);
24  theNDigisPerLayerPlot = iBooker.book1D("CSCStripDigisPerLayer", "Number of CSC Strip Digis per layer", 48, 0, 48);
25  theNDigisPerEventPlot = iBooker.book1D("CSCStripDigisPerEvent", "Number of CSC Strip Digis per event", 100, 0, 500);
26  if (doSim) {
27  for (int i = 0; i < 10; ++i) {
28  char title1[200];
29  sprintf(title1, "CSCStripDigiResolution%d", i + 1);
30  theResolutionPlots[i] = iBooker.book1D(title1, title1, 100, -5, 5);
31  }
32  }
33 }
34 
37  e.getByToken(strips_Token_, strips);
38  if (!strips.isValid()) {
39  edm::LogError("CSCDigiValidation") << "Cannot get strips by label " << theInputTag.encode();
40  }
41 
42  unsigned nDigisPerEvent = 0;
43 
44  for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin(); j != strips->end(); j++) {
45  std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
46  std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
47  int nDigis = last - digiItr;
48  nDigisPerEvent += nDigis;
49  theNDigisPerLayerPlot->Fill(nDigis);
50 
51  double maxAmplitude = 0.;
52  // int maxStrip = 0;
53 
54  for (; digiItr != last; ++digiItr) {
55  // average up the pedestals
56  std::vector<int> adcCounts = digiItr->getADCCounts();
57  thePedestalSum += adcCounts[0];
58  thePedestalSum += adcCounts[1];
59  thePedestalCount += 2;
61  if (adcCounts[4] - pedestal > maxAmplitude) {
62  // maxStrip = digiItr->getStrip();
63  maxAmplitude = adcCounts[4] - pedestal;
64  }
65 
66  // if we have enough pedestal statistics
67  if (thePedestalCount > 100) {
68  fillPedestalPlots(*digiItr);
69 
70  // see if it's big enough to count as "signal"
71  if (adcCounts[5] > (thePedestalSum / thePedestalCount + 100)) {
72  fillSignalPlots(*digiItr);
73  }
74  }
75  }
76  } // loop over digis
77 
78  theNDigisPerEventPlot->Fill(nDigisPerEvent);
79 }
80 
82  std::vector<int> adcCounts = digi.getADCCounts();
83  thePedestalPlot->Fill(adcCounts[0]);
84  thePedestalPlot->Fill(adcCounts[1]);
85 }
86 
88  std::vector<int> adcCounts = digi.getADCCounts();
90  theAmplitudePlot->Fill(adcCounts[4] - pedestal);
91  theRatio4to5Plot->Fill((adcCounts[3] - pedestal) / (adcCounts[4] - pedestal));
92  theRatio6to5Plot->Fill((adcCounts[5] - pedestal) / (adcCounts[4] - pedestal));
93 }
94 
95 void CSCStripDigiValidation::plotResolution(const PSimHit &hit, int strip, const CSCLayer *layer, int chamberType) {
96  double hitX = hit.localPosition().x();
97  double hitY = hit.localPosition().y();
98  double digiX = layer->geometry()->xOfStrip(strip, hitY);
99  theResolutionPlots[chamberType - 1]->Fill(digiX - hitX);
100 }
Handle.h
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
CSCStripDigiValidation::theResolutionPlots
MonitorElement * theResolutionPlots[10]
Definition: CSCStripDigiValidation.h:37
cscDigiValidation_cfi.doSim
doSim
Definition: cscDigiValidation_cfi.py:12
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCStripDigiCollection
CSCStripDigiValidation::fillSignalPlots
void fillSignalPlots(const CSCStripDigi &digi)
Definition: CSCStripDigiValidation.cc:87
CSCStripDigiValidation::~CSCStripDigiValidation
~CSCStripDigiValidation() override
Definition: CSCStripDigiValidation.cc:17
CSCBaseValidation::theInputTag
edm::InputTag theInputTag
Definition: CSCBaseValidation.h:27
DQMStore.h
CSCLayer
Definition: CSCLayer.h:24
CSCStripDigiValidation::thePedestalSum
float thePedestalSum
Definition: CSCStripDigiValidation.h:25
edm::Handle< CSCStripDigiCollection >
CSCStripDigiValidation::theNDigisPerLayerPlot
MonitorElement * theNDigisPerLayerPlot
Definition: CSCStripDigiValidation.h:34
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
CSCStripDigiValidation::thePedestalCount
int thePedestalCount
Definition: CSCStripDigiValidation.h:27
dqmdumpme.last
last
Definition: dqmdumpme.py:56
CSCLayerGeometry::xOfStrip
float xOfStrip(int strip, float y=0.) const
Definition: CSCLayerGeometry.h:175
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
CSCStripDigiValidation::fillPedestalPlots
void fillPedestalPlots(const CSCStripDigi &digi)
Definition: CSCStripDigiValidation.cc:81
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
CSCStripDigiValidation::bookHistograms
void bookHistograms(DQMStore::IBooker &, bool doSim)
Definition: CSCStripDigiValidation.cc:19
CSCStripDigiValidation::CSCStripDigiValidation
CSCStripDigiValidation(const edm::InputTag &inputTag, edm::ConsumesCollector &&iC)
Definition: CSCStripDigiValidation.cc:6
CSCStripDigiValidation::analyze
void analyze(const edm::Event &e, const edm::EventSetup &) override
Definition: CSCStripDigiValidation.cc:35
CSCStripDigiValidation::strips_Token_
edm::EDGetTokenT< CSCStripDigiCollection > strips_Token_
Definition: CSCStripDigiValidation.h:24
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
CSCStripDigi::getADCCounts
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:44
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
edm::EventSetup
Definition: EventSetup.h:57
CSCStripDigiValidation::theNDigisPerEventPlot
MonitorElement * theNDigisPerEventPlot
Definition: CSCStripDigiValidation.h:36
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCStripDigi
Definition: CSCStripDigi.h:17
CSCStripDigiValidation::thePedestalPlot
MonitorElement * thePedestalPlot
Definition: CSCStripDigiValidation.h:28
CSCStripDigiValidation::plotResolution
void plotResolution(const PSimHit &hit, int strip, const CSCLayer *layer, int chamberType)
Definition: CSCStripDigiValidation.cc:95
CSCStripDigiValidation.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
CSCStripDigiValidation::theRatio4to5Plot
MonitorElement * theRatio4to5Plot
Definition: CSCStripDigiValidation.h:32
CSCBaseValidation
Definition: CSCBaseValidation.h:14
PSimHit
Definition: PSimHit.h:15
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
DigiContainerIterator
Definition: MuonDigiCollection.h:30
edm::Event
Definition: Event.h:73
CSCStripDigiValidation::theRatio6to5Plot
MonitorElement * theRatio6to5Plot
Definition: CSCStripDigiValidation.h:33
CSCStripDigiValidation::theAmplitudePlot
MonitorElement * theAmplitudePlot
Definition: CSCStripDigiValidation.h:31
edm::InputTag
Definition: InputTag.h:15
DigiDM_cff.strips
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers....
Definition: DigiDM_cff.py:32
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
hit
Definition: SiStripHitEffFromCalibTree.cc:88
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
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37