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 
18 
23 
26 
30 
31 namespace edm {
32  class ParameterSet;
33  class Event;
34  class EventSetup;
35 } // namespace edm
36 class HTracks;
37 class HResolution;
38 
39 class MuonServiceProxy;
40 class KFUpdator;
43 
45 public:
46  enum EtaRange { all, barrel, endcap };
47 
48 public:
51 
53  ~MuonTrackResidualAnalyzer() override;
54 
55  // Operations
56 
57  void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override;
58 
59  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
60  void dqmEndRun(edm::Run const &, edm::EventSetup const &) override;
61 
62 protected:
63 private:
64  bool isInTheAcceptance(double eta);
65 
66  std::map<DetId, const PSimHit *> mapMuSimHitsPerId(edm::Handle<edm::PSimHitContainer> dtSimhits,
69 
70  void mapMuSimHitsPerId(edm::Handle<edm::PSimHitContainer> simhits, std::map<DetId, const PSimHit *> &hitIdMap);
71 
72  void computeResolution(Trajectory &trajectory,
73  std::map<DetId, const PSimHit *> &hitIdMap,
75 
76 private:
82 
86 
91 
96 
100 
101 private:
103 
104  // Resolution wrt the 1D Rec Hits
106 
107  // Resolution wrt the 1d Sim Hits
109 
114 
116 
117  unsigned int theSimTkId;
118 
119  std::vector<const PSimHit *> theSimHitContainer;
120 
123 
124  bool operator()(const PSimHit *a, const PSimHit *b) const {
125  const GeomDet *geomDetA = theTG->idToDet(DetId(a->detUnitId()));
126  const GeomDet *geomDetB = theTG->idToDet(DetId(b->detUnitId()));
127 
128  double distA = geomDetA->toGlobal(a->localPosition()).mag();
129  double distB = geomDetB->toGlobal(b->localPosition()).mag();
130 
131  return distA < distB;
132  }
133 
135  };
136 };
137 #endif
MeasurementEstimator * theEstimator
std::vector< const PSimHit * > theSimHitContainer
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:49
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:17
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
double b
Definition: hdecay.h:118
edm::EDGetTokenT< std::vector< PSimHit > > theRPCSimHitToken
histos
Definition: combine.py:4
edm::EDGetTokenT< edm::SimTrackContainer > theDataTypeToken
HLT enums.
double a
Definition: hdecay.h:119
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