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 
20 
23 
26 
27 namespace edm {
28  class ParameterSet;
29  class Event;
30  class EventSetup;
31 } // namespace edm
32 class HTracks;
33 class HResolution;
34 
35 class MuonServiceProxy;
36 class KFUpdator;
39 
41 public:
42  enum EtaRange { all, barrel, endcap };
43 
44 public:
47 
49  ~MuonTrackResidualAnalyzer() override;
50 
51  // Operations
52 
53  void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override;
54 
55  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
56  void dqmEndRun(edm::Run const &, edm::EventSetup const &) override;
57 
58 protected:
59 private:
60  bool isInTheAcceptance(double eta);
61 
62  std::map<DetId, const PSimHit *> mapMuSimHitsPerId(edm::Handle<edm::PSimHitContainer> dtSimhits,
65 
66  void mapMuSimHitsPerId(edm::Handle<edm::PSimHitContainer> simhits, std::map<DetId, const PSimHit *> &hitIdMap);
67 
68  void computeResolution(Trajectory &trajectory,
69  std::map<DetId, const PSimHit *> &hitIdMap,
71 
72 private:
78 
82 
87 
92 
96 
97 private:
99 
100  // Resolution wrt the 1D Rec Hits
102 
103  // Resolution wrt the 1d Sim Hits
105 
110 
112 
113  unsigned int theSimTkId;
114 
115  std::vector<const PSimHit *> theSimHitContainer;
116 
119 
120  bool operator()(const PSimHit *a, const PSimHit *b) const {
121  const GeomDet *geomDetA = theTG->idToDet(DetId(a->detUnitId()));
122  const GeomDet *geomDetB = theTG->idToDet(DetId(b->detUnitId()));
123 
124  double distA = geomDetA->toGlobal(a->localPosition()).mag();
125  double distB = geomDetB->toGlobal(b->localPosition()).mag();
126 
127  return distA < distB;
128  }
129 
131  };
132 };
133 #endif
~MuonTrackResidualAnalyzer() override
Destructor.
MeasurementEstimator * theEstimator
std::map< DetId, const PSimHit * > mapMuSimHitsPerId(edm::Handle< edm::PSimHitContainer > dtSimhits, edm::Handle< edm::PSimHitContainer > cscSimhits, edm::Handle< edm::PSimHitContainer > rpcSimhits)
std::vector< const PSimHit * > theSimHitContainer
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
RadiusComparatorInOut(edm::ESHandle< GlobalTrackingGeometry > tg)
edm::EDGetTokenT< reco::TrackCollection > theMuonTrackToken
const GeomDet * idToDet(DetId) const override
void dqmEndRun(edm::Run const &, edm::EventSetup const &) override
void computeResolution(Trajectory &trajectory, std::map< DetId, const PSimHit *> &hitIdMap, HResolution1DRecHit *histos)
MuonTrackResidualAnalyzer(const edm::ParameterSet &ps)
Constructor.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
Definition: DetId.h:17
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
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
bool operator()(const PSimHit *a, const PSimHit *b) const
edm::EDGetTokenT< std::vector< PSimHit > > theCSCSimHitToken
Definition: event.py:1
Definition: Run.h:45
edm::EDGetTokenT< std::vector< PSimHit > > theDTSimHitToken