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

#include <CSCWireDigiValidation.h>

Inheritance diagram for CSCWireDigiValidation:
CSCBaseValidation

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
 CSCWireDigiValidation (DQMStore *dbe, const edm::InputTag &inputTag, edm::ConsumesCollector &&, bool doSim)
 
void plotResolution (const PSimHit &hit, const CSCWireDigi &digi, const CSCLayer *layer, int chamberType)
 
 ~CSCWireDigiValidation ()
 
- 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

bool theDoSimFlag
 
MonitorElementtheNDigisPerEventPlot
 
MonitorElementtheNDigisPerLayerPlots [10]
 
MonitorElementtheResolutionPlots [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 11 of file CSCWireDigiValidation.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file CSCWireDigiValidation.cc.

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

16 : CSCBaseValidation(dbe, inputTag),
17  theDoSimFlag(doSim),
20  theNDigisPerEventPlot( dbe_->book1D("CSCWireDigisPerEvent", "CSC Wire Digis per event", 100, 0, 100) )
21 {
22  for(int i = 0; i < 10; ++i)
23  {
24  char title1[200], title2[200], title3[200];
25  sprintf(title1, "CSCWireDigiTimeType%d", i+1);
26  sprintf(title2, "CSCWireDigisPerLayerType%d", i+1);
27  sprintf(title3, "CSCWireDigiResolution%d", i+1);
28  theTimeBinPlots[i] = dbe_->book1D(title1, title1, 9, 0, 8);
29  theNDigisPerLayerPlots[i] = dbe_->book1D(title2, title2, 100, 0, 20);
30  theResolutionPlots[i] = dbe_->book1D(title3, title3, 100, -10, 10);
31  }
32 }
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:873
MonitorElement * theResolutionPlots[10]
MonitorElement * theNDigisPerLayerPlots[10]
CSCBaseValidation(DQMStore *dbe, const edm::InputTag &inputTag)
MonitorElement * theTimeBinPlots[10]
CSCWireDigiValidation::~CSCWireDigiValidation ( )

Definition at line 36 of file CSCWireDigiValidation.cc.

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

Member Function Documentation

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

Implements CSCBaseValidation.

Definition at line 49 of file CSCWireDigiValidation.cc.

References CSCLayer::chamber(), CSCChamberSpecs::chamberType(), edm::InputTag::encode(), MonitorElement::Fill(), CSCBaseValidation::findLayer(), edm::Event::getByLabel(), PSimHitMap::hits(), edm::HandleBase::isValid(), j, plotResolution(), trackerHits::simHits, CSCChamber::specs(), theDoSimFlag, CSCBaseValidation::theInputTag, theNDigisPerEventPlot, theNDigisPerLayerPlots, CSCBaseValidation::theSimHitMap, and theTimeBinPlots.

Referenced by CSCDigiValidation::analyze().

50 {
52 
53  e.getByLabel(theInputTag, wires);
54  if (!wires.isValid()) {
55  edm::LogError("CSCDigiDump") << "Cannot get wires by label " << theInputTag.encode();
56  }
57 
58  unsigned nDigisPerEvent = 0;
59 
60  for (CSCWireDigiCollection::DigiRangeIterator j=wires->begin(); j!=wires->end(); j++) {
61  std::vector<CSCWireDigi>::const_iterator beginDigi = (*j).second.first;
62  std::vector<CSCWireDigi>::const_iterator endDigi = (*j).second.second;
63  int detId = (*j).first.rawId();
64 
65  const CSCLayer * layer = findLayer(detId);
66  int chamberType = layer->chamber()->specs()->chamberType();
67  int nDigis = endDigi-beginDigi;
68  nDigisPerEvent += nDigis;
69  theNDigisPerLayerPlots[chamberType-1]->Fill(nDigis);
70 
71  for( std::vector<CSCWireDigi>::const_iterator digiItr = beginDigi;
72  digiItr != endDigi; ++digiItr)
73  {
74  theTimeBinPlots[chamberType-1]->Fill(digiItr->getTimeBin());
75  }
76 
77  if(theDoSimFlag)
78  {
80  if(nDigis == 1 && simHits.size() == 1)
81  {
82  plotResolution(simHits[0], *beginDigi, layer, chamberType);
83  }
84  }
85  }
86 
87  theNDigisPerEventPlot->Fill(nDigisPerEvent);
88 }
edm::InputTag theInputTag
MonitorElement * theNDigisPerEventPlot
std::string encode() const
Definition: InputTag.cc:164
void Fill(long long x)
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:42
const PSimHitMap * theSimHitMap
const edm::PSimHitContainer & hits(int detId) const
Definition: PSimHitMap.cc:32
MonitorElement * theNDigisPerLayerPlots[10]
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:390
void plotResolution(const PSimHit &hit, const CSCWireDigi &digi, const CSCLayer *layer, int chamberType)
MonitorElement * theTimeBinPlots[10]
int chamberType() const
tuple simHits
Definition: trackerHits.py:16
std::vector< PSimHit > PSimHitContainer
const CSCChamber * chamber() const
Definition: CSCLayer.h:52
const CSCLayer * findLayer(int detId) const
void CSCWireDigiValidation::plotResolution ( const PSimHit hit,
const CSCWireDigi digi,
const CSCLayer layer,
int  chamberType 
)

Definition at line 91 of file CSCWireDigiValidation.cc.

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

Referenced by analyze().

95 {
96  double hitX = hit.localPosition().x();
97  double hitY = hit.localPosition().y();
98  double digiY = layer->geometry()->yOfWireGroup(digi.getWireGroup(), hitX);
99  theResolutionPlots[chamberType-1]->Fill(digiY - hitY);
100 }
MonitorElement * theResolutionPlots[10]
T y() const
Definition: PV3DBase.h:63
float yOfWireGroup(int wireGroup, float x=0.) const
void Fill(long long x)
Local3DPoint localPosition() const
Definition: PSimHit.h:44
int getWireGroup() const
default
Definition: CSCWireDigi.h:24
T x() const
Definition: PV3DBase.h:62
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47

Member Data Documentation

bool CSCWireDigiValidation::theDoSimFlag
private

Definition at line 25 of file CSCWireDigiValidation.h.

Referenced by analyze().

MonitorElement* CSCWireDigiValidation::theNDigisPerEventPlot
private

Definition at line 29 of file CSCWireDigiValidation.h.

Referenced by analyze().

MonitorElement* CSCWireDigiValidation::theNDigisPerLayerPlots[10]
private

Definition at line 27 of file CSCWireDigiValidation.h.

Referenced by analyze(), and CSCWireDigiValidation().

MonitorElement* CSCWireDigiValidation::theResolutionPlots[10]
private

Definition at line 28 of file CSCWireDigiValidation.h.

Referenced by CSCWireDigiValidation(), and plotResolution().

MonitorElement* CSCWireDigiValidation::theTimeBinPlots[10]
private

Definition at line 26 of file CSCWireDigiValidation.h.

Referenced by analyze(), and CSCWireDigiValidation().