00001 #ifndef DTNoiseComputation_H
00002 #define DTNoiseComputation_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <FWCore/Framework/interface/EDAnalyzer.h>
00014 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
00015 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00016 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
00017 #include <FWCore/Framework/interface/ESHandle.h>
00018
00019 #include <string>
00020 #include <map>
00021 #include <vector>
00022
00023 namespace edm {
00024 class ParameterSet;
00025 class Event;
00026 class EventSetup;
00027 }
00028
00029 class DTGeometry;
00030 class TFile;
00031 class TH2F;
00032 class TH1F;
00033
00034 class DTNoiseComputation: public edm::EDAnalyzer{
00035
00036 public:
00037
00039 DTNoiseComputation(const edm::ParameterSet& ps);
00040
00042 virtual ~DTNoiseComputation();
00043
00045 void beginJob(const edm::EventSetup& c);
00046
00047 void analyze(const edm::Event& event, const edm::EventSetup& setup) {}
00048
00050 void endJob();
00051
00052
00053 protected:
00054
00055 private:
00056
00057 bool debug;
00058 int counter;
00059 int MaxEvents;
00060 bool fastAnalysis;
00061
00062
00063 edm::ESHandle<DTGeometry> dtGeom;
00064
00065
00066 TFile *theFile;
00067
00068
00069 TFile *theNewFile;
00070
00071
00072 std::map<DTLayerId , bool> toComputeNoiseAverage;
00073
00074
00075 std::map<DTWireId , double> theAverageNoise;
00076
00077
00078 std::map<DTLayerId, std::vector<TH2F*> > theEvtMap;
00079
00080
00081 std::map<DTWireId, TH1F*> theHistoEvtDistancePerWire;
00082
00083
00084 std::map<DTWireId , bool> toDel;
00085
00086
00087 std::map<DTWireId , double> theTimeConstant;
00088
00090 std::string getLayerName(const DTLayerId& lId) const;
00091
00093 std::string getSuperLayerName(const DTSuperLayerId& slId) const;
00094
00096 std::string getChamberName(const DTLayerId& lId) const;
00097
00098
00099 std::map<DTChamberId, TH1F*> AvNoisePerChamber;
00100
00101
00102 std::map<DTChamberId, TH1F*> AvNoiseIntegratedPerChamber;
00103
00104
00105 std::map<DTSuperLayerId, TH1F*> AvNoisePerSuperLayer;
00106
00107
00108 std::map<DTSuperLayerId, TH1F*> AvNoiseIntegratedPerSuperLayer;
00109
00110
00111 int getMaxNumBins(const DTChamberId& chId) const;
00112
00113
00114 double getYMaximum(const DTSuperLayerId& slId) const;
00115
00116
00117 std::map< std::pair<int,int> , TH1F*> noisyC;
00118
00119
00120 std::map< std::pair<int,int> , TH1F*> someHowNoisyC;
00121
00122 };
00123 #endif