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 
30 
31 namespace edm {
32  class ParameterSet;
33  class Event;
34  class EventSetup;
35 }
36 
37 class PSimHit;
38 class DTLayer;
39 class DTWireId;
40 class DTGeometry;
41 class HRes1DHit;
42 class HEff1DHit;
43 namespace dtrechit {
44  struct Histograms;
45 }
46 
47 class DTRecHitQuality : public DQMGlobalEDAnalyzer<dtrechit::Histograms> {
48 public:
51 
52 private:
55 
57  void dqmAnalyze(edm::Event const&, edm::EventSetup const&, dtrechit::Histograms const&) const override;
58 
59 
60 private:
61  // Switch for debug output
62  bool debug_;
63 
64  // Root file name
69 
74 
75  // Switches for analysis at various steps
76  bool doStep1_;
77  bool doStep2_;
78  bool doStep3_;
79  bool local_;
80  bool doall_;
81 
82  // Return a map between DTRecHit1DPair and wireId
83  std::map<DTWireId, std::vector<DTRecHit1DPair>>
84  map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs) const;
85 
86  // Return a map between DTRecHit1D and wireId
87  std::map<DTWireId, std::vector<DTRecHit1D>>
88  map1DRecHitsPerWire(const DTRecSegment2DCollection* segment2Ds) const;
89 
90  // Return a map between DTRecHit1D and wireId
91  std::map<DTWireId, std::vector<DTRecHit1D>>
92  map1DRecHitsPerWire(const DTRecSegment4DCollection* segment4Ds) const;
93 
94  // Compute SimHit distance from wire (cm)
95  float simHitDistFromWire(const DTLayer* layer,
96  const DTWireId& wireId,
97  const PSimHit& hit) const;
98 
99  // Compute SimHit impact angle (in direction perp to wire)
100  float simHitImpactAngle(const DTLayer* layer,
101  const DTWireId& wireId,
102  const PSimHit& hit) const;
103 
104  // Compute SimHit distance from FrontEnd
105  float simHitDistFromFE(const DTLayer* layer,
106  const DTWireId& wireId,
107  const PSimHit& hit) const;
108 
109  // Find the RecHit closest to the muon SimHit
110 // const DTRecHit1DPair*
111 // findBestRecHit(const DTLayer* layer,
112 // DTWireId wireId,
113 // const std::vector<DTRecHit1DPair>& recHits,
114 // const float simHitDist) const;
115  template <typename type>
116  const type*
117  findBestRecHit(const DTLayer* layer,
118  const DTWireId& wireId,
119  const std::vector<type>& recHits,
120  float simHitDist) const;
121 
122  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
123  float recHitDistFromWire(const DTRecHit1DPair& hitPair, const DTLayer* layer) const;
124  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
125  float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer) const;
126 
127  // Return the error on the measured (cm) coordinate
128  float recHitPositionError(const DTRecHit1DPair& recHit) const;
129  float recHitPositionError(const DTRecHit1D& recHit) const;
130 
131  // Does the real job
132  template <typename type>
133  void compute(const DTGeometry *dtGeom,
134  const std::map<DTWireId, std::vector<PSimHit>>& simHitsPerWire,
135  const std::map<DTWireId, std::vector<type>>& recHitsPerWire,
136  dtrechit::Histograms const& histograms, int step) const;
137 
138 };
139 
140 #endif // Validation_DTRecHits_DTRecHitQuality_h
type
Definition: HCALResponse.h:21
edm::InputTag recHitLabel_
edm::EDGetTokenT< DTRecHitCollection > recHitToken_
edm::InputTag segment4DLabel_
virtual example_global void dqmAnalyze(edm::Event const &,@example_global edm::EventSetup const &,@example_global Histograms___class__ const &) const override
A set of histograms fo efficiency computation for 1D RecHits (producer)
Definition: Histograms.h:133
edm::InputTag simHitLabel_
edm::InputTag segment2DLabel_
edm::EDGetTokenT< DTRecSegment2DCollection > segment2DToken_
virtual example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
A set of histograms of residuals and pulls for 1D RecHits.
Definition: Histograms.h:46
def compute(min, max)
HLT enums.
step
edm::EDGetTokenT< edm::PSimHitContainer > simHitToken_
Definition: Run.h:44