CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
 CSCStripDigiValidation (DQMStore *dbe, const edm::InputTag &inputTag, edm::ConsumesCollector &&iC, bool doSim)
 
void plotResolution (const PSimHit &hit, int strip, const CSCLayer *layer, int chamberType)
 
void setGeometry (const CSCGeometry *geom)
 
 ~CSCStripDigiValidation ()
 
- Public Member Functions inherited from CSCBaseValidation
 CSCBaseValidation (DQMStore *dbe, 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
< CSCStripDigiCollection
strips_Token_
 
MonitorElementtheAmplitudePlot
 
bool theDoSimFlag
 
MonitorElementtheNDigisPerChamberPlot
 
MonitorElementtheNDigisPerEventPlot
 
MonitorElementtheNDigisPerLayerPlot
 
int thePedestalCount
 
float thePedestalCovarianceSum
 
MonitorElementthePedestalNeighborCorrelationPlot
 
MonitorElementthePedestalPlot
 
float thePedestalSum
 
MonitorElementthePedestalTimeCorrelationPlot
 
MonitorElementtheRatio4to5Plot
 
MonitorElementtheRatio6to5Plot
 
MonitorElementtheResolutionPlots [10]
 

Additional Inherited Members

- Protected Member Functions inherited from CSCBaseValidation
const CSCLayerfindLayer (int detId) const
 
- Protected Attributes inherited from CSCBaseValidation
DQMStoredbe_
 
const CSCGeometrytheCSCGeometry
 
edm::InputTag theInputTag
 
const PSimHitMaptheSimHitMap
 

Detailed Description

Definition at line 12 of file CSCStripDigiValidation.h.

Constructor & Destructor Documentation

CSCStripDigiValidation::CSCStripDigiValidation ( DQMStore dbe,
const edm::InputTag inputTag,
edm::ConsumesCollector &&  iC,
bool  doSim 
)

Definition at line 7 of file CSCStripDigiValidation.cc.

References DQMStore::book1D(), CSCBaseValidation::dbe_, i, strips_Token_, and theResolutionPlots.

11 : CSCBaseValidation(dbe, inputTag),
12  thePedestalSum(0),
15  theDoSimFlag(doSim),
16  thePedestalPlot( dbe_->book1D("CSCPedestal", "CSC Pedestal ", 400, 550, 650) ),
19  theAmplitudePlot( dbe_->book1D("CSCStripAmplitude", "CSC Strip Amplitude", 200, 0, 2000) ),
20  theRatio4to5Plot( dbe_->book1D("CSCStrip4to5", "CSC Strip Ratio tbin 4 to tbin 5", 100, 0, 1) ),
21  theRatio6to5Plot( dbe_->book1D("CSCStrip6to5", "CSC Strip Ratio tbin 6 to tbin 5", 120, 0, 1.2) ),
22  theNDigisPerLayerPlot( dbe_->book1D("CSCStripDigisPerLayer", "Number of CSC Strip Digis per layer", 48, 0, 48) ),
24  theNDigisPerEventPlot( dbe_->book1D("CSCStripDigisPerEvent", "Number of CSC Strip Digis per event", 100, 0, 500) )
25 {
27 
28  if(doSim) {
29  for(int i = 0; i < 10; ++i)
30  {
31  char title1[200];
32  sprintf(title1, "CSCStripDigiResolution%d", i+1);
33  theResolutionPlots[i] = dbe_->book1D(title1, title1, 100, -5, 5);
34  }
35  }
36 
37 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int i
Definition: DBlmapReader.cc:9
MonitorElement * theNDigisPerEventPlot
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
MonitorElement * theRatio4to5Plot
MonitorElement * theRatio6to5Plot
edm::EDGetTokenT< CSCStripDigiCollection > strips_Token_
MonitorElement * thePedestalPlot
MonitorElement * theNDigisPerLayerPlot
MonitorElement * theNDigisPerChamberPlot
CSCBaseValidation(DQMStore *dbe, const edm::InputTag &inputTag)
MonitorElement * theAmplitudePlot
MonitorElement * thePedestalTimeCorrelationPlot
MonitorElement * thePedestalNeighborCorrelationPlot
MonitorElement * theResolutionPlots[10]
CSCStripDigiValidation::~CSCStripDigiValidation ( )

Definition at line 40 of file CSCStripDigiValidation.cc.

40  {
41 
42 // edm::LogInfo("CSCDigiValidation") << "RATIO for strips 4 to 5 : " << theRatio4to5Plot->getMean();
43 // edm::LogInfo("CSCDigiValidation") << "RATIO for strips 6 to 5 : " << theRatio6to5Plot->getMean();
44 // edm::LogInfo("CSCDigiValidation") << "NDIGIS per event : " << theNDigisPerEventPlot->getMean();
45 
46 }

Member Function Documentation

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

Implements CSCBaseValidation.

Definition at line 49 of file CSCStripDigiValidation.cc.

References edm::InputTag::encode(), MonitorElement::Fill(), fillPedestalPlots(), fillSignalPlots(), edm::Event::getByToken(), edm::HandleBase::isValid(), j, prof2calltree::last, EcalCondDBWriter_cfi::pedestal, RecoTauPiZeroBuilderPlugins_cfi::strips, strips_Token_, CSCBaseValidation::theInputTag, theNDigisPerEventPlot, theNDigisPerLayerPlot, thePedestalCount, and thePedestalSum.

Referenced by CSCDigiValidation::analyze().

51 {
53  e.getByToken(strips_Token_, strips);
54  if (!strips.isValid()) {
55  edm::LogError("CSCDigiValidation") << "Cannot get strips by label "
56  << theInputTag.encode();
57  }
58 
59  unsigned nDigisPerEvent = 0;
60 
61  for (CSCStripDigiCollection::DigiRangeIterator j=strips->begin(); j!=strips->end(); j++) {
62  std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
63  std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
64  int nDigis = last-digiItr;
65  nDigisPerEvent += nDigis;
66  theNDigisPerLayerPlot->Fill(nDigis);
67 
68  double maxAmplitude = 0.;
69  // int maxStrip = 0;
70 
71  for( ; digiItr != last; ++digiItr) {
72  // average up the pedestals
73  std::vector<int> adcCounts = digiItr->getADCCounts();
74  thePedestalSum += adcCounts[0];
75  thePedestalSum += adcCounts[1];
76  thePedestalCount += 2;
78  if(adcCounts[4]-pedestal > maxAmplitude)
79  {
80  // maxStrip = digiItr->getStrip();
81  maxAmplitude = adcCounts[4]-pedestal;
82  }
83 
84  // if we have enough pedestal statistics
85  if(thePedestalCount > 100)
86  {
87  fillPedestalPlots(*digiItr);
88 
89  // see if it's big enough to count as "signal"
90  if(adcCounts[5] > (thePedestalSum/thePedestalCount + 100))
91  {
92  fillSignalPlots(*digiItr);
93  }
94  }
95  }
96 
97 /*
98  int detId = (*j).first.rawId();
99 
100  edm::PSimHitContainer simHits = theSimHitMap->hits(detId);
101 
102  if(simHits.size() == 1)
103  {
104  const CSCLayer * layer = findLayer(detId);
105  int chamberType = layer->chamber()->specs()->chamberType();
106  plotResolution(simHits[0], maxStrip, layer, chamberType);
107  }
108 */
109  } // loop over digis
110 
111  theNDigisPerEventPlot->Fill(nDigisPerEvent);
112 }
edm::InputTag theInputTag
MonitorElement * theNDigisPerEventPlot
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
void fillSignalPlots(const CSCStripDigi &digi)
std::string encode() const
Definition: InputTag.cc:164
void Fill(long long x)
edm::EDGetTokenT< CSCStripDigiCollection > strips_Token_
MonitorElement * theNDigisPerLayerPlot
int j
Definition: DBlmapReader.cc:9
bool isValid() const
Definition: HandleBase.h:76
void fillPedestalPlots(const CSCStripDigi &digi)
void CSCStripDigiValidation::fillPedestalPlots ( const CSCStripDigi digi)
private

Definition at line 115 of file CSCStripDigiValidation.cc.

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

Referenced by analyze().

116 {
117  std::vector<int> adcCounts = digi.getADCCounts();
118  thePedestalPlot->Fill(adcCounts[0]);
119  thePedestalPlot->Fill(adcCounts[1]);
120 }
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:54
void Fill(long long x)
MonitorElement * thePedestalPlot
void CSCStripDigiValidation::fillSignalPlots ( const CSCStripDigi digi)
private

Definition at line 124 of file CSCStripDigiValidation.cc.

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

Referenced by analyze().

125 {
126  std::vector<int> adcCounts = digi.getADCCounts();
128  theAmplitudePlot->Fill(adcCounts[4] - pedestal);
129  theRatio4to5Plot->Fill( (adcCounts[3]-pedestal) / (adcCounts[4]-pedestal) );
130  theRatio6to5Plot->Fill( (adcCounts[5]-pedestal) / (adcCounts[4]-pedestal) );
131 }
MonitorElement * theRatio4to5Plot
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:54
MonitorElement * theRatio6to5Plot
void Fill(long long x)
MonitorElement * theAmplitudePlot
void CSCStripDigiValidation::plotResolution ( const PSimHit hit,
int  strip,
const CSCLayer layer,
int  chamberType 
)

Definition at line 134 of file CSCStripDigiValidation.cc.

References MonitorElement::Fill(), CSCLayer::geometry(), PSimHit::localPosition(), theResolutionPlots, PV3DBase< T, PVType, FrameType >::x(), CSCLayerGeometry::xOfStrip(), and PV3DBase< T, PVType, FrameType >::y().

136 {
137  double hitX = hit.localPosition().x();
138  double hitY = hit.localPosition().y();
139  double digiX = layer->geometry()->xOfStrip(strip, hitY);
140  theResolutionPlots[chamberType-1]->Fill(digiX - hitX);
141 }
T y() const
Definition: PV3DBase.h:63
void Fill(long long x)
float xOfStrip(int strip, float y=0.) const
Local3DPoint localPosition() const
Definition: PSimHit.h:44
MonitorElement * theResolutionPlots[10]
T x() const
Definition: PV3DBase.h:62
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void CSCStripDigiValidation::setGeometry ( const CSCGeometry geom)
inline

Member Data Documentation

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

Definition at line 31 of file CSCStripDigiValidation.h.

Referenced by analyze(), and CSCStripDigiValidation().

MonitorElement* CSCStripDigiValidation::theAmplitudePlot
private

Definition at line 39 of file CSCStripDigiValidation.h.

Referenced by fillSignalPlots().

bool CSCStripDigiValidation::theDoSimFlag
private

Definition at line 35 of file CSCStripDigiValidation.h.

MonitorElement* CSCStripDigiValidation::theNDigisPerChamberPlot
private

Definition at line 43 of file CSCStripDigiValidation.h.

MonitorElement* CSCStripDigiValidation::theNDigisPerEventPlot
private

Definition at line 44 of file CSCStripDigiValidation.h.

Referenced by analyze().

MonitorElement* CSCStripDigiValidation::theNDigisPerLayerPlot
private

Definition at line 42 of file CSCStripDigiValidation.h.

Referenced by analyze().

int CSCStripDigiValidation::thePedestalCount
private

Definition at line 34 of file CSCStripDigiValidation.h.

Referenced by analyze(), and fillSignalPlots().

float CSCStripDigiValidation::thePedestalCovarianceSum
private

Definition at line 33 of file CSCStripDigiValidation.h.

MonitorElement* CSCStripDigiValidation::thePedestalNeighborCorrelationPlot
private

Definition at line 38 of file CSCStripDigiValidation.h.

MonitorElement* CSCStripDigiValidation::thePedestalPlot
private

Definition at line 36 of file CSCStripDigiValidation.h.

Referenced by fillPedestalPlots().

float CSCStripDigiValidation::thePedestalSum
private

Definition at line 32 of file CSCStripDigiValidation.h.

Referenced by analyze(), and fillSignalPlots().

MonitorElement* CSCStripDigiValidation::thePedestalTimeCorrelationPlot
private

Definition at line 37 of file CSCStripDigiValidation.h.

MonitorElement* CSCStripDigiValidation::theRatio4to5Plot
private

Definition at line 40 of file CSCStripDigiValidation.h.

Referenced by fillSignalPlots().

MonitorElement* CSCStripDigiValidation::theRatio6to5Plot
private

Definition at line 41 of file CSCStripDigiValidation.h.

Referenced by fillSignalPlots().

MonitorElement* CSCStripDigiValidation::theResolutionPlots[10]
private

Definition at line 45 of file CSCStripDigiValidation.h.

Referenced by CSCStripDigiValidation(), and plotResolution().