CMS 3D CMS Logo

DTMtime.h
Go to the documentation of this file.
1 #ifndef DTMtime_H
2 #define DTMtime_H
3 
13 //----------------------
14 // Base Class Headers --
15 //----------------------
16 
17 //------------------------------------
18 // Collaborating Class Declarations --
19 //------------------------------------
21 
27 
28 //---------------
29 // C++ Headers --
30 //---------------
31 #include <string>
32 #include <vector>
33 #include <utility>
34 
35 template <class Key, class Content>
36 class DTBufferTree;
37 
38 // ---------------------
39 // -- Class Interface --
40 // ---------------------
41 
42 class DTMtimeId {
43 public:
44  DTMtimeId();
45  ~DTMtimeId();
46 
47  int wheelId;
48  int stationId;
49  int sectorId;
50  int slId;
51  int layerId;
52  int cellId;
53 
55 };
56 
57 class DTMtimeData {
58 public:
59  DTMtimeData();
60  ~DTMtimeData();
61 
62  float mTime;
63  float mTrms;
64 
66 };
67 
68 class DTMtime {
69 public:
72  DTMtime();
73  DTMtime(const std::string& version);
74 
77  ~DTMtime();
78 
81  int slMtime(
83  int wheelId, int stationId, int sectorId, int slId, float& mTime, float& mTrms, DTTimeUnits::type unit) const {
84  return get(wheelId, stationId, sectorId, slId, 0, 0, mTime, mTrms, unit);
85  };
86  int slMtime(int wheelId,
87  int stationId,
88  int sectorId,
89  int slId,
90  int layerId,
91  int cellId,
92  float& mTime,
93  float& mTrms,
94  DTTimeUnits::type unit) const {
95  return get(wheelId, stationId, sectorId, slId, layerId, cellId, mTime, mTrms, unit);
96  };
97  int slMtime(const DTSuperLayerId& id, float& mTime, float& mTrms, DTTimeUnits::type unit) const {
98  return get(id, mTime, mTrms, unit);
99  };
100  int slMtime(const DetId& id, float& mTime, float& mTrms, DTTimeUnits::type unit) const {
101  return get(id, mTime, mTrms, unit);
102  };
103  int get(int wheelId, int stationId, int sectorId, int slId, float& mTime, float& mTrms, DTTimeUnits::type unit) const;
104  int get(
105  int wheelId, int stationId, int sectorId, int slId, float& mTime, float& mTrms, DTVelocityUnits::type unit) const;
106  int get(int wheelId,
107  int stationId,
108  int sectorId,
109  int slId,
110  int layerId,
111  int cellId,
112  float& mTime,
113  float& mTrms,
114  DTTimeUnits::type unit) const;
115  int get(int wheelId,
116  int stationId,
117  int sectorId,
118  int slId,
119  int layerId,
120  int cellId,
121  float& mTime,
122  float& mTrms,
124  int get(const DTSuperLayerId& id, float& mTime, float& mTrms, DTTimeUnits::type unit) const;
125  int get(const DTSuperLayerId& id, float& mTime, float& mTrms, DTVelocityUnits::type unit) const;
126  int get(const DetId& id, float& mTime, float& mTrms, DTTimeUnits::type unit) const;
127  int get(const DetId& id, float& mTime, float& mTrms, DTVelocityUnits::type unit) const;
128  float unit() const;
129 
131  const std::string& version() const;
132  std::string& version();
133 
135  void clear();
136 
137  int setSLMtime(int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit) {
138  return set(wheelId, stationId, sectorId, slId, 0, 0, mTime, mTrms, unit);
139  };
140  int setSLMtime(int wheelId,
141  int stationId,
142  int sectorId,
143  int slId,
144  int layerId,
145  int cellId,
146  float mTime,
147  float mTrms,
148  DTTimeUnits::type unit) {
149  return set(wheelId, stationId, sectorId, slId, layerId, cellId, mTime, mTrms, unit);
150  };
151  int setSLMtime(const DTSuperLayerId& id, float mTime, float mTrms, DTTimeUnits::type unit) {
152  return set(id, mTime, mTrms, unit);
153  };
154  int setSLMtime(const DetId& id, float mTime, float mTrms, DTTimeUnits::type unit) {
155  return set(id, mTime, mTrms, unit);
156  };
157  int set(int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit);
158  int set(int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTVelocityUnits::type unit);
159  int set(int wheelId,
160  int stationId,
161  int sectorId,
162  int slId,
163  int layerId,
164  int cellId,
165  float mTime,
166  float mTrms,
168  int set(int wheelId,
169  int stationId,
170  int sectorId,
171  int slId,
172  int layerId,
173  int cellId,
174  float mTime,
175  float mTrms,
177  int set(const DTSuperLayerId& id, float mTime, float mTrms, DTTimeUnits::type unit);
178  int set(const DTSuperLayerId& id, float mTime, float mTrms, DTVelocityUnits::type unit);
179  int set(const DetId& id, float mTime, float mTrms, DTTimeUnits::type unit);
180  int set(const DetId& id, float mTime, float mTrms, DTVelocityUnits::type unit);
181  void setUnit(float unit);
182 
184  typedef std::vector<std::pair<DTMtimeId, DTMtimeData> >::const_iterator const_iterator;
185  const_iterator begin() const;
186  const_iterator end() const;
187 
188  void initialize();
189 
190 private:
191  DTMtime(DTMtime const&) = delete;
192  DTMtime& operator=(DTMtime const&) = delete;
193 
195  float nsPerCount;
196 
197  std::vector<std::pair<DTMtimeId, DTMtimeData> > dataList;
198 
200 
202  std::string mapName() const;
203 
205 };
206 #endif // DTMtime_H
int stationId
Definition: DTMtime.h:48
static AlgebraicMatrix initialize()
float nsPerCount
Definition: DTMtime.h:195
int slMtime(const DetId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const
Definition: DTMtime.h:100
int setSLMtime(int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.h:137
int wheelId
Definition: DTMtime.h:47
int setSLMtime(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.h:140
int setSLMtime(const DTSuperLayerId &id, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.h:151
int slMtime(const DTSuperLayerId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const
Definition: DTMtime.h:97
int cellId
Definition: DTMtime.h:52
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:151
#define end
Definition: vmac.h:39
float mTrms
Definition: DTMtime.h:63
Definition: DetId.h:17
#define COND_TRANSIENT
Definition: Serializable.h:62
std::vector< std::pair< DTMtimeId, DTMtimeData > >::const_iterator const_iterator
Access methods to data.
Definition: DTMtime.h:184
int sectorId
Definition: DTMtime.h:49
int slId
Definition: DTMtime.h:50
#define COND_SERIALIZABLE
Definition: Serializable.h:38
#define begin
Definition: vmac.h:32
float mTime
Definition: DTMtime.h:62
DTMtimeId()
Definition: DTMtime.cc:40
int layerId
Definition: DTMtime.h:51
~DTMtimeId()
Definition: DTMtime.cc:49
std::string dataVersion
Definition: DTMtime.h:194
int slMtime(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
Definition: DTMtime.h:86
std::vector< std::pair< DTMtimeId, DTMtimeData > > dataList
Definition: DTMtime.h:197
Basic3DVector unit() const
int setSLMtime(const DetId &id, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.h:154