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 TSpectrum;
27 class DTT0;
28 
30 public:
33 
35  ~DTT0Calibration() override;
36 
37  // Operations
38 
40  void analyze(const edm::Event & event, const edm::EventSetup& eventSetup) override;
41 
43  void endJob() override;
44 
45 
46 protected:
47 
48 private:
49  // Generate the histo name
50  std::string getHistoName(const DTWireId& wId) const;
51  std::string getHistoName(const DTLayerId& lId) const;
52 
53  // Debug flag
54  bool debug;
55 
56  // The label used to retrieve digis from the event
58 
60 
61  // The root file which contain the histos per layer
62  TFile *theFile;
63  // The root file which will contain the histos per wire (for the given layer)
64  TFile *theOutputFile;
65 
66  //The event counter
67  unsigned int nevents;
68  //Number of events to be used for the t0 per layer histos
69  unsigned int eventsForLayerT0;
70  //Number of events to be used for the t0 reference per wire
71  unsigned int eventsForWireT0;
72 
73  //Acceptance of t0 w.r.t. reference peak
74  double tpPeakWidth;
75 
76  //Acceptance of t0 w.r.t. reference peak
78 
79  //Size of timeBox
80  unsigned int timeBoxWidth;
81 
82  //Digi's will be rejected if too far from TP peak
83  unsigned int rejectDigiFromPeak;
84 
85  unsigned int retryForLayerT0;
86 
87  //The wheels,sector to be calibrated (default All)
89  int selWheel;
91  int selSector;
92 
93  // Map of the histos and graph by layer
94  std::map<DTLayerId, TH1I*> theHistoLayerMap;
95  //Histo with t0 mean per layer for all the sector
97 
98  TSpectrum* spectrum;
99 
100  //Layer with histos for each wire
101  std::vector<DTWireId> wireIdWithHistos;
102  std::vector<std::string> cellsWithHistos;
103 
104  //Maps with t0, sigma, number of digi per wire
105  std::map<DTWireId,double> theAbsoluteT0PerWire;
106  std::map<DTWireId,double> theRelativeT0PerWire;
107  std::map<DTWireId,double> theSigmaT0PerWire;
108  std::map<DTWireId,int> nDigiPerWire;
109  std::map<DTWireId,int> nDigiPerWire_ref;
110  std::map<DTWireId,double> mK;
111  std::map<DTWireId,double> mK_ref;
112  std::map<DTWireId,double> qK;
113  //Map with histo per wire for the chosen layer
114  std::map<DTWireId,TH1I*> theHistoWireMap;
115  //Map with mean and RMS of t0 per layer
116  std::map<std::string,double> theT0LayerMap;
117  std::map<std::string,double> theSigmaT0LayerMap;
118  std::map<DTLayerId,double> theTPPeakMap;
119  //Ref. t0 per chamber
120  std::map<DTChamberId,double> theSumT0ByChamber;
121  std::map<DTChamberId,int> theCountT0ByChamber;
122  std::map<DTChamberId,double> theRefT0ByChamber;
123 
124  //DTGeometry used to loop on the SL in the endJob
126 };
127 #endif
128 
double tpPeakWidthPerLayer
std::map< DTLayerId, TH1I * > theHistoLayerMap
void endJob() override
Compute the mean and the RMS of the t0 from the maps and write them to the DB with channel granularit...
unsigned int nevents
std::map< DTWireId, double > theAbsoluteT0PerWire
std::map< DTWireId, TH1I * > theHistoWireMap
std::map< DTChamberId, double > theRefT0ByChamber
std::map< DTLayerId, double > theTPPeakMap
std::map< DTWireId, int > nDigiPerWire
std::vector< DTWireId > wireIdWithHistos
std::string theCalibWheel
unsigned int timeBoxWidth
std::map< DTChamberId, int > theCountT0ByChamber
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
std::string dbLabel
unsigned int rejectDigiFromPeak
std::map< DTWireId, double > theRelativeT0PerWire
~DTT0Calibration() override
Destructor.
std::string theCalibSector
std::map< DTWireId, double > qK
std::map< std::string, double > theSigmaT0LayerMap
unsigned int retryForLayerT0
std::map< std::string, double > theT0LayerMap
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
Fill the maps with t0 (by channel)
std::map< DTWireId, double > mK_ref
std::string digiLabel
std::vector< std::string > cellsWithHistos
TSpectrum * spectrum
std::map< DTChamberId, double > theSumT0ByChamber
DTT0Calibration(const edm::ParameterSet &pset)
Constructor.
unsigned int eventsForWireT0
Definition: event.py:1
std::map< DTWireId, int > nDigiPerWire_ref