00001 #ifndef DTMtime_H
00002 #define DTMtime_H
00003
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "CondFormats/DTObjects/interface/DTTimeUnits.h"
00024 #include "CondFormats/DTObjects/interface/DTVelocityUnits.h"
00025 #include "CondFormats/DTObjects/interface/DTBufferTree.h"
00026 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00027 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
00028
00029
00030
00031
00032 #include <string>
00033 #include <vector>
00034
00035
00036
00037
00038
00039 class DTMtimeId {
00040
00041 public:
00042
00043 DTMtimeId();
00044 ~DTMtimeId();
00045
00046 int wheelId;
00047 int stationId;
00048 int sectorId;
00049 int slId;
00050 int layerId;
00051 int cellId;
00052
00053 };
00054
00055
00056 class DTMtimeData {
00057
00058 public:
00059
00060 DTMtimeData();
00061 ~DTMtimeData();
00062
00063 float mTime;
00064 float mTrms;
00065
00066 };
00067
00068
00069 class DTMtime {
00070
00071 public:
00072
00075 DTMtime();
00076 DTMtime( const std::string& version );
00077
00080 ~DTMtime();
00081
00084
00085 int slMtime( int wheelId,
00086 int stationId,
00087 int sectorId,
00088 int slId,
00089 float& mTime,
00090 float& mTrms,
00091 DTTimeUnits::type unit ) const
00092 { return get( wheelId, stationId, sectorId, slId, 0, 0,
00093 mTime, mTrms, unit ); };
00094 int slMtime( int wheelId,
00095 int stationId,
00096 int sectorId,
00097 int slId,
00098 int layerId,
00099 int cellId,
00100 float& mTime,
00101 float& mTrms,
00102 DTTimeUnits::type unit ) const
00103 { return get( wheelId, stationId, sectorId, slId, layerId, cellId,
00104 mTime, mTrms, unit ); };
00105 int slMtime( const DTSuperLayerId& id,
00106 float& mTime,
00107 float& mTrms,
00108 DTTimeUnits::type unit ) const
00109 { return get( id, mTime, mTrms, unit ); };
00110 int slMtime( const DetId& id,
00111 float& mTime,
00112 float& mTrms,
00113 DTTimeUnits::type unit ) const
00114 { return get( id, mTime, mTrms, unit ); };
00115 int get( int wheelId,
00116 int stationId,
00117 int sectorId,
00118 int slId,
00119 float& mTime,
00120 float& mTrms,
00121 DTTimeUnits::type unit ) const;
00122 int get( int wheelId,
00123 int stationId,
00124 int sectorId,
00125 int slId,
00126 float& mTime,
00127 float& mTrms,
00128 DTVelocityUnits::type unit ) const;
00129 int get( int wheelId,
00130 int stationId,
00131 int sectorId,
00132 int slId,
00133 int layerId,
00134 int cellId,
00135 float& mTime,
00136 float& mTrms,
00137 DTTimeUnits::type unit ) const;
00138 int get( int wheelId,
00139 int stationId,
00140 int sectorId,
00141 int slId,
00142 int layerId,
00143 int cellId,
00144 float& mTime,
00145 float& mTrms,
00146 DTVelocityUnits::type unit ) const;
00147 int get( const DTSuperLayerId& id,
00148 float& mTime,
00149 float& mTrms,
00150 DTTimeUnits::type unit ) const;
00151 int get( const DTSuperLayerId& id,
00152 float& mTime,
00153 float& mTrms,
00154 DTVelocityUnits::type unit ) const;
00155 int get( const DetId& id,
00156 float& mTime,
00157 float& mTrms,
00158 DTTimeUnits::type unit ) const;
00159 int get( const DetId& id,
00160 float& mTime,
00161 float& mTrms,
00162 DTVelocityUnits::type unit ) const;
00163 float unit() const;
00164
00166 const
00167 std::string& version() const;
00168 std::string& version();
00169
00171 void clear();
00172
00173 int setSLMtime( int wheelId,
00174 int stationId,
00175 int sectorId,
00176 int slId,
00177 float mTime,
00178 float mTrms,
00179 DTTimeUnits::type unit )
00180 { return set( wheelId, stationId, sectorId, slId, 0, 0,
00181 mTime, mTrms, unit ); };
00182 int setSLMtime( int wheelId,
00183 int stationId,
00184 int sectorId,
00185 int slId,
00186 int layerId,
00187 int cellId,
00188 float mTime,
00189 float mTrms,
00190 DTTimeUnits::type unit )
00191 { return set( wheelId, stationId, sectorId, slId, layerId, cellId,
00192 mTime, mTrms, unit ); };
00193 int setSLMtime( const DTSuperLayerId& id,
00194 float mTime,
00195 float mTrms,
00196 DTTimeUnits::type unit )
00197 { return set( id, mTime, mTrms, unit ); };
00198 int setSLMtime( const DetId& id,
00199 float mTime,
00200 float mTrms,
00201 DTTimeUnits::type unit )
00202 { return set( id, mTime, mTrms, unit ); };
00203 int set( int wheelId,
00204 int stationId,
00205 int sectorId,
00206 int slId,
00207 float mTime,
00208 float mTrms,
00209 DTTimeUnits::type unit );
00210 int set( int wheelId,
00211 int stationId,
00212 int sectorId,
00213 int slId,
00214 float mTime,
00215 float mTrms,
00216 DTVelocityUnits::type unit );
00217 int set( int wheelId,
00218 int stationId,
00219 int sectorId,
00220 int slId,
00221 int layerId,
00222 int cellId,
00223 float mTime,
00224 float mTrms,
00225 DTTimeUnits::type unit );
00226 int set( int wheelId,
00227 int stationId,
00228 int sectorId,
00229 int slId,
00230 int layerId,
00231 int cellId,
00232 float mTime,
00233 float mTrms,
00234 DTVelocityUnits::type unit );
00235 int set( const DTSuperLayerId& id,
00236 float mTime,
00237 float mTrms,
00238 DTTimeUnits::type unit );
00239 int set( const DTSuperLayerId& id,
00240 float mTime,
00241 float mTrms,
00242 DTVelocityUnits::type unit );
00243 int set( const DetId& id,
00244 float mTime,
00245 float mTrms,
00246 DTTimeUnits::type unit );
00247 int set( const DetId& id,
00248 float mTime,
00249 float mTrms,
00250 DTVelocityUnits::type unit );
00251 void setUnit( float unit );
00252
00254 typedef std::vector< std::pair<DTMtimeId,
00255 DTMtimeData> >::const_iterator
00256 const_iterator;
00257 const_iterator begin() const;
00258 const_iterator end() const;
00259
00260 private:
00261
00262 std::string dataVersion;
00263 float nsPerCount;
00264
00265 std::vector< std::pair<DTMtimeId,DTMtimeData> > dataList;
00266
00267 DTBufferTree<int,int>* dBuf;
00268
00270 void cacheMap() const;
00271 std::string mapName() const;
00272
00273 };
00274
00275
00276 #endif // DTMtime_H
00277