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::RadiusComparatorInOut::operator()
bool operator()(const PSimHit *a, const PSimHit *b) const
Definition: MuonTrackResidualAnalyzer.h:120
MuonTrackResidualAnalyzer::theSimHitContainer
std::vector< const PSimHit * > theSimHitContainer
Definition: MuonTrackResidualAnalyzer.h:115
MeasurementEstimator
Definition: MeasurementEstimator.h:19
dqm::impl::MonitorElement
Definition: MonitorElement.h:99
MuonTrackResidualAnalyzer::theUpdator
KFUpdator * theUpdator
Definition: MuonTrackResidualAnalyzer.h:94
Handle.h
MuonTrackResidualAnalyzer::hDeltaPtVsEtaSim
MonitorElement * hDeltaPtVsEtaSim
Definition: MuonTrackResidualAnalyzer.h:108
MuonTrackResidualAnalyzer::barrel
Definition: MuonTrackResidualAnalyzer.h:42
MuonTrackResidualAnalyzer::hDPtRef
MonitorElement * hDPtRef
Definition: MuonTrackResidualAnalyzer.h:98
MuonTrackResidualAnalyzer::theCSCSimHitToken
edm::EDGetTokenT< std::vector< PSimHit > > theCSCSimHitToken
Definition: MuonTrackResidualAnalyzer.h:89
MuonTrackResidualAnalyzer::theDTSimHitToken
edm::EDGetTokenT< std::vector< PSimHit > > theDTSimHitToken
Definition: MuonTrackResidualAnalyzer.h:90
GeomDet
Definition: GeomDet.h:27
ESHandle.h
MuonTrackResidualAnalyzer::theEtaRange
EtaRange theEtaRange
Definition: MuonTrackResidualAnalyzer.h:81
MuonTrackResidualAnalyzer::RadiusComparatorInOut::theTG
edm::ESHandle< GlobalTrackingGeometry > theTG
Definition: MuonTrackResidualAnalyzer.h:130
edm::Run
Definition: Run.h:45
MuonTrackResidualAnalyzer::mapMuSimHitsPerId
std::map< DetId, const PSimHit * > mapMuSimHitsPerId(edm::Handle< edm::PSimHitContainer > dtSimhits, edm::Handle< edm::PSimHitContainer > cscSimhits, edm::Handle< edm::PSimHitContainer > rpcSimhits)
Definition: MuonTrackResidualAnalyzer.cc:268
edm::EDGetTokenT< edm::SimTrackContainer >
edm
HLT enums.
Definition: AlignableModifier.h:19
MuonTrackResidualAnalyzer::out
std::string out
Definition: MuonTrackResidualAnalyzer.h:77
PSimHitContainer.h
MuonTrackResidualAnalyzer::h1DSimHitRes
HResolution1DRecHit * h1DSimHitRes
Definition: MuonTrackResidualAnalyzer.h:104
MuonTrackResidualAnalyzer::endcap
Definition: MuonTrackResidualAnalyzer.h:42
MuonTrackResidualAnalyzer::cscSimHitLabel
edm::InputTag cscSimHitLabel
Definition: MuonTrackResidualAnalyzer.h:84
MuonTrackResidualAnalyzer::hDeltaPtVsEtaSim2
MonitorElement * hDeltaPtVsEtaSim2
Definition: MuonTrackResidualAnalyzer.h:109
MuonTrackResidualAnalyzer::theService
MuonServiceProxy * theService
Definition: MuonTrackResidualAnalyzer.h:93
DQMOneEDAnalyzer
Definition: DQMOneEDAnalyzer.h:20
MuonTrackResidualAnalyzer::h1DRecHitRes
HResolution1DRecHit * h1DRecHitRes
Definition: MuonTrackResidualAnalyzer.h:101
edm::Handle< edm::PSimHitContainer >
MuonTrackResidualAnalyzer
Definition: MuonTrackResidualAnalyzer.h:40
MuonTrackResidualAnalyzer::theRPCSimHitToken
edm::EDGetTokenT< std::vector< PSimHit > > theRPCSimHitToken
Definition: MuonTrackResidualAnalyzer.h:91
MuonTrackResidualAnalyzer::subsystemname_
std::string subsystemname_
Definition: MuonTrackResidualAnalyzer.h:75
DQMOneEDAnalyzer.h
MuonTrackResidualAnalyzer::dbe_
DQMStore * dbe_
Definition: MuonTrackResidualAnalyzer.h:73
DetId
Definition: DetId.h:17
PSimHit.h
Track.h
TrackFwd.h
MuonTrackResidualAnalyzer::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: MuonTrackResidualAnalyzer.cc:81
dqm::legacy::DQMStore
Definition: DQMStore.h:728
MuonTrackResidualAnalyzer::analyze
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
Definition: MuonTrackResidualAnalyzer.cc:122
MuonTrackResidualAnalyzer::theMuonSimHitNumberPerEvent
int theMuonSimHitNumberPerEvent
Definition: MuonTrackResidualAnalyzer.h:111
MuonTrackResidualAnalyzer::hSimHitsPerTrack
MonitorElement * hSimHitsPerTrack
Definition: MuonTrackResidualAnalyzer.h:106
MuonTrackResidualAnalyzer::theMuonTrackLabel
edm::InputTag theMuonTrackLabel
Definition: MuonTrackResidualAnalyzer.h:83
PVValHelper::eta
Definition: PVValidationHelpers.h:70
MuonTrackResidualAnalyzer::isInTheAcceptance
bool isInTheAcceptance(double eta)
Definition: MuonTrackResidualAnalyzer.cc:252
edm::ESHandle< GlobalTrackingGeometry >
MuonTrackResidualAnalyzer::dqmEndRun
void dqmEndRun(edm::Run const &, edm::EventSetup const &) override
Definition: MuonTrackResidualAnalyzer.cc:118
Event
MuonTrackResidualAnalyzer::MuonTrackResidualAnalyzer
MuonTrackResidualAnalyzer(const edm::ParameterSet &ps)
Constructor.
Definition: MuonTrackResidualAnalyzer.cc:38
b
double b
Definition: hdecay.h:118
MuonTrackResidualAnalyzer::~MuonTrackResidualAnalyzer
~MuonTrackResidualAnalyzer() override
Destructor.
Definition: MuonTrackResidualAnalyzer.cc:75
MuonTrackResidualAnalyzer::pset
edm::ParameterSet pset
Definition: MuonTrackResidualAnalyzer.h:76
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
HLTBitAnalyser_cfi.simhits
simhits
SIM objects.
Definition: HLTBitAnalyser_cfi.py:21
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
MuonTrackResidualAnalyzer::rpcSimHitLabel
edm::InputTag rpcSimHitLabel
Definition: MuonTrackResidualAnalyzer.h:86
ParameterSet
Definition: Functions.h:16
HResolution
Definition: Histograms.h:1802
MuonTrackResidualAnalyzer::hSimHitsPerTrackVsEta
MonitorElement * hSimHitsPerTrackVsEta
Definition: MuonTrackResidualAnalyzer.h:107
MuonTrackResidualAnalyzer::all
Definition: MuonTrackResidualAnalyzer.h:42
edm::EventSetup
Definition: EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
InputTag.h
combine.histos
histos
Definition: combine.py:4
MuonTrackResidualAnalyzer::theDataTypeToken
edm::EDGetTokenT< edm::SimTrackContainer > theDataTypeToken
Definition: MuonTrackResidualAnalyzer.h:80
Trajectory.h
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
MuonTrackResidualAnalyzer::RadiusComparatorInOut
Definition: MuonTrackResidualAnalyzer.h:117
DetId.h
Trajectory
Definition: Trajectory.h:38
MuonTrackResidualAnalyzer::dtSimHitLabel
edm::InputTag dtSimHitLabel
Definition: MuonTrackResidualAnalyzer.h:85
GlobalTrackingGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GlobalTrackingGeometry.cc:44
MuonTrackResidualAnalyzer::dirName_
std::string dirName_
Definition: MuonTrackResidualAnalyzer.h:74
MuonTrackResidualAnalyzer::theMuonTrackToken
edm::EDGetTokenT< reco::TrackCollection > theMuonTrackToken
Definition: MuonTrackResidualAnalyzer.h:88
HResolution1DRecHit
Definition: Histograms.h:299
dqm::implementation::IBooker
Definition: DQMStore.h:43
MuonTrackResidualAnalyzer::computeResolution
void computeResolution(Trajectory &trajectory, std::map< DetId, const PSimHit * > &hitIdMap, HResolution1DRecHit *histos)
Definition: MuonTrackResidualAnalyzer.cc:320
EventSetup
MuonServiceProxy
Definition: MuonServiceProxy.h:38
PSimHit
Definition: PSimHit.h:15
MuonTrackResidualAnalyzer::EtaRange
EtaRange
Definition: MuonTrackResidualAnalyzer.h:42
MuonTrackResidualAnalyzer::theDataType
edm::InputTag theDataType
Definition: MuonTrackResidualAnalyzer.h:79
event
Definition: event.py:1
GlobalTrackingGeometry.h
edm::Event
Definition: Event.h:73
SimTrackContainer.h
edm::InputTag
Definition: InputTag.h:15
MuonTrackResidualAnalyzer::theEstimator
MeasurementEstimator * theEstimator
Definition: MuonTrackResidualAnalyzer.h:95
KFUpdator
Definition: KFUpdator.h:32
MuonTrackResidualAnalyzer::RadiusComparatorInOut::RadiusComparatorInOut
RadiusComparatorInOut(edm::ESHandle< GlobalTrackingGeometry > tg)
Definition: MuonTrackResidualAnalyzer.h:118
MuonTrackResidualAnalyzer::theSimTkId
unsigned int theSimTkId
Definition: MuonTrackResidualAnalyzer.h:113