00001 #ifndef CalibMuon_DTTTrigCalibration_H 00002 #define CalibMuon_DTTTrigCalibration_H 00003 00014 #include "FWCore/Framework/interface/EDAnalyzer.h" 00015 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h" 00016 #include "DataFormats/MuonDetId/interface/DTLayerId.h" 00017 00018 #include <string> 00019 #include <map> 00020 00021 00022 namespace edm { 00023 class ParameterSet; 00024 class Event; 00025 class EventSetup; 00026 } 00027 00028 class TFile; 00029 class TH1F; 00030 class DTTimeBoxFitter; 00031 class DTTTrigBaseSync; 00032 class DTTtrig; 00033 00034 class DTTTrigCalibration : public edm::EDAnalyzer { 00035 public: 00037 DTTTrigCalibration(const edm::ParameterSet& pset); 00038 00040 virtual ~DTTTrigCalibration(); 00041 00042 // Operations 00043 00045 void analyze(const edm::Event & event, const edm::EventSetup& eventSetup); 00046 00048 void endJob(); 00049 00050 00051 protected: 00052 00053 private: 00054 // Generate the time box name 00055 std::string getTBoxName(const DTSuperLayerId& slId) const; 00056 // Generate the time box name 00057 std::string getOccupancyName(const DTLayerId& slId) const; 00058 00059 // Print computed ttrig 00060 void dumpTTrigMap(const DTTtrig* tTrig) const; 00061 00062 // Plot computed ttrig 00063 void plotTTrig(const DTTtrig* tTrig) const; 00064 00065 // Debug flag 00066 bool debug; 00067 00068 // The label used to retrieve digis from the event 00069 std::string digiLabel; 00070 00071 // The TDC time-window 00072 int maxTDCCounts; 00073 //The maximum number of digis per layer 00074 int maxDigiPerLayer; 00075 00076 // The file which will contain the time boxes 00077 TFile *theFile; 00078 00079 // Map of the histograms by SL 00080 std::map<DTSuperLayerId, TH1F*> theHistoMap; 00081 std::map<DTLayerId, TH1F*> theOccupancyMap; 00082 00083 // Switch for t0 subtraction 00084 bool doSubtractT0; 00085 // Switch for checking of noisy channels 00086 bool checkNoisyChannels; 00087 //card to switch on/off the DB writing 00088 bool findTMeanAndSigma; 00089 // the kfactor to be uploaded in the ttrig DB 00090 double kFactor; 00091 00092 // The fitter 00093 DTTimeBoxFitter *theFitter; 00094 // The module for t0 subtraction 00095 DTTTrigBaseSync *theSync;//FIXME: should be const 00096 00097 }; 00098 #endif 00099