File indexing completed on 2024-09-07 04:34:56
0001 #ifndef DTNoiseComputation_H
0002 #define DTNoiseComputation_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0012 #include "FWCore/Framework/interface/EventSetup.h"
0013 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
0014 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0015 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0016 #include "FWCore/Framework/interface/ESHandle.h"
0017 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0018
0019 #include <string>
0020 #include <map>
0021 #include <vector>
0022
0023 namespace edm {
0024 class ParameterSet;
0025 class Event;
0026 class EventSetup;
0027 }
0028
0029 class DTGeometry;
0030 class TFile;
0031 class TH2F;
0032 class TH1F;
0033
0034 class DTNoiseComputation : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0035 public:
0036
0037 DTNoiseComputation(const edm::ParameterSet& ps);
0038
0039
0040 ~DTNoiseComputation() override;
0041
0042
0043 void beginJob() override {}
0044
0045 void beginRun(const edm::Run&, const edm::EventSetup& setup) override;
0046
0047 void analyze(const edm::Event& event, const edm::EventSetup& setup) override {}
0048
0049 void endRun(const edm::Run&, const edm::EventSetup& setup) override {}
0050
0051
0052 void endJob() override;
0053
0054 protected:
0055 private:
0056 bool debug;
0057 int counter;
0058 int MaxEvents;
0059 bool fastAnalysis;
0060
0061
0062 edm::ESHandle<DTGeometry> dtGeom;
0063 const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0064
0065
0066 TFile* theFile;
0067
0068
0069 TFile* theNewFile;
0070
0071
0072 std::map<DTLayerId, bool> toComputeNoiseAverage;
0073
0074
0075 std::map<DTWireId, double> theAverageNoise;
0076
0077
0078 std::map<DTLayerId, std::vector<TH2F*> > theEvtMap;
0079
0080
0081 std::map<DTWireId, TH1F*> theHistoEvtDistancePerWire;
0082
0083
0084 std::map<DTWireId, bool> toDel;
0085
0086
0087 std::map<DTWireId, double> theTimeConstant;
0088
0089
0090 std::string getLayerName(const DTLayerId& lId) const;
0091
0092
0093 std::string getSuperLayerName(const DTSuperLayerId& slId) const;
0094
0095
0096 std::string getChamberName(const DTLayerId& lId) const;
0097
0098
0099 std::map<DTChamberId, TH1F*> AvNoisePerChamber;
0100
0101
0102 std::map<DTChamberId, TH1F*> AvNoiseIntegratedPerChamber;
0103
0104
0105 std::map<DTSuperLayerId, TH1F*> AvNoisePerSuperLayer;
0106
0107
0108 std::map<DTSuperLayerId, TH1F*> AvNoiseIntegratedPerSuperLayer;
0109
0110
0111 int getMaxNumBins(const DTChamberId& chId) const;
0112
0113
0114 double getYMaximum(const DTSuperLayerId& slId) const;
0115
0116
0117 std::map<std::pair<int, int>, TH1F*> noisyC;
0118
0119
0120 std::map<std::pair<int, int>, TH1F*> someHowNoisyC;
0121 };
0122 #endif