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  virtual ~MuonTrackResidualAnalyzer();
58 
59  // Operations
60 
61  void analyze(const edm::Event & event, const edm::EventSetup& eventSetup) override;
62 
63  virtual void beginJob() ;
64  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
65  virtual void endRun(edm::Run const&, edm::EventSetup const&) override;
66 
67 protected:
68 
69 private:
70  bool isInTheAcceptance(double eta);
71 
72  std::map<DetId, const PSimHit*> mapMuSimHitsPerId(edm::Handle<edm::PSimHitContainer> dtSimhits,
75 
76  void mapMuSimHitsPerId(edm::Handle<edm::PSimHitContainer> simhits,
77  std::map<DetId,const PSimHit*> &hitIdMap);
78 
79  void computeResolution(Trajectory &trajectory,
80  std::map<DetId,const PSimHit*> &hitIdMap,
82 
83  private:
84 
90 
94 
99 
104 
108 
109  private:
111 
112  // Resolution wrt the 1D Rec Hits
114 
115  // Resolution wrt the 1d Sim Hits
117 
122 
124 
125  unsigned int theSimTkId;
126 
127 
128  std::vector<const PSimHit*> theSimHitContainer;
129 
130 
132 
134 
135  bool operator()(const PSimHit *a,
136  const PSimHit *b) const{
137 
138  const GeomDet *geomDetA = theTG->idToDet(DetId(a->detUnitId()));
139  const GeomDet *geomDetB = theTG->idToDet(DetId(b->detUnitId()));
140 
141  double distA = geomDetA->toGlobal(a->localPosition()).mag();
142  double distB = geomDetB->toGlobal(b->localPosition()).mag();
143 
144  return distA < distB;
145  }
146 
148  };
149 
150 
151 };
152 #endif
153 
MeasurementEstimator * theEstimator
RadiusComparatorInOut(edm::ESHandle< GlobalTrackingGeometry > tg)
edm::EDGetTokenT< reco::TrackCollection > theMuonTrackToken
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
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
void bookHistograms(fwlite::EventContainer &eventCont)
void beginJob()
Definition: Breakpoints.cc:15
bool operator()(const PSimHit *a, const PSimHit *b) const
Local3DPoint localPosition() const
Definition: PSimHit.h:44
Definition: DetId.h:18
std::vector< const PSimHit * > theSimHitContainer
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:93
Definition: event.py:1
Definition: Run.h:43
edm::EDGetTokenT< std::vector< PSimHit > > theDTSimHitToken