CMS 3D CMS Logo

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  thePedestalPlot = iBooker.book1D("CSCPedestal", "CSC Pedestal;ADC Counts;Entries", 400, 550, 650);
23  theAmplitudePlot = iBooker.book1D("CSCStripAmplitude", "CSC Strip Amplitude;Strip Amplitude;Entries", 200, 0, 2000);
24  theRatio4to5Plot = iBooker.book1D("CSCStrip4to5", "CSC Strip Ratio tbin 4 to tbin 5;Strip Ratio;Entries", 100, 0, 1);
26  iBooker.book1D("CSCStrip6to5", "CSC Strip Ratio tbin 6 to tbin 5;Strip Ratio;Entries", 120, 0, 1.2);
28  iBooker.book1D("CSCStripDigisPerLayer",
29  "Number of CSC Strip Digis per layer;Number of CSC Strip Digis per layer;Entries",
30  48,
31  0,
32  48);
34  iBooker.book1D("CSCStripDigisPerEvent",
35  "Number of CSC Strip Digis per event;Number of CSC Strip Digis per event;Entries",
36  100,
37  0,
38  500);
39 
40  if (doSim_) {
41  for (int i = 1; i <= 10; ++i) {
42  const std::string t1("CSCStripPosResolution_" + CSCDetId::chamberName(i));
43  theResolutionPlots[i - 1] = iBooker.book1D(
44  t1,
45  "Strip X Position Resolution " + CSCDetId::chamberName(i) + ";Strip X Position Resolution; Entries",
46  100,
47  -5,
48  5);
49  }
50  }
51 }
52 
55  e.getByToken(strips_Token_, strips);
56  if (!strips.isValid()) {
57  edm::LogError("CSCStripDigiValidation") << "Cannot get strips by label " << inputTag_.encode();
58  }
59 
60  unsigned nDigisPerEvent = 0;
61 
62  for (auto j = strips->begin(); j != strips->end(); j++) {
63  auto digiItr = (*j).second.first;
64  auto last = (*j).second.second;
65  int detId = (*j).first.rawId();
66 
67  const CSCLayer *layer = findLayer(detId);
68  int chamberType = layer->chamber()->specs()->chamberType();
69  int nDigis = last - digiItr;
70  nDigisPerEvent += nDigis;
71  theNDigisPerLayerPlot->Fill(nDigis);
72 
73  double maxAmplitude = 0.;
74 
75  if (doSim_) {
77  if (nDigis == 1 && simHits.size() == 1) {
78  plotResolution(simHits[0], digiItr->getStrip(), layer, chamberType);
79  }
80  }
81 
82  for (; digiItr != last; ++digiItr) {
83  // average up the pedestals
84  std::vector<int> adcCounts = digiItr->getADCCounts();
85  thePedestalSum += adcCounts[0];
86  thePedestalSum += adcCounts[1];
87  thePedestalCount += 2;
89  if (adcCounts[4] - pedestal > maxAmplitude) {
90  maxAmplitude = adcCounts[4] - pedestal;
91  }
92 
93  // if we have enough pedestal statistics
94  if (thePedestalCount > 100) {
95  fillPedestalPlots(*digiItr);
96 
97  // see if it's big enough to count as "signal"
98  if (adcCounts[5] > (thePedestalSum / thePedestalCount + 100)) {
99  fillSignalPlots(*digiItr);
100  }
101  }
102  }
103  } // loop over digis
104 
105  theNDigisPerEventPlot->Fill(nDigisPerEvent);
106 }
107 
109  std::vector<int> adcCounts = digi.getADCCounts();
110  thePedestalPlot->Fill(adcCounts[0]);
111  thePedestalPlot->Fill(adcCounts[1]);
112 }
113 
115  std::vector<int> adcCounts = digi.getADCCounts();
117  theAmplitudePlot->Fill(adcCounts[4] - pedestal);
118  theRatio4to5Plot->Fill((adcCounts[3] - pedestal) / (adcCounts[4] - pedestal));
119  theRatio6to5Plot->Fill((adcCounts[5] - pedestal) / (adcCounts[4] - pedestal));
120 }
121 
122 void CSCStripDigiValidation::plotResolution(const PSimHit &hit, int strip, const CSCLayer *layer, int chamberType) {
123  double hitX = hit.localPosition().x();
124  double hitY = hit.localPosition().y();
125  double digiX = layer->geometry()->xOfStrip(strip, hitY);
126  theResolutionPlots[chamberType - 1]->Fill(digiX - hitX);
127 }
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:39
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCStripDigiCollection
CSCStripDigiValidation::fillSignalPlots
void fillSignalPlots(const CSCStripDigi &digi)
Definition: CSCStripDigiValidation.cc:114
CSCStripDigiValidation::~CSCStripDigiValidation
~CSCStripDigiValidation() override
Definition: CSCStripDigiValidation.cc:19
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
DQMStore.h
CSCLayer
Definition: CSCLayer.h:24
CSCStripDigiValidation::thePedestalSum
float thePedestalSum
Definition: CSCStripDigiValidation.h:27
edm::Handle< CSCStripDigiCollection >
CSCStripDigiValidation::theNDigisPerLayerPlot
MonitorElement * theNDigisPerLayerPlot
Definition: CSCStripDigiValidation.h:36
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
CSCStripDigiValidation::inputTag_
edm::InputTag inputTag_
Definition: CSCStripDigiValidation.h:26
CSCStripDigiValidation::thePedestalCount
int thePedestalCount
Definition: CSCStripDigiValidation.h:29
dqmdumpme.last
last
Definition: dqmdumpme.py:56
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
CSCBaseValidation::doSim_
bool doSim_
Definition: CSCBaseValidation.h:26
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
CSCStripDigiValidation::fillPedestalPlots
void fillPedestalPlots(const CSCStripDigi &digi)
Definition: CSCStripDigiValidation.cc:108
CSCBaseValidation::findLayer
const CSCLayer * findLayer(int detId) const
Definition: CSCBaseValidation.cc:7
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
CSCBaseValidation::theSimHitMap
const PSimHitMap * theSimHitMap
Definition: CSCBaseValidation.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
CSCStripDigiValidation::analyze
void analyze(const edm::Event &e, const edm::EventSetup &) override
Definition: CSCStripDigiValidation.cc:53
CSCStripDigiValidation::CSCStripDigiValidation
CSCStripDigiValidation(const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
Definition: CSCStripDigiValidation.cc:6
CSCStripDigiValidation::strips_Token_
edm::EDGetTokenT< CSCStripDigiCollection > strips_Token_
Definition: CSCStripDigiValidation.h:25
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:47
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
edm::EventSetup
Definition: EventSetup.h:58
CSCStripDigiValidation::theNDigisPerEventPlot
MonitorElement * theNDigisPerEventPlot
Definition: CSCStripDigiValidation.h:38
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCStripDigi
Definition: CSCStripDigi.h:17
CSCDetId::chamberName
std::string chamberName() const
Definition: CSCDetId.cc:86
CSCStripDigiValidation::thePedestalPlot
MonitorElement * thePedestalPlot
Definition: CSCStripDigiValidation.h:30
PSimHitMap::hits
const edm::PSimHitContainer & hits(int detId) const
Definition: PSimHitMap.cc:20
CSCStripDigiValidation::plotResolution
void plotResolution(const PSimHit &hit, int strip, const CSCLayer *layer, int chamberType)
Definition: CSCStripDigiValidation.cc:122
CSCStripDigiValidation.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
CSCStripDigiValidation::bookHistograms
void bookHistograms(DQMStore::IBooker &)
Definition: CSCStripDigiValidation.cc:21
CSCStripDigiValidation::theRatio4to5Plot
MonitorElement * theRatio4to5Plot
Definition: CSCStripDigiValidation.h:34
CSCBaseValidation
Definition: CSCBaseValidation.h:14
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
PSimHit
Definition: PSimHit.h:15
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::Event
Definition: Event.h:73
CSCStripDigiValidation::theRatio6to5Plot
MonitorElement * theRatio6to5Plot
Definition: CSCStripDigiValidation.h:35
CSCStripDigiValidation::theAmplitudePlot
MonitorElement * theAmplitudePlot
Definition: CSCStripDigiValidation.h:33
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
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
hit
Definition: SiStripHitEffFromCalibTree.cc:88
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
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