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 protected:
43 private:
44  // Generate the histo name
45  std::string getHistoName(const DTWireId& wId) const;
46  std::string getHistoName(const DTLayerId& lId) const;
47 
48  // Debug flag
49  bool debug;
50 
51  // The label used to retrieve digis from the event
53 
54  // The root file which contain the histos per layer
55  TFile* theFile;
56  // The root file which will contain the histos per wire (for the given layer)
57  TFile* theOutputFile;
58 
59  //The event counter
60  unsigned int nevents;
61  //Number of events to be used for the t0 per layer histos
62  unsigned int eventsForLayerT0;
63  //Number of events to be used for the t0 reference per wire
64  unsigned int eventsForWireT0;
65 
66  //Reject digis if far from TP peak
67  unsigned int rejectDigiFromPeak;
68 
69  //Acceptance of t0 w.r.t. reference peak
70  double tpPeakWidth;
71 
72  // Write relative t0's with respect to mean t0's in chamber
74 
75  //The wheels,sector to be calibrated (default All)
77  int selWheel;
79  int selSector;
80 
81  // Map of the histos and graph by layer
82  std::map<DTLayerId, TH1I*> theHistoLayerMap;
83  //Histo with t0 mean per layer for all the sector
85 
86  //Layer with histos for each wire
87  std::vector<DTWireId> wireIdWithHistos;
88  std::vector<std::string> cellsWithHistos;
89 
90  //Maps with t0, sigma, number of digi per wire
91  std::map<DTWireId, double> theAbsoluteT0PerWire;
92  std::map<DTWireId, double> theRelativeT0PerWire;
93  std::map<DTWireId, double> theSigmaT0PerWire;
94  std::map<DTWireId, int> nDigiPerWire;
95  std::map<DTWireId, int> nDigiPerWire_ref;
96  std::map<DTWireId, double> mK;
97  std::map<DTWireId, double> mK_ref;
98  std::map<DTWireId, double> qK;
99  //Map with histo per wire for the chosen layer
100  std::map<DTWireId, TH1I*> theHistoWireMap;
101  std::map<DTWireId, TH1I*> theHistoWireMap_ref;
102  //Map with mean and RMS of t0 per layer
103  std::map<std::string, double> theT0LayerMap;
104  std::map<std::string, double> theSigmaT0LayerMap;
105 
106  //DTGeometry used to loop on the SL in the endJob
108 };
109 #endif
std::map< DTWireId, double > theAbsoluteT0PerWire
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 > qK
std::map< DTWireId, double > mK
std::map< DTWireId, int > nDigiPerWire
std::map< std::string, double > theSigmaT0LayerMap
edm::ESHandle< DTGeometry > dtGeom
std::map< DTWireId, TH1I * > theHistoWireMap
unsigned int rejectDigiFromPeak
std::vector< DTWireId > wireIdWithHistos
std::string theCalibSector
unsigned int eventsForWireT0
std::string getHistoName(const DTWireId &wId) const
std::map< std::string, double > theT0LayerMap
std::map< DTWireId, TH1I * > theHistoWireMap_ref
std::map< DTWireId, double > mK_ref
Definition: DTT0.h:48
~DTT0CalibrationRMS() override
Destructor.
unsigned int eventsForLayerT0
std::map< DTLayerId, TH1I * > theHistoLayerMap
std::map< DTWireId, double > theSigmaT0PerWire
std::vector< std::string > cellsWithHistos
DTT0CalibrationRMS(const edm::ParameterSet &pset)
Constructor.
std::map< DTWireId, double > theRelativeT0PerWire
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
Fill the maps with t0 (by channel)
std::map< DTWireId, int > nDigiPerWire_ref
Definition: event.py:1