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 } // namespace edm
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  edm::Run const &,
56  edm::EventSetup const &,
57  dtrechit::Histograms &) const override;
58 
60  void dqmAnalyze(edm::Event const &, edm::EventSetup const &, dtrechit::Histograms const &) const override;
61 
62 private:
63  // Switch for debug output
64  bool debug_;
65 
66  //Get DT Geometry
68 
69  // Root file name
74  ;
75 
80 
81  // Switches for analysis at various steps
82  bool doStep1_;
83  bool doStep2_;
84  bool doStep3_;
85  bool local_;
86  bool doall_;
87 
88  // Return a map between DTRecHit1DPair and wireId
89  std::map<DTWireId, std::vector<DTRecHit1DPair>> map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs) const;
90 
91  // Return a map between DTRecHit1D and wireId
92  std::map<DTWireId, std::vector<DTRecHit1D>> map1DRecHitsPerWire(const DTRecSegment2DCollection *segment2Ds) const;
93 
94  // Return a map between DTRecHit1D and wireId
95  std::map<DTWireId, std::vector<DTRecHit1D>> map1DRecHitsPerWire(const DTRecSegment4DCollection *segment4Ds) const;
96 
97  // Compute SimHit distance from wire (cm)
98  float simHitDistFromWire(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const;
99 
100  // Compute SimHit impact angle (in direction perp to wire)
101  float simHitImpactAngle(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const;
102 
103  // Compute SimHit distance from FrontEnd
104  float simHitDistFromFE(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const;
105 
106  // Find the RecHit closest to the muon SimHit
107  // const DTRecHit1DPair*
108  // findBestRecHit(const DTLayer* layer,
109  // DTWireId wireId,
110  // const std::vector<DTRecHit1DPair>& recHits,
111  // const float simHitDist) const;
112  template <typename type>
113  const type *findBestRecHit(const DTLayer *layer,
114  const DTWireId &wireId,
115  const std::vector<type> &recHits,
116  float simHitDist) const;
117 
118  // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
119  float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer) const;
120  // Compute the distance from wire (cm) of a hits in a DTRecHit1D
121  float recHitDistFromWire(const DTRecHit1D &recHit, const DTLayer *layer) const;
122 
123  // Return the error on the measured (cm) coordinate
124  float recHitPositionError(const DTRecHit1DPair &recHit) const;
125  float recHitPositionError(const DTRecHit1D &recHit) const;
126 
127  // Does the real job
128  template <typename type>
129  void compute(const DTGeometry &dtGeom,
130  const std::map<DTWireId, std::vector<PSimHit>> &simHitsPerWire,
131  const std::map<DTWireId, std::vector<type>> &recHitsPerWire,
133  int step) const;
134 };
135 
136 #endif // Validation_DTRecHits_DTRecHitQuality_h
edm::InputTag recHitLabel_
edm::EDGetTokenT< DTRecHitCollection > recHitToken_
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer) const
edm::InputTag segment4DLabel_
A set of histograms fo efficiency computation for 1D RecHits (producer)
Definition: Histograms.h:138
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
float recHitPositionError(const DTRecHit1DPair &recHit) const
edm::InputTag simHitLabel_
constexpr std::array< uint8_t, layerIndexSize > layer
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs) const
DTRecHitQuality(const edm::ParameterSet &pset)
Constructor.
edm::InputTag segment2DLabel_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, dtrechit::Histograms &) const override
Book the DQM plots.
edm::EDGetTokenT< DTRecSegment2DCollection > segment2DToken_
float simHitImpactAngle(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const
float simHitDistFromWire(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const
A set of histograms of residuals and pulls for 1D RecHits.
Definition: Histograms.h:44
const type * findBestRecHit(const DTLayer *layer, const DTWireId &wireId, const std::vector< type > &recHits, float simHitDist) const
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
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
void dqmAnalyze(edm::Event const &, edm::EventSetup const &, dtrechit::Histograms const &) const override
Perform the real analysis.
HLT enums.
step
Definition: StallMonitor.cc:98
float simHitDistFromFE(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const
edm::EDGetTokenT< edm::PSimHitContainer > simHitToken_
Definition: Run.h:45