CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCRecHit2DValidation Class Reference

#include <CSCRecHit2DValidation.h>

Inheritance diagram for CSCRecHit2DValidation:
CSCBaseValidation

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &)
 
 CSCRecHit2DValidation (const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
 
 ~CSCRecHit2DValidation () 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 Member Functions

void plotResolution (const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
 

Private Attributes

edm::InputTag inputTag_
 
edm::EDGetTokenT< CSCRecHit2DCollectionrechits_Token_
 
MonitorElementtheNPerEventPlot
 
MonitorElementthePullPlots [10]
 
MonitorElementtheRecHitPosInStrip [10]
 
MonitorElementtheResolutionPlots [10]
 
MonitorElementtheScatterPlots [10]
 
MonitorElementtheSimHitPosInStrip [10]
 
MonitorElementtheSimHitScatterPlots [10]
 
MonitorElementtheTPeaks [10]
 
MonitorElementtheYPullPlots [10]
 
MonitorElementtheYResolutionPlots [10]
 

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 8 of file CSCRecHit2DValidation.h.

Constructor & Destructor Documentation

◆ CSCRecHit2DValidation()

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

Definition at line 5 of file CSCRecHit2DValidation.cc.

6  : CSCBaseValidation(ps), theNPerEventPlot(nullptr) {
7  const auto &pset = ps.getParameterSet("cscRecHit");
8  inputTag_ = pset.getParameter<edm::InputTag>("inputTag");
10 }

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

◆ ~CSCRecHit2DValidation()

CSCRecHit2DValidation::~CSCRecHit2DValidation ( )
override

Definition at line 12 of file CSCRecHit2DValidation.cc.

12 {}

Member Function Documentation

◆ analyze()

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

Implements CSCBaseValidation.

Definition at line 44 of file CSCRecHit2DValidation.cc.

44  {
45  // get the collection of CSCRecHrecHitItrD
47  e.getByToken(rechits_Token_, hRecHits);
48  const CSCRecHit2DCollection *cscRecHits = hRecHits.product();
49 
50  unsigned nPerEvent = 0;
51 
52  for (auto recHitItr = cscRecHits->begin(); recHitItr != cscRecHits->end(); recHitItr++) {
53  ++nPerEvent;
54  int detId = (*recHitItr).cscDetId().rawId();
56  const CSCLayer *layer = findLayer(detId);
57  int chamberType = layer->chamber()->specs()->chamberType();
58  theTPeaks[chamberType - 1]->Fill(recHitItr->tpeak());
59  if (simHits.size() == 1) {
60  plotResolution(simHits[0], *recHitItr, layer, chamberType);
61  }
62  float localX = recHitItr->localPosition().x();
63  float localY = recHitItr->localPosition().y();
64  // find a local phi
65  float globalR = layer->toGlobal(LocalPoint(0., 0., 0.)).perp();
66  GlobalPoint axisThruChamber(globalR + localY, localX, 0.);
67  float localPhi = axisThruChamber.phi().degrees();
68  theScatterPlots[chamberType - 1]->Fill(localPhi, localY);
69  }
70  theNPerEventPlot->Fill(nPerEvent);
71 
72  if (doSim_) {
73  // fill sim hits
74  std::vector<int> layersWithSimHits = theSimHitMap->detsWithHits();
75  for (unsigned i = 0; i < layersWithSimHits.size(); ++i) {
76  edm::PSimHitContainer simHits = theSimHitMap->hits(layersWithSimHits[i]);
77  for (auto hitItr = simHits.begin(); hitItr != simHits.end(); ++hitItr) {
78  const CSCLayer *layer = findLayer(layersWithSimHits[i]);
79  int chamberType = layer->chamber()->specs()->chamberType();
80  float localX = hitItr->localPosition().x();
81  float localY = hitItr->localPosition().y();
82  // find a local phi
83  float globalR = layer->toGlobal(LocalPoint(0., 0., 0.)).perp();
84  GlobalPoint axisThruChamber(globalR + localY, localX, 0.);
85  float localPhi = axisThruChamber.phi().degrees();
86  theSimHitScatterPlots[chamberType - 1]->Fill(localPhi, localY);
87  }
88  }
89  }
90 }

References Geom::Phi< T1, Range >::degrees(), PSimHitMap::detsWithHits(), CSCBaseValidation::doSim_, MillePedeFileConverter_cfg::e, dqm::impl::MonitorElement::Fill(), CSCBaseValidation::findLayer(), PSimHitMap::hits(), mps_fire::i, phase1PixelTopology::layer, phase1PixelTopology::localX(), phase1PixelTopology::localY(), PV3DBase< T, PVType, FrameType >::phi(), plotResolution(), edm::Handle< T >::product(), rechits_Token_, FastTrackerRecHitCombiner_cfi::simHits, theNPerEventPlot, theScatterPlots, CSCBaseValidation::theSimHitMap, theSimHitScatterPlots, and theTPeaks.

◆ bookHistograms()

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

Definition at line 14 of file CSCRecHit2DValidation.cc.

14  {
15  theNPerEventPlot = iBooker.book1D("CSCRecHitsPerEvent", "Number of CSC Rec Hits per event", 100, 0, 500);
16  // 10 chamber types, if you consider ME1/a and ME1/b separate
17  for (int i = 1; i <= 10; ++i) {
19  const std::string t1("CSCRecHitResolution_" + cn);
20  const std::string t2("CSCRecHitPull_" + cn);
21  const std::string t3("CSCRecHitYResolution_" + cn);
22 
23  const std::string t4("CSCRecHitYPull_" + cn);
24  const std::string t5("CSCRecHitPosInStrip_" + cn);
25  const std::string t6("CSCSimHitPosInStrip_" + cn);
26 
27  const std::string t7("CSCRecHit_" + cn);
28  const std::string t8("CSCSimHit_" + cn);
29  const std::string t9("CSCTPeak_" + cn);
30 
31  theResolutionPlots[i - 1] = iBooker.book1D(t1, t1 + ";R*dPhi Resolution [cm];Entries", 100, -0.2, 0.2);
32  thePullPlots[i - 1] = iBooker.book1D(t2, t2 + ";dPhi Pull;Entries", 100, -3, 3);
33  theYResolutionPlots[i - 1] = iBooker.book1D(t3, t3 + ";Local Y Resolution [cm];Entries", 100, -5, 5);
34  theYPullPlots[i - 1] = iBooker.book1D(t4, t4 + ";Local Y Pull;Entries", 100, -3, 3);
35  theRecHitPosInStrip[i - 1] = iBooker.book1D(t5, t5 + ";Position in Strip;Entries", 100, -2, 2);
36  theSimHitPosInStrip[i - 1] = iBooker.book1D(t6, t6 + ";Position in Strip;Entries", 100, -2, 2);
37 
38  theScatterPlots[i - 1] = iBooker.book2D(t7, t7 + ";Local Phi;Local Y [cm]", 200, -20, 20, 200, -250, 250);
39  theSimHitScatterPlots[i - 1] = iBooker.book2D(t8, t8 + ";Local Phi;Local Y [cm]", 200, -20, 20, 200, -250, 250);
40  theTPeaks[i - 1] = iBooker.book1D(t9, t9 + ";Peak Time [ns];Entries", 200, 0, 400);
41  }
42 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), CSCDetId::chamberName(), mps_fire::i, AlCaHLTBitMon_QueryRunRegistry::string, RandomServiceHelper::t1, RandomServiceHelper::t2, RandomServiceHelper::t3, theNPerEventPlot, thePullPlots, theRecHitPosInStrip, theResolutionPlots, theScatterPlots, theSimHitPosInStrip, theSimHitScatterPlots, theTPeaks, theYPullPlots, and theYResolutionPlots.

◆ plotResolution()

void CSCRecHit2DValidation::plotResolution ( const PSimHit simHit,
const CSCRecHit2D recHit,
const CSCLayer layer,
int  chamberType 
)
private

Definition at line 92 of file CSCRecHit2DValidation.cc.

95  {
96  GlobalPoint simHitPos = layer->toGlobal(simHit.localPosition());
97  GlobalPoint recHitPos = layer->toGlobal(recHit.localPosition());
98 
99  double dphi = recHitPos.phi() - simHitPos.phi();
100  double rdphi = recHitPos.perp() * dphi;
101  theResolutionPlots[chamberType - 1]->Fill(rdphi);
102  thePullPlots[chamberType - 1]->Fill(rdphi / sqrt(recHit.localPositionError().xx()));
103  double dy = recHit.localPosition().y() - simHit.localPosition().y();
104  theYResolutionPlots[chamberType - 1]->Fill(dy);
105  theYPullPlots[chamberType - 1]->Fill(dy / sqrt(recHit.localPositionError().yy()));
106 
107  const CSCLayerGeometry *layerGeometry = layer->geometry();
108  float recStrip = layerGeometry->strip(recHit.localPosition());
109  float simStrip = layerGeometry->strip(simHit.localPosition());
110  theRecHitPosInStrip[chamberType - 1]->Fill(recStrip - int(recStrip));
111  theSimHitPosInStrip[chamberType - 1]->Fill(simStrip - int(simStrip));
112 }

References PVValHelper::dy, dqm::impl::MonitorElement::Fill(), phase1PixelTopology::layer, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), rpcPointValidation_cfi::recHit, rpcPointValidation_cfi::simHit, mathSSE::sqrt(), CSCLayerGeometry::strip(), thePullPlots, theRecHitPosInStrip, theResolutionPlots, theSimHitPosInStrip, theYPullPlots, and theYResolutionPlots.

Referenced by analyze().

Member Data Documentation

◆ inputTag_

edm::InputTag CSCRecHit2DValidation::inputTag_
private

Definition at line 17 of file CSCRecHit2DValidation.h.

Referenced by CSCRecHit2DValidation().

◆ rechits_Token_

edm::EDGetTokenT<CSCRecHit2DCollection> CSCRecHit2DValidation::rechits_Token_
private

Definition at line 16 of file CSCRecHit2DValidation.h.

Referenced by analyze(), and CSCRecHit2DValidation().

◆ theNPerEventPlot

MonitorElement* CSCRecHit2DValidation::theNPerEventPlot
private

Definition at line 21 of file CSCRecHit2DValidation.h.

Referenced by analyze(), and bookHistograms().

◆ thePullPlots

MonitorElement* CSCRecHit2DValidation::thePullPlots[10]
private

Definition at line 23 of file CSCRecHit2DValidation.h.

Referenced by bookHistograms(), and plotResolution().

◆ theRecHitPosInStrip

MonitorElement* CSCRecHit2DValidation::theRecHitPosInStrip[10]
private

Definition at line 28 of file CSCRecHit2DValidation.h.

Referenced by bookHistograms(), and plotResolution().

◆ theResolutionPlots

MonitorElement* CSCRecHit2DValidation::theResolutionPlots[10]
private

Definition at line 22 of file CSCRecHit2DValidation.h.

Referenced by bookHistograms(), and plotResolution().

◆ theScatterPlots

MonitorElement* CSCRecHit2DValidation::theScatterPlots[10]
private

Definition at line 26 of file CSCRecHit2DValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theSimHitPosInStrip

MonitorElement* CSCRecHit2DValidation::theSimHitPosInStrip[10]
private

Definition at line 29 of file CSCRecHit2DValidation.h.

Referenced by bookHistograms(), and plotResolution().

◆ theSimHitScatterPlots

MonitorElement* CSCRecHit2DValidation::theSimHitScatterPlots[10]
private

Definition at line 27 of file CSCRecHit2DValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theTPeaks

MonitorElement* CSCRecHit2DValidation::theTPeaks[10]
private

Definition at line 30 of file CSCRecHit2DValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theYPullPlots

MonitorElement* CSCRecHit2DValidation::theYPullPlots[10]
private

Definition at line 25 of file CSCRecHit2DValidation.h.

Referenced by bookHistograms(), and plotResolution().

◆ theYResolutionPlots

MonitorElement* CSCRecHit2DValidation::theYResolutionPlots[10]
private

Definition at line 24 of file CSCRecHit2DValidation.h.

Referenced by bookHistograms(), and plotResolution().

RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
CSCRecHit2DCollection
mps_fire.i
i
Definition: mps_fire.py:428
CSCRecHit2DValidation::theNPerEventPlot
MonitorElement * theNPerEventPlot
Definition: CSCRecHit2DValidation.h:21
edm::Handle::product
T const * product() const
Definition: Handle.h:70
phase1PixelTopology::localY
constexpr uint16_t localY(uint16_t py)
Definition: phase1PixelTopology.h:151
CSCRecHit2DValidation::theYResolutionPlots
MonitorElement * theYResolutionPlots[10]
Definition: CSCRecHit2DValidation.h:24
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
CSCLayer
Definition: CSCLayer.h:24
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
edm::Handle< CSCRecHit2DCollection >
CSCRecHit2DValidation::theSimHitPosInStrip
MonitorElement * theSimHitPosInStrip[10]
Definition: CSCRecHit2DValidation.h:29
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
CSCRecHit2DValidation::theResolutionPlots
MonitorElement * theResolutionPlots[10]
Definition: CSCRecHit2DValidation.h:22
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
CSCRecHit2DValidation::theScatterPlots
MonitorElement * theScatterPlots[10]
Definition: CSCRecHit2DValidation.h:26
rpcPointValidation_cfi.simHit
simHit
Definition: rpcPointValidation_cfi.py:24
CSCLayerGeometry
Definition: CSCLayerGeometry.h:25
CSCRecHit2DValidation::plotResolution
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
Definition: CSCRecHit2DValidation.cc:92
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
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
CSCRecHit2DValidation::theRecHitPosInStrip
MonitorElement * theRecHitPosInStrip[10]
Definition: CSCRecHit2DValidation.h:28
CSCBaseValidation::findLayer
const CSCLayer * findLayer(int detId) const
Definition: CSCBaseValidation.cc:7
Point3DBase< float, GlobalTag >
RandomServiceHelper.t3
t3
Definition: RandomServiceHelper.py:258
CSCRecHit2DValidation::theYPullPlots
MonitorElement * theYPullPlots[10]
Definition: CSCRecHit2DValidation.h:25
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCBaseValidation::theSimHitMap
const PSimHitMap * theSimHitMap
Definition: CSCBaseValidation.h:28
phase1PixelTopology::localX
constexpr uint16_t localX(uint16_t px)
Definition: phase1PixelTopology.h:142
CSCRecHit2DValidation::theSimHitScatterPlots
MonitorElement * theSimHitScatterPlots[10]
Definition: CSCRecHit2DValidation.h:27
CSCRecHit2DValidation::theTPeaks
MonitorElement * theTPeaks[10]
Definition: CSCRecHit2DValidation.h:30
PSimHitMap::detsWithHits
std::vector< int > detsWithHits() const
Definition: PSimHitMap.cc:29
CSCRecHit2DValidation::rechits_Token_
edm::EDGetTokenT< CSCRecHit2DCollection > rechits_Token_
Definition: CSCRecHit2DValidation.h:16
PVValHelper::dy
Definition: PVValidationHelpers.h:50
CSCLayerGeometry::strip
float strip(const LocalPoint &lp) const
Definition: CSCLayerGeometry.h:183
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
CSCDetId::chamberName
std::string chamberName() const
Definition: CSCDetId.cc:74
PSimHitMap::hits
const edm::PSimHitContainer & hits(int detId) const
Definition: PSimHitMap.cc:20
CSCRecHit2DValidation::thePullPlots
MonitorElement * thePullPlots[10]
Definition: CSCRecHit2DValidation.h:23
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
CSCRecHit2DValidation::inputTag_
edm::InputTag inputTag_
Definition: CSCRecHit2DValidation.h:17
edm::InputTag
Definition: InputTag.h:15
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
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