CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTT0CalibrationNew.h
Go to the documentation of this file.
1 #ifndef CalibMuon_DTT0CalibrationNew_H
2 #define CalibMuon_DTT0CalibrationNew_H
3 
20 
21 #include <string>
22 #include <vector>
23 #include <map>
24 
25 class TFile;
26 class TH1I;
27 class TH1D;
28 class TSpectrum;
29 class DTT0;
30 
32 public:
35 
37  virtual ~DTT0CalibrationNew();
38 
39  // Operations
40 
42  void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
43 
45  void endJob();
46 
47 
48 protected:
49 
50 private:
51  // Generate the histo name
52  std::string getHistoName(const DTWireId& wId) const;
53  std::string getHistoName(const DTLayerId& lId) const;
54 
55  // Debug flag
56  bool debug;
57 
58  // The label used to retrieve digis from the event
59  std::string digiLabel;
60 
61  std::string dbLabel;
62 
63  // The root file which contain the histos per layer
64  TFile *theFile;
65  // The root file which will contain the histos per wire (for the given layer)
66  TFile *theOutputFile;
67 
68  //The event counter
69  unsigned int nevents;
70  //Number of events to be used for the t0 per layer histos
71  unsigned int eventsForLayerT0;
72  //Number of events to be used for the t0 reference per wire
73  unsigned int eventsForWireT0;
74 
75  //Acceptance of t0 w.r.t. reference peak
76  double tpPeakWidth;
77 
78  //Acceptance of t0 w.r.t. reference peak
80 
81  //Size of timeBox
82  unsigned int timeBoxWidth;
83 
84  //Digi's will be rejected if too far from TP peak
85  unsigned int rejectDigiFromPeak;
86 
87  unsigned int retryForLayerT0;
88 
89  //The wheels,sector to be calibrated (default All)
90  std::string theCalibWheel;
91  int selWheel;
92  std::string theCalibSector;
93  int selSector;
94 
95  // Map of the histos and graph by layer
96  std::map<DTLayerId, TH1I*> theHistoLayerMap;
97  //Histo with t0 mean per layer for all the sector
99 
100  TSpectrum* spectrum;
101 
102  //Layer with histos for each wire
103  std::vector<DTWireId> wireIdWithHistos;
104  std::vector<std::string> cellsWithHistos;
105 
106  //Maps with t0, sigma, number of digi per wire
107  std::map<DTWireId,double> theAbsoluteT0PerWire;
108  std::map<DTWireId,double> theRelativeT0PerWire;
109  std::map<DTWireId,double> theSigmaT0PerWire;
110  std::map<DTWireId,int> nDigiPerWire;
111  std::map<DTWireId,int> nDigiPerWire_ref;
112  std::map<DTWireId,double> mK;
113  std::map<DTWireId,double> mK_ref;
114  std::map<DTWireId,double> qK;
115  //Map with histo per wire for the chosen layer
116  std::map<DTWireId,TH1I*> theHistoWireMap;
117  //Map with mean and RMS of t0 per layer
118  std::map<std::string,double> theT0LayerMap;
119  std::map<std::string,double> theSigmaT0LayerMap;
120  std::map<DTLayerId,double> theTPPeakMap;
121  //Ref. t0 per chamber
122  std::map<DTChamberId,double> theSumT0ByChamber;
123  std::map<DTChamberId,int> theCountT0ByChamber;
124  std::map<DTChamberId,double> theRefT0ByChamber;
125 
126  //DTGeometry used to loop on the SL in the endJob
128 };
129 #endif
130 
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:52
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
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< 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