CMS 3D CMS Logo

DTT0Calibration.h
Go to the documentation of this file.
1 #ifndef CalibMuon_DTT0Calibration_H
2 #define CalibMuon_DTT0Calibration_H
3 
18 
19 #include <string>
20 #include <vector>
21 #include <map>
22 
23 class TFile;
24 class TH1I;
25 class TH1D;
26 class DTT0;
27 
29 public:
32 
34  virtual ~DTT0Calibration();
35 
36  // Operations
37 
39  void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
40 
42  void endJob();
43 
44 
45 protected:
46 
47 private:
48  // Generate the histo name
49  std::string getHistoName(const DTWireId& wId) const;
50  std::string getHistoName(const DTLayerId& lId) const;
51 
52  // Debug flag
53  bool debug;
54 
55  // The label used to retrieve digis from the event
57 
58  // The root file which contain the histos per layer
59  TFile *theFile;
60  // The root file which will contain the histos per wire (for the given layer)
61  TFile *theOutputFile;
62 
63  //The event counter
64  unsigned int nevents;
65  //Number of events to be used for the t0 per layer histos
66  unsigned int eventsForLayerT0;
67  //Number of events to be used for the t0 reference per wire
68  unsigned int eventsForWireT0;
69 
70  //Reject digis if far from TP peak
71  unsigned int rejectDigiFromPeak;
72 
73  //Acceptance of t0 w.r.t. reference peak
74  double tpPeakWidth;
75 
76  // Write relative t0's with respect to mean t0's in chamber
78 
79  //The wheels,sector to be calibrated (default All)
81  int selWheel;
83  int selSector;
84 
85  // Map of the histos and graph by layer
86  std::map<DTLayerId, TH1I*> theHistoLayerMap;
87  //Histo with t0 mean per layer for all the sector
89 
90  //Layer with histos for each wire
91  std::vector<DTWireId> wireIdWithHistos;
92  std::vector<std::string> cellsWithHistos;
93 
94  //Maps with t0, sigma, number of digi per wire
95  std::map<DTWireId,double> theAbsoluteT0PerWire;
96  std::map<DTWireId,double> theRelativeT0PerWire;
97  std::map<DTWireId,double> theSigmaT0PerWire;
98  std::map<DTWireId,int> nDigiPerWire;
99  std::map<DTWireId,int> nDigiPerWire_ref;
100  std::map<DTWireId,double> mK;
101  std::map<DTWireId,double> mK_ref;
102  std::map<DTWireId,double> qK;
103  //Map with histo per wire for the chosen layer
104  std::map<DTWireId,TH1I*> theHistoWireMap;
105  std::map<DTWireId,TH1I*> theHistoWireMap_ref;
106  //Map with mean and RMS of t0 per layer
107  std::map<std::string,double> theT0LayerMap;
108  std::map<std::string,double> theSigmaT0LayerMap;
109 
110  //DTGeometry used to loop on the SL in the endJob
112 };
113 #endif
114 
std::map< DTLayerId, TH1I * > theHistoLayerMap
unsigned int nevents
std::map< DTWireId, double > theAbsoluteT0PerWire
std::map< DTWireId, TH1I * > theHistoWireMap
std::map< DTWireId, int > nDigiPerWire
std::vector< DTWireId > wireIdWithHistos
std::string theCalibWheel
std::map< DTWireId, TH1I * > theHistoWireMap_ref
std::string getHistoName(const DTWireId &wId) const
std::map< DTWireId, double > theSigmaT0PerWire
edm::ESHandle< DTGeometry > dtGeom
std::map< DTWireId, double > mK
unsigned int eventsForLayerT0
Definition: DTT0.h:53
unsigned int rejectDigiFromPeak
std::map< DTWireId, double > theRelativeT0PerWire
virtual ~DTT0Calibration()
Destructor.
void endJob()
Compute the mean and the RMS of the t0 from the maps and write them to the DB with channel granularit...
std::string theCalibSector
std::map< DTWireId, double > qK
std::map< std::string, double > theSigmaT0LayerMap
std::map< std::string, double > theT0LayerMap
std::map< DTWireId, double > mK_ref
std::string digiLabel
std::vector< std::string > cellsWithHistos
DTT0Calibration(const edm::ParameterSet &pset)
Constructor.
unsigned int eventsForWireT0
Definition: event.py:1
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
Fill the maps with t0 (by channel)
std::map< DTWireId, int > nDigiPerWire_ref