CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 DTT0;
27 
29 public:
32 
34  virtual ~DTT0Calibration();
35 
36  // Operations
37 
39  void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
40 
42  void endJob();
43 
44 
45 protected:
46 
47 private:
48  // Generate the histo name
49  std::string getHistoName(const DTWireId& wId) const;
50  std::string getHistoName(const DTLayerId& lId) const;
51 
52  // Debug flag
53  bool debug;
54 
55  // The label used to retrieve digis from the event
57 
58  // The root file which contain the histos per layer
59  TFile *theFile;
60  // The root file which will contain the histos per wire (for the given layer)
61  TFile *theOutputFile;
62 
63  //The event counter
64  unsigned int nevents;
65  //Number of events to be used for the t0 per layer histos
66  unsigned int eventsForLayerT0;
67  //Number of events to be used for the t0 reference per wire
68  unsigned int eventsForWireT0;
69 
70  //Reject digis if far from TP peak
71  unsigned int rejectDigiFromPeak;
72 
73  //Acceptance of t0 w.r.t. reference peak
74  double tpPeakWidth;
75 
76  // Write relative t0's with respect to mean t0's in chamber
78 
79  //The wheels,sector to be calibrated (default All)
81  int selWheel;
83  int selSector;
84 
85  // Map of the histos and graph by layer
86  std::map<DTLayerId, TH1I*> theHistoLayerMap;
87  //Histo with t0 mean per layer for all the sector
89 
90  //Layer with histos for each wire
91  std::vector<DTWireId> wireIdWithHistos;
92  std::vector<std::string> cellsWithHistos;
93 
94  //Maps with t0, sigma, number of digi per wire
95  std::map<DTWireId,double> theAbsoluteT0PerWire;
96  std::map<DTWireId,double> theRelativeT0PerWire;
97  std::map<DTWireId,double> theSigmaT0PerWire;
98  std::map<DTWireId,int> nDigiPerWire;
99  std::map<DTWireId,int> nDigiPerWire_ref;
100  std::map<DTWireId,double> mK;
101  std::map<DTWireId,double> mK_ref;
102  std::map<DTWireId,double> qK;
103  //Map with histo per wire for the chosen layer
104  std::map<DTWireId,TH1I*> theHistoWireMap;
105  std::map<DTWireId,TH1I*> theHistoWireMap_ref;
106  //Map with mean and RMS of t0 per layer
107  std::map<std::string,double> theT0LayerMap;
108  std::map<std::string,double> theSigmaT0LayerMap;
109 
110  //DTGeometry used to loop on the SL in the endJob
112 };
113 #endif
114 
std::map< DTLayerId, TH1I * > theHistoLayerMap
unsigned int nevents
std::map< DTWireId, double > theAbsoluteT0PerWire
std::map< DTWireId, TH1I * > theHistoWireMap
std::map< DTWireId, int > nDigiPerWire
std::vector< DTWireId > wireIdWithHistos
std::string theCalibWheel
std::map< DTWireId, TH1I * > theHistoWireMap_ref
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
unsigned int rejectDigiFromPeak
std::map< DTWireId, double > theRelativeT0PerWire
virtual ~DTT0Calibration()
Destructor.
void endJob()
Compute the mean and the RMS of the t0 from the maps and write them to the DB with channel granularit...
std::string theCalibSector
std::map< DTWireId, double > qK
std::map< std::string, double > theSigmaT0LayerMap
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::map< std::string, double > theT0LayerMap
std::map< DTWireId, double > mK_ref
std::string digiLabel
std::vector< std::string > cellsWithHistos
DTT0Calibration(const edm::ParameterSet &pset)
Constructor.
unsigned int eventsForWireT0
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
Fill the maps with t0 (by channel)
std::map< DTWireId, int > nDigiPerWire_ref