CMS 3D CMS Logo

MuonTrackResidualAnalyzer.h
Go to the documentation of this file.
1 #ifndef Validation_RecoMuon_MuonTrackResidualAnalyzer_H
2 #define Validation_RecoMuon_MuonTrackResidualAnalyzer_H
3 
10 // Base Class Headers
15 
16 
19 
24 
27 
31 
32 
33 namespace edm {
34  class ParameterSet;
35  class Event;
36  class EventSetup;
37 }
38 class DQMStore;
39 class HTracks;
40 class HResolution;
41 
42 class MuonServiceProxy;
43 class KFUpdator;
46 
48 
49  public:
51 
52 public:
55 
57  ~MuonTrackResidualAnalyzer() override;
58 
59  // Operations
60 
61  void analyze(const edm::Event & event, const edm::EventSetup& eventSetup) override;
62 
63  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
64  void endRun(edm::Run const&, edm::EventSetup const&) override;
65 
66 protected:
67 
68 private:
69  bool isInTheAcceptance(double eta);
70 
71  std::map<DetId, const PSimHit*> mapMuSimHitsPerId(edm::Handle<edm::PSimHitContainer> dtSimhits,
74 
75  void mapMuSimHitsPerId(edm::Handle<edm::PSimHitContainer> simhits,
76  std::map<DetId,const PSimHit*> &hitIdMap);
77 
78  void computeResolution(Trajectory &trajectory,
79  std::map<DetId,const PSimHit*> &hitIdMap,
81 
82  private:
83 
89 
93 
98 
103 
107 
108  private:
110 
111  // Resolution wrt the 1D Rec Hits
113 
114  // Resolution wrt the 1d Sim Hits
116 
121 
123 
124  unsigned int theSimTkId;
125 
126 
127  std::vector<const PSimHit*> theSimHitContainer;
128 
129 
131 
133 
134  bool operator()(const PSimHit *a,
135  const PSimHit *b) const{
136 
137  const GeomDet *geomDetA = theTG->idToDet(DetId(a->detUnitId()));
138  const GeomDet *geomDetB = theTG->idToDet(DetId(b->detUnitId()));
139 
140  double distA = geomDetA->toGlobal(a->localPosition()).mag();
141  double distB = geomDetB->toGlobal(b->localPosition()).mag();
142 
143  return distA < distB;
144  }
145 
147  };
148 
149 
150 };
151 #endif
152 
MeasurementEstimator * theEstimator
RadiusComparatorInOut(edm::ESHandle< GlobalTrackingGeometry > tg)
edm::EDGetTokenT< reco::TrackCollection > theMuonTrackToken
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
bool operator()(const PSimHit *a, const PSimHit *b) const
Local3DPoint localPosition() const
Definition: PSimHit.h:52
Definition: DetId.h:18
std::vector< const PSimHit * > theSimHitContainer
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
double b
Definition: hdecay.h:120
edm::EDGetTokenT< std::vector< PSimHit > > theRPCSimHitToken
edm::EDGetTokenT< edm::SimTrackContainer > theDataTypeToken
HLT enums.
double a
Definition: hdecay.h:121
edm::EDGetTokenT< std::vector< PSimHit > > theCSCSimHitToken
unsigned int detUnitId() const
Definition: PSimHit.h:97
Definition: event.py:1
Definition: Run.h:45
edm::EDGetTokenT< std::vector< PSimHit > > theDTSimHitToken