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::ParameterSet &ps, edm::ConsumesCollector &&iC)
 
void plotResolution (const PSimHit &hit, const CSCWireDigi &digi, const CSCLayer *layer, int chamberType)
 
 ~CSCWireDigiValidation () override
 
- Public Member Functions inherited from CSCBaseValidation
 CSCBaseValidation (const edm::ParameterSet &ps)
 
void setGeometry (const CSCGeometry *geom)
 
void setSimHitMap (const PSimHitMap *simHitMap)
 
virtual ~CSCBaseValidation ()
 

Private Attributes

edm::InputTag inputTag_
 
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
bool doSim_
 
const CSCGeometrytheCSCGeometry
 
const PSimHitMaptheSimHitMap
 

Detailed Description

Definition at line 11 of file CSCWireDigiValidation.h.

Constructor & Destructor Documentation

◆ CSCWireDigiValidation()

CSCWireDigiValidation::CSCWireDigiValidation ( const edm::ParameterSet ps,
edm::ConsumesCollector &&  iC 
)

Definition at line 9 of file CSCWireDigiValidation.cc.

11  const auto &pset = ps.getParameterSet("cscWireDigi");
12  inputTag_ = pset.getParameter<edm::InputTag>("inputTag");
14 }

References edm::ParameterSet::getParameterSet(), inputTag_, muonDTDigis_cfi::pset, and wires_Token_.

◆ ~CSCWireDigiValidation()

CSCWireDigiValidation::~CSCWireDigiValidation ( )
override

Definition at line 16 of file CSCWireDigiValidation.cc.

16 {}

Member Function Documentation

◆ analyze()

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

Implements CSCBaseValidation.

Definition at line 38 of file CSCWireDigiValidation.cc.

38  {
40 
41  e.getByToken(wires_Token_, wires);
42 
43  if (!wires.isValid()) {
44  edm::LogError("CSCWireDigiValidation") << "Cannot get wires by label " << inputTag_.encode();
45  }
46 
47  unsigned nDigisPerEvent = 0;
48 
49  for (auto j = wires->begin(); j != wires->end(); j++) {
50  auto beginDigi = (*j).second.first;
51  auto endDigi = (*j).second.second;
52  int detId = (*j).first.rawId();
53 
54  const CSCLayer *layer = findLayer(detId);
55  int chamberType = layer->chamber()->specs()->chamberType();
56  int nDigis = endDigi - beginDigi;
57  nDigisPerEvent += nDigis;
58  theNDigisPerLayerPlots[chamberType - 1]->Fill(nDigis);
59 
60  for (auto digiItr = beginDigi; digiItr != endDigi; ++digiItr) {
61  theTimeBinPlots[chamberType - 1]->Fill(digiItr->getTimeBin());
62  }
63 
64  if (doSim_) {
66  if (nDigis == 1 && simHits.size() == 1) {
67  plotResolution(simHits[0], *beginDigi, layer, chamberType);
68  }
69  }
70  }
71 
72  theNDigisPerEventPlot->Fill(nDigisPerEvent);
73 }

References CSCBaseValidation::doSim_, MillePedeFileConverter_cfg::e, edm::InputTag::encode(), dqm::impl::MonitorElement::Fill(), CSCBaseValidation::findLayer(), PSimHitMap::hits(), inputTag_, dqmiolumiharvest::j, phase1PixelTopology::layer, plotResolution(), FastTrackerRecHitCombiner_cfi::simHits, theNDigisPerEventPlot, theNDigisPerLayerPlots, CSCBaseValidation::theSimHitMap, theTimeBinPlots, DigiDM_cff::wires, and wires_Token_.

◆ bookHistograms()

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

Definition at line 18 of file CSCWireDigiValidation.cc.

18  {
20  iBooker.book1D("CSCWireDigisPerEvent", "CSC Wire Digis per event;CSC Wire Digis per event;Entries", 100, 0, 100);
21  for (int i = 1; i <= 10; ++i) {
22  const std::string t1("CSCWireDigiTime_" + CSCDetId::chamberName(i));
23  const std::string t2("CSCWireDigisPerLayer_" + CSCDetId::chamberName(i));
24  const std::string t3("CSCWireDigiResolution_" + CSCDetId::chamberName(i));
25  theTimeBinPlots[i - 1] =
26  iBooker.book1D(t1, "Wire Time Bin " + CSCDetId::chamberName(i) + ";Wire Time Bin; Entries", 16, 0, 16);
27  theNDigisPerLayerPlots[i - 1] = iBooker.book1D(
28  t2, "Number of Wire Digis " + CSCDetId::chamberName(i) + ";Number of Wire Digis; Entries", 100, 0, 20);
29  theResolutionPlots[i - 1] = iBooker.book1D(
30  t3,
31  "Wire Y Position Resolution " + CSCDetId::chamberName(i) + ";Wire Y Position Resolution; Entries",
32  100,
33  -10,
34  10);
35  }
36 }

References dqm::implementation::IBooker::book1D(), CSCDetId::chamberName(), mps_fire::i, AlCaHLTBitMon_QueryRunRegistry::string, RandomServiceHelper::t1, RandomServiceHelper::t2, RandomServiceHelper::t3, theNDigisPerEventPlot, theNDigisPerLayerPlots, theResolutionPlots, and theTimeBinPlots.

◆ plotResolution()

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

Definition at line 75 of file CSCWireDigiValidation.cc.

78  {
79  double hitX = hit.localPosition().x();
80  double hitY = hit.localPosition().y();
81  double digiY = layer->geometry()->yOfWireGroup(digi.getWireGroup(), hitX);
82  theResolutionPlots[chamberType - 1]->Fill(digiY - hitY);
83 }

References dqm::impl::MonitorElement::Fill(), CSCWireDigi::getWireGroup(), phase1PixelTopology::layer, theResolutionPlots, hit::x, and hit::y.

Referenced by analyze().

Member Data Documentation

◆ inputTag_

edm::InputTag CSCWireDigiValidation::inputTag_
private

Definition at line 21 of file CSCWireDigiValidation.h.

Referenced by analyze(), and CSCWireDigiValidation().

◆ 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::theResolutionPlots
MonitorElement * theResolutionPlots[10]
Definition: CSCWireDigiValidation.h:24
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
mps_fire.i
i
Definition: mps_fire.py:428
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
CSCWireDigi::getWireGroup
int getWireGroup() const
default
Definition: CSCWireDigi.h:22
DigiDM_cff.wires
wires
Definition: DigiDM_cff.py:33
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
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
CSCBaseValidation::CSCBaseValidation
CSCBaseValidation(const edm::ParameterSet &ps)
Definition: CSCBaseValidation.cc:4
CSCBaseValidation::doSim_
bool doSim_
Definition: CSCBaseValidation.h:26
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:55
CSCBaseValidation::findLayer
const CSCLayer * findLayer(int detId) const
Definition: CSCBaseValidation.cc:7
RandomServiceHelper.t3
t3
Definition: RandomServiceHelper.py:258
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
CSCBaseValidation::theSimHitMap
const PSimHitMap * theSimHitMap
Definition: CSCBaseValidation.h:28
CSCWireDigiValidation::wires_Token_
edm::EDGetTokenT< CSCWireDigiCollection > wires_Token_
Definition: CSCWireDigiValidation.h:20
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCWireDigiCollection
CSCWireDigiValidation::theNDigisPerEventPlot
MonitorElement * theNDigisPerEventPlot
Definition: CSCWireDigiValidation.h:25
CSCDetId::chamberName
std::string chamberName() const
Definition: CSCDetId.cc:86
PSimHitMap::hits
const edm::PSimHitContainer & hits(int detId) const
Definition: PSimHitMap.cc:20
CSCWireDigiValidation::theNDigisPerLayerPlots
MonitorElement * theNDigisPerLayerPlots[10]
Definition: CSCWireDigiValidation.h:23
CSCWireDigiValidation::inputTag_
edm::InputTag inputTag_
Definition: CSCWireDigiValidation.h:21
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CSCWireDigiValidation::plotResolution
void plotResolution(const PSimHit &hit, const CSCWireDigi &digi, const CSCLayer *layer, int chamberType)
Definition: CSCWireDigiValidation.cc:75
edm::InputTag
Definition: InputTag.h:15
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
hit
Definition: SiStripHitEffFromCalibTree.cc:88
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37