File indexing completed on 2024-04-06 12:32:00
0001 #ifndef Validation_DTRecHits_DTRecHitQuality_h
0002 #define Validation_DTRecHits_DTRecHitQuality_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #include <map>
0019 #include <string>
0020 #include <vector>
0021
0022 #include "DQMServices/Core/interface/DQMGlobalEDAnalyzer.h"
0023 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
0024 #include "DataFormats/DTRecHit/interface/DTRecSegment2DCollection.h"
0025 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0026 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0027 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0028 #include "FWCore/Utilities/interface/InputTag.h"
0029 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0030
0031 namespace edm {
0032 class ParameterSet;
0033 class Event;
0034 class EventSetup;
0035 }
0036
0037 class PSimHit;
0038 class DTLayer;
0039 class DTWireId;
0040 class DTGeometry;
0041 class HRes1DHit;
0042 class HEff1DHit;
0043 namespace dtrechit {
0044 struct Histograms;
0045 }
0046
0047 class DTRecHitQuality : public DQMGlobalEDAnalyzer<dtrechit::Histograms> {
0048 public:
0049
0050 DTRecHitQuality(const edm::ParameterSet &pset);
0051
0052 private:
0053
0054 void bookHistograms(DQMStore::IBooker &,
0055 edm::Run const &,
0056 edm::EventSetup const &,
0057 dtrechit::Histograms &) const override;
0058
0059
0060 void dqmAnalyze(edm::Event const &, edm::EventSetup const &, dtrechit::Histograms const &) const override;
0061
0062 private:
0063
0064 bool debug_;
0065
0066
0067 edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0068
0069
0070 edm::EDGetTokenT<edm::PSimHitContainer> simHitToken_;
0071 edm::EDGetTokenT<DTRecHitCollection> recHitToken_;
0072 edm::EDGetTokenT<DTRecSegment2DCollection> segment2DToken_;
0073 edm::EDGetTokenT<DTRecSegment4DCollection> segment4DToken_;
0074 ;
0075
0076 edm::InputTag simHitLabel_;
0077 edm::InputTag recHitLabel_;
0078 edm::InputTag segment2DLabel_;
0079 edm::InputTag segment4DLabel_;
0080
0081
0082 bool doStep1_;
0083 bool doStep2_;
0084 bool doStep3_;
0085 bool local_;
0086 bool doall_;
0087
0088
0089 std::map<DTWireId, std::vector<DTRecHit1DPair>> map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs) const;
0090
0091
0092 std::map<DTWireId, std::vector<DTRecHit1D>> map1DRecHitsPerWire(const DTRecSegment2DCollection *segment2Ds) const;
0093
0094
0095 std::map<DTWireId, std::vector<DTRecHit1D>> map1DRecHitsPerWire(const DTRecSegment4DCollection *segment4Ds) const;
0096
0097
0098 float simHitDistFromWire(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const;
0099
0100
0101 float simHitImpactAngle(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const;
0102
0103
0104 float simHitDistFromFE(const DTLayer *layer, const DTWireId &wireId, const PSimHit &hit) const;
0105
0106
0107
0108
0109
0110
0111
0112 template <typename type>
0113 const type *findBestRecHit(const DTLayer *layer,
0114 const DTWireId &wireId,
0115 const std::vector<type> &recHits,
0116 float simHitDist) const;
0117
0118
0119 float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer) const;
0120
0121 float recHitDistFromWire(const DTRecHit1D &recHit, const DTLayer *layer) const;
0122
0123
0124 float recHitPositionError(const DTRecHit1DPair &recHit) const;
0125 float recHitPositionError(const DTRecHit1D &recHit) const;
0126
0127
0128 template <typename type>
0129 void compute(const DTGeometry &dtGeom,
0130 const std::map<DTWireId, std::vector<PSimHit>> &simHitsPerWire,
0131 const std::map<DTWireId, std::vector<type>> &recHitsPerWire,
0132 dtrechit::Histograms const &histograms,
0133 int step) const;
0134 };
0135
0136 #endif