CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 &) 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
< CSCWireDigiCollection
wires_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 ( const edm::ParameterSet ps,
edm::ConsumesCollector &&  iC 
)

Definition at line 9 of file CSCWireDigiValidation.cc.

References edm::ParameterSet::getParameterSet(), inputTag_, TrackValidation_cff::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)
edm::EDGetTokenT< CSCWireDigiCollection > wires_Token_
MonitorElement * theNDigisPerLayerPlots[10]
CSCBaseValidation(const edm::ParameterSet &ps)
MonitorElement * theTimeBinPlots[10]
ParameterSet const & getParameterSet(std::string const &) const
CSCWireDigiValidation::~CSCWireDigiValidation ( )
override

Definition at line 16 of file CSCWireDigiValidation.cc.

16 {}

Member Function Documentation

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

Implements CSCBaseValidation.

Definition at line 43 of file CSCWireDigiValidation.cc.

References CSCLayer::chamber(), CSCChamberSpecs::chamberType(), CSCBaseValidation::doSim_, edm::InputTag::encode(), dqm::impl::MonitorElement::Fill(), CSCBaseValidation::findLayer(), edm::Event::getByToken(), PSimHitMap::hits(), inputTag_, edm::HandleBase::isValid(), dqmiolumiharvest::j, phase1PixelTopology::layer, plotResolution(), trackerHits::simHits, CSCChamber::specs(), 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;
63  theNDigisPerLayerPlots[chamberType - 1]->Fill(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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
Log< level::Error, false > LogError
std::string encode() const
Definition: InputTag.cc:159
constexpr std::array< uint8_t, layerIndexSize > layer
void Fill(long long x)
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:39
const PSimHitMap * theSimHitMap
edm::EDGetTokenT< CSCWireDigiCollection > wires_Token_
const edm::PSimHitContainer & hits(int detId) const
Definition: PSimHitMap.cc:20
MonitorElement * theNDigisPerLayerPlots[10]
bool isValid() const
Definition: HandleBase.h:70
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
tuple wires
Definition: DigiDM_cff.py:33
const CSCChamber * chamber() const
Definition: CSCLayer.h:49
const CSCLayer * findLayer(int detId) const
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, 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:32
MonitorElement * theResolutionPlots[10]
MonitorElement * theNDigisPerLayerPlots[10]
std::string chamberName() const
Definition: CSCDetId.cc:92
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
void CSCWireDigiValidation::plotResolution ( const PSimHit hit,
const CSCWireDigi digi,
const CSCLayer layer,
int  chamberType 
)

Definition at line 80 of file CSCWireDigiValidation.cc.

References dqm::impl::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().

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]
T y() const
Definition: PV3DBase.h:60
float yOfWireGroup(int wireGroup, float x=0.) const
void Fill(long long x)
Local3DPoint localPosition() const
Definition: PSimHit.h:52
int getWireGroup() const
default
Definition: CSCWireDigi.h:22
T x() const
Definition: PV3DBase.h:59
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44

Member Data Documentation

edm::InputTag CSCWireDigiValidation::inputTag_
private

Definition at line 20 of file CSCWireDigiValidation.h.

Referenced by analyze(), and CSCWireDigiValidation().

MonitorElement* CSCWireDigiValidation::theNDigisPerEventPlot
private

Definition at line 24 of file CSCWireDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* CSCWireDigiValidation::theNDigisPerLayerPlots[10]
private

Definition at line 22 of file CSCWireDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* CSCWireDigiValidation::theResolutionPlots[10]
private

Definition at line 23 of file CSCWireDigiValidation.h.

Referenced by bookHistograms(), and plotResolution().

MonitorElement* CSCWireDigiValidation::theTimeBinPlots[10]
private

Definition at line 21 of file CSCWireDigiValidation.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 19 of file CSCWireDigiValidation.h.

Referenced by analyze(), and CSCWireDigiValidation().