CMS 3D CMS Logo

CSCComparatorDigiValidation.cc
Go to the documentation of this file.
5 
7  : CSCBaseValidation(ps), theTimeBinPlots(), theNDigisPerLayerPlots(), theStripDigiPlots(), the3StripPlots() {
8  const auto &comps = ps.getParameterSet("cscComparatorDigi");
9  inputTagComp_ = comps.getParameter<edm::InputTag>("inputTag");
11 
12  const auto &strips = ps.getParameterSet("cscStripDigi");
13  inputTagStrip_ = strips.getParameter<edm::InputTag>("inputTag");
15 }
16 
18 
20  theNDigisPerEventPlot = iBooker.book1D("CSCComparatorDigisPerEvent",
21  "CSC Comparator Digis per event;CSC Comparator Digis per event;Entries",
22  100,
23  0,
24  100);
25  // 10 chamber types, if you consider ME1/a and ME1/b separate
26  for (int i = 1; i <= 10; ++i) {
27  const std::string t1("CSCComparatorDigiTime_" + CSCDetId::chamberName(i));
28  const std::string t2("CSCComparatorDigisPerLayer_" + CSCDetId::chamberName(i));
29  const std::string t3("CSCComparatorStripAmplitude_" + CSCDetId::chamberName(i));
30  const std::string t4("CSCComparator3StripAmplitude_" + CSCDetId::chamberName(i));
31  theTimeBinPlots[i - 1] = iBooker.book1D(
32  t1, "Comparator Time Bin " + CSCDetId::chamberName(i) + " ;Comparator Time Bin; Entries", 16, 0, 16);
33  theNDigisPerLayerPlots[i - 1] = iBooker.book1D(
34  t2,
35  "Number of Comparator Digis " + CSCDetId::chamberName(i) + " ;Number of Comparator Digis; Entries",
36  100,
37  0,
38  20);
39  theStripDigiPlots[i - 1] = iBooker.book1D(
40  t3, "Comparator Amplitude " + CSCDetId::chamberName(i) + " ;Comparator Amplitude; Entries", 100, 0, 1000);
41  the3StripPlots[i - 1] = iBooker.book1D(
42  t4,
43  "Comparator-triplet Amplitude " + CSCDetId::chamberName(i) + " ;Comparator-triplet Amplitude; Entries",
44  100,
45  0,
46  1000);
47  }
48 }
49 
53 
54  e.getByToken(comparators_Token_, comparators);
55  if (!comparators.isValid()) {
56  edm::LogError("CSCComparatorDigiValidation") << "Cannot get comparators by label " << inputTagComp_.encode();
57  }
58  e.getByToken(strips_Token_, stripDigis);
59  if (!stripDigis.isValid()) {
60  edm::LogError("CSCComparatorDigiValidation") << "Cannot get strips by label " << inputTagComp_.encode();
61  }
62 
63  unsigned nDigisPerEvent = 0;
64 
65  for (auto j = comparators->begin(); j != comparators->end(); j++) {
66  auto digiItr = (*j).second.first;
67  auto last = (*j).second.second;
68 
69  CSCDetId detId((*j).first);
70  const CSCLayer *layer = findLayer(detId.rawId());
71  int chamberType = layer->chamber()->specs()->chamberType();
72 
73  theNDigisPerLayerPlots[chamberType - 1]->Fill(last - digiItr);
74 
75  for (auto stripRange = stripDigis->get(detId); digiItr != last; ++digiItr) {
76  ++nDigisPerEvent;
77  theTimeBinPlots[chamberType - 1]->Fill(digiItr->getTimeBin());
78 
79  int strip = digiItr->getStrip();
80  for (auto stripItr = stripRange.first; stripItr != stripRange.second; ++stripItr) {
81  if (stripItr->getStrip() == strip) {
82  std::vector<int> adc = stripItr->getADCCounts();
83  float pedc = 0.5 * (adc[0] + adc[1]);
84  float amp = adc[4] - pedc;
85  theStripDigiPlots[chamberType - 1]->Fill(amp);
86  // check neighbors
87  if (stripItr != stripRange.first && stripItr != stripRange.second - 1) {
88  std::vector<int> adcl = (stripItr - 1)->getADCCounts();
89  std::vector<int> adcr = (stripItr + 1)->getADCCounts();
90  float pedl = 0.5 * (adcl[0] + adcl[1]);
91  float pedr = 0.5 * (adcr[0] + adcr[1]);
92  float three = adcl[4] - pedl + adcr[4] - pedr + amp;
93  the3StripPlots[chamberType - 1]->Fill(three);
94  }
95  }
96  }
97  }
98  }
99  theNDigisPerEventPlot->Fill(nDigisPerEvent);
100 }
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
Handle.h
CSCComparatorDigiValidation::CSCComparatorDigiValidation
CSCComparatorDigiValidation(const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
Definition: CSCComparatorDigiValidation.cc:6
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
CSCComparatorDigiValidation::theNDigisPerLayerPlots
MonitorElement * theNDigisPerLayerPlots[10]
Definition: CSCComparatorDigiValidation.h:26
CSCComparatorDigiValidation::theNDigisPerEventPlot
MonitorElement * theNDigisPerEventPlot
Definition: CSCComparatorDigiValidation.h:30
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCStripDigiCollection
CSCComparatorDigiValidation::comparators_Token_
edm::EDGetTokenT< CSCComparatorDigiCollection > comparators_Token_
Definition: CSCComparatorDigiValidation.h:21
CSCComparatorDigiValidation::inputTagComp_
edm::InputTag inputTagComp_
Definition: CSCComparatorDigiValidation.h:23
CSCComparatorDigiValidation::inputTagStrip_
edm::InputTag inputTagStrip_
Definition: CSCComparatorDigiValidation.h:22
DQMStore.h
CSCLayer
Definition: CSCLayer.h:24
edm::Handle< CSCComparatorDigiCollection >
CSCComparatorDigiValidation.h
dqmdumpme.last
last
Definition: dqmdumpme.py:56
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
CSCBaseValidation::findLayer
const CSCLayer * findLayer(int detId) const
Definition: CSCBaseValidation.cc:7
RandomServiceHelper.t3
t3
Definition: RandomServiceHelper.py:258
CSCComparatorDigiValidation::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: CSCComparatorDigiValidation.cc:50
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
edm::ParameterSet
Definition: ParameterSet.h:47
CSCDetId
Definition: CSCDetId.h:26
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
CSCComparatorDigiCollection
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCComparatorDigiValidation::bookHistograms
void bookHistograms(DQMStore::IBooker &)
Definition: CSCComparatorDigiValidation.cc:19
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCComparatorDigiValidation::strips_Token_
edm::EDGetTokenT< CSCStripDigiCollection > strips_Token_
Definition: CSCComparatorDigiValidation.h:20
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CSCComparatorDigiValidation::theStripDigiPlots
MonitorElement * theStripDigiPlots[10]
Definition: CSCComparatorDigiValidation.h:27
CSCComparatorDigiValidation::~CSCComparatorDigiValidation
~CSCComparatorDigiValidation() override
Definition: CSCComparatorDigiValidation.cc:17
CSCDetId::chamberName
std::string chamberName() const
Definition: CSCDetId.cc:86
CSCComparatorDigiValidation::theTimeBinPlots
MonitorElement * theTimeBinPlots[10]
Definition: CSCComparatorDigiValidation.h:25
dqm::implementation::IBooker
Definition: DQMStore.h:43
CSCBaseValidation
Definition: CSCBaseValidation.h:14
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
CSCComparatorDigiValidation::the3StripPlots
MonitorElement * the3StripPlots[10]
Definition: CSCComparatorDigiValidation.h:28
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
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