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
 
bool isSimTrackGood (const SimTrack &t) const
 
- Protected Attributes inherited from CSCBaseValidation
bool doSim_
 
double simTrackMaxEta_
 
double simTrackMinEta_
 
double simTrackMinPt_
 
const CSCGeometrytheCSCGeometry
 
const PSimHitMaptheSimHitMap
 

Detailed Description

Definition at line 10 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.

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

11  const auto &pset = ps.getParameterSet("cscWireDigi");
12  inputTag_ = pset.getParameter<edm::InputTag>("inputTag");
14 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< CSCWireDigiCollection > wires_Token_
MonitorElement * theNDigisPerLayerPlots[10]
CSCBaseValidation(const edm::ParameterSet &ps)
MonitorElement * theTimeBinPlots[10]

◆ ~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 43 of file CSCWireDigiValidation.cc.

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

43  {
45 
46  e.getByToken(wires_Token_, wires);
47 
48  if (!wires.isValid()) {
49  edm::LogError("CSCWireDigiValidation") << "Cannot get wires by label " << inputTag_.encode();
50  }
51 
52  unsigned nDigisPerEvent = 0;
53 
54  for (auto j = wires->begin(); j != wires->end(); j++) {
55  auto beginDigi = (*j).second.first;
56  auto endDigi = (*j).second.second;
57  int detId = (*j).first.rawId();
58 
59  const CSCLayer *layer = findLayer(detId);
60  int chamberType = layer->chamber()->specs()->chamberType();
61  int nDigis = endDigi - beginDigi;
62  nDigisPerEvent += nDigis;
64 
65  for (auto digiItr = beginDigi; digiItr != endDigi; ++digiItr) {
66  theTimeBinPlots[chamberType - 1]->Fill(digiItr->getTimeBin());
67  }
68 
69  if (doSim_) {
71  if (nDigis == 1 && simHits.size() == 1) {
72  plotResolution(simHits[0], *beginDigi, layer, chamberType);
73  }
74  }
75  }
76 
77  theNDigisPerEventPlot->Fill(nDigisPerEvent);
78 }
MonitorElement * theNDigisPerEventPlot
std::string encode() const
Definition: InputTag.cc:159
Log< level::Error, false > LogError
void Fill(long long x)
const PSimHitMap * theSimHitMap
edm::EDGetTokenT< CSCWireDigiCollection > wires_Token_
const CSCLayer * findLayer(int detId) const
MonitorElement * theNDigisPerLayerPlots[10]
const edm::PSimHitContainer & hits(int detId) const
Definition: PSimHitMap.cc:20
void plotResolution(const PSimHit &hit, const CSCWireDigi &digi, const CSCLayer *layer, int chamberType)
MonitorElement * theTimeBinPlots[10]
std::vector< PSimHit > PSimHitContainer

◆ bookHistograms()

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

Definition at line 18 of file CSCWireDigiValidation.cc.

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

18  {
19  iBooker.setCurrentFolder("MuonCSCDigisV/CSCDigiTask/Wire/Occupancy/");
21  iBooker.book1D("CSCWireDigisPerEvent", "CSC Wire Digis per event;CSC Wire Digis per event;Entries", 100, 0, 100);
22  for (int i = 1; i <= 10; ++i) {
23  const std::string t1("CSCWireDigiTime_" + CSCDetId::chamberName(i));
24  const std::string t2("CSCWireDigisPerLayer_" + 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  }
30 
31  iBooker.setCurrentFolder("MuonCSCDigisV/CSCDigiTask/Wire/Resolution/");
32  for (int i = 1; i <= 10; ++i) {
33  const std::string t3("CSCWireDigiResolution_" + CSCDetId::chamberName(i));
34  theResolutionPlots[i - 1] = iBooker.book1D(
35  t3,
36  "Wire Y Position Resolution " + CSCDetId::chamberName(i) + ";Wire Y Position Resolution [cm]; Entries",
37  100,
38  -10,
39  10);
40  }
41 }
MonitorElement * theNDigisPerEventPlot
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * theResolutionPlots[10]
std::string chamberName() const
Definition: CSCDetId.cc:92
MonitorElement * theNDigisPerLayerPlots[10]
MonitorElement * theTimeBinPlots[10]
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ plotResolution()

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

Definition at line 80 of file CSCWireDigiValidation.cc.

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

Referenced by analyze().

83  {
84  double hitX = hit.localPosition().x();
85  double hitY = hit.localPosition().y();
86  double digiY = layer->geometry()->yOfWireGroup(digi.getWireGroup(), hitX);
87  theResolutionPlots[chamberType - 1]->Fill(digiY - hitY);
88 }
MonitorElement * theResolutionPlots[10]
void Fill(long long x)
int getWireGroup() const
default
Definition: CSCWireDigi.h:22

Member Data Documentation

◆ inputTag_

edm::InputTag CSCWireDigiValidation::inputTag_
private

Definition at line 20 of file CSCWireDigiValidation.h.

Referenced by analyze(), and CSCWireDigiValidation().

◆ theNDigisPerEventPlot

MonitorElement* CSCWireDigiValidation::theNDigisPerEventPlot
private

Definition at line 24 of file CSCWireDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theNDigisPerLayerPlots

MonitorElement* CSCWireDigiValidation::theNDigisPerLayerPlots[10]
private

Definition at line 22 of file CSCWireDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theResolutionPlots

MonitorElement* CSCWireDigiValidation::theResolutionPlots[10]
private

Definition at line 23 of file CSCWireDigiValidation.h.

Referenced by bookHistograms(), and plotResolution().

◆ theTimeBinPlots

MonitorElement* CSCWireDigiValidation::theTimeBinPlots[10]
private

Definition at line 21 of file CSCWireDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ wires_Token_

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

Definition at line 19 of file CSCWireDigiValidation.h.

Referenced by analyze(), and CSCWireDigiValidation().