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 Attributes
CSCComparatorDigiValidation Class Reference

#include <CSCComparatorDigiValidation.h>

Inheritance diagram for CSCComparatorDigiValidation:
CSCBaseValidation

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
void bookHistograms (DQMStore::IBooker &)
 
 CSCComparatorDigiValidation (const edm::InputTag &inputTag, const edm::InputTag &stripDigiInputTag, edm::ConsumesCollector &&iC)
 
 ~CSCComparatorDigiValidation ()
 
- 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
< CSCComparatorDigiCollection
comparators_Token_
 
MonitorElementthe3StripPlots [10]
 
MonitorElementtheNDigisPerEventPlot
 
MonitorElementtheNDigisPerLayerPlots [10]
 
edm::EDGetTokenT
< CSCStripDigiCollection
theStripDigi_Token_
 
MonitorElementtheStripDigiPlots [10]
 
MonitorElementtheTimeBinPlots [10]
 

Additional Inherited Members

- 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 13 of file CSCComparatorDigiValidation.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file CSCComparatorDigiValidation.cc.

References comparators_Token_, and HLT_25ns14e33_v1_cff::inputTag.

10  :
11  CSCBaseValidation(inputTag),
12  theStripDigi_Token_(iC.consumes<CSCStripDigiCollection>(stripDigiInputTag)),
17 {
19 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< CSCStripDigiCollection > theStripDigi_Token_
CSCBaseValidation(const edm::InputTag &inputTag)
edm::EDGetTokenT< CSCComparatorDigiCollection > comparators_Token_
CSCComparatorDigiValidation::~CSCComparatorDigiValidation ( )

Definition at line 21 of file CSCComparatorDigiValidation.cc.

22 {
23 }

Member Function Documentation

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

Implements CSCBaseValidation.

Definition at line 42 of file CSCComparatorDigiValidation.cc.

References ecalMGPA::adc(), CSCLayer::chamber(), CSCChamberSpecs::chamberType(), comparators_Token_, edm::InputTag::encode(), MonitorElement::Fill(), CSCBaseValidation::findLayer(), edm::Event::getByToken(), edm::HandleBase::isValid(), j, prof2calltree::last, DetId::rawId(), CSCChamber::specs(), the3StripPlots, CSCBaseValidation::theInputTag, theNDigisPerEventPlot, theNDigisPerLayerPlots, theStripDigi_Token_, theStripDigiPlots, and theTimeBinPlots.

Referenced by CSCDigiValidation::analyze().

43 {
46 
47  e.getByToken(comparators_Token_, comparators);
48  if (!comparators.isValid()) {
49  edm::LogError("CSCDigiDump") << "Cannot get comparators by label " << theInputTag.encode();
50  }
51  e.getByToken(theStripDigi_Token_, stripDigis);
52  if (!stripDigis.isValid()) {
53  edm::LogError("CSCDigiDump") << "Cannot get comparators by label " << theInputTag.encode();
54  }
55 
56  unsigned nDigisPerEvent = 0;
57 
58  for (CSCComparatorDigiCollection::DigiRangeIterator j=comparators->begin(); j!=comparators->end(); j++) {
59  std::vector<CSCComparatorDigi>::const_iterator digiItr = (*j).second.first;
60  std::vector<CSCComparatorDigi>::const_iterator last = (*j).second.second;
61 
62  CSCDetId detId((*j).first);
63  const CSCLayer * layer = findLayer(detId.rawId());
64  int chamberType = layer->chamber()->specs()->chamberType();
65 
66  CSCStripDigiCollection::Range stripRange = stripDigis->get(detId);
67 
68  theNDigisPerLayerPlots[chamberType-1]->Fill(last-digiItr);
69 
70  for( ; digiItr != last; ++digiItr) {
71  ++nDigisPerEvent;
72  theTimeBinPlots[chamberType-1]->Fill(digiItr->getTimeBin());
73 
74  int strip = digiItr->getStrip();
75  for(std::vector<CSCStripDigi>::const_iterator stripItr = stripRange.first;
76  stripItr != stripRange.second; ++stripItr)
77  {
78  if(stripItr->getStrip() == strip)
79  {
80  std::vector<int> adc = stripItr->getADCCounts();
81  float pedc = 0.5*(adc[0]+adc[1]);
82  float amp = adc[4] - pedc;
83  theStripDigiPlots[chamberType-1]->Fill(amp);
84  // check neighbors
85  if(stripItr != stripRange.first && stripItr != stripRange.second-1)
86  {
87  std::vector<int> adcl = (stripItr-1)->getADCCounts();
88  std::vector<int> adcr = (stripItr+1)->getADCCounts();
89  float pedl = 0.5*(adcl[0]+adcl[1]);
90  float pedr = 0.5*(adcr[0]+adcr[1]);
91  float three = adcl[4]-pedl
92  + adcr[4]-pedr
93  + amp;
94  the3StripPlots[chamberType-1]->Fill(three);
95  }
96  }
97  }
98  }
99 
100  }
101 
102  theNDigisPerEventPlot->Fill(nDigisPerEvent);
103 }
int adc(sample_type sample)
get the ADC sample (12 bits)
edm::InputTag theInputTag
edm::EDGetTokenT< CSCStripDigiCollection > theStripDigi_Token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
std::string encode() const
Definition: InputTag.cc:164
void Fill(long long x)
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:42
edm::EDGetTokenT< CSCComparatorDigiCollection > comparators_Token_
int j
Definition: DBlmapReader.cc:9
bool isValid() const
Definition: HandleBase.h:75
int chamberType() const
std::pair< const_iterator, const_iterator > Range
const CSCChamber * chamber() const
Definition: CSCLayer.h:52
const CSCLayer * findLayer(int detId) const
void CSCComparatorDigiValidation::bookHistograms ( DQMStore::IBooker iBooker)

Definition at line 25 of file CSCComparatorDigiValidation.cc.

References DQMStore::IBooker::book1D(), i, the3StripPlots, theNDigisPerEventPlot, theNDigisPerLayerPlots, theStripDigiPlots, and theTimeBinPlots.

Referenced by CSCDigiValidation::bookHistograms().

26 {
27  theNDigisPerEventPlot = iBooker.book1D("CSCComparatorDigisPerEvent", "CSC Comparator Digis per event", 100, 0, 100);
28  for(int i = 0; i < 10; ++i)
29  {
30  char title1[200], title2[200], title3[200], title4[200];
31  sprintf(title1, "CSCComparatorDigiTimeType%d", i+1);
32  sprintf(title2, "CSCComparatorDigisPerLayerType%d", i+1);
33  sprintf(title3, "CSCComparatorStripAmplitudeType%d", i+1);
34  sprintf(title4, "CSCComparator3StripAmplitudeType%d", i+1);
35  theTimeBinPlots[i] = iBooker.book1D(title1, title1, 9, 0, 8);
36  theNDigisPerLayerPlots[i] = iBooker.book1D(title2, title2, 100, 0, 20);
37  theStripDigiPlots[i] = iBooker.book1D(title3, title3, 100, 0, 1000);
38  the3StripPlots[i] = iBooker.book1D(title4, title4, 100, 0, 1000);
39  }
40 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115

Member Data Documentation

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

Definition at line 25 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and CSCComparatorDigiValidation().

MonitorElement* CSCComparatorDigiValidation::the3StripPlots[10]
private

Definition at line 30 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* CSCComparatorDigiValidation::theNDigisPerEventPlot
private

Definition at line 32 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* CSCComparatorDigiValidation::theNDigisPerLayerPlots[10]
private

Definition at line 28 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 24 of file CSCComparatorDigiValidation.h.

Referenced by analyze().

MonitorElement* CSCComparatorDigiValidation::theStripDigiPlots[10]
private

Definition at line 29 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* CSCComparatorDigiValidation::theTimeBinPlots[10]
private

Definition at line 27 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().