File indexing completed on 2024-09-07 04:34:56
0001 #ifndef DTNoiseCalibration_H
0002 #define DTNoiseCalibration_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0013 #include "FWCore/Framework/interface/ESHandle.h"
0014 #include "FWCore/Utilities/interface/InputTag.h"
0015 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0016 #include "CondFormats/DataRecord/interface/DTTtrigRcd.h"
0017 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
0018
0019 #include <string>
0020 #include <vector>
0021 #include <map>
0022 #include <ctime>
0023
0024 class DTGeometry;
0025 class DTChamberId;
0026 class DTSuperLayerId;
0027 class DTLayerId;
0028 class DTWireId;
0029 class DTTtrig;
0030 class TFile;
0031 class TH2F;
0032 class TH1F;
0033
0034 class DTNoiseCalibration : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0035 public:
0036
0037 DTNoiseCalibration(const edm::ParameterSet& ps);
0038
0039 ~DTNoiseCalibration() override;
0040
0041 void beginJob() override;
0042 void beginRun(const edm::Run& run, const edm::EventSetup& setup) override;
0043 void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0044 void endRun(const edm::Run& run, const edm::EventSetup& setup) override {}
0045 void endJob() override;
0046
0047 private:
0048 std::string getChannelName(const DTWireId&) const;
0049
0050 std::string getLayerName(const DTLayerId&) const;
0051
0052 std::string getSuperLayerName(const DTSuperLayerId&) const;
0053
0054 std::string getChamberName(const DTChamberId&) const;
0055
0056 const edm::EDGetTokenT<DTDigiCollection> digiToken_;
0057 const bool useTimeWindow_;
0058 const double triggerWidth_;
0059 const int timeWindowOffset_;
0060 const double maximumNoiseRate_;
0061 const bool useAbsoluteRate_;
0062
0063 bool readDB_;
0064 int defaultTtrig_;
0065
0066 std::vector<DTWireId> wireIdWithHisto_;
0067 unsigned int lumiMax_;
0068
0069 int nevents_;
0070
0071 time_t runBeginTime_;
0072 time_t runEndTime_;
0073
0074
0075 edm::ESHandle<DTGeometry> dtGeom_;
0076 const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0077
0078
0079 edm::ESHandle<DTTtrig> tTrigMap_;
0080 const edm::ESGetToken<DTTtrig, DTTtrigRcd> ttrigToken_;
0081
0082 TFile* rootFile_;
0083
0084 TH1F* hTDCTriggerWidth_;
0085
0086 std::map<DTLayerId, TH1F*> theHistoOccupancyMap_;
0087
0088 std::map<DTWireId, TH1F*> theHistoOccupancyVsLumiMap_;
0089
0090 std::map<DTChamberId, TH1F*> chamberOccupancyVsLumiMap_;
0091
0092 std::map<DTChamberId, TH1F*> chamberOccupancyVsTimeMap_;
0093 };
0094 #endif