CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
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
void dqmEndRun(edm::Run const &, edm::EventSetup const &) override
bool operator()(const PSimHit *a, const PSimHit *b) const
Local3DPoint localPosition() const
Definition: PSimHit.h:52
MuonTrackResidualAnalyzer(const edm::ParameterSet &ps)
Constructor.
Definition: DetId.h:17
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
double b
Definition: hdecay.h:118
edm::EDGetTokenT< std::vector< PSimHit > > theRPCSimHitToken
edm::EDGetTokenT< edm::SimTrackContainer > theDataTypeToken
double a
Definition: hdecay.h:119
void computeResolution(Trajectory &trajectory, std::map< DetId, const PSimHit * > &hitIdMap, HResolution1DRecHit *histos)
edm::EDGetTokenT< std::vector< PSimHit > > theCSCSimHitToken
unsigned int detUnitId() const
Definition: PSimHit.h:97
Definition: Run.h:45
edm::EDGetTokenT< std::vector< PSimHit > > theDTSimHitToken