CMS 3D CMS Logo

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

bool doSim_
 
MonitorElementtheNDigisPerEventPlot
 
MonitorElementtheNDigisPerLayerPlots [10]
 
MonitorElementtheResolutionPlots [10]
 
MonitorElementtheTimeBinPlots [10]
 
edm::EDGetTokenT< CSCWireDigiCollectionwires_Token_
 

Additional Inherited Members

- Public Types inherited from CSCBaseValidation
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- 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 11 of file CSCWireDigiValidation.h.

Constructor & Destructor Documentation

◆ CSCWireDigiValidation()

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

◆ ~CSCWireDigiValidation()

CSCWireDigiValidation::~CSCWireDigiValidation ( )
override

Definition at line 14 of file CSCWireDigiValidation.cc.

14 {}

Member Function Documentation

◆ analyze()

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

Implements CSCBaseValidation.

Definition at line 29 of file CSCWireDigiValidation.cc.

29  {
31 
32  e.getByToken(wires_Token_, wires);
33 
34  if (!wires.isValid()) {
35  edm::LogError("CSCDigiDump") << "Cannot get wires by label " << theInputTag.encode();
36  }
37 
38  unsigned nDigisPerEvent = 0;
39 
40  for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); j != wires->end(); j++) {
41  std::vector<CSCWireDigi>::const_iterator beginDigi = (*j).second.first;
42  std::vector<CSCWireDigi>::const_iterator endDigi = (*j).second.second;
43  int detId = (*j).first.rawId();
44 
45  const CSCLayer *layer = findLayer(detId);
46  int chamberType = layer->chamber()->specs()->chamberType();
47  int nDigis = endDigi - beginDigi;
48  nDigisPerEvent += nDigis;
49  theNDigisPerLayerPlots[chamberType - 1]->Fill(nDigis);
50 
51  for (std::vector<CSCWireDigi>::const_iterator digiItr = beginDigi; digiItr != endDigi; ++digiItr) {
52  theTimeBinPlots[chamberType - 1]->Fill(digiItr->getTimeBin());
53  }
54 
55  if (doSim_) {
57  if (nDigis == 1 && simHits.size() == 1) {
58  plotResolution(simHits[0], *beginDigi, layer, chamberType);
59  }
60  }
61  }
62 
63  theNDigisPerEventPlot->Fill(nDigisPerEvent);
64 }

References CSCLayer::chamber(), CSCChamberSpecs::chamberType(), doSim_, MillePedeFileConverter_cfg::e, edm::InputTag::encode(), dqm::impl::MonitorElement::Fill(), CSCBaseValidation::findLayer(), PSimHitMap::hits(), dqmiolumiharvest::j, plotResolution(), FastTrackerRecHitCombiner_cfi::simHits, CSCChamber::specs(), CSCBaseValidation::theInputTag, theNDigisPerEventPlot, theNDigisPerLayerPlots, CSCBaseValidation::theSimHitMap, theTimeBinPlots, DigiDM_cff::wires, and wires_Token_.

◆ bookHistograms()

void CSCWireDigiValidation::bookHistograms ( DQMStore::IBooker iBooker)

Definition at line 16 of file CSCWireDigiValidation.cc.

16  {
17  theNDigisPerEventPlot = iBooker.book1D("CSCWireDigisPerEvent", "CSC Wire Digis per event", 100, 0, 100);
18  for (int i = 0; i < 10; ++i) {
19  char title1[200], title2[200], title3[200];
20  sprintf(title1, "CSCWireDigiTimeType%d", i + 1);
21  sprintf(title2, "CSCWireDigisPerLayerType%d", i + 1);
22  sprintf(title3, "CSCWireDigiResolution%d", i + 1);
23  theTimeBinPlots[i] = iBooker.book1D(title1, title1, 9, 0, 8);
24  theNDigisPerLayerPlots[i] = iBooker.book1D(title2, title2, 100, 0, 20);
25  theResolutionPlots[i] = iBooker.book1D(title3, title3, 100, -10, 10);
26  }
27 }

References dqm::implementation::IBooker::book1D(), mps_fire::i, theNDigisPerEventPlot, theNDigisPerLayerPlots, theResolutionPlots, and theTimeBinPlots.

◆ plotResolution()

void CSCWireDigiValidation::plotResolution ( const PSimHit hit,
const CSCWireDigi digi,
const CSCLayer layer,
int  chamberType 
)

Definition at line 66 of file CSCWireDigiValidation.cc.

69  {
70  double hitX = hit.localPosition().x();
71  double hitY = hit.localPosition().y();
72  double digiY = layer->geometry()->yOfWireGroup(digi.getWireGroup(), hitX);
73  theResolutionPlots[chamberType - 1]->Fill(digiY - hitY);
74 }

References dqm::impl::MonitorElement::Fill(), CSCLayer::geometry(), CSCWireDigi::getWireGroup(), theResolutionPlots, hit::x, hit::y, and CSCLayerGeometry::yOfWireGroup().

Referenced by analyze().

Member Data Documentation

◆ doSim_

bool CSCWireDigiValidation::doSim_
private

Definition at line 21 of file CSCWireDigiValidation.h.

Referenced by analyze().

◆ theNDigisPerEventPlot

MonitorElement* CSCWireDigiValidation::theNDigisPerEventPlot
private

Definition at line 25 of file CSCWireDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theNDigisPerLayerPlots

MonitorElement* CSCWireDigiValidation::theNDigisPerLayerPlots[10]
private

Definition at line 23 of file CSCWireDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theResolutionPlots

MonitorElement* CSCWireDigiValidation::theResolutionPlots[10]
private

Definition at line 24 of file CSCWireDigiValidation.h.

Referenced by bookHistograms(), and plotResolution().

◆ theTimeBinPlots

MonitorElement* CSCWireDigiValidation::theTimeBinPlots[10]
private

Definition at line 22 of file CSCWireDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ wires_Token_

edm::EDGetTokenT<CSCWireDigiCollection> CSCWireDigiValidation::wires_Token_
private

Definition at line 20 of file CSCWireDigiValidation.h.

Referenced by analyze(), and CSCWireDigiValidation().

CSCWireDigiValidation::doSim_
bool doSim_
Definition: CSCWireDigiValidation.h:21
CSCWireDigiValidation::theResolutionPlots
MonitorElement * theResolutionPlots[10]
Definition: CSCWireDigiValidation.h:24
mps_fire.i
i
Definition: mps_fire.py:355
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
cscDigiValidation_cfi.doSim
doSim
Definition: cscDigiValidation_cfi.py:12
CSCLayer::chamber
const CSCChamber * chamber() const
Definition: CSCLayer.h:49
CSCWireDigi::getWireGroup
int getWireGroup() const
default
Definition: CSCWireDigi.h:22
DigiDM_cff.wires
wires
Definition: DigiDM_cff.py:33
CSCChamberSpecs::chamberType
int chamberType() const
Definition: CSCChamberSpecs.cc:154
CSCBaseValidation::theInputTag
edm::InputTag theInputTag
Definition: CSCBaseValidation.h:28
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
CSCWireDigiValidation::theTimeBinPlots
MonitorElement * theTimeBinPlots[10]
Definition: CSCWireDigiValidation.h:22
CSCLayer
Definition: CSCLayer.h:24
edm::Handle< CSCWireDigiCollection >
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
CSCBaseValidation::CSCBaseValidation
CSCBaseValidation(const edm::InputTag &inputTag)
Definition: CSCBaseValidation.cc:4
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
CSCBaseValidation::findLayer
const CSCLayer * findLayer(int detId) const
Definition: CSCBaseValidation.cc:7
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
CSCBaseValidation::theSimHitMap
const PSimHitMap * theSimHitMap
Definition: CSCBaseValidation.h:29
edm::LogError
Definition: MessageLogger.h:183
CSCWireDigiValidation::wires_Token_
edm::EDGetTokenT< CSCWireDigiCollection > wires_Token_
Definition: CSCWireDigiValidation.h:20
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
CSCChamber::specs
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:39
CSCWireDigiCollection
CSCWireDigiValidation::theNDigisPerEventPlot
MonitorElement * theNDigisPerEventPlot
Definition: CSCWireDigiValidation.h:25
PSimHitMap::hits
const edm::PSimHitContainer & hits(int detId) const
Definition: PSimHitMap.cc:19
CSCWireDigiValidation::theNDigisPerLayerPlots
MonitorElement * theNDigisPerLayerPlots[10]
Definition: CSCWireDigiValidation.h:23
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
CSCLayerGeometry::yOfWireGroup
float yOfWireGroup(int wireGroup, float x=0.) const
Definition: CSCLayerGeometry.h:201
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
DigiContainerIterator
Definition: MuonDigiCollection.h:30
CSCWireDigiValidation::plotResolution
void plotResolution(const PSimHit &hit, const CSCWireDigi &digi, const CSCLayer *layer, int chamberType)
Definition: CSCWireDigiValidation.cc:66
hit
Definition: SiStripHitEffFromCalibTree.cc:88
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37