CMS 3D CMS Logo

DTCalibrationMap.h
Go to the documentation of this file.
1 #ifndef DTCalibration_DTCalibrationMap_H
2 #define DTCalibration_DTCalibrationMap_H
3 
28 
29 #include <string>
30 #include <map>
31 #include <vector>
32 
33 namespace edm {
34  class ParameterSet;
35 }
36 
38 public:
41 
43  virtual ~DTCalibrationMap();
44 
45  // Operations
46 
48  float tTrig(DTWireId wireId) const;
49 
51  float sigma_tTrig(DTWireId wireId) const;
52 
54  float kFactor(DTWireId wireId) const;
55 
57  float meanVDrift(DTWireId wireId) const;
58 
60  float sigma_meanVDrift(DTWireId wireId) const;
61 
62  typedef std::vector<float> CalibConsts;
63  typedef DTWireId Key;
64  typedef std::map<Key, CalibConsts>::const_iterator const_iterator;
65 
66  // Clean the map
67  void cleanTheConsts() { theMap.clear(); }
68 
69  // Get a particular number (field) between all the calibration
70  // constants available for a particluar wire
71  float getField(DTWireId wireId, int field) const;
72 
73  // Get from the map the calibration constants for a particular wire
74  const CalibConsts* getConsts(DTWireId wireId) const;
75 
76  // Add to the map the calibration consts for a given key
77  void addCell(Key wireId, const CalibConsts& calibConst);
78 
79  // Write the calibration consts to a file
80  void writeConsts(const std::string& outputFileName) const;
81 
82  // Get a key to read calibration constants for a particular wire
83  // with the given granularity
84  Key getKey(DTWireId wireId) const;
85 
86  const_iterator keyAndConsts_begin() const { return theMap.begin(); }
87 
88  const_iterator keyAndConsts_end() const { return theMap.end(); }
89 
90 protected:
91 private:
92  // Specify the granularity for the calibration constants
95 
96  // Read the calibration consts from a file
98 
99  // Check the consistency of a given key with the selected granularity
100  bool checkGranularity(Key aKey) const;
101 
102  // The number of fields (calibration numbers) to be read from file
103  unsigned int nFields;
104 
105  // The name of the file containing the calibration constants
107 
108  // Define the granularity to be used for t0
110 
111  // The map between the Key and the calibration constants
112  std::map<Key, CalibConsts> theMap;
113 };
114 
115 #endif
float tTrig(DTWireId wireId) const
Return the t_trig (ns) for a particular wire.
float sigma_meanVDrift(DTWireId wireId) const
Return the sigma of the mean drift velocity for a particular wire (cm/ns)
std::map< Key, CalibConsts >::const_iterator const_iterator
const_iterator keyAndConsts_begin() const
DTCalibrationMap(const edm::ParameterSet &pset)
Constructor.
std::map< Key, CalibConsts > theMap
const_iterator keyAndConsts_end() const
CalibGranularity theGranularity
std::string calibConstGranularity
std::string calibConstFileName
float kFactor(DTWireId wireId) const
Return the kfactor for a particular wire.
float meanVDrift(DTWireId wireId) const
Return the mean drift velocity for a particular wire (cm/ns)
const CalibConsts * getConsts(DTWireId wireId) const
std::vector< float > CalibConsts
virtual ~DTCalibrationMap()
Destructor.
void addCell(Key wireId, const CalibConsts &calibConst)
Key getKey(DTWireId wireId) const
unsigned int nFields
bool checkGranularity(Key aKey) const
void writeConsts(const std::string &outputFileName) const
HLT enums.
float sigma_tTrig(DTWireId wireId) const
Return the sigma of the t_trig (ns) for a particular wire.
void readConsts(const std::string &inputFileName)
float getField(DTWireId wireId, int field) const