CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
 CSCRecHit2DValidation (DQMStore *dbe, const edm::InputTag &inputTag)
 
virtual ~CSCRecHit2DValidation ()
 
- Public Member Functions inherited from CSCBaseValidation
 CSCBaseValidation (DQMStore *dbe, 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

MonitorElementtheNPerEventPlot
 
MonitorElementthePullPlots [10]
 
MonitorElementtheRecHitPosInStrip [10]
 
MonitorElementtheResolutionPlots [10]
 
MonitorElementtheScatterPlots [10]
 
MonitorElementtheSimHitPosInStrip [10]
 
MonitorElementtheSimHitScatterPlots [10]
 
MonitorElementtheTPeaks [10]
 
MonitorElementtheYPullPlots [10]
 
MonitorElementtheYResolutionPlots [10]
 

Additional Inherited Members

- Protected Member Functions inherited from CSCBaseValidation
const CSCLayerfindLayer (int detId) const
 
- Protected Attributes inherited from CSCBaseValidation
DQMStoredbe_
 
const CSCGeometrytheCSCGeometry
 
edm::InputTag theInputTag
 
const PSimHitMaptheSimHitMap
 

Detailed Description

Definition at line 10 of file CSCRecHit2DValidation.h.

Constructor & Destructor Documentation

CSCRecHit2DValidation::CSCRecHit2DValidation ( DQMStore dbe,
const edm::InputTag inputTag 
)

Definition at line 8 of file CSCRecHit2DValidation.cc.

References DQMStore::book1D(), DQMStore::book2D(), CSCBaseValidation::dbe_, i, DQMStore::setCurrentFolder(), thePullPlots, theRecHitPosInStrip, theResolutionPlots, theScatterPlots, theSimHitPosInStrip, theSimHitScatterPlots, theTPeaks, theYPullPlots, and theYResolutionPlots.

9 : CSCBaseValidation(dbe, inputTag),
10  theNPerEventPlot( dbe_->book1D("CSCRecHitsPerEvent", "Number of CSC Rec Hits per event", 100, 0, 500) )
11 {
12  dbe_->setCurrentFolder("CSCRecHitsV/CSCRecHitTask");
13 
14  for(int i = 0; i < 10; ++i)
15  {
16  char title1[200], title2[200], title3[200], title4[200], title5[200], title6[200], title7[200], title8[200], title9[200];
17  sprintf(title1, "CSCRecHitResolution%d", i+1);
18  sprintf(title2, "CSCRecHitPull%d", i+1);
19  sprintf(title3, "CSCRecHitYResolution%d", i+1);
20  sprintf(title4, "CSCRecHitYPull%d", i+1);
21  sprintf(title5, "CSCRecHitPosInStrip%d", i+1);
22  sprintf(title6, "CSCSimHitPosInStrip%d", i+1);
23  sprintf(title7, "CSCRecHit%d", i+1);
24  sprintf(title8, "CSCSimHit%d", i+1);
25  sprintf(title9, "CSCTPeak%d", i+1);
26 
27 
28  theResolutionPlots[i] = dbe_->book1D(title1, title1, 100, -0.2, 0.2);
29  thePullPlots[i] = dbe_->book1D(title2, title2, 100, -3, 3);
30  theYResolutionPlots[i] = dbe_->book1D(title3, title3, 100, -5, 5);
31  theYPullPlots[i] = dbe_->book1D(title4, title4, 100, -3, 3);
32  theRecHitPosInStrip[i] = dbe_->book1D(title5, title5, 100, -2, 2);
33  theSimHitPosInStrip[i] = dbe_->book1D(title6, title6, 100, -2, 2);
34  theScatterPlots[i] = dbe->book2D(title7, title7, 200, -20, 20, 200, -250, 250);
35  theSimHitScatterPlots[i] = dbe->book2D(title8, title8, 200, -20, 20, 200, -250, 250);
36  theTPeaks[i] = dbe->book1D(title9, title9, 200, 0, 400);
37  }
38 
39 }
MonitorElement * theSimHitScatterPlots[10]
MonitorElement * theYResolutionPlots[10]
int i
Definition: DBlmapReader.cc:9
MonitorElement * theScatterPlots[10]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
MonitorElement * theResolutionPlots[10]
MonitorElement * theSimHitPosInStrip[10]
MonitorElement * theYPullPlots[10]
CSCBaseValidation(DQMStore *dbe, const edm::InputTag &inputTag)
MonitorElement * theNPerEventPlot
MonitorElement * thePullPlots[10]
MonitorElement * theRecHitPosInStrip[10]
MonitorElement * theTPeaks[10]
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1000
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
CSCRecHit2DValidation::~CSCRecHit2DValidation ( )
virtual

Definition at line 41 of file CSCRecHit2DValidation.cc.

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

42 {
43  for(int i = 0; i < 10; ++i)
44  {
45  edm::LogInfo("CSCRecHitValidation") << "Resolution of " << theResolutionPlots[i]->getName() << " is " << theResolutionPlots[i]->getRMS();
46  edm::LogInfo("CSCRecHitValidation") << "Peak Time is " << theTPeaks[i]->getMean();
47  }
48 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
MonitorElement * theResolutionPlots[10]
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * theTPeaks[10]

Member Function Documentation

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

Implements CSCBaseValidation.

Definition at line 51 of file CSCRecHit2DValidation.cc.

References CSCLayer::chamber(), CSCChamberSpecs::chamberType(), Geom::Phi< T >::degrees(), PSimHitMap::detsWithHits(), MonitorElement::Fill(), CSCBaseValidation::findLayer(), edm::Event::getByLabel(), PSimHitMap::hits(), i, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), plotResolution(), edm::Handle< T >::product(), trackerHits::simHits, CSCChamber::specs(), CSCBaseValidation::theInputTag, theNPerEventPlot, theScatterPlots, CSCBaseValidation::theSimHitMap, theSimHitScatterPlots, theTPeaks, and GeomDet::toGlobal().

Referenced by CSCRecHitValidation::analyze().

52 {
53  // get the collection of CSCRecHrecHitItrD
55  e.getByLabel(theInputTag, hRecHits);
56  const CSCRecHit2DCollection * cscRecHits = hRecHits.product();
57 
58  unsigned nPerEvent = 0;
59 
60  for(CSCRecHit2DCollection::const_iterator recHitItr = cscRecHits->begin();
61  recHitItr != cscRecHits->end(); recHitItr++)
62  {
63  ++nPerEvent;
64  int detId = (*recHitItr).cscDetId().rawId();
66  const CSCLayer * layer = findLayer(detId);
67  int chamberType = layer->chamber()->specs()->chamberType();
68  theTPeaks[chamberType-1]->Fill(recHitItr->tpeak());
69  if(simHits.size() == 1)
70  {
71  plotResolution(simHits[0], *recHitItr, layer, chamberType);
72  }
73  float localX = recHitItr->localPosition().x();
74  float localY = recHitItr->localPosition().y();
75  //theYPlots[chamberType-1]->Fill(localY);
76  // find a local phi
77  float globalR = layer->toGlobal(LocalPoint(0.,0.,0.)).perp();
78  GlobalPoint axisThruChamber(globalR+localY, localX, 0.);
79  float localPhi = axisThruChamber.phi().degrees();
80  //thePhiPlots[chamberType-1]->Fill(axisThruChamber.phi().degrees());
81  theScatterPlots[chamberType-1]->Fill( localPhi, localY);
82  }
83  theNPerEventPlot->Fill(nPerEvent);
84 return;
85  // fill sim hits
86  std::vector<int> layersWithSimHits = theSimHitMap->detsWithHits();
87  for(unsigned i = 0; i < layersWithSimHits.size(); ++i)
88  {
89  edm::PSimHitContainer simHits = theSimHitMap->hits(layersWithSimHits[i]);
90  for(edm::PSimHitContainer::const_iterator hitItr = simHits.begin(); hitItr != simHits.end(); ++hitItr)
91  {
92  const CSCLayer * layer = findLayer(layersWithSimHits[i]);
93  int chamberType = layer->chamber()->specs()->chamberType();
94  float localX = hitItr->localPosition().x();
95  float localY = hitItr->localPosition().y();
96  //theYPlots[chamberType-1]->Fill(localY);
97  // find a local phi
98  float globalR = layer->toGlobal(LocalPoint(0.,0.,0.)).perp();
99  GlobalPoint axisThruChamber(globalR+localY, localX, 0.);
100  float localPhi = axisThruChamber.phi().degrees();
101  //thePhiPlots[chamberType-1]->Fill(axisThruChamber.phi().degrees());
102  theSimHitScatterPlots[chamberType-1]->Fill( localPhi, localY);
103  }
104  }
105 
106 }
MonitorElement * theSimHitScatterPlots[10]
int i
Definition: DBlmapReader.cc:9
edm::InputTag theInputTag
MonitorElement * theScatterPlots[10]
T perp() const
Definition: PV3DBase.h:72
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:47
void Fill(long long x)
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:42
const PSimHitMap * theSimHitMap
const edm::PSimHitContainer & hits(int detId) const
Definition: PSimHitMap.cc:32
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
std::vector< int > detsWithHits() const
Definition: PSimHitMap.cc:47
int chamberType() const
tuple simHits
Definition: trackerHits.py:16
MonitorElement * theNPerEventPlot
T const * product() const
Definition: Handle.h:81
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
MonitorElement * theTPeaks[10]
std::vector< PSimHit > PSimHitContainer
const CSCChamber * chamber() const
Definition: CSCLayer.h:52
const CSCLayer * findLayer(int detId) const
void CSCRecHit2DValidation::plotResolution ( const PSimHit simHit,
const CSCRecHit2D recHit,
const CSCLayer layer,
int  chamberType 
)
private

Definition at line 109 of file CSCRecHit2DValidation.cc.

References MonitorElement::Fill(), CSCLayer::geometry(), PSimHit::localPosition(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), mathSSE::sqrt(), CSCLayerGeometry::strip(), thePullPlots, theRecHitPosInStrip, theResolutionPlots, theSimHitPosInStrip, theYPullPlots, theYResolutionPlots, GeomDet::toGlobal(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by analyze().

111 {
112  GlobalPoint simHitPos = layer->toGlobal(simHit.localPosition());
113  GlobalPoint recHitPos = layer->toGlobal(recHit.localPosition());
114 
115  double dphi = recHitPos.phi() - simHitPos.phi();
116  double rdphi = recHitPos.perp() * dphi;
117  theResolutionPlots[chamberType-1]->Fill( rdphi );
118  thePullPlots[chamberType-1]->Fill( rdphi/ sqrt(recHit.localPositionError().xx()) );
119  double dy = recHit.localPosition().y() - simHit.localPosition().y();
120  theYResolutionPlots[chamberType-1]->Fill( dy );
121  theYPullPlots[chamberType-1]->Fill( dy/ sqrt(recHit.localPositionError().yy()) );
122 
123  const CSCLayerGeometry * layerGeometry = layer->geometry();
124  float recStrip = layerGeometry->strip(recHit.localPosition());
125  float simStrip = layerGeometry->strip(simHit.localPosition());
126  theRecHitPosInStrip[chamberType-1]->Fill( recStrip - int(recStrip) );
127  theSimHitPosInStrip[chamberType-1]->Fill( simStrip - int(simStrip) );
128 }
MonitorElement * theYResolutionPlots[10]
T perp() const
Definition: PV3DBase.h:72
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:47
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
MonitorElement * theResolutionPlots[10]
void Fill(long long x)
MonitorElement * theSimHitPosInStrip[10]
MonitorElement * theYPullPlots[10]
Local3DPoint localPosition() const
Definition: PSimHit.h:44
T sqrt(T t)
Definition: SSEVec.h:48
float strip(const LocalPoint &lp) const
MonitorElement * thePullPlots[10]
MonitorElement * theRecHitPosInStrip[10]
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47

Member Data Documentation

MonitorElement* CSCRecHit2DValidation::theNPerEventPlot
private

Definition at line 23 of file CSCRecHit2DValidation.h.

Referenced by analyze().

MonitorElement* CSCRecHit2DValidation::thePullPlots[10]
private

Definition at line 25 of file CSCRecHit2DValidation.h.

Referenced by CSCRecHit2DValidation(), and plotResolution().

MonitorElement* CSCRecHit2DValidation::theRecHitPosInStrip[10]
private

Definition at line 30 of file CSCRecHit2DValidation.h.

Referenced by CSCRecHit2DValidation(), and plotResolution().

MonitorElement* CSCRecHit2DValidation::theResolutionPlots[10]
private
MonitorElement* CSCRecHit2DValidation::theScatterPlots[10]
private

Definition at line 28 of file CSCRecHit2DValidation.h.

Referenced by analyze(), and CSCRecHit2DValidation().

MonitorElement* CSCRecHit2DValidation::theSimHitPosInStrip[10]
private

Definition at line 31 of file CSCRecHit2DValidation.h.

Referenced by CSCRecHit2DValidation(), and plotResolution().

MonitorElement* CSCRecHit2DValidation::theSimHitScatterPlots[10]
private

Definition at line 29 of file CSCRecHit2DValidation.h.

Referenced by analyze(), and CSCRecHit2DValidation().

MonitorElement* CSCRecHit2DValidation::theTPeaks[10]
private

Definition at line 32 of file CSCRecHit2DValidation.h.

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

MonitorElement* CSCRecHit2DValidation::theYPullPlots[10]
private

Definition at line 27 of file CSCRecHit2DValidation.h.

Referenced by CSCRecHit2DValidation(), and plotResolution().

MonitorElement* CSCRecHit2DValidation::theYResolutionPlots[10]
private

Definition at line 26 of file CSCRecHit2DValidation.h.

Referenced by CSCRecHit2DValidation(), and plotResolution().