CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTCalibrationMap.h
Go to the documentation of this file.
1 #ifndef DTCalibration_DTCalibrationMap_H
2 #define DTCalibration_DTCalibrationMap_H
3 
15 
16 
17 #include <string>
18 #include <map>
19 #include <vector>
20 
21 
22 
23 namespace edm {
24  class ParameterSet;
25 }
26 
28 public:
31 
33  virtual ~DTCalibrationMap();
34 
35  // Operations
36 
38  float tTrig(DTWireId wireId) const;
39 
41  float sigma_tTrig(DTWireId wireId) const;
42 
44  float kFactor(DTWireId wireId) const;
45 
47  float meanVDrift(DTWireId wireId) const;
48 
50  float sigma_meanVDrift(DTWireId wireId) const;
51 
52  typedef std::vector<float> CalibConsts;
53  typedef DTWireId Key;
54  typedef std::map<Key, CalibConsts>::const_iterator const_iterator;
55 
56  // Clean the map
57  void cleanTheConsts() {
58  theMap.clear();
59  }
60 
61  // Get a particular number (field) between all the calibration
62  // constants available for a particluar wire
63  float getField(DTWireId wireId, int field) const;
64 
65  // Get from the map the calibration constants for a particular wire
66  const CalibConsts* getConsts(DTWireId wireId) const;
67 
68 
69  // Add to the map the calibration consts for a given key
70  void addCell(Key wireId, const CalibConsts& calibConst);
71 
72  // Write the calibration consts to a file
73  void writeConsts(const std::string& outputFileName) const;
74 
75  // Get a key to read calibration constants for a particular wire
76  // with the given granularity
77  Key getKey(DTWireId wireId) const;
78 
80  return theMap.begin();
81  }
82 
84  return theMap.end();
85  }
86 
87 
88 protected:
89 
90 private:
91 
92  // Specify the granularity for the calibration constants
95 
96 
97  // Read the calibration consts from a file
99 
100 
101  // Check the consistency of a given key with the selected granularity
102  bool checkGranularity(Key aKey) const;
103 
104 
105  // The number of fields (calibration numbers) to be read from file
106  unsigned int nFields;
107 
108  // The name of the file containing the calibration constants
110 
111  // Define the granularity to be used for t0
113 
114  // The map between the Key and the calibration constants
115  std::map<Key, CalibConsts> theMap;
116 
117 };
118 
119 #endif
120 
Key getKey(DTWireId wireId) const
void writeConsts(const std::string &outputFileName) const
std::map< Key, CalibConsts >::const_iterator const_iterator
const_iterator keyAndConsts_begin() const
const_iterator keyAndConsts_end() const
DTCalibrationMap(const edm::ParameterSet &pset)
Constructor.
std::map< Key, CalibConsts > theMap
float kFactor(DTWireId wireId) const
Return the kfactor for a particular wire.
CalibGranularity theGranularity
std::string calibConstGranularity
std::string calibConstFileName
float meanVDrift(DTWireId wireId) const
Return the mean drift velocity for a particular wire (cm/ns)
float getField(DTWireId wireId, int field) const
std::vector< float > CalibConsts
bool checkGranularity(Key aKey) const
virtual ~DTCalibrationMap()
Destructor.
void addCell(Key wireId, const CalibConsts &calibConst)
float sigma_tTrig(DTWireId wireId) const
Return the sigma of the t_trig (ns) for a particular wire.
float tTrig(DTWireId wireId) const
Return the t_trig (ns) for a particular wire.
unsigned int nFields
float sigma_meanVDrift(DTWireId wireId) const
Return the sigma of the mean drift velocity for a particular wire (cm/ns)
const CalibConsts * getConsts(DTWireId wireId) const
void readConsts(const std::string &inputFileName)