CMS 3D CMS Logo

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