CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/CalibMuon/DTCalibration/plugins/DTT0Calibration.h

Go to the documentation of this file.
00001 #ifndef CalibMuon_DTT0Calibration_H
00002 #define CalibMuon_DTT0Calibration_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 DTT0;
00029 
00030 class DTT0Calibration : public edm::EDAnalyzer {
00031 public:
00033   DTT0Calibration(const edm::ParameterSet& pset);
00034 
00036   virtual ~DTT0Calibration();
00037 
00038   // Operations
00039 
00041   void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
00042 
00044   void endJob();
00045 
00046 
00047 protected:
00048 
00049 private:
00050   // Generate the histo name
00051   std::string getHistoName(const DTWireId& wId) const;
00052   std::string getHistoName(const DTLayerId& lId) const;
00053 
00054   // Debug flag
00055   bool debug;
00056 
00057   // The label used to retrieve digis from the event
00058   std::string digiLabel;
00059 
00060   // The root file which contain the histos per layer
00061   TFile *theFile;
00062   // The root file which will contain the histos per wire (for the given layer)
00063   TFile *theOutputFile;
00064 
00065   //The event counter
00066   unsigned int nevents;
00067   //Number of events to be used for the t0 per layer histos
00068   unsigned int eventsForLayerT0;
00069   //Number of events to be used for the t0 reference per wire
00070   unsigned int eventsForWireT0;
00071 
00072   //Reject digis if far from TP peak
00073   unsigned int rejectDigiFromPeak;
00074 
00075   //Acceptance of t0 w.r.t. reference peak
00076   double tpPeakWidth;
00077 
00078   // Write relative t0's with respect to mean t0's in chamber
00079   bool correctByChamberMean_;
00080 
00081   //The wheels,sector to be calibrated (default All)
00082   std::string theCalibWheel;
00083   int selWheel;
00084   std::string theCalibSector;
00085   int selSector;
00086 
00087   // Map of the histos and graph by layer
00088   std::map<DTLayerId, TH1I*> theHistoLayerMap;
00089   //Histo with t0 mean per layer for all the sector
00090   TH1D* hT0SectorHisto;
00091   
00092   //Layer with histos for each wire
00093   std::vector<DTWireId> wireIdWithHistos;
00094   std::vector<std::string> cellsWithHistos;
00095 
00096   //Maps with t0, sigma, number of digi per wire
00097   std::map<DTWireId,double> theAbsoluteT0PerWire;
00098   std::map<DTWireId,double> theRelativeT0PerWire;
00099   std::map<DTWireId,double> theSigmaT0PerWire;
00100   std::map<DTWireId,int> nDigiPerWire;
00101   std::map<DTWireId,int> nDigiPerWire_ref;
00102   std::map<DTWireId,double> mK;
00103   std::map<DTWireId,double> mK_ref;
00104   std::map<DTWireId,double> qK;
00105   //Map with histo per wire for the chosen layer
00106   std::map<DTWireId,TH1I*> theHistoWireMap;
00107   std::map<DTWireId,TH1I*> theHistoWireMap_ref;
00108   //Map with mean and RMS of t0 per layer
00109   std::map<std::string,double> theT0LayerMap;
00110   std::map<std::string,double> theSigmaT0LayerMap;
00111 
00112   //DTGeometry used to loop on the SL in the endJob
00113   edm::ESHandle<DTGeometry> dtGeom;
00114 };
00115 #endif
00116