File indexing completed on 2024-09-07 04:34:57
0001 #ifndef DTVDriftCalibration_H
0002 #define DTVDriftCalibration_H
0003
0004
0005
0006
0007
0008
0009
0010 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0011 #include "FWCore/Utilities/interface/InputTag.h"
0012 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0013 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0014
0015 #include "CalibMuon/DTCalibration/interface/vDriftHistos.h"
0016 #include "CalibMuon/DTCalibration/interface/DTTMax.h"
0017 #include "CalibMuon/DTCalibration/interface/DTSegmentSelector.h"
0018
0019 #include "DTCalibrationMap.h"
0020
0021 #include <string>
0022 #include <vector>
0023
0024 namespace edm {
0025 class ParameterSet;
0026 class Event;
0027 class EventSetup;
0028 }
0029
0030 class TFile;
0031 class DTMeanTimerFitter;
0032 class DTGeometry;
0033 class MuonGeometryRecord;
0034
0035 class DTVDriftCalibration : public edm::one::EDAnalyzer<> {
0036 public:
0037
0038 DTVDriftCalibration(const edm::ParameterSet& pset);
0039
0040
0041 ~DTVDriftCalibration() override;
0042
0043
0044
0045 void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override;
0046
0047 void endJob() override;
0048
0049 protected:
0050 private:
0051 std::unique_ptr<DTSegmentSelector> select_;
0052
0053
0054 typedef DTTMax::TMax TMax;
0055
0056 dtcalibration::Histograms histograms_;
0057
0058
0059 class cellInfo {
0060 public:
0061 cellInfo(const TString& name) { histos = new hTMaxCell(name); }
0062
0063 ~cellInfo() { delete histos; }
0064
0065 void add(const std::vector<const TMax*>& tMaxes);
0066 void update() { addedCells.clear(); }
0067 hTMaxCell* getHists() { return histos; }
0068
0069 private:
0070 cellInfo() {}
0071 cellInfo(const cellInfo&) {}
0072
0073 std::vector<dttmaxenums::TMaxCells> addedCells;
0074 hTMaxCell* histos;
0075 };
0076
0077 TH1F* hChi2;
0078 h2DSegm* h2DSegmRZ;
0079 h2DSegm* h2DSegmRPhi;
0080 h4DSegm* h4DSegmAllCh;
0081
0082
0083
0084
0085
0086 enum TMaxGranularity { byChamber, bySL, byPartition };
0087 TMaxGranularity theGranularity;
0088
0089
0090 edm::EDGetTokenT<DTRecSegment4DCollection> theRecHits4DToken;
0091
0092 const edm::ESGetToken<DTGeometry, MuonGeometryRecord> theDTGeomToken;
0093
0094
0095 bool debug;
0096
0097
0098 std::string digiLabel;
0099
0100
0101 TFile* theFile;
0102
0103
0104 std::unique_ptr<DTMeanTimerFitter> theFitter;
0105
0106
0107
0108 bool findVDriftAndT0;
0109
0110
0111 std::string theVDriftOutputFile;
0112
0113
0114 std::map<DTWireId, cellInfo*> theWireIdAndCellMap;
0115
0116
0117
0118
0119
0120 std::unique_ptr<DTTTrigBaseSync> theSync;
0121
0122
0123 edm::ParameterSet theCalibFilePar;
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135 std::string theCalibChamber;
0136
0137
0138 bool writeLegacyVDriftDB;
0139 };
0140 #endif