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(DTMtime const&) = delete;
74  DTMtime& operator=(DTMtime const&) = delete;
75  DTMtime(const std::string& version);
76 
79  ~DTMtime();
80 
83  int slMtime(
85  int wheelId, int stationId, int sectorId, int slId, float& mTime, float& mTrms, DTTimeUnits::type unit) const {
86  return get(wheelId, stationId, sectorId, slId, 0, 0, mTime, mTrms, unit);
87  };
88  int slMtime(int wheelId,
89  int stationId,
90  int sectorId,
91  int slId,
92  int layerId,
93  int cellId,
94  float& mTime,
95  float& mTrms,
96  DTTimeUnits::type unit) const {
97  return get(wheelId, stationId, sectorId, slId, layerId, cellId, mTime, mTrms, unit);
98  };
99  int slMtime(const DTSuperLayerId& id, float& mTime, float& mTrms, DTTimeUnits::type unit) const {
100  return get(id, mTime, mTrms, unit);
101  };
102  int slMtime(const DetId& id, float& mTime, float& mTrms, DTTimeUnits::type unit) const {
103  return get(id, mTime, mTrms, unit);
104  };
105  int get(int wheelId, int stationId, int sectorId, int slId, float& mTime, float& mTrms, DTTimeUnits::type unit) const;
106  int get(
107  int wheelId, int stationId, int sectorId, int slId, float& mTime, float& mTrms, DTVelocityUnits::type unit) const;
108  int get(int wheelId,
109  int stationId,
110  int sectorId,
111  int slId,
112  int layerId,
113  int cellId,
114  float& mTime,
115  float& mTrms,
116  DTTimeUnits::type unit) const;
117  int get(int wheelId,
118  int stationId,
119  int sectorId,
120  int slId,
121  int layerId,
122  int cellId,
123  float& mTime,
124  float& mTrms,
126  int get(const DTSuperLayerId& id, float& mTime, float& mTrms, DTTimeUnits::type unit) const;
127  int get(const DTSuperLayerId& id, float& mTime, float& mTrms, DTVelocityUnits::type unit) const;
128  int get(const DetId& id, float& mTime, float& mTrms, DTTimeUnits::type unit) const;
129  int get(const DetId& id, float& mTime, float& mTrms, DTVelocityUnits::type unit) const;
130  float unit() const;
131 
133  const std::string& version() const;
134  std::string& version();
135 
137  void clear();
138 
139  int setSLMtime(int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit) {
140  return set(wheelId, stationId, sectorId, slId, 0, 0, mTime, mTrms, unit);
141  };
142  int setSLMtime(int wheelId,
143  int stationId,
144  int sectorId,
145  int slId,
146  int layerId,
147  int cellId,
148  float mTime,
149  float mTrms,
151  return set(wheelId, stationId, sectorId, slId, layerId, cellId, mTime, mTrms, unit);
152  };
153  int setSLMtime(const DTSuperLayerId& id, float mTime, float mTrms, DTTimeUnits::type unit) {
154  return set(id, mTime, mTrms, unit);
155  };
156  int setSLMtime(const DetId& id, float mTime, float mTrms, DTTimeUnits::type unit) {
157  return set(id, mTime, mTrms, unit);
158  };
159  int set(int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit);
160  int set(int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTVelocityUnits::type unit);
161  int set(int wheelId,
162  int stationId,
163  int sectorId,
164  int slId,
165  int layerId,
166  int cellId,
167  float mTime,
168  float mTrms,
170  int set(int wheelId,
171  int stationId,
172  int sectorId,
173  int slId,
174  int layerId,
175  int cellId,
176  float mTime,
177  float mTrms,
179  int set(const DTSuperLayerId& id, float mTime, float mTrms, DTTimeUnits::type unit);
180  int set(const DTSuperLayerId& id, float mTime, float mTrms, DTVelocityUnits::type unit);
181  int set(const DetId& id, float mTime, float mTrms, DTTimeUnits::type unit);
182  int set(const DetId& id, float mTime, float mTrms, DTVelocityUnits::type unit);
183  void setUnit(float unit);
184 
186  typedef std::vector<std::pair<DTMtimeId, DTMtimeData> >::const_iterator const_iterator;
187  const_iterator begin() const;
188  const_iterator end() const;
189 
190  void initialize();
191 
192 private:
194  float nsPerCount;
195 
196  std::vector<std::pair<DTMtimeId, DTMtimeData> > dataList;
197 
199 
201  std::string mapName() const;
202 
204 };
205 #endif // DTMtime_H
int stationId
Definition: DTMtime.h:48
float nsPerCount
Definition: DTMtime.h:194
~DTMtimeData()
Definition: DTMtime.cc:51
int setSLMtime(int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.h:139
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:142
void setUnit(float unit)
Definition: DTMtime.cc:282
int slMtime(int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
get content
Definition: DTMtime.h:84
int setSLMtime(const DTSuperLayerId &id, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.h:153
int cellId
Definition: DTMtime.h:52
void initialize()
Definition: DTMtime.cc:294
DTMtimeData()
Definition: DTMtime.cc:42
const std::string & version() const
access version
Definition: DTMtime.cc:158
const_iterator begin() const
Definition: DTMtime.cc:284
float mTrms
Definition: DTMtime.h:63
int slMtime(const DetId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const
Definition: DTMtime.h:102
Definition: DetId.h:17
#define COND_TRANSIENT
Definition: Serializable.h:63
DTMtime & operator=(DTMtime const &)=delete
std::vector< std::pair< DTMtimeId, DTMtimeData > >::const_iterator const_iterator
Access methods to data.
Definition: DTMtime.h:186
DTMtime()
Definition: DTMtime.cc:31
int sectorId
Definition: DTMtime.h:49
int slId
Definition: DTMtime.h:50
std::string mapName() const
read and store full content
Definition: DTMtime.cc:288
#define COND_SERIALIZABLE
Definition: Serializable.h:39
edm::ConstRespectingPtr< DTBufferTree< int, int > > dBuf
Definition: DTMtime.h:198
~DTMtime()
Definition: DTMtime.cc:47
float mTime
Definition: DTMtime.h:62
DTMtimeId()
Definition: DTMtime.cc:40
const_iterator end() const
Definition: DTMtime.cc:286
int slMtime(const DTSuperLayerId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const
Definition: DTMtime.h:99
int layerId
Definition: DTMtime.h:51
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:88
~DTMtimeId()
Definition: DTMtime.cc:49
std::string dataVersion
Definition: DTMtime.h:193
void clear()
reset content
Definition: DTMtime.cc:162
std::vector< std::pair< DTMtimeId, DTMtimeData > > dataList
Definition: DTMtime.h:196
int setSLMtime(const DetId &id, float mTime, float mTrms, DTTimeUnits::type unit)
Definition: DTMtime.h:156
float unit() const
Definition: DTMtime.cc:156