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
CSCCLCTDigiValidation Class Reference

#include <CSCCLCTDigiValidation.h>

Inheritance diagram for CSCCLCTDigiValidation:
CSCBaseValidation

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
 CSCCLCTDigiValidation (DQMStore *dbe, const edm::InputTag &inputTag, edm::ConsumesCollector &&iC)
 
void endJob ()
 
 ~CSCCLCTDigiValidation ()
 
- 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 Attributes

edm::EDGetTokenT
< CSCCLCTDigiCollection
clcts_Token_
 
MonitorElementtheNDigisPerEventPlot
 
MonitorElementtheNDigisPerLayerPlots [10]
 
MonitorElementtheTimeBinPlots [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 CSCCLCTDigiValidation.h.

Constructor & Destructor Documentation

CSCCLCTDigiValidation::CSCCLCTDigiValidation ( DQMStore dbe,
const edm::InputTag inputTag,
edm::ConsumesCollector &&  iC 
)

Definition at line 11 of file CSCCLCTDigiValidation.cc.

References DQMStore::book1D(), clcts_Token_, CSCBaseValidation::dbe_, i, theNDigisPerLayerPlots, and theTimeBinPlots.

14 : CSCBaseValidation(dbe, inputTag),
17  theNDigisPerEventPlot( dbe_->book1D("CSCCLCTDigisPerEvent", "CSC CLCT Digis per event", 100, 0, 100) )
18 {
20 
21  for(int i = 0; i < 10; ++i)
22  {
23  char title1[200], title2[200];
24  sprintf(title1, "CSCCLCTDigiTimeType%d", i+1);
25  sprintf(title2, "CSCCLCTDigisPerLayerType%d", i+1);
26  theTimeBinPlots[i] = dbe_->book1D(title1, title1, 20, 0, 20);
27  theNDigisPerLayerPlots[i] = dbe_->book1D(title2, title2, 100, 0, 20);
28  }
29 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int i
Definition: DBlmapReader.cc:9
MonitorElement * theNDigisPerLayerPlots[10]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:964
MonitorElement * theTimeBinPlots[10]
CSCBaseValidation(DQMStore *dbe, const edm::InputTag &inputTag)
MonitorElement * theNDigisPerEventPlot
edm::EDGetTokenT< CSCCLCTDigiCollection > clcts_Token_
CSCCLCTDigiValidation::~CSCCLCTDigiValidation ( )

Definition at line 33 of file CSCCLCTDigiValidation.cc.

34 {
35 
36 // for(int i = 0; i < 10; ++i)
37 // {
38 // edm::LogInfo("CSCDigiValidation") << "Mean of " << theTimeBinPlots[i]->getName()
39 // << " is " << theTimeBinPlots[i]->getMean()
40 // << " +/- " << theTimeBinPlots[i]->getRMS();
41 // }
42 
43 }

Member Function Documentation

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

Implements CSCBaseValidation.

Definition at line 46 of file CSCCLCTDigiValidation.cc.

References clcts_Token_, edm::InputTag::encode(), MonitorElement::Fill(), edm::Event::getByToken(), CSCDetId::iChamberType(), edm::HandleBase::isValid(), j, CSCBaseValidation::theInputTag, theNDigisPerLayerPlots, and theTimeBinPlots.

Referenced by CSCDigiValidation::analyze().

47 {
49 
50  e.getByToken(clcts_Token_, clcts);
51  if (!clcts.isValid()) {
52  edm::LogError("CSCDigiDump") << "Cannot get clcts by label " << theInputTag.encode();
53  }
54 
55  unsigned nDigisPerEvent = 0;
56 
57  for (CSCCLCTDigiCollection::DigiRangeIterator j=clcts->begin(); j!=clcts->end(); j++) {
58  std::vector<CSCCLCTDigi>::const_iterator beginDigi = (*j).second.first;
59  std::vector<CSCCLCTDigi>::const_iterator endDigi = (*j).second.second;
60  CSCDetId detId((*j).first.rawId());
61  int chamberType = detId.iChamberType();
62 
63  int nDigis = endDigi-beginDigi;
64  nDigisPerEvent += nDigis;
65  theNDigisPerLayerPlots[chamberType-1]->Fill(nDigis);
66 
67  for( std::vector<CSCCLCTDigi>::const_iterator digiItr = beginDigi;
68  digiItr != endDigi; ++digiItr)
69  {
70  theTimeBinPlots[chamberType-1]->Fill(digiItr->getBX());
71  }
72 
73  }
74 }
edm::InputTag theInputTag
MonitorElement * theNDigisPerLayerPlots[10]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
MonitorElement * theTimeBinPlots[10]
std::string encode() const
Definition: InputTag.cc:164
void Fill(long long x)
int j
Definition: DBlmapReader.cc:9
bool isValid() const
Definition: HandleBase.h:76
unsigned short iChamberType()
Definition: CSCDetId.h:120
edm::EDGetTokenT< CSCCLCTDigiCollection > clcts_Token_
void CSCCLCTDigiValidation::endJob ( void  )
inline

Definition at line 20 of file CSCCLCTDigiValidation.h.

20 {}

Member Data Documentation

edm::EDGetTokenT<CSCCLCTDigiCollection> CSCCLCTDigiValidation::clcts_Token_
private

Definition at line 23 of file CSCCLCTDigiValidation.h.

Referenced by analyze(), and CSCCLCTDigiValidation().

MonitorElement* CSCCLCTDigiValidation::theNDigisPerEventPlot
private

Definition at line 27 of file CSCCLCTDigiValidation.h.

MonitorElement* CSCCLCTDigiValidation::theNDigisPerLayerPlots[10]
private

Definition at line 26 of file CSCCLCTDigiValidation.h.

Referenced by analyze(), and CSCCLCTDigiValidation().

MonitorElement* CSCCLCTDigiValidation::theTimeBinPlots[10]
private

Definition at line 25 of file CSCCLCTDigiValidation.h.

Referenced by analyze(), and CSCCLCTDigiValidation().