File indexing completed on 2024-04-06 11:58:26
0001 #ifndef CalibMuon_DTT0Calibration_H
0002 #define CalibMuon_DTT0Calibration_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0015 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0016 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0017 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
0018 #include "FWCore/Framework/interface/ESHandle.h"
0019 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0020
0021 #include <string>
0022 #include <vector>
0023 #include <map>
0024
0025 #include "TFile.h"
0026 #include "TH1I.h"
0027 #include "TH1D.h"
0028 #include "TSpectrum.h"
0029
0030
0031
0032
0033
0034 class DTT0;
0035
0036 class DTT0Calibration : public edm::one::EDAnalyzer<> {
0037 public:
0038
0039 DTT0Calibration(const edm::ParameterSet& pset);
0040
0041
0042 ~DTT0Calibration() override;
0043
0044
0045
0046
0047 void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override;
0048
0049
0050 void endJob() override;
0051
0052 protected:
0053 private:
0054
0055 std::string getHistoName(const DTWireId& wId) const;
0056 std::string getHistoName(const DTLayerId& lId) const;
0057
0058
0059 bool debug;
0060
0061
0062 edm::EDGetTokenT<DTDigiCollection> digiToken;
0063
0064
0065 TFile theFile;
0066
0067
0068 unsigned int nevents;
0069
0070 unsigned int eventsForLayerT0;
0071
0072 unsigned int eventsForWireT0;
0073
0074
0075 double tpPeakWidth;
0076
0077
0078 double tpPeakWidthPerLayer;
0079
0080
0081 unsigned int rejectDigiFromPeak;
0082
0083
0084 std::string theCalibWheel;
0085 int selWheel;
0086 std::string theCalibSector;
0087 int selSector;
0088
0089
0090 std::map<DTLayerId, TH1I> theHistoLayerMap;
0091
0092
0093 TH1D hLayerPeaks;
0094
0095 TSpectrum spectrum;
0096
0097
0098 std::vector<DTWireId> wireIdWithHistos;
0099 std::vector<DTLayerId> layerIdWithWireHistos;
0100
0101
0102 std::map<DTWireId, double> theAbsoluteT0PerWire;
0103 std::map<DTWireId, double> theRelativeT0PerWire;
0104 std::map<DTWireId, double> theSigmaT0PerWire;
0105 std::map<DTWireId, int> nDigiPerWire;
0106 std::map<DTWireId, int> nDigiPerWire_ref;
0107 std::map<DTWireId, double> mK;
0108 std::map<DTWireId, double> mK_ref;
0109 std::map<DTWireId, double> qK;
0110
0111 std::map<DTWireId, TH1I> theHistoWireMap;
0112
0113 std::map<std::string, double> theT0LayerMap;
0114 std::map<std::string, double> theSigmaT0LayerMap;
0115 std::map<DTLayerId, double> theTPPeakMap;
0116
0117 std::map<DTChamberId, double> theSumT0ByChamber;
0118 std::map<DTChamberId, int> theCountT0ByChamber;
0119 std::map<DTChamberId, double> theSigmaT0ByChamber;
0120 std::map<DTChamberId, double> theMeanT0ByChamber;
0121 std::map<DTChamberId, double> theRefT0ByChamber;
0122
0123
0124 edm::ESHandle<DTGeometry> dtGeom;
0125 const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0126 };
0127 #endif