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 "DataFormats/MuonDetId/interface/DTWireId.h"
00025 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
00026
00027
00028
00029
00030 #include <string>
00031 #include <vector>
00032
00033
00034
00035
00036
00037 class DTMtimeId {
00038
00039 public:
00040
00041 DTMtimeId();
00042 ~DTMtimeId();
00043
00044 int wheelId;
00045 int stationId;
00046 int sectorId;
00047 int slId;
00048 int layerId;
00049 int cellId;
00050
00051 };
00052
00053
00054 class DTMtimeData {
00055
00056 public:
00057
00058 DTMtimeData();
00059 ~DTMtimeData();
00060
00061 float mTime;
00062 float mTrms;
00063
00064 };
00065
00066
00067 class DTMtime {
00068
00069 public:
00070
00073 DTMtime();
00074 DTMtime( const std::string& version );
00075
00078 ~DTMtime();
00079
00082
00083 int slMtime( int wheelId,
00084 int stationId,
00085 int sectorId,
00086 int slId,
00087 float& mTime,
00088 float& mTrms,
00089 DTTimeUnits::type unit = DTTimeUnits::counts ) const
00090 { return get( wheelId, stationId, sectorId, slId, 0, 0,
00091 mTime, mTrms, unit ); };
00092 int slMtime( int wheelId,
00093 int stationId,
00094 int sectorId,
00095 int slId,
00096 int layerId,
00097 int cellId,
00098 float& mTime,
00099 float& mTrms,
00100 DTTimeUnits::type unit = DTTimeUnits::counts ) const
00101 { return get( wheelId, stationId, sectorId, slId, layerId, cellId,
00102 mTime, mTrms, unit ); };
00103 int slMtime( const DTSuperLayerId& id,
00104 float& mTime,
00105 float& mTrms,
00106 DTTimeUnits::type unit = DTTimeUnits::counts ) const
00107 { return get( id, mTime, mTrms, unit ); };
00108 int slMtime( const DetId& id,
00109 float& mTime,
00110 float& mTrms,
00111 DTTimeUnits::type unit = DTTimeUnits::counts ) const
00112 { return get( id, mTime, mTrms, unit ); };
00113 int get( int wheelId,
00114 int stationId,
00115 int sectorId,
00116 int slId,
00117 float& mTime,
00118 float& mTrms,
00119 DTTimeUnits::type unit = DTTimeUnits::counts ) const;
00120 int get( int wheelId,
00121 int stationId,
00122 int sectorId,
00123 int slId,
00124 int layerId,
00125 int cellId,
00126 float& mTime,
00127 float& mTrms,
00128 DTTimeUnits::type unit = DTTimeUnits::counts ) const;
00129 int get( const DTSuperLayerId& id,
00130 float& mTime,
00131 float& mTrms,
00132 DTTimeUnits::type unit = DTTimeUnits::counts ) const;
00133 int get( const DetId& id,
00134 float& mTime,
00135 float& mTrms,
00136 DTTimeUnits::type unit = DTTimeUnits::counts ) const;
00137 float unit() const;
00138
00140 const
00141 std::string& version() const;
00142 std::string& version();
00143
00145 void clear();
00146
00147 int setSLMtime( int wheelId,
00148 int stationId,
00149 int sectorId,
00150 int slId,
00151 float mTime,
00152 float mTrms,
00153 DTTimeUnits::type unit = DTTimeUnits::counts )
00154 { return set( wheelId, stationId, sectorId, slId, 0, 0,
00155 mTime, mTrms, unit ); };
00156 int setSLMtime( int wheelId,
00157 int stationId,
00158 int sectorId,
00159 int slId,
00160 int layerId,
00161 int cellId,
00162 float mTime,
00163 float mTrms,
00164 DTTimeUnits::type unit = DTTimeUnits::counts )
00165 { return set( wheelId, stationId, sectorId, slId, layerId, cellId,
00166 mTime, mTrms, unit ); };
00167 int setSLMtime( const DTSuperLayerId& id,
00168 float mTime,
00169 float mTrms,
00170 DTTimeUnits::type unit = DTTimeUnits::counts )
00171 { return set( id, mTime, mTrms, unit ); };
00172 int setSLMtime( const DetId& id,
00173 float mTime,
00174 float mTrms,
00175 DTTimeUnits::type unit = DTTimeUnits::counts )
00176 { return set( id, mTime, mTrms, unit ); };
00177 int set( int wheelId,
00178 int stationId,
00179 int sectorId,
00180 int slId,
00181 float mTime,
00182 float mTrms,
00183 DTTimeUnits::type unit = DTTimeUnits::counts );
00184 int set( int wheelId,
00185 int stationId,
00186 int sectorId,
00187 int slId,
00188 int layerId,
00189 int cellId,
00190 float mTime,
00191 float mTrms,
00192 DTTimeUnits::type unit = DTTimeUnits::counts );
00193 int set( const DTSuperLayerId& id,
00194 float mTime,
00195 float mTrms,
00196 DTTimeUnits::type unit = DTTimeUnits::counts );
00197 int set( const DetId& id,
00198 float mTime,
00199 float mTrms,
00200 DTTimeUnits::type unit = DTTimeUnits::counts );
00201 void setUnit( float unit );
00202
00204 typedef std::vector< std::pair<DTMtimeId,
00205 DTMtimeData> >::const_iterator
00206 const_iterator;
00207 const_iterator begin() const;
00208 const_iterator end() const;
00209
00210 private:
00211
00212 std::string dataVersion;
00213 float nsPerCount;
00214
00215 std::vector< std::pair<DTMtimeId,DTMtimeData> > dataList;
00216
00218 void cacheMap() const;
00219 std::string mapName() const;
00220
00221 };
00222
00223
00224 #endif // DTMtime_H
00225