File indexing completed on 2023-03-17 10:54:13
0001
0002 #ifndef DTCalibValidation_H
0003 #define DTCalibValidation_H
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "FWCore/Framework/interface/Frameworkfwd.h"
0013 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "FWCore/Framework/interface/LuminosityBlock.h"
0016
0017 #include "DQMServices/Core/interface/DQMStore.h"
0018 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0019
0020 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0021 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
0022 #include "DataFormats/DTRecHit/interface/DTRecSegment2DCollection.h"
0023 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0024 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0025
0026 #include "FWCore/Framework/interface/ESHandle.h"
0027
0028 #include <string>
0029 #include <map>
0030 #include <vector>
0031
0032
0033
0034
0035
0036 class DTGeometry;
0037 class DTChamber;
0038
0039
0040 class DTCalibValidation : public DQMEDAnalyzer {
0041 public:
0042
0043 DTCalibValidation(const edm::ParameterSet& pset);
0044
0045
0046 ~DTCalibValidation() override;
0047
0048
0049 void dqmBeginRun(const edm::Run& r, const edm::EventSetup& c) override;
0050
0051
0052 void analyze(const edm::Event& event, const edm::EventSetup& setup) override;
0053
0054 protected:
0055 void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0056
0057 private:
0058
0059
0060 edm::ParameterSet parameters;
0061 int wrongSegment;
0062 int rightSegment;
0063 int nevent;
0064
0065 bool detailedAnalysis;
0066
0067 edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0068 const DTGeometry* dtGeom;
0069
0070
0071 edm::EDGetTokenT<DTRecHitCollection> recHits1DToken_;
0072
0073 edm::EDGetTokenT<DTRecSegment2DCollection> segment2DToken_;
0074
0075 edm::EDGetTokenT<DTRecSegment4DCollection> segment4DToken_;
0076
0077
0078 std::map<DTWireId, std::vector<DTRecHit1DPair> > map1DRecHitsPerWire(const DTRecHitCollection* dt1DRecHitPairs);
0079
0080
0081 std::map<DTWireId, std::vector<DTRecHit1D> > map1DRecHitsPerWire(const DTRecSegment2DCollection* segment2Ds);
0082
0083
0084 std::map<DTWireId, std::vector<DTRecHit1D> > map1DRecHitsPerWire(const DTRecSegment4DCollection* segment4Ds);
0085
0086 template <typename type>
0087 const type* findBestRecHit(const DTLayer* layer,
0088 DTWireId wireId,
0089 const std::vector<type>& recHits,
0090 const float simHitDist);
0091
0092
0093 float recHitDistFromWire(const DTRecHit1DPair& hitPair, const DTLayer* layer);
0094
0095 float recHitDistFromWire(const DTRecHit1D& recHit, const DTLayer* layer);
0096
0097 float recHitPosition(
0098 const DTRecHit1DPair& hitPair, const DTLayer* layer, const DTChamber* chamber, float segmPos, int sl);
0099
0100 float recHitPosition(const DTRecHit1D& recHit, const DTLayer* layer, const DTChamber* chamber, float segmPos, int sl);
0101
0102
0103 template <typename type>
0104 void compute(const DTGeometry* dtGeom,
0105 const DTRecSegment4D& segment,
0106 const std::map<DTWireId, std::vector<type> >& recHitsPerWire,
0107 int step);
0108
0109
0110 void bookHistos(DTSuperLayerId slId, int step);
0111
0112 void fillHistos(DTSuperLayerId slId,
0113 float distance,
0114 float residualOnDistance,
0115 float position,
0116 float residualOnPosition,
0117 int step);
0118
0119 std::map<std::pair<DTSuperLayerId, int>, std::vector<MonitorElement*> > histosPerSL;
0120 };
0121 #endif
0122
0123
0124
0125
0126