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
type
Definition: HCALResponse.h:21
edm::InputTag recHitLabel_
edm::EDGetTokenT< DTRecHitCollection > recHitToken_
edm::InputTag segment4DLabel_
A set of histograms fo efficiency computation for 1D RecHits (producer)
Definition: Histograms.h:138
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
edm::InputTag simHitLabel_
edm::InputTag segment2DLabel_
example_global void dqmAnalyze(edm::Event const &,@example_global edm::EventSetup const &,@example_global Histograms___class__ const &) const override
edm::EDGetTokenT< DTRecSegment2DCollection > segment2DToken_
A set of histograms of residuals and pulls for 1D RecHits.
Definition: Histograms.h:44
def compute(min, max)
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
HLT enums.
step
Definition: StallMonitor.cc:94
edm::EDGetTokenT< edm::PSimHitContainer > simHitToken_
Definition: Run.h:45