CMS 3D CMS Logo

DTT0CalibrationRMS.h
Go to the documentation of this file.
1 #ifndef CalibMuon_DTT0CalibrationRMS_H
2 #define CalibMuon_DTT0CalibrationRMS_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  ~DTT0CalibrationRMS() override;
35 
36  // Operations
37 
39  void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override;
40 
42  void endJob() override;
43 
44 protected:
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 token 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
111 };
112 #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
edm::EDGetTokenT< DTDigiCollection > digiToken
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