CMS 3D CMS Logo

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

#include <CSCStripDigiValidation.h>

Inheritance diagram for CSCStripDigiValidation:
CSCBaseValidation

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, bool doSim)
 
 CSCStripDigiValidation (const edm::InputTag &inputTag, edm::ConsumesCollector &&iC)
 
void plotResolution (const PSimHit &hit, int strip, const CSCLayer *layer, int chamberType)
 
void setGeometry (const CSCGeometry *geom)
 
 ~CSCStripDigiValidation () 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 Member Functions

void fillPedestalPlots (const CSCStripDigi &digi)
 
void fillSignalPlots (const CSCStripDigi &digi)
 

Private Attributes

edm::EDGetTokenT< CSCStripDigiCollectionstrips_Token_
 
MonitorElementtheAmplitudePlot
 
MonitorElementtheNDigisPerChamberPlot
 
MonitorElementtheNDigisPerEventPlot
 
MonitorElementtheNDigisPerLayerPlot
 
int thePedestalCount
 
float thePedestalCovarianceSum
 
MonitorElementthePedestalNeighborCorrelationPlot
 
MonitorElementthePedestalPlot
 
float thePedestalSum
 
MonitorElementthePedestalTimeCorrelationPlot
 
MonitorElementtheRatio4to5Plot
 
MonitorElementtheRatio6to5Plot
 
MonitorElementtheResolutionPlots [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 11 of file CSCStripDigiValidation.h.

Constructor & Destructor Documentation

◆ CSCStripDigiValidation()

CSCStripDigiValidation::CSCStripDigiValidation ( const edm::InputTag inputTag,
edm::ConsumesCollector &&  iC 
)

◆ ~CSCStripDigiValidation()

CSCStripDigiValidation::~CSCStripDigiValidation ( )
override

Definition at line 17 of file CSCStripDigiValidation.cc.

17 {}

Member Function Documentation

◆ analyze()

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

Implements CSCBaseValidation.

Definition at line 35 of file CSCStripDigiValidation.cc.

35  {
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 }

References MillePedeFileConverter_cfg::e, edm::InputTag::encode(), dqm::impl::MonitorElement::Fill(), fillPedestalPlots(), fillSignalPlots(), dqmiolumiharvest::j, dqmdumpme::last, EcalCondDBWriter_cfi::pedestal, DigiDM_cff::strips, strips_Token_, CSCBaseValidation::theInputTag, theNDigisPerEventPlot, theNDigisPerLayerPlot, thePedestalCount, and thePedestalSum.

◆ bookHistograms()

void CSCStripDigiValidation::bookHistograms ( DQMStore::IBooker iBooker,
bool  doSim 
)

Definition at line 19 of file CSCStripDigiValidation.cc.

19  {
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 }

References dqm::implementation::IBooker::book1D(), cscDigiValidation_cfi::doSim, mps_fire::i, theAmplitudePlot, theNDigisPerEventPlot, theNDigisPerLayerPlot, thePedestalPlot, theRatio4to5Plot, theRatio6to5Plot, and theResolutionPlots.

◆ fillPedestalPlots()

void CSCStripDigiValidation::fillPedestalPlots ( const CSCStripDigi digi)
private

Definition at line 81 of file CSCStripDigiValidation.cc.

81  {
82  std::vector<int> adcCounts = digi.getADCCounts();
83  thePedestalPlot->Fill(adcCounts[0]);
84  thePedestalPlot->Fill(adcCounts[1]);
85 }

References dqm::impl::MonitorElement::Fill(), CSCStripDigi::getADCCounts(), and thePedestalPlot.

Referenced by analyze().

◆ fillSignalPlots()

void CSCStripDigiValidation::fillSignalPlots ( const CSCStripDigi digi)
private

Definition at line 87 of file CSCStripDigiValidation.cc.

87  {
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 }

References dqm::impl::MonitorElement::Fill(), CSCStripDigi::getADCCounts(), EcalCondDBWriter_cfi::pedestal, theAmplitudePlot, thePedestalCount, thePedestalSum, theRatio4to5Plot, and theRatio6to5Plot.

Referenced by analyze().

◆ plotResolution()

void CSCStripDigiValidation::plotResolution ( const PSimHit hit,
int  strip,
const CSCLayer layer,
int  chamberType 
)

Definition at line 95 of file CSCStripDigiValidation.cc.

95  {
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 }

References dqm::impl::MonitorElement::Fill(), CSCLayer::geometry(), digitizers_cfi::strip, theResolutionPlots, hit::x, CSCLayerGeometry::xOfStrip(), and hit::y.

◆ setGeometry()

void CSCStripDigiValidation::setGeometry ( const CSCGeometry geom)
inline

Member Data Documentation

◆ strips_Token_

edm::EDGetTokenT<CSCStripDigiCollection> CSCStripDigiValidation::strips_Token_
private

Definition at line 24 of file CSCStripDigiValidation.h.

Referenced by analyze(), and CSCStripDigiValidation().

◆ theAmplitudePlot

MonitorElement* CSCStripDigiValidation::theAmplitudePlot
private

Definition at line 31 of file CSCStripDigiValidation.h.

Referenced by bookHistograms(), and fillSignalPlots().

◆ theNDigisPerChamberPlot

MonitorElement* CSCStripDigiValidation::theNDigisPerChamberPlot
private

Definition at line 35 of file CSCStripDigiValidation.h.

◆ theNDigisPerEventPlot

MonitorElement* CSCStripDigiValidation::theNDigisPerEventPlot
private

Definition at line 36 of file CSCStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theNDigisPerLayerPlot

MonitorElement* CSCStripDigiValidation::theNDigisPerLayerPlot
private

Definition at line 34 of file CSCStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ thePedestalCount

int CSCStripDigiValidation::thePedestalCount
private

Definition at line 27 of file CSCStripDigiValidation.h.

Referenced by analyze(), and fillSignalPlots().

◆ thePedestalCovarianceSum

float CSCStripDigiValidation::thePedestalCovarianceSum
private

Definition at line 26 of file CSCStripDigiValidation.h.

◆ thePedestalNeighborCorrelationPlot

MonitorElement* CSCStripDigiValidation::thePedestalNeighborCorrelationPlot
private

Definition at line 30 of file CSCStripDigiValidation.h.

◆ thePedestalPlot

MonitorElement* CSCStripDigiValidation::thePedestalPlot
private

Definition at line 28 of file CSCStripDigiValidation.h.

Referenced by bookHistograms(), and fillPedestalPlots().

◆ thePedestalSum

float CSCStripDigiValidation::thePedestalSum
private

Definition at line 25 of file CSCStripDigiValidation.h.

Referenced by analyze(), and fillSignalPlots().

◆ thePedestalTimeCorrelationPlot

MonitorElement* CSCStripDigiValidation::thePedestalTimeCorrelationPlot
private

Definition at line 29 of file CSCStripDigiValidation.h.

◆ theRatio4to5Plot

MonitorElement* CSCStripDigiValidation::theRatio4to5Plot
private

Definition at line 32 of file CSCStripDigiValidation.h.

Referenced by bookHistograms(), and fillSignalPlots().

◆ theRatio6to5Plot

MonitorElement* CSCStripDigiValidation::theRatio6to5Plot
private

Definition at line 33 of file CSCStripDigiValidation.h.

Referenced by bookHistograms(), and fillSignalPlots().

◆ theResolutionPlots

MonitorElement* CSCStripDigiValidation::theResolutionPlots[10]
private

Definition at line 37 of file CSCStripDigiValidation.h.

Referenced by bookHistograms(), and plotResolution().

mps_fire.i
i
Definition: mps_fire.py:355
CSCStripDigiValidation::thePedestalTimeCorrelationPlot
MonitorElement * thePedestalTimeCorrelationPlot
Definition: CSCStripDigiValidation.h:29
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
CSCBaseValidation::theInputTag
edm::InputTag theInputTag
Definition: CSCBaseValidation.h:28
CSCStripDigiValidation::thePedestalSum
float thePedestalSum
Definition: CSCStripDigiValidation.h:25
edm::Handle< CSCStripDigiCollection >
CSCStripDigiValidation::theNDigisPerLayerPlot
MonitorElement * theNDigisPerLayerPlot
Definition: CSCStripDigiValidation.h:34
CSCStripDigiValidation::thePedestalNeighborCorrelationPlot
MonitorElement * thePedestalNeighborCorrelationPlot
Definition: CSCStripDigiValidation.h:30
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
CSCBaseValidation::CSCBaseValidation
CSCBaseValidation(const edm::InputTag &inputTag)
Definition: CSCBaseValidation.cc:4
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
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
CSCStripDigiValidation::thePedestalCovarianceSum
float thePedestalCovarianceSum
Definition: CSCStripDigiValidation.h:26
edm::LogError
Definition: MessageLogger.h:183
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
CSCStripDigiValidation::theNDigisPerEventPlot
MonitorElement * theNDigisPerEventPlot
Definition: CSCStripDigiValidation.h:36
CSCStripDigiValidation::thePedestalPlot
MonitorElement * thePedestalPlot
Definition: CSCStripDigiValidation.h:28
CSCStripDigiValidation::theNDigisPerChamberPlot
MonitorElement * theNDigisPerChamberPlot
Definition: CSCStripDigiValidation.h:35
CSCStripDigiValidation::theRatio4to5Plot
MonitorElement * theRatio4to5Plot
Definition: CSCStripDigiValidation.h:32
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
DigiContainerIterator
Definition: MuonDigiCollection.h:30
CSCStripDigiValidation::theRatio6to5Plot
MonitorElement * theRatio6to5Plot
Definition: CSCStripDigiValidation.h:33
CSCBaseValidation::theCSCGeometry
const CSCGeometry * theCSCGeometry
Definition: CSCBaseValidation.h:30
CSCStripDigiValidation::theAmplitudePlot
MonitorElement * theAmplitudePlot
Definition: CSCStripDigiValidation.h:31
DigiDM_cff.strips
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers....
Definition: DigiDM_cff.py:32
hit
Definition: SiStripHitEffFromCalibTree.cc:88
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37