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::InputTag &inputTag, edm::ConsumesCollector &&iC)
 
 ~CSCRecHit2DValidation () 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 Member Functions

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

Private Attributes

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
const CSCGeometrytheCSCGeometry
 
edm::InputTag theInputTag
 
const PSimHitMaptheSimHitMap
 

Detailed Description

Definition at line 11 of file CSCRecHit2DValidation.h.

Constructor & Destructor Documentation

◆ CSCRecHit2DValidation()

CSCRecHit2DValidation::CSCRecHit2DValidation ( const edm::InputTag inputTag,
edm::ConsumesCollector &&  iC 
)

◆ ~CSCRecHit2DValidation()

CSCRecHit2DValidation::~CSCRecHit2DValidation ( )
override

Definition at line 10 of file CSCRecHit2DValidation.cc.

10  {
11  for (int i = 0; i < 10; ++i) {
12  edm::LogInfo("CSCRecHitValidation") << "Resolution of " << theResolutionPlots[i]->getName() << " is "
14  edm::LogInfo("CSCRecHitValidation") << "Peak Time is " << theTPeaks[i]->getMean();
15  }
16 }

References dqm::impl::MonitorElement::getMean(), dqm::impl::MonitorElement::getName(), dqm::impl::MonitorElement::getRMS(), mps_fire::i, theResolutionPlots, and theTPeaks.

Member Function Documentation

◆ analyze()

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

Implements CSCBaseValidation.

Definition at line 45 of file CSCRecHit2DValidation.cc.

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

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

Referenced by CSCRecHitValidation::analyze().

◆ bookHistograms()

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

Definition at line 18 of file CSCRecHit2DValidation.cc.

18  {
19  theNPerEventPlot = iBooker.book1D("CSCRecHitsPerEvent", "Number of CSC Rec Hits per event", 100, 0, 500);
20  for (int i = 0; i < 10; ++i) {
21  char title1[200], title2[200], title3[200], title4[200], title5[200], title6[200], title7[200], title8[200],
22  title9[200];
23  sprintf(title1, "CSCRecHitResolution%d", i + 1);
24  sprintf(title2, "CSCRecHitPull%d", i + 1);
25  sprintf(title3, "CSCRecHitYResolution%d", i + 1);
26  sprintf(title4, "CSCRecHitYPull%d", i + 1);
27  sprintf(title5, "CSCRecHitPosInStrip%d", i + 1);
28  sprintf(title6, "CSCSimHitPosInStrip%d", i + 1);
29  sprintf(title7, "CSCRecHit%d", i + 1);
30  sprintf(title8, "CSCSimHit%d", i + 1);
31  sprintf(title9, "CSCTPeak%d", i + 1);
32 
33  theResolutionPlots[i] = iBooker.book1D(title1, title1, 100, -0.2, 0.2);
34  thePullPlots[i] = iBooker.book1D(title2, title2, 100, -3, 3);
35  theYResolutionPlots[i] = iBooker.book1D(title3, title3, 100, -5, 5);
36  theYPullPlots[i] = iBooker.book1D(title4, title4, 100, -3, 3);
37  theRecHitPosInStrip[i] = iBooker.book1D(title5, title5, 100, -2, 2);
38  theSimHitPosInStrip[i] = iBooker.book1D(title6, title6, 100, -2, 2);
39  theScatterPlots[i] = iBooker.book2D(title7, title7, 200, -20, 20, 200, -250, 250);
40  theSimHitScatterPlots[i] = iBooker.book2D(title8, title8, 200, -20, 20, 200, -250, 250);
41  theTPeaks[i] = iBooker.book1D(title9, title9, 200, 0, 400);
42  }
43 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), mps_fire::i, theNPerEventPlot, thePullPlots, theRecHitPosInStrip, theResolutionPlots, theScatterPlots, theSimHitPosInStrip, theSimHitScatterPlots, theTPeaks, theYPullPlots, and theYResolutionPlots.

Referenced by CSCRecHitValidation::bookHistograms().

◆ plotResolution()

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

Definition at line 96 of file CSCRecHit2DValidation.cc.

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

References PVValHelper::dy, dqm::impl::MonitorElement::Fill(), CSCLayer::geometry(), 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, theYResolutionPlots, and GeomDet::toGlobal().

Referenced by analyze().

Member Data Documentation

◆ rechits_Token_

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

Definition at line 19 of file CSCRecHit2DValidation.h.

Referenced by analyze(), and CSCRecHit2DValidation().

◆ theNPerEventPlot

MonitorElement* CSCRecHit2DValidation::theNPerEventPlot
private

Definition at line 23 of file CSCRecHit2DValidation.h.

Referenced by analyze(), and bookHistograms().

◆ thePullPlots

MonitorElement* CSCRecHit2DValidation::thePullPlots[10]
private

Definition at line 25 of file CSCRecHit2DValidation.h.

Referenced by bookHistograms(), and plotResolution().

◆ theRecHitPosInStrip

MonitorElement* CSCRecHit2DValidation::theRecHitPosInStrip[10]
private

Definition at line 30 of file CSCRecHit2DValidation.h.

Referenced by bookHistograms(), and plotResolution().

◆ theResolutionPlots

MonitorElement* CSCRecHit2DValidation::theResolutionPlots[10]
private

Definition at line 24 of file CSCRecHit2DValidation.h.

Referenced by bookHistograms(), plotResolution(), and ~CSCRecHit2DValidation().

◆ theScatterPlots

MonitorElement* CSCRecHit2DValidation::theScatterPlots[10]
private

Definition at line 28 of file CSCRecHit2DValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theSimHitPosInStrip

MonitorElement* CSCRecHit2DValidation::theSimHitPosInStrip[10]
private

Definition at line 31 of file CSCRecHit2DValidation.h.

Referenced by bookHistograms(), and plotResolution().

◆ theSimHitScatterPlots

MonitorElement* CSCRecHit2DValidation::theSimHitScatterPlots[10]
private

Definition at line 29 of file CSCRecHit2DValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theTPeaks

MonitorElement* CSCRecHit2DValidation::theTPeaks[10]
private

Definition at line 32 of file CSCRecHit2DValidation.h.

Referenced by analyze(), bookHistograms(), and ~CSCRecHit2DValidation().

◆ theYPullPlots

MonitorElement* CSCRecHit2DValidation::theYPullPlots[10]
private

Definition at line 27 of file CSCRecHit2DValidation.h.

Referenced by bookHistograms(), and plotResolution().

◆ theYResolutionPlots

MonitorElement* CSCRecHit2DValidation::theYResolutionPlots[10]
private

Definition at line 26 of file CSCRecHit2DValidation.h.

Referenced by bookHistograms(), and plotResolution().

CSCRecHit2DCollection
mps_fire.i
i
Definition: mps_fire.py:428
CSCRecHit2DValidation::theNPerEventPlot
MonitorElement * theNPerEventPlot
Definition: CSCRecHit2DValidation.h:23
edm::Handle::product
T const * product() const
Definition: Handle.h:70
phase1PixelTopology::localY
constexpr uint16_t localY(uint16_t py)
Definition: phase1PixelTopology.h:58
CSCRecHit2DValidation::theYResolutionPlots
MonitorElement * theYResolutionPlots[10]
Definition: CSCRecHit2DValidation.h:26
CSCLayer::chamber
const CSCChamber * chamber() const
Definition: CSCLayer.h:49
CSCChamberSpecs::chamberType
int chamberType() const
Definition: CSCChamberSpecs.cc:154
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
CSCLayer
Definition: CSCLayer.h:24
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
edm::Handle< CSCRecHit2DCollection >
CSCRecHit2DValidation::theSimHitPosInStrip
MonitorElement * theSimHitPosInStrip[10]
Definition: CSCRecHit2DValidation.h:31
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
CSCBaseValidation::CSCBaseValidation
CSCBaseValidation(const edm::InputTag &inputTag)
Definition: CSCBaseValidation.cc:4
CSCRecHit2DValidation::theResolutionPlots
MonitorElement * theResolutionPlots[10]
Definition: CSCRecHit2DValidation.h:24
CSCRecHit2DValidation::theScatterPlots
MonitorElement * theScatterPlots[10]
Definition: CSCRecHit2DValidation.h:28
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:96
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:30
dqm::impl::MonitorElement::getRMS
virtual double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:562
CSCBaseValidation::findLayer
const CSCLayer * findLayer(int detId) const
Definition: CSCBaseValidation.cc:7
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
Point3DBase< float, GlobalTag >
CSCRecHit2DValidation::theYPullPlots
MonitorElement * theYPullPlots[10]
Definition: CSCRecHit2DValidation.h:27
CSCBaseValidation::theSimHitMap
const PSimHitMap * theSimHitMap
Definition: CSCBaseValidation.h:28
phase1PixelTopology::localX
constexpr uint16_t localX(uint16_t px)
Definition: phase1PixelTopology.h:49
CSCRecHit2DValidation::theSimHitScatterPlots
MonitorElement * theSimHitScatterPlots[10]
Definition: CSCRecHit2DValidation.h:29
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
CSCRecHit2DValidation::theTPeaks
MonitorElement * theTPeaks[10]
Definition: CSCRecHit2DValidation.h:32
PSimHitMap::detsWithHits
std::vector< int > detsWithHits() const
Definition: PSimHitMap.cc:28
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
CSCRecHit2DValidation::rechits_Token_
edm::EDGetTokenT< CSCRecHit2DCollection > rechits_Token_
Definition: CSCRecHit2DValidation.h:19
PVValHelper::dy
Definition: PVValidationHelpers.h:49
CSCChamber::specs
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:39
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
dqm::impl::MonitorElement::getName
const std::string & getName() const
get name of ME
Definition: MonitorElement.h:250
PSimHitMap::hits
const edm::PSimHitContainer & hits(int detId) const
Definition: PSimHitMap.cc:19
CSCRecHit2DValidation::thePullPlots
MonitorElement * thePullPlots[10]
Definition: CSCRecHit2DValidation.h:25
dqm::impl::MonitorElement::getMean
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:549
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
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