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 &)
 
 CSCStripDigiValidation (const edm::ParameterSet &ps, 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::ParameterSet &ps)
 
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::InputTag inputTag_
 
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
bool doSim_
 
const CSCGeometrytheCSCGeometry
 
const PSimHitMaptheSimHitMap
 

Detailed Description

Definition at line 11 of file CSCStripDigiValidation.h.

Constructor & Destructor Documentation

◆ CSCStripDigiValidation()

CSCStripDigiValidation::CSCStripDigiValidation ( const edm::ParameterSet ps,
edm::ConsumesCollector &&  iC 
)

Definition at line 6 of file CSCStripDigiValidation.cc.

7  : CSCBaseValidation(ps),
13  theNDigisPerChamberPlot(nullptr) {
14  const auto &pset = ps.getParameterSet("cscStripDigi");
15  inputTag_ = pset.getParameter<edm::InputTag>("inputTag");
17 }

References edm::ParameterSet::getParameterSet(), inputTag_, muonDTDigis_cfi::pset, and strips_Token_.

◆ ~CSCStripDigiValidation()

CSCStripDigiValidation::~CSCStripDigiValidation ( )
override

Definition at line 19 of file CSCStripDigiValidation.cc.

19 {}

Member Function Documentation

◆ analyze()

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

Implements CSCBaseValidation.

Definition at line 53 of file CSCStripDigiValidation.cc.

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

References CSCBaseValidation::doSim_, MillePedeFileConverter_cfg::e, edm::InputTag::encode(), dqm::impl::MonitorElement::Fill(), fillPedestalPlots(), fillSignalPlots(), CSCBaseValidation::findLayer(), PSimHitMap::hits(), inputTag_, dqmiolumiharvest::j, dqmdumpme::last, phase1PixelTopology::layer, EcalCondDBWriter_cfi::pedestal, plotResolution(), FastTrackerRecHitCombiner_cfi::simHits, DigiDM_cff::strips, strips_Token_, theNDigisPerEventPlot, theNDigisPerLayerPlot, thePedestalCount, thePedestalSum, and CSCBaseValidation::theSimHitMap.

◆ bookHistograms()

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

Definition at line 21 of file CSCStripDigiValidation.cc.

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

References dqm::implementation::IBooker::book1D(), CSCDetId::chamberName(), CSCBaseValidation::doSim_, mps_fire::i, AlCaHLTBitMon_QueryRunRegistry::string, RandomServiceHelper::t1, theAmplitudePlot, theNDigisPerEventPlot, theNDigisPerLayerPlot, thePedestalPlot, theRatio4to5Plot, theRatio6to5Plot, and theResolutionPlots.

◆ fillPedestalPlots()

void CSCStripDigiValidation::fillPedestalPlots ( const CSCStripDigi digi)
private

Definition at line 108 of file CSCStripDigiValidation.cc.

108  {
109  std::vector<int> adcCounts = digi.getADCCounts();
110  thePedestalPlot->Fill(adcCounts[0]);
111  thePedestalPlot->Fill(adcCounts[1]);
112 }

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

Referenced by analyze().

◆ fillSignalPlots()

void CSCStripDigiValidation::fillSignalPlots ( const CSCStripDigi digi)
private

Definition at line 114 of file CSCStripDigiValidation.cc.

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

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 122 of file CSCStripDigiValidation.cc.

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

References dqm::impl::MonitorElement::Fill(), phase1PixelTopology::layer, digitizers_cfi::strip, theResolutionPlots, hit::x, and hit::y.

Referenced by analyze().

◆ setGeometry()

void CSCStripDigiValidation::setGeometry ( const CSCGeometry geom)
inline

Member Data Documentation

◆ inputTag_

edm::InputTag CSCStripDigiValidation::inputTag_
private

Definition at line 26 of file CSCStripDigiValidation.h.

Referenced by analyze(), and CSCStripDigiValidation().

◆ strips_Token_

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

Definition at line 25 of file CSCStripDigiValidation.h.

Referenced by analyze(), and CSCStripDigiValidation().

◆ theAmplitudePlot

MonitorElement* CSCStripDigiValidation::theAmplitudePlot
private

Definition at line 33 of file CSCStripDigiValidation.h.

Referenced by bookHistograms(), and fillSignalPlots().

◆ theNDigisPerChamberPlot

MonitorElement* CSCStripDigiValidation::theNDigisPerChamberPlot
private

Definition at line 37 of file CSCStripDigiValidation.h.

◆ theNDigisPerEventPlot

MonitorElement* CSCStripDigiValidation::theNDigisPerEventPlot
private

Definition at line 38 of file CSCStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theNDigisPerLayerPlot

MonitorElement* CSCStripDigiValidation::theNDigisPerLayerPlot
private

Definition at line 36 of file CSCStripDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ thePedestalCount

int CSCStripDigiValidation::thePedestalCount
private

Definition at line 29 of file CSCStripDigiValidation.h.

Referenced by analyze(), and fillSignalPlots().

◆ thePedestalCovarianceSum

float CSCStripDigiValidation::thePedestalCovarianceSum
private

Definition at line 28 of file CSCStripDigiValidation.h.

◆ thePedestalNeighborCorrelationPlot

MonitorElement* CSCStripDigiValidation::thePedestalNeighborCorrelationPlot
private

Definition at line 32 of file CSCStripDigiValidation.h.

◆ thePedestalPlot

MonitorElement* CSCStripDigiValidation::thePedestalPlot
private

Definition at line 30 of file CSCStripDigiValidation.h.

Referenced by bookHistograms(), and fillPedestalPlots().

◆ thePedestalSum

float CSCStripDigiValidation::thePedestalSum
private

Definition at line 27 of file CSCStripDigiValidation.h.

Referenced by analyze(), and fillSignalPlots().

◆ thePedestalTimeCorrelationPlot

MonitorElement* CSCStripDigiValidation::thePedestalTimeCorrelationPlot
private

Definition at line 31 of file CSCStripDigiValidation.h.

◆ theRatio4to5Plot

MonitorElement* CSCStripDigiValidation::theRatio4to5Plot
private

Definition at line 34 of file CSCStripDigiValidation.h.

Referenced by bookHistograms(), and fillSignalPlots().

◆ theRatio6to5Plot

MonitorElement* CSCStripDigiValidation::theRatio6to5Plot
private

Definition at line 35 of file CSCStripDigiValidation.h.

Referenced by bookHistograms(), and fillSignalPlots().

◆ theResolutionPlots

MonitorElement* CSCStripDigiValidation::theResolutionPlots[10]
private

Definition at line 39 of file CSCStripDigiValidation.h.

Referenced by bookHistograms(), and plotResolution().

mps_fire.i
i
Definition: mps_fire.py:428
CSCStripDigiValidation::thePedestalTimeCorrelationPlot
MonitorElement * thePedestalTimeCorrelationPlot
Definition: CSCStripDigiValidation.h:31
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
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
CSCLayer
Definition: CSCLayer.h:24
CSCStripDigiValidation::thePedestalSum
float thePedestalSum
Definition: CSCStripDigiValidation.h:27
edm::Handle< CSCStripDigiCollection >
CSCStripDigiValidation::theNDigisPerLayerPlot
MonitorElement * theNDigisPerLayerPlot
Definition: CSCStripDigiValidation.h:36
CSCStripDigiValidation::thePedestalNeighborCorrelationPlot
MonitorElement * thePedestalNeighborCorrelationPlot
Definition: CSCStripDigiValidation.h:32
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::CSCBaseValidation
CSCBaseValidation(const edm::ParameterSet &ps)
Definition: CSCBaseValidation.cc:4
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
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
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
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCBaseValidation::theSimHitMap
const PSimHitMap * theSimHitMap
Definition: CSCBaseValidation.h:28
CSCStripDigiValidation::thePedestalCovarianceSum
float thePedestalCovarianceSum
Definition: CSCStripDigiValidation.h:28
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:44
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
CSCStripDigiValidation::theNDigisPerEventPlot
MonitorElement * theNDigisPerEventPlot
Definition: CSCStripDigiValidation.h:38
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCDetId::chamberName
std::string chamberName() const
Definition: CSCDetId.cc:74
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::theNDigisPerChamberPlot
MonitorElement * theNDigisPerChamberPlot
Definition: CSCStripDigiValidation.h:37
CSCStripDigiValidation::theRatio4to5Plot
MonitorElement * theRatio4to5Plot
Definition: CSCStripDigiValidation.h:34
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CSCStripDigiValidation::theRatio6to5Plot
MonitorElement * theRatio6to5Plot
Definition: CSCStripDigiValidation.h:35
CSCBaseValidation::theCSCGeometry
const CSCGeometry * theCSCGeometry
Definition: CSCBaseValidation.h:29
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::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