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, 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

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 9 of file CSCStripDigiValidation.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file CSCStripDigiValidation.cc.

References DQMStore::book1D(), CSCBaseValidation::dbe_, i, 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 {
26  if(doSim) {
27  for(int i = 0; i < 10; ++i)
28  {
29  char title1[200];
30  sprintf(title1, "CSCStripDigiResolution%d", i+1);
31  theResolutionPlots[i] = dbe_->book1D(title1, title1, 100, -5, 5);
32  }
33  }
34 
35 }
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:717
MonitorElement * theRatio4to5Plot
MonitorElement * theRatio6to5Plot
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 38 of file CSCStripDigiValidation.cc.

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

Member Function Documentation

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

Implements CSCBaseValidation.

Definition at line 47 of file CSCStripDigiValidation.cc.

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

Referenced by CSCDigiValidation::analyze().

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

Definition at line 113 of file CSCStripDigiValidation.cc.

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

Referenced by analyze().

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

Definition at line 122 of file CSCStripDigiValidation.cc.

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

Referenced by analyze().

123 {
124  std::vector<int> adcCounts = digi.getADCCounts();
125  float pedestal = thePedestalSum/thePedestalCount;
126  theAmplitudePlot->Fill(adcCounts[4] - pedestal);
127  theRatio4to5Plot->Fill( (adcCounts[3]-pedestal) / (adcCounts[4]-pedestal) );
128  theRatio6to5Plot->Fill( (adcCounts[5]-pedestal) / (adcCounts[4]-pedestal) );
129 }
MonitorElement * theRatio4to5Plot
std::vector< int > getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.cc:41
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 132 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().

134 {
135  double hitX = hit.localPosition().x();
136  double hitY = hit.localPosition().y();
137  double digiX = layer->geometry()->xOfStrip(strip, hitY);
138  theResolutionPlots[chamberType-1]->Fill(digiX - hitX);
139 }
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
T y() const
Definition: PV3DBase.h:62
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:61
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void CSCStripDigiValidation::setGeometry ( const CSCGeometry geom)
inline

Member Data Documentation

MonitorElement* CSCStripDigiValidation::theAmplitudePlot
private

Definition at line 33 of file CSCStripDigiValidation.h.

Referenced by fillSignalPlots().

bool CSCStripDigiValidation::theDoSimFlag
private

Definition at line 29 of file CSCStripDigiValidation.h.

MonitorElement* CSCStripDigiValidation::theNDigisPerChamberPlot
private

Definition at line 37 of file CSCStripDigiValidation.h.

MonitorElement* CSCStripDigiValidation::theNDigisPerEventPlot
private

Definition at line 38 of file CSCStripDigiValidation.h.

Referenced by analyze().

MonitorElement* CSCStripDigiValidation::theNDigisPerLayerPlot
private

Definition at line 36 of file CSCStripDigiValidation.h.

Referenced by analyze().

int CSCStripDigiValidation::thePedestalCount
private

Definition at line 28 of file CSCStripDigiValidation.h.

Referenced by analyze(), and fillSignalPlots().

float CSCStripDigiValidation::thePedestalCovarianceSum
private

Definition at line 27 of file CSCStripDigiValidation.h.

MonitorElement* CSCStripDigiValidation::thePedestalNeighborCorrelationPlot
private

Definition at line 32 of file CSCStripDigiValidation.h.

MonitorElement* CSCStripDigiValidation::thePedestalPlot
private

Definition at line 30 of file CSCStripDigiValidation.h.

Referenced by fillPedestalPlots().

float CSCStripDigiValidation::thePedestalSum
private

Definition at line 26 of file CSCStripDigiValidation.h.

Referenced by analyze(), and fillSignalPlots().

MonitorElement* CSCStripDigiValidation::thePedestalTimeCorrelationPlot
private

Definition at line 31 of file CSCStripDigiValidation.h.

MonitorElement* CSCStripDigiValidation::theRatio4to5Plot
private

Definition at line 34 of file CSCStripDigiValidation.h.

Referenced by fillSignalPlots().

MonitorElement* CSCStripDigiValidation::theRatio6to5Plot
private

Definition at line 35 of file CSCStripDigiValidation.h.

Referenced by fillSignalPlots().

MonitorElement* CSCStripDigiValidation::theResolutionPlots[10]
private

Definition at line 39 of file CSCStripDigiValidation.h.

Referenced by CSCStripDigiValidation(), and plotResolution().