CMS 3D CMS Logo

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