CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CalibMuon/DTCalibration/plugins/DTT0CalibrationNew.h

Go to the documentation of this file.
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   // Operations
00040 
00042   void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
00043 
00045   void endJob();
00046 
00047 
00048 protected:
00049 
00050 private:
00051   // Generate the histo name
00052   std::string getHistoName(const DTWireId& wId) const;
00053   std::string getHistoName(const DTLayerId& lId) const;
00054 
00055   // Debug flag
00056   bool debug;
00057 
00058   // The label used to retrieve digis from the event
00059   std::string digiLabel;
00060 
00061   std::string dbLabel;
00062 
00063   // The root file which contain the histos per layer
00064   TFile *theFile;
00065   // The root file which will contain the histos per wire (for the given layer)
00066   TFile *theOutputFile;
00067 
00068   //The event counter
00069   unsigned int nevents;
00070   //Number of events to be used for the t0 per layer histos
00071   unsigned int eventsForLayerT0;
00072   //Number of events to be used for the t0 reference per wire
00073   unsigned int eventsForWireT0;
00074 
00075   //Acceptance of t0 w.r.t. reference peak
00076   double tpPeakWidth;
00077 
00078   //Acceptance of t0 w.r.t. reference peak
00079   double tpPeakWidthPerLayer;
00080 
00081   //Size of timeBox 
00082   unsigned int timeBoxWidth; 
00083 
00084   //Digi's will be rejected if too far from TP peak 
00085   unsigned int rejectDigiFromPeak;
00086 
00087   unsigned int retryForLayerT0;
00088 
00089   //The wheels,sector to be calibrated (default All)
00090   std::string theCalibWheel;
00091   int selWheel;
00092   std::string theCalibSector;
00093   int selSector;
00094 
00095   // Map of the histos and graph by layer
00096   std::map<DTLayerId, TH1I*> theHistoLayerMap;
00097   //Histo with t0 mean per layer for all the sector
00098   TH1D* hT0SectorHisto;
00099   
00100   TSpectrum* spectrum;
00101 
00102   //Layer with histos for each wire
00103   std::vector<DTWireId> wireIdWithHistos;
00104   std::vector<std::string> cellsWithHistos;
00105 
00106   //Maps with t0, sigma, number of digi per wire
00107   std::map<DTWireId,double> theAbsoluteT0PerWire;
00108   std::map<DTWireId,double> theRelativeT0PerWire;
00109   std::map<DTWireId,double> theSigmaT0PerWire;
00110   std::map<DTWireId,int> nDigiPerWire;
00111   std::map<DTWireId,int> nDigiPerWire_ref;
00112   std::map<DTWireId,double> mK;
00113   std::map<DTWireId,double> mK_ref;
00114   std::map<DTWireId,double> qK;
00115   //Map with histo per wire for the chosen layer
00116   std::map<DTWireId,TH1I*> theHistoWireMap;
00117   //Map with mean and RMS of t0 per layer
00118   std::map<std::string,double> theT0LayerMap;
00119   std::map<std::string,double> theSigmaT0LayerMap;
00120   std::map<DTLayerId,double> theTPPeakMap;
00121   //Ref. t0 per chamber
00122   std::map<DTChamberId,double> theSumT0ByChamber;
00123   std::map<DTChamberId,int> theCountT0ByChamber;
00124   std::map<DTChamberId,double> theRefT0ByChamber;
00125 
00126   //DTGeometry used to loop on the SL in the endJob
00127   edm::ESHandle<DTGeometry> dtGeom;
00128 };
00129 #endif
00130