CMS 3D CMS Logo

DTT0Calibration.h
Go to the documentation of this file.
1 #ifndef CalibMuon_DTT0Calibration_H
2 #define CalibMuon_DTT0Calibration_H
3 
14 //#include "FWCore/Framework/interface/EDAnalyzer.h"
20 
21 #include <string>
22 #include <vector>
23 #include <map>
24 
25 #include "TFile.h"
26 #include "TH1I.h"
27 #include "TH1D.h"
28 #include "TSpectrum.h"
29 
30 //class TFile;
31 //class TH1I;
32 //class TH1D;
33 //class TSpectrum;
34 class DTT0;
35 
37 public:
40 
42  ~DTT0Calibration() override;
43 
44  // Operations
45 
47  void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override;
48 
50  void endJob() override;
51 
52 protected:
53 private:
54  // Generate the histo name
55  std::string getHistoName(const DTWireId& wId) const;
56  std::string getHistoName(const DTLayerId& lId) const;
57 
58  // Debug flag
59  bool debug;
60 
61  // The label used to retrieve digis from the event
63 
64  // The root file which contain the histos per layer
65  TFile theFile;
66 
67  //The event counter
68  unsigned int nevents;
69  //Number of events to be used for the t0 per layer histos
70  unsigned int eventsForLayerT0;
71  //Number of events to be used for the t0 reference per wire
72  unsigned int eventsForWireT0;
73 
74  //Acceptance of t0 w.r.t. reference peak
75  double tpPeakWidth;
76 
77  //Acceptance of t0 w.r.t. reference peak
79 
80  //Digi's will be rejected if too far from TP peak
81  unsigned int rejectDigiFromPeak;
82 
83  //The wheels,sector to be calibrated (default All)
85  int selWheel;
87  int selSector;
88 
89  // Map of the histos and graph by layer
90  std::map<DTLayerId, TH1I> theHistoLayerMap;
91 
92  // Histogram containing position of all peaks
94 
95  TSpectrum spectrum;
96 
97  //Layer with histos for each wire
98  std::vector<DTWireId> wireIdWithHistos;
99  std::vector<DTLayerId> layerIdWithWireHistos;
100 
101  //Maps with t0, sigma, number of digi per wire
102  std::map<DTWireId, double> theAbsoluteT0PerWire;
103  std::map<DTWireId, double> theRelativeT0PerWire;
104  std::map<DTWireId, double> theSigmaT0PerWire;
105  std::map<DTWireId, int> nDigiPerWire;
106  std::map<DTWireId, int> nDigiPerWire_ref;
107  std::map<DTWireId, double> mK;
108  std::map<DTWireId, double> mK_ref;
109  std::map<DTWireId, double> qK;
110  //Map with histo per wire for the chosen layer
111  std::map<DTWireId, TH1I> theHistoWireMap;
112  //Map with mean and RMS of t0 per layer
113  std::map<std::string, double> theT0LayerMap;
114  std::map<std::string, double> theSigmaT0LayerMap;
115  std::map<DTLayerId, double> theTPPeakMap;
116  //Ref. t0 per chamber
117  std::map<DTChamberId, double> theSumT0ByChamber;
118  std::map<DTChamberId, int> theCountT0ByChamber;
119  std::map<DTChamberId, double> theSigmaT0ByChamber;
120  std::map<DTChamberId, double> theMeanT0ByChamber;
121  std::map<DTChamberId, double> theRefT0ByChamber;
122 
123  //DTGeometry used to loop on the SL in the endJob
125 };
126 #endif
DTT0Calibration::theFile
TFile theFile
Definition: DTT0Calibration.h:65
DTT0Calibration::layerIdWithWireHistos
std::vector< DTLayerId > layerIdWithWireHistos
Definition: DTT0Calibration.h:99
DTT0Calibration::theSigmaT0LayerMap
std::map< std::string, double > theSigmaT0LayerMap
Definition: DTT0Calibration.h:114
EDAnalyzer.h
ESHandle.h
DTT0Calibration::endJob
void endJob() override
Compute the mean and the RMS of the t0 from the maps and write them to the DB with channel granularit...
Definition: DTT0Calibration.cc:281
edm::EDGetTokenT< DTDigiCollection >
DTT0Calibration::theSigmaT0PerWire
std::map< DTWireId, double > theSigmaT0PerWire
Definition: DTT0Calibration.h:104
DTT0Calibration::theCalibWheel
std::string theCalibWheel
Definition: DTT0Calibration.h:84
DTT0Calibration::mK
std::map< DTWireId, double > mK
Definition: DTT0Calibration.h:107
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
DTT0Calibration::tpPeakWidthPerLayer
double tpPeakWidthPerLayer
Definition: DTT0Calibration.h:78
DTT0Calibration::theRelativeT0PerWire
std::map< DTWireId, double > theRelativeT0PerWire
Definition: DTT0Calibration.h:103
DTT0Calibration::analyze
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
Fill the maps with t0 (by channel)
Definition: DTT0Calibration.cc:93
DTT0Calibration::theT0LayerMap
std::map< std::string, double > theT0LayerMap
Definition: DTT0Calibration.h:113
DTT0Calibration::theSigmaT0ByChamber
std::map< DTChamberId, double > theSigmaT0ByChamber
Definition: DTT0Calibration.h:119
DTT0Calibration::theHistoLayerMap
std::map< DTLayerId, TH1I > theHistoLayerMap
Definition: DTT0Calibration.h:90
DTWireId
Definition: DTWireId.h:12
DTT0Calibration::theAbsoluteT0PerWire
std::map< DTWireId, double > theAbsoluteT0PerWire
Definition: DTT0Calibration.h:102
DTT0Calibration::theHistoWireMap
std::map< DTWireId, TH1I > theHistoWireMap
Definition: DTT0Calibration.h:111
DTT0Calibration::theRefT0ByChamber
std::map< DTChamberId, double > theRefT0ByChamber
Definition: DTT0Calibration.h:121
edm::ESHandle< DTGeometry >
DTT0Calibration
Definition: DTT0Calibration.h:36
DTT0Calibration::nDigiPerWire
std::map< DTWireId, int > nDigiPerWire
Definition: DTT0Calibration.h:105
DTT0Calibration::eventsForWireT0
unsigned int eventsForWireT0
Definition: DTT0Calibration.h:72
DTT0Calibration::getHistoName
std::string getHistoName(const DTWireId &wId) const
Definition: DTT0Calibration.cc:452
DTLayerId
Definition: DTLayerId.h:12
DTT0Calibration::selSector
int selSector
Definition: DTT0Calibration.h:87
DTT0Calibration::~DTT0Calibration
~DTT0Calibration() override
Destructor.
Definition: DTT0Calibration.cc:85
DTT0Calibration::qK
std::map< DTWireId, double > qK
Definition: DTT0Calibration.h:109
DTT0Calibration::dtGeom
edm::ESHandle< DTGeometry > dtGeom
Definition: DTT0Calibration.h:124
DTGeometry.h
DTT0Calibration::debug
bool debug
Definition: DTT0Calibration.h:59
edm::ParameterSet
Definition: ParameterSet.h:47
DTT0Calibration::DTT0Calibration
DTT0Calibration(const edm::ParameterSet &pset)
Constructor.
Definition: DTT0Calibration.cc:34
DTT0Calibration::eventsForLayerT0
unsigned int eventsForLayerT0
Definition: DTT0Calibration.h:70
DTT0Calibration::nevents
unsigned int nevents
Definition: DTT0Calibration.h:68
DTT0Calibration::spectrum
TSpectrum spectrum
Definition: DTT0Calibration.h:95
DTT0Calibration::digiToken
edm::EDGetTokenT< DTDigiCollection > digiToken
Definition: DTT0Calibration.h:62
DTT0Calibration::hLayerPeaks
TH1D hLayerPeaks
Definition: DTT0Calibration.h:93
edm::EventSetup
Definition: EventSetup.h:58
DTT0Calibration::tpPeakWidth
double tpPeakWidth
Definition: DTT0Calibration.h:75
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DTWireId.h
DTT0Calibration::theCountT0ByChamber
std::map< DTChamberId, int > theCountT0ByChamber
Definition: DTT0Calibration.h:118
DTT0
Definition: DTT0.h:48
DTT0Calibration::mK_ref
std::map< DTWireId, double > mK_ref
Definition: DTT0Calibration.h:108
DTT0Calibration::theSumT0ByChamber
std::map< DTChamberId, double > theSumT0ByChamber
Definition: DTT0Calibration.h:117
DTT0Calibration::theTPPeakMap
std::map< DTLayerId, double > theTPPeakMap
Definition: DTT0Calibration.h:115
DTT0Calibration::selWheel
int selWheel
Definition: DTT0Calibration.h:85
DTT0Calibration::nDigiPerWire_ref
std::map< DTWireId, int > nDigiPerWire_ref
Definition: DTT0Calibration.h:106
DTDigiCollection.h
DTT0Calibration::theCalibSector
std::string theCalibSector
Definition: DTT0Calibration.h:86
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
DTT0Calibration::theMeanT0ByChamber
std::map< DTChamberId, double > theMeanT0ByChamber
Definition: DTT0Calibration.h:120
DTT0Calibration::wireIdWithHistos
std::vector< DTWireId > wireIdWithHistos
Definition: DTT0Calibration.h:98
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
DTT0Calibration::rejectDigiFromPeak
unsigned int rejectDigiFromPeak
Definition: DTT0Calibration.h:81