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
DTCalibrationMap::getField
float getField(DTWireId wireId, int field) const
Definition: DTCalibrationMap.cc:101
DTCalibrationMap::theMap
std::map< Key, CalibConsts > theMap
Definition: DTCalibrationMap.h:112
DTCalibrationMap::calibConstGranularity
std::string calibConstGranularity
Definition: DTCalibrationMap.h:109
DTCalibrationMap::keyAndConsts_end
const_iterator keyAndConsts_end() const
Definition: DTCalibrationMap.h:88
edm
HLT enums.
Definition: AlignableModifier.h:19
DTCalibrationMap::calibConstFileName
std::string calibConstFileName
Definition: DTCalibrationMap.h:106
DTCalibrationMap::kFactor
float kFactor(DTWireId wireId) const
Return the kfactor for a particular wire.
Definition: DTCalibrationMap.cc:54
DTCalibrationMap::sigma_tTrig
float sigma_tTrig(DTWireId wireId) const
Return the sigma of the t_trig (ns) for a particular wire.
Definition: DTCalibrationMap.cc:51
DTCalibrationMap::CalibGranularity
CalibGranularity
Definition: DTCalibrationMap.h:93
DTCalibrationMap::byChamber
Definition: DTCalibrationMap.h:93
DTCalibrationMap::keyAndConsts_begin
const_iterator keyAndConsts_begin() const
Definition: DTCalibrationMap.h:86
DTCalibrationMap::theGranularity
CalibGranularity theGranularity
Definition: DTCalibrationMap.h:94
DTCalibrationMap::cleanTheConsts
void cleanTheConsts()
Definition: DTCalibrationMap.h:67
DTCalibrationMap::nFields
unsigned int nFields
Definition: DTCalibrationMap.h:103
DTCalibrationMap::Key
DTWireId Key
Definition: DTCalibrationMap.h:63
DTCalibrationMap::byWire
Definition: DTCalibrationMap.h:93
Key
Definition: GoldenPattern.h:15
DTCalibrationMap::CalibConsts
std::vector< float > CalibConsts
Definition: DTCalibrationMap.h:62
InefficientDoubleROC.inputFileName
inputFileName
Definition: InefficientDoubleROC.py:437
DTCalibrationMap::DTCalibrationMap
DTCalibrationMap(const edm::ParameterSet &pset)
Constructor.
Definition: DTCalibrationMap.cc:23
DTWireId
Definition: DTWireId.h:12
DTCalibrationMap::getKey
Key getKey(DTWireId wireId) const
Definition: DTCalibrationMap.cc:64
reco_skim_cfg_mod.outputFileName
outputFileName
Definition: reco_skim_cfg_mod.py:15
DTCalibrationMap::~DTCalibrationMap
virtual ~DTCalibrationMap()
Destructor.
Definition: DTCalibrationMap.cc:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
DTCalibrationMap::meanVDrift
float meanVDrift(DTWireId wireId) const
Return the mean drift velocity for a particular wire (cm/ns)
Definition: DTCalibrationMap.cc:57
DTCalibrationMap::writeConsts
void writeConsts(const std::string &outputFileName) const
Definition: DTCalibrationMap.cc:169
DTCalibrationMap::byLayer
Definition: DTCalibrationMap.h:93
DTCalibrationMap::bySL
Definition: DTCalibrationMap.h:93
DTCalibrationMap::sigma_meanVDrift
float sigma_meanVDrift(DTWireId wireId) const
Return the sigma of the mean drift velocity for a particular wire (cm/ns)
Definition: DTCalibrationMap.cc:60
DTCalibrationMap::getConsts
const CalibConsts * getConsts(DTWireId wireId) const
Definition: DTCalibrationMap.cc:77
DTWireId.h
DTCalibrationMap::tTrig
float tTrig(DTWireId wireId) const
Return the t_trig (ns) for a particular wire.
Definition: DTCalibrationMap.cc:48
DTCalibrationMap
Definition: DTCalibrationMap.h:37
DTCalibrationMap::addCell
void addCell(Key wireId, const CalibConsts &calibConst)
Definition: DTCalibrationMap.cc:160
DTCalibrationMap::checkGranularity
bool checkGranularity(Key aKey) const
Definition: DTCalibrationMap.cc:180
DTCalibrationMap::const_iterator
std::map< Key, CalibConsts >::const_iterator const_iterator
Definition: DTCalibrationMap.h:64
DTCalibrationMap::readConsts
void readConsts(const std::string &inputFileName)
Definition: DTCalibrationMap.cc:113
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27