CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTRecoConditions.h
Go to the documentation of this file.
1 #ifndef CondFormats_DTObjects_DTRecoConditions_H
2 #define CondFormats_DTObjects_DTRecoConditions_H
3 
17 
18 #include <map>
19 #include <vector>
20 #include <string>
21 #include <stdint.h>
22 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
23 #include <atomic>
24 #endif
25 
26 class DTWireId;
27 class TFormula;
28 
30 public:
31  typedef std::map<uint32_t, std::vector<double> >::const_iterator const_iterator;
32 
37 
39  virtual ~DTRecoConditions();
40 
41  void setVersion(int version) {
43  }
44 
46  int version() const {
47  return theVersion;
48  }
49 
52  float get(const DTWireId& wireid, double* x=0) const;
53 
55  void setFormulaExpr(const std::string& expr) {
56  expression=expr;
57  }
58 
60  return expression;
61  }
62 
64  void set(const DTWireId& wireid, const std::vector<double>& values);
65 
67  const_iterator begin() const;
68  const_iterator end() const;
69 
70 private:
71 
72  // The formula used for parametrization (transient pointer)
73 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
74  mutable std::atomic<TFormula*> formula COND_TRANSIENT;
75 #else
76  mutable TFormula* formula COND_TRANSIENT;
77 #endif
78 
79  // Formula evalaution strategy, derived from expression and cached for efficiency reasons
80 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
81  mutable std::atomic<int> formulaType COND_TRANSIENT;
82 #else
83  mutable int formulaType COND_TRANSIENT;
84 #endif
85 
86  // String with the expression representing the formula used for parametrization
88 
89  // Actual data
90  std::map<uint32_t, std::vector<double> > payload;
91 
92  // Versioning
94 
96 };
97 #endif
98 
const_iterator end() const
int version() const
Version numer specifying the structure of the payload. See .cc file for details.
void setVersion(int version)
void set(const DTWireId &wireid, const std::vector< double > &values)
Fill the payload.
std::map< uint32_t, std::vector< double > > payload
std::map< uint32_t, std::vector< double > >::const_iterator const_iterator
std::string getFormulaExpr() const
const DTRecoConditions & operator=(const DTRecoConditions &)
DTRecoConditions()
Constructor.
const_iterator begin() const
Access the data.
virtual ~DTRecoConditions()
Destructor.
#define COND_TRANSIENT
Definition: Serializable.h:60
std::atomic< TFormula * > formula
#define COND_SERIALIZABLE
Definition: Serializable.h:37
std::string expression
void setFormulaExpr(const std::string &expr)
Set the expression representing the formula used for parametrization.
std::atomic< int > formulaType