00001 #ifndef CalibMuon_DTT0CalibrationNew_H
00002 #define CalibMuon_DTT0CalibrationNew_H
00003
00016 #include "FWCore/Framework/interface/EDAnalyzer.h"
00017 #include "Geometry/DTGeometry/interface/DTGeometry.h"
00018 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00019 #include "FWCore/Framework/interface/ESHandle.h"
00020
00021 #include <string>
00022 #include <vector>
00023 #include <map>
00024
00025 class TFile;
00026 class TH1I;
00027 class TH1D;
00028 class TSpectrum;
00029 class DTT0;
00030
00031 class DTT0CalibrationNew : public edm::EDAnalyzer {
00032 public:
00034 DTT0CalibrationNew(const edm::ParameterSet& pset);
00035
00037 virtual ~DTT0CalibrationNew();
00038
00039
00040
00042 void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
00043
00045 void endJob();
00046
00047
00048 protected:
00049
00050 private:
00051
00052 std::string getHistoName(const DTWireId& wId) const;
00053 std::string getHistoName(const DTLayerId& lId) const;
00054
00055
00056 bool debug;
00057
00058
00059 std::string digiLabel;
00060
00061
00062 TFile *theFile;
00063
00064 TFile *theOutputFile;
00065
00066
00067 unsigned int nevents;
00068
00069 unsigned int eventsForLayerT0;
00070
00071 unsigned int eventsForWireT0;
00072
00073
00074 double tpPeakWidth;
00075
00076
00077 double tpPeakWidthPerLayer;
00078
00079
00080 unsigned int timeBoxWidth;
00081
00082
00083 unsigned int rejectDigiFromPeak;
00084
00085 unsigned int retryForLayerT0;
00086
00087
00088 std::string theCalibWheel;
00089 int selWheel;
00090 std::string theCalibSector;
00091 int selSector;
00092
00093
00094 std::map<DTLayerId, TH1I*> theHistoLayerMap;
00095
00096 TH1D* hT0SectorHisto;
00097
00098 TSpectrum* spectrum;
00099
00100
00101 std::vector<DTWireId> wireIdWithHistos;
00102 std::vector<std::string> cellsWithHistos;
00103
00104
00105 std::map<DTWireId,double> theAbsoluteT0PerWire;
00106 std::map<DTWireId,double> theRelativeT0PerWire;
00107 std::map<DTWireId,double> theSigmaT0PerWire;
00108 std::map<DTWireId,int> nDigiPerWire;
00109 std::map<DTWireId,int> nDigiPerWire_ref;
00110 std::map<DTWireId,double> mK;
00111 std::map<DTWireId,double> mK_ref;
00112 std::map<DTWireId,double> qK;
00113
00114 std::map<DTWireId,TH1I*> theHistoWireMap;
00115
00116 std::map<std::string,double> theT0LayerMap;
00117 std::map<std::string,double> theSigmaT0LayerMap;
00118 std::map<DTLayerId,double> theTPPeakMap;
00119
00120 std::map<DTChamberId,double> theSumT0ByChamber;
00121 std::map<DTChamberId,int> theCountT0ByChamber;
00122 std::map<DTChamberId,double> theRefT0ByChamber;
00123
00124
00125 edm::ESHandle<DTGeometry> dtGeom;
00126 };
00127 #endif
00128