CMS 3D CMS Logo

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