CMS 3D CMS Logo

DTRecHitQuality.h
Go to the documentation of this file.
1 #ifndef Validation_DTRecHits_DTRecHitQuality_h
2 #define Validation_DTRecHits_DTRecHitQuality_h
3 
18 #include <map>
19 #include <string>
20 #include <vector>
21 
29 
30 namespace edm {
31  class ParameterSet;
32  class Event;
33  class EventSetup;
34 } // namespace edm
35 
36 class PSimHit;
37 class DTLayer;
38 class DTWireId;
39 class DTGeometry;
40 class HRes1DHit;
41 class HEff1DHit;
42 namespace dtrechit {
43  struct Histograms;
44 }
45 
46 class DTRecHitQuality : public DQMGlobalEDAnalyzer<dtrechit::Histograms> {
47 public:
50 
51 private:
54  edm::Run const &,
55  edm::EventSetup const &,
56  dtrechit::Histograms &) const override;
57 
59  void dqmAnalyze(edm::Event const &, edm::EventSetup const &, dtrechit::Histograms const &) const override;
60 
61 private:
62  // Switch for debug output
63  bool debug_;
64 
65  // Root file name
70  ;
71 
76 
77  // Switches for analysis at various steps
78  bool doStep1_;
79  bool doStep2_;
80  bool doStep3_;
81  bool local_;
82  bool doall_;
83 
84  // Return a map between DTRecHit1DPair and wireId
85  std::map<DTWireId, std::vector<DTRecHit1DPair>> map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs) const;
86 
87  // Return a map between DTRecHit1D and wireId
88  std::map<DTWireId, std::vector<DTRecHit1D>> map1DRecHitsPerWire(const DTRecSegment2DCollection *segment2Ds) const;
89 
90  // Return a map between DTRecHit1D and wireId
91  std::map<DTWireId, std::vector<DTRecHit1D>> map1DRecHitsPerWire(const DTRecSegment4DCollection *segment4Ds) const;
92 
93  // Compute SimHit distance from wire (cm)
94  float simHitDistFromWire(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const;
95 
96  // Compute SimHit impact angle (in direction perp to wire)
97  float simHitImpactAngle(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const;
98 
99  // Compute SimHit distance from FrontEnd
100  float simHitDistFromFE(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const;
101 
102  // Find the RecHit closest to the muon SimHit
103  // const DTRecHit1DPair*
104  // findBestRecHit(const DTLayer* layer,
105  // DTWireId wireId,
106  // const std::vector<DTRecHit1DPair>& recHits,
107  // const float simHitDist) const;
108  template <typename type>
109  const type *findBestRecHit(const DTLayer *layer,
110  const DTWireId &wireId,
111  const std::vector<type> &recHits,
112  float simHitDist) const;
113 
114  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
115  float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer) const;
116  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
117  float recHitDistFromWire(const DTRecHit1D &recHit, const DTLayer *layer) const;
118 
119  // Return the error on the measured (cm) coordinate
120  float recHitPositionError(const DTRecHit1DPair &recHit) const;
121  float recHitPositionError(const DTRecHit1D &recHit) const;
122 
123  // Does the real job
124  template <typename type>
125  void compute(const DTGeometry *dtGeom,
126  const std::map<DTWireId, std::vector<PSimHit>> &simHitsPerWire,
127  const std::map<DTWireId, std::vector<type>> &recHitsPerWire,
129  int step) const;
130 };
131 
132 #endif // Validation_DTRecHits_DTRecHitQuality_h
DTRecSegment2DCollection.h
DTGeometry
Definition: DTGeometry.h:28
DTRecHitQuality::recHitDistFromWire
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer) const
Definition: DTRecHitQuality.cc:405
DTRecHitQuality::simHitToken_
edm::EDGetTokenT< edm::PSimHitContainer > simHitToken_
Definition: DTRecHitQuality.h:66
DTRecHitCollection.h
DTRecHitQuality::segment2DLabel_
edm::InputTag segment2DLabel_
Definition: DTRecHitQuality.h:74
step
step
Definition: StallMonitor.cc:94
DTRecHitQuality::debug_
bool debug_
Definition: DTRecHitQuality.h:63
edm::Run
Definition: Run.h:45
HEff1DHit
A set of histograms fo efficiency computation for 1D RecHits (producer)
Definition: Histograms.h:138
edm::EDGetTokenT< edm::PSimHitContainer >
DTRecHitQuality::simHitImpactAngle
float simHitImpactAngle(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const
Definition: DTRecHitQuality.cc:366
edm
HLT enums.
Definition: AlignableModifier.h:19
DTRecHitQuality::doall_
bool doall_
Definition: DTRecHitQuality.h:82
PSimHitContainer.h
DTRecHitQuality::DTRecHitQuality
DTRecHitQuality(const edm::ParameterSet &pset)
Constructor.
Definition: DTRecHitQuality.cc:88
DTRecHit1D
Definition: DTRecHit1D.h:25
DTRecHitQuality::recHitLabel_
edm::InputTag recHitLabel_
Definition: DTRecHitQuality.h:73
DTRecHitQuality::simHitLabel_
edm::InputTag simHitLabel_
Definition: DTRecHitQuality.h:70
DTRecHitQuality::segment2DToken_
edm::EDGetTokenT< DTRecSegment2DCollection > segment2DToken_
Definition: DTRecHitQuality.h:68
dtrechit
Definition: DTRecHitQuality.cc:24
DTRecHitQuality
Definition: DTRecHitQuality.h:46
DTRecHitQuality::compute
void compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit >> &simHitsPerWire, const std::map< DTWireId, std::vector< type >> &recHitsPerWire, dtrechit::Histograms const &histograms, int step) const
Definition: DTRecHitQuality.cc:416
DTRecHitQuality::recHitToken_
edm::EDGetTokenT< DTRecHitCollection > recHitToken_
Definition: DTRecHitQuality.h:67
DTRecHitQuality::segment4DToken_
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
Definition: DTRecHitQuality.h:69
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
DTRecHitQuality::doStep1_
bool doStep1_
Definition: DTRecHitQuality.h:78
DTRecHitCollection
DTWireId
Definition: DTWireId.h:12
DTRecHitQuality::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, dtrechit::Histograms &) const override
Book the DQM plots.
Definition: DTRecHitQuality.cc:111
DTRecHitQuality::recHitPositionError
float recHitPositionError(const DTRecHit1DPair &recHit) const
Definition: DTRecHitQuality.cc:699
DTRecHit1DPair
Definition: DTRecHit1DPair.h:26
Event
DTRecSegment4DCollection
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
DTRecHitQuality::map1DRecHitsPerWire
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs) const
Definition: DTRecHitQuality.cc:304
HRes1DHit
A set of histograms of residuals and pulls for 1D RecHits.
Definition: Histograms.h:44
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
DTRecHitQuality::dqmAnalyze
void dqmAnalyze(edm::Event const &, edm::EventSetup const &, dtrechit::Histograms const &) const override
Perform the real analysis.
Definition: DTRecHitQuality.cc:212
DTRecHitQuality::doStep3_
bool doStep3_
Definition: DTRecHitQuality.h:80
DTRecHitQuality::local_
bool local_
Definition: DTRecHitQuality.h:81
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
edm::EventSetup
Definition: EventSetup.h:57
DTRecHitQuality::doStep2_
bool doStep2_
Definition: DTRecHitQuality.h:79
histograms
Definition: histograms.py:1
DTLayer
Definition: DTLayer.h:25
InputTag.h
DTWireId.h
DTRecHitQuality::simHitDistFromFE
float simHitDistFromFE(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const
Definition: DTRecHitQuality.cc:374
DTRecHitQuality::simHitDistFromWire
float simHitDistFromWire(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const
Definition: DTRecHitQuality.cc:355
dtrechit::Histograms
Definition: DTRecHitQuality.cc:25
DTRecHitQuality::segment4DLabel_
edm::InputTag segment4DLabel_
Definition: DTRecHitQuality.h:75
dqm::implementation::IBooker
Definition: DQMStore.h:43
DQMGlobalEDAnalyzer
Definition: DQMGlobalEDAnalyzer.h:76
genParticles_cff.map
map
Definition: genParticles_cff.py:11
EventSetup
PSimHit
Definition: PSimHit.h:15
edm::Event
Definition: Event.h:73
DTRecHitQuality::findBestRecHit
const type * findBestRecHit(const DTLayer *layer, const DTWireId &wireId, const std::vector< type > &recHits, float simHitDist) const
Definition: DTRecHitQuality.cc:386
edm::InputTag
Definition: InputTag.h:15
DTRecSegment2DCollection
hit
Definition: SiStripHitEffFromCalibTree.cc:88
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
DTRecSegment4DCollection.h
DQMGlobalEDAnalyzer.h