CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTMtime.h
Go to the documentation of this file.
1 #ifndef DTMtime_H
2 #define DTMtime_H
3 
15 //----------------------
16 // Base Class Headers --
17 //----------------------
18 
19 
20 //------------------------------------
21 // Collaborating Class Declarations --
22 //------------------------------------
28 
29 //---------------
30 // C++ Headers --
31 //---------------
32 #include <string>
33 #include <vector>
34 
35 // ---------------------
36 // -- Class Interface --
37 // ---------------------
38 
39 class DTMtimeId {
40 
41  public:
42 
43  DTMtimeId();
44  ~DTMtimeId();
45 
46  int wheelId;
47  int stationId;
48  int sectorId;
49  int slId;
50  int layerId;
51  int cellId;
52 
53 };
54 
55 
56 class DTMtimeData {
57 
58  public:
59 
60  DTMtimeData();
61  ~DTMtimeData();
62 
63  float mTime;
64  float mTrms;
65 
66 };
67 
68 
69 class DTMtime {
70 
71  public:
72 
75  DTMtime();
76  DTMtime( const std::string& version );
77 
80  ~DTMtime();
81 
84  int slMtime( int wheelId,
86  int stationId,
87  int sectorId,
88  int slId,
89  float& mTime,
90  float& mTrms,
91  DTTimeUnits::type unit ) const
92  { return get( wheelId, stationId, sectorId, slId, 0, 0,
93  mTime, mTrms, unit ); };
94  int slMtime( int wheelId,
95  int stationId,
96  int sectorId,
97  int slId,
98  int layerId,
99  int cellId,
100  float& mTime,
101  float& mTrms,
102  DTTimeUnits::type unit ) const
103  { return get( wheelId, stationId, sectorId, slId, layerId, cellId,
104  mTime, mTrms, unit ); };
105  int slMtime( const DTSuperLayerId& id,
106  float& mTime,
107  float& mTrms,
108  DTTimeUnits::type unit ) const
109  { return get( id, mTime, mTrms, unit ); };
110  int slMtime( const DetId& id,
111  float& mTime,
112  float& mTrms,
113  DTTimeUnits::type unit ) const
114  { return get( id, mTime, mTrms, unit ); };
115  int get( int wheelId,
116  int stationId,
117  int sectorId,
118  int slId,
119  float& mTime,
120  float& mTrms,
121  DTTimeUnits::type unit ) const;
122  int get( int wheelId,
123  int stationId,
124  int sectorId,
125  int slId,
126  float& mTime,
127  float& mTrms,
128  DTVelocityUnits::type unit ) const;
129  int get( int wheelId,
130  int stationId,
131  int sectorId,
132  int slId,
133  int layerId,
134  int cellId,
135  float& mTime,
136  float& mTrms,
137  DTTimeUnits::type unit ) const;
138  int get( int wheelId,
139  int stationId,
140  int sectorId,
141  int slId,
142  int layerId,
143  int cellId,
144  float& mTime,
145  float& mTrms,
146  DTVelocityUnits::type unit ) const;
147  int get( const DTSuperLayerId& id,
148  float& mTime,
149  float& mTrms,
150  DTTimeUnits::type unit ) const;
151  int get( const DTSuperLayerId& id,
152  float& mTime,
153  float& mTrms,
154  DTVelocityUnits::type unit ) const;
155  int get( const DetId& id,
156  float& mTime,
157  float& mTrms,
158  DTTimeUnits::type unit ) const;
159  int get( const DetId& id,
160  float& mTime,
161  float& mTrms,
162  DTVelocityUnits::type unit ) const;
163  float unit() const;
164 
166  const
167  std::string& version() const;
168  std::string& version();
169 
171  void clear();
172 
173  int setSLMtime( int wheelId,
174  int stationId,
175  int sectorId,
176  int slId,
177  float mTime,
178  float mTrms,
179  DTTimeUnits::type unit )
180  { return set( wheelId, stationId, sectorId, slId, 0, 0,
181  mTime, mTrms, unit ); };
182  int setSLMtime( int wheelId,
183  int stationId,
184  int sectorId,
185  int slId,
186  int layerId,
187  int cellId,
188  float mTime,
189  float mTrms,
190  DTTimeUnits::type unit )
191  { return set( wheelId, stationId, sectorId, slId, layerId, cellId,
192  mTime, mTrms, unit ); };
193  int setSLMtime( const DTSuperLayerId& id,
194  float mTime,
195  float mTrms,
196  DTTimeUnits::type unit )
197  { return set( id, mTime, mTrms, unit ); };
198  int setSLMtime( const DetId& id,
199  float mTime,
200  float mTrms,
201  DTTimeUnits::type unit )
202  { return set( id, mTime, mTrms, unit ); };
203  int set( int wheelId,
204  int stationId,
205  int sectorId,
206  int slId,
207  float mTime,
208  float mTrms,
209  DTTimeUnits::type unit );
210  int set( int wheelId,
211  int stationId,
212  int sectorId,
213  int slId,
214  float mTime,
215  float mTrms,
216  DTVelocityUnits::type unit );
217  int set( int wheelId,
218  int stationId,
219  int sectorId,
220  int slId,
221  int layerId,
222  int cellId,
223  float mTime,
224  float mTrms,
225  DTTimeUnits::type unit );
226  int set( int wheelId,
227  int stationId,
228  int sectorId,
229  int slId,
230  int layerId,
231  int cellId,
232  float mTime,
233  float mTrms,
234  DTVelocityUnits::type unit );
235  int set( const DTSuperLayerId& id,
236  float mTime,
237  float mTrms,
238  DTTimeUnits::type unit );
239  int set( const DTSuperLayerId& id,
240  float mTime,
241  float mTrms,
242  DTVelocityUnits::type unit );
243  int set( const DetId& id,
244  float mTime,
245  float mTrms,
246  DTTimeUnits::type unit );
247  int set( const DetId& id,
248  float mTime,
249  float mTrms,
250  DTVelocityUnits::type unit );
251  void setUnit( float unit );
252 
254  typedef std::vector< std::pair<DTMtimeId,
257  const_iterator begin() const;
258  const_iterator end() const;
259 
260  private:
261 
263  float nsPerCount;
264 
265  std::vector< std::pair<DTMtimeId,DTMtimeData> > dataList;
266 
268 
270  void cacheMap() const;
271  std::string mapName() const;
272 
273 };
274 
275 
276 #endif // DTMtime_H
277 
int stationId
Definition: DTMtime.h:47
float nsPerCount
Definition: DTMtime.h:263
~DTMtimeData()
Definition: DTMtime.cc:79
int slMtime(const DetId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const
Definition: DTMtime.h:110
int set(int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.cc:266
int setSLMtime(int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.h:173
int wheelId
Definition: DTMtime.h:46
int setSLMtime(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.h:182
void setUnit(float unit)
Definition: DTMtime.cc:434
int setSLMtime(const DTSuperLayerId &id, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.h:193
void cacheMap() const
read and store full content
Definition: DTMtime.cc:456
int slMtime(const DTSuperLayerId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const
Definition: DTMtime.h:105
int cellId
Definition: DTMtime.h:51
DTBufferTree< int, int > * dBuf
Definition: DTMtime.h:267
DTMtimeData()
Definition: DTMtime.cc:60
float mTrms
Definition: DTMtime.h:64
Definition: DetId.h:20
int slMtime(int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
get content
Definition: DTMtime.h:85
std::vector< std::pair< DTMtimeId, DTMtimeData > > dataList
Definition: DTMtime.h:265
const_iterator begin() const
Definition: DTMtime.cc:439
std::vector< std::pair< DTMtimeId, DTMtimeData > >::const_iterator const_iterator
Access methods to data.
Definition: DTMtime.h:256
std::string mapName() const
Definition: DTMtime.cc:449
DTMtime()
Definition: DTMtime.cc:34
int sectorId
Definition: DTMtime.h:48
int slId
Definition: DTMtime.h:49
float unit() const
Definition: DTMtime.cc:241
const std::string & version() const
access version
Definition: DTMtime.cc:247
~DTMtime()
Definition: DTMtime.cc:69
float mTime
Definition: DTMtime.h:63
DTMtimeId()
Definition: DTMtime.cc:50
const_iterator end() const
Definition: DTMtime.cc:444
int layerId
Definition: DTMtime.h:50
~DTMtimeId()
Definition: DTMtime.cc:75
std::string dataVersion
Definition: DTMtime.h:262
void clear()
reset content
Definition: DTMtime.cc:257
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:94
int setSLMtime(const DetId &id, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.h:198