CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCComparatorDigiValidation Class Reference

#include <CSCComparatorDigiValidation.h>

Inheritance diagram for CSCComparatorDigiValidation:
CSCBaseValidation

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &)
 
 CSCComparatorDigiValidation (const edm::InputTag &inputTag, const edm::InputTag &stripDigiInputTag, edm::ConsumesCollector &&iC)
 
 ~CSCComparatorDigiValidation () override
 
- Public Member Functions inherited from CSCBaseValidation
 CSCBaseValidation (const edm::InputTag &inputTag)
 
void setGeometry (const CSCGeometry *geom)
 
void setSimHitMap (const PSimHitMap *simHitMap)
 
virtual ~CSCBaseValidation ()
 

Private Attributes

edm::EDGetTokenT< CSCComparatorDigiCollectioncomparators_Token_
 
MonitorElementthe3StripPlots [10]
 
MonitorElementtheNDigisPerEventPlot
 
MonitorElementtheNDigisPerLayerPlots [10]
 
edm::EDGetTokenT< CSCStripDigiCollectiontheStripDigi_Token_
 
MonitorElementtheStripDigiPlots [10]
 
MonitorElementtheTimeBinPlots [10]
 

Additional Inherited Members

- Public Types inherited from CSCBaseValidation
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from CSCBaseValidation
const CSCLayerfindLayer (int detId) const
 
- Protected Attributes inherited from CSCBaseValidation
const CSCGeometrytheCSCGeometry
 
edm::InputTag theInputTag
 
const PSimHitMaptheSimHitMap
 

Detailed Description

Definition at line 12 of file CSCComparatorDigiValidation.h.

Constructor & Destructor Documentation

◆ CSCComparatorDigiValidation()

CSCComparatorDigiValidation::CSCComparatorDigiValidation ( const edm::InputTag inputTag,
const edm::InputTag stripDigiInputTag,
edm::ConsumesCollector &&  iC 
)

◆ ~CSCComparatorDigiValidation()

CSCComparatorDigiValidation::~CSCComparatorDigiValidation ( )
override

Definition at line 18 of file CSCComparatorDigiValidation.cc.

18 {}

Member Function Documentation

◆ analyze()

void CSCComparatorDigiValidation::analyze ( const edm::Event e,
const edm::EventSetup  
)
overridevirtual

Implements CSCBaseValidation.

Definition at line 35 of file CSCComparatorDigiValidation.cc.

35  {
38 
39  e.getByToken(comparators_Token_, comparators);
40  if (!comparators.isValid()) {
41  edm::LogError("CSCDigiDump") << "Cannot get comparators by label " << theInputTag.encode();
42  }
43  e.getByToken(theStripDigi_Token_, stripDigis);
44  if (!stripDigis.isValid()) {
45  edm::LogError("CSCDigiDump") << "Cannot get comparators by label " << theInputTag.encode();
46  }
47 
48  unsigned nDigisPerEvent = 0;
49 
50  for (CSCComparatorDigiCollection::DigiRangeIterator j = comparators->begin(); j != comparators->end(); j++) {
51  std::vector<CSCComparatorDigi>::const_iterator digiItr = (*j).second.first;
52  std::vector<CSCComparatorDigi>::const_iterator last = (*j).second.second;
53 
54  CSCDetId detId((*j).first);
55  const CSCLayer *layer = findLayer(detId.rawId());
56  int chamberType = layer->chamber()->specs()->chamberType();
57 
58  CSCStripDigiCollection::Range stripRange = stripDigis->get(detId);
59 
60  theNDigisPerLayerPlots[chamberType - 1]->Fill(last - digiItr);
61 
62  for (; digiItr != last; ++digiItr) {
63  ++nDigisPerEvent;
64  theTimeBinPlots[chamberType - 1]->Fill(digiItr->getTimeBin());
65 
66  int strip = digiItr->getStrip();
67  for (std::vector<CSCStripDigi>::const_iterator stripItr = stripRange.first; stripItr != stripRange.second;
68  ++stripItr) {
69  if (stripItr->getStrip() == strip) {
70  std::vector<int> adc = stripItr->getADCCounts();
71  float pedc = 0.5 * (adc[0] + adc[1]);
72  float amp = adc[4] - pedc;
73  theStripDigiPlots[chamberType - 1]->Fill(amp);
74  // check neighbors
75  if (stripItr != stripRange.first && stripItr != stripRange.second - 1) {
76  std::vector<int> adcl = (stripItr - 1)->getADCCounts();
77  std::vector<int> adcr = (stripItr + 1)->getADCCounts();
78  float pedl = 0.5 * (adcl[0] + adcl[1]);
79  float pedr = 0.5 * (adcr[0] + adcr[1]);
80  float three = adcl[4] - pedl + adcr[4] - pedr + amp;
81  the3StripPlots[chamberType - 1]->Fill(three);
82  }
83  }
84  }
85  }
86  }
87 
88  theNDigisPerEventPlot->Fill(nDigisPerEvent);
89 }

References ecalLiteDTU::adc(), CSCLayer::chamber(), CSCChamberSpecs::chamberType(), comparators_Token_, MillePedeFileConverter_cfg::e, edm::InputTag::encode(), dqm::impl::MonitorElement::Fill(), CSCBaseValidation::findLayer(), edm::HandleBase::isValid(), dqmiolumiharvest::j, dqmdumpme::last, DetId::rawId(), CSCChamber::specs(), digitizers_cfi::strip, the3StripPlots, CSCBaseValidation::theInputTag, theNDigisPerEventPlot, theNDigisPerLayerPlots, theStripDigi_Token_, theStripDigiPlots, and theTimeBinPlots.

◆ bookHistograms()

void CSCComparatorDigiValidation::bookHistograms ( DQMStore::IBooker iBooker)

Definition at line 20 of file CSCComparatorDigiValidation.cc.

20  {
21  theNDigisPerEventPlot = iBooker.book1D("CSCComparatorDigisPerEvent", "CSC Comparator Digis per event", 100, 0, 100);
22  for (int i = 0; i < 10; ++i) {
23  char title1[200], title2[200], title3[200], title4[200];
24  sprintf(title1, "CSCComparatorDigiTimeType%d", i + 1);
25  sprintf(title2, "CSCComparatorDigisPerLayerType%d", i + 1);
26  sprintf(title3, "CSCComparatorStripAmplitudeType%d", i + 1);
27  sprintf(title4, "CSCComparator3StripAmplitudeType%d", i + 1);
28  theTimeBinPlots[i] = iBooker.book1D(title1, title1, 9, 0, 8);
29  theNDigisPerLayerPlots[i] = iBooker.book1D(title2, title2, 100, 0, 20);
30  theStripDigiPlots[i] = iBooker.book1D(title3, title3, 100, 0, 1000);
31  the3StripPlots[i] = iBooker.book1D(title4, title4, 100, 0, 1000);
32  }
33 }

References dqm::implementation::IBooker::book1D(), mps_fire::i, the3StripPlots, theNDigisPerEventPlot, theNDigisPerLayerPlots, theStripDigiPlots, and theTimeBinPlots.

Member Data Documentation

◆ comparators_Token_

edm::EDGetTokenT<CSCComparatorDigiCollection> CSCComparatorDigiValidation::comparators_Token_
private

Definition at line 23 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and CSCComparatorDigiValidation().

◆ the3StripPlots

MonitorElement* CSCComparatorDigiValidation::the3StripPlots[10]
private

Definition at line 28 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theNDigisPerEventPlot

MonitorElement* CSCComparatorDigiValidation::theNDigisPerEventPlot
private

Definition at line 30 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theNDigisPerLayerPlots

MonitorElement* CSCComparatorDigiValidation::theNDigisPerLayerPlots[10]
private

Definition at line 26 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theStripDigi_Token_

edm::EDGetTokenT<CSCStripDigiCollection> CSCComparatorDigiValidation::theStripDigi_Token_
private

Definition at line 22 of file CSCComparatorDigiValidation.h.

Referenced by analyze().

◆ theStripDigiPlots

MonitorElement* CSCComparatorDigiValidation::theStripDigiPlots[10]
private

Definition at line 27 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theTimeBinPlots

MonitorElement* CSCComparatorDigiValidation::theTimeBinPlots[10]
private

Definition at line 25 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

mps_fire.i
i
Definition: mps_fire.py:428
CSCComparatorDigiValidation::theNDigisPerLayerPlots
MonitorElement * theNDigisPerLayerPlots[10]
Definition: CSCComparatorDigiValidation.h:26
CSCComparatorDigiValidation::theNDigisPerEventPlot
MonitorElement * theNDigisPerEventPlot
Definition: CSCComparatorDigiValidation.h:30
CSCLayer::chamber
const CSCChamber * chamber() const
Definition: CSCLayer.h:49
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCChamberSpecs::chamberType
int chamberType() const
Definition: CSCChamberSpecs.cc:154
CSCStripDigiCollection
CSCComparatorDigiValidation::comparators_Token_
edm::EDGetTokenT< CSCComparatorDigiCollection > comparators_Token_
Definition: CSCComparatorDigiValidation.h:23
CSCBaseValidation::theInputTag
edm::InputTag theInputTag
Definition: CSCBaseValidation.h:27
CSCLayer
Definition: CSCLayer.h:24
edm::Handle< CSCComparatorDigiCollection >
ecalLiteDTU::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalLiteDTUSample.h:12
CSCBaseValidation::CSCBaseValidation
CSCBaseValidation(const edm::InputTag &inputTag)
Definition: CSCBaseValidation.cc:4
dqmdumpme.last
last
Definition: dqmdumpme.py:56
CSCComparatorDigiValidation::theStripDigi_Token_
edm::EDGetTokenT< CSCStripDigiCollection > theStripDigi_Token_
Definition: CSCComparatorDigiValidation.h:22
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
CSCBaseValidation::findLayer
const CSCLayer * findLayer(int detId) const
Definition: CSCBaseValidation.cc:7
CSCDetId
Definition: CSCDetId.h:26
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
CSCComparatorDigiCollection
CSCChamber::specs
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:39
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCComparatorDigiValidation::theStripDigiPlots
MonitorElement * theStripDigiPlots[10]
Definition: CSCComparatorDigiValidation.h:27
CSCComparatorDigiValidation::theTimeBinPlots
MonitorElement * theTimeBinPlots[10]
Definition: CSCComparatorDigiValidation.h:25
MuonDigiCollection::Range
std::pair< const_iterator, const_iterator > Range
Definition: MuonDigiCollection.h:95
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
DigiContainerIterator
Definition: MuonDigiCollection.h:30
CSCComparatorDigiValidation::the3StripPlots
MonitorElement * the3StripPlots[10]
Definition: CSCComparatorDigiValidation.h:28
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