CMS 3D CMS Logo

DTT0CalibrationNew.h
Go to the documentation of this file.
1 #ifndef CalibMuon_DTT0CalibrationNew_H
2 #define CalibMuon_DTT0CalibrationNew_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  virtual ~DTT0CalibrationNew();
36 
37  // Operations
38 
40  void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
41 
43  void endJob();
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 
std::map< DTChamberId, double > theRefT0ByChamber
std::map< DTWireId, TH1I * > theHistoWireMap
unsigned int eventsForLayerT0
unsigned int retryForLayerT0
unsigned int eventsForWireT0
void endJob()
Compute the mean and the RMS of the t0 from the maps and write them to the DB with channel granularit...
unsigned int timeBoxWidth
std::map< std::string, double > theSigmaT0LayerMap
std::map< DTLayerId, double > theTPPeakMap
virtual ~DTT0CalibrationNew()
Destructor.
Definition: DTT0.h:53
std::map< DTChamberId, double > theSumT0ByChamber
std::map< DTWireId, double > theSigmaT0PerWire
std::map< DTChamberId, int > theCountT0ByChamber
std::vector< std::string > cellsWithHistos
std::map< DTWireId, int > nDigiPerWire
std::map< DTWireId, double > theRelativeT0PerWire
std::vector< DTWireId > wireIdWithHistos
std::map< DTWireId, double > mK
std::map< DTWireId, int > nDigiPerWire_ref
std::map< std::string, double > theT0LayerMap
std::map< DTLayerId, TH1I * > theHistoLayerMap
std::map< DTWireId, double > theAbsoluteT0PerWire
std::map< DTWireId, double > mK_ref
DTT0CalibrationNew(const edm::ParameterSet &pset)
Constructor.
unsigned int rejectDigiFromPeak
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
Fill the maps with t0 (by channel)
std::string getHistoName(const DTWireId &wId) const
std::map< DTWireId, double > qK
std::string theCalibSector
edm::ESHandle< DTGeometry > dtGeom
Definition: event.py:1