#include <CondFormats/DTObjects/interface/DTPerformance.h>
Public Types | |
typedef std::vector< std::pair < DTPerformanceId, DTPerformanceData > >::const_iterator | const_iterator |
Access methods to data. | |
Public Member Functions | |
const_iterator | begin () const |
void | clear () |
reset content | |
DTPerformance (const std::string &version) | |
DTPerformance () | |
Constructor. | |
const_iterator | end () const |
int | get (const DTSuperLayerId &id, float &meanT0, float &meanTtrig, float &meanMtime, float &meanNoise, float &meanAfterPulse, float &meanResolution, float &meanEfficiency, DTTimeUnits::type unit=DTTimeUnits::counts) const |
int | get (int wheelId, int stationId, int sectorId, int slId, float &meanT0, float &meanTtrig, float &meanMtime, float &meanNoise, float &meanAfterPulse, float &meanResolution, float &meanEfficiency, DTTimeUnits::type unit=DTTimeUnits::counts) const |
int | set (const DTSuperLayerId &id, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type unit=DTTimeUnits::counts) |
int | set (int wheelId, int stationId, int sectorId, int slId, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type unit=DTTimeUnits::counts) |
int | setSLPerformance (const DTSuperLayerId &id, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type unit=DTTimeUnits::counts) |
int | setSLPerformance (int wheelId, int stationId, int sectorId, int slId, float meanT0, float meanTtrig, float meanMtime, float meanNoise, float meanAfterPulse, float meanResolution, float meanEfficiency, DTTimeUnits::type unit=DTTimeUnits::counts) |
void | setUnit (float unit) |
int | slPerformance (const DTSuperLayerId &id, float &meanT0, float &meanTtrig, float &meanMtime, float &meanNoise, float &meanAfterPulse, float &meanResolution, float &meanEfficiency, DTTimeUnits::type unit=DTTimeUnits::counts) const |
int | slPerformance (int wheelId, int stationId, int sectorId, int slId, float &meanT0, float &meanTtrig, float &meanMtime, float &meanNoise, float &meanAfterPulse, float &meanResolution, float &meanEfficiency, DTTimeUnits::type unit=DTTimeUnits::counts) const |
Operations. | |
float | unit () const |
std::string & | version () |
const std::string & | version () const |
access version | |
~DTPerformance () | |
Destructor. | |
Private Member Functions | |
void | cacheMap () const |
read and store full content | |
std::string | mapName () const |
Private Attributes | |
std::vector< std::pair < DTPerformanceId, DTPerformanceData > > | dataList |
std::string | dataVersion |
float | nsPerCount |
Definition at line 68 of file DTPerformance.h.
typedef std::vector< std::pair<DTPerformanceId, DTPerformanceData> >::const_iterator DTPerformance::const_iterator |
DTPerformance::DTPerformance | ( | ) |
Constructor.
Definition at line 34 of file DTPerformance.cc.
References dataList.
00034 : 00035 dataVersion( " " ) { 00036 dataList.reserve( 1000 ); 00037 }
DTPerformance::DTPerformance | ( | const std::string & | version | ) |
Definition at line 40 of file DTPerformance.cc.
References dataList.
00040 : 00041 dataVersion( version ) { 00042 dataList.reserve( 1000 ); 00043 }
DTPerformance::~DTPerformance | ( | ) |
Destructor.
Definition at line 68 of file DTPerformance.cc.
References DTDataBuffer< Key, Content >::dropBuffer(), and mapName().
00068 { 00069 DTDataBuffer<int,int>::dropBuffer( mapName() ); 00070 }
DTPerformance::const_iterator DTPerformance::begin | ( | ) | const |
Definition at line 292 of file DTPerformance.cc.
References dataList.
00292 { 00293 return dataList.begin(); 00294 }
void DTPerformance::cacheMap | ( | ) | const [private] |
read and store full content
Definition at line 309 of file DTPerformance.cc.
References dataList, DTBufferTree< Key, Content >::insert(), mapName(), DTDataBuffer< Key, Content >::openBuffer(), and DTPerformanceId::stationId.
Referenced by get(), and set().
00309 { 00310 00311 std::string mName = mapName(); 00312 DTBufferTree<int,int>* dBuf = 00313 DTDataBuffer<int,int>::openBuffer( mName ); 00314 00315 int entryNum = 0; 00316 int entryMax = dataList.size(); 00317 std::vector<int> chanKey; 00318 chanKey.reserve(6); 00319 while ( entryNum < entryMax ) { 00320 00321 const DTPerformanceId& chan = dataList[entryNum].first; 00322 00323 chanKey.clear(); 00324 chanKey.push_back( chan. wheelId ); 00325 chanKey.push_back( chan.stationId ); 00326 chanKey.push_back( chan. sectorId ); 00327 chanKey.push_back( chan. slId ); 00328 dBuf->insert( chanKey.begin(), chanKey.end(), entryNum++ ); 00329 00330 } 00331 00332 return; 00333 00334 }
reset content
Definition at line 183 of file DTPerformance.cc.
References dataList, DTDataBuffer< Key, Content >::dropBuffer(), and mapName().
00183 { 00184 DTDataBuffer<int,int>::dropBuffer( mapName() ); 00185 dataList.clear(); 00186 return; 00187 }
DTPerformance::const_iterator DTPerformance::end | ( | ) | const |
Definition at line 297 of file DTPerformance.cc.
References dataList.
00297 { 00298 return dataList.end(); 00299 }
int DTPerformance::get | ( | const DTSuperLayerId & | id, | |
float & | meanT0, | |||
float & | meanTtrig, | |||
float & | meanMtime, | |||
float & | meanNoise, | |||
float & | meanAfterPulse, | |||
float & | meanResolution, | |||
float & | meanEfficiency, | |||
DTTimeUnits::type | unit = DTTimeUnits::counts | |||
) | const |
Definition at line 143 of file DTPerformance.cc.
00151 { 00152 return get( id.wheel(), 00153 id.station(), 00154 id.sector(), 00155 id.superLayer(), 00156 meanT0, 00157 meanTtrig, 00158 meanMtime, 00159 meanNoise, 00160 meanAfterPulse, 00161 meanResolution, 00162 meanEfficiency, 00163 unit ); 00164 }
int DTPerformance::get | ( | int | wheelId, | |
int | stationId, | |||
int | sectorId, | |||
int | slId, | |||
float & | meanT0, | |||
float & | meanTtrig, | |||
float & | meanMtime, | |||
float & | meanNoise, | |||
float & | meanAfterPulse, | |||
float & | meanResolution, | |||
float & | meanEfficiency, | |||
DTTimeUnits::type | unit = DTTimeUnits::counts | |||
) | const |
Definition at line 84 of file DTPerformance.cc.
References cacheMap(), data, dataList, DTBufferTree< Key, Content >::find(), DTDataBuffer< Key, Content >::findBuffer(), mapName(), DTPerformanceData::meanAfterPulse, DTPerformanceData::meanEfficiency, DTPerformanceData::meanMtime, DTPerformanceData::meanNoise, DTPerformanceData::meanResolution, DTPerformanceData::meanT0, DTPerformanceData::meanTtrig, DTTimeUnits::ns, nsPerCount, and edm::second().
00095 { 00096 00097 meanT0 = 00098 meanTtrig = 00099 meanMtime = 00100 meanNoise = 00101 meanAfterPulse = 00102 meanResolution = 00103 meanEfficiency = 0.0; 00104 00105 std::string mName = mapName(); 00106 DTBufferTree<int,int>* dBuf = 00107 DTDataBuffer<int,int>::findBuffer( mName ); 00108 if ( dBuf == 0 ) { 00109 cacheMap(); 00110 dBuf = 00111 DTDataBuffer<int,int>::findBuffer( mName ); 00112 } 00113 00114 std::vector<int> chanKey; 00115 chanKey.reserve(4); 00116 chanKey.push_back( wheelId ); 00117 chanKey.push_back( stationId ); 00118 chanKey.push_back( sectorId ); 00119 chanKey.push_back( slId ); 00120 int ientry; 00121 int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry ); 00122 if ( !searchStatus ) { 00123 const DTPerformanceData& data( dataList[ientry].second ); 00124 meanT0 = data.meanT0; 00125 meanTtrig = data.meanTtrig; 00126 meanMtime = data.meanMtime; 00127 meanNoise = data.meanNoise; 00128 meanAfterPulse = data.meanAfterPulse; 00129 meanResolution = data.meanResolution; 00130 meanEfficiency = data.meanEfficiency; 00131 if ( unit == DTTimeUnits::ns ) { 00132 meanT0 *= nsPerCount; 00133 meanTtrig *= nsPerCount; 00134 meanMtime *= nsPerCount; 00135 } 00136 } 00137 00138 return searchStatus; 00139 00140 }
std::string DTPerformance::mapName | ( | ) | const [private] |
Definition at line 302 of file DTPerformance.cc.
References dataVersion, and name.
Referenced by cacheMap(), clear(), get(), set(), and ~DTPerformance().
00302 { 00303 std::stringstream name; 00304 name << dataVersion << "_map_Performance" << this; 00305 return name.str(); 00306 }
int DTPerformance::set | ( | const DTSuperLayerId & | id, | |
float | meanT0, | |||
float | meanTtrig, | |||
float | meanMtime, | |||
float | meanNoise, | |||
float | meanAfterPulse, | |||
float | meanResolution, | |||
float | meanEfficiency, | |||
DTTimeUnits::type | unit = DTTimeUnits::counts | |||
) |
Definition at line 263 of file DTPerformance.cc.
00271 { 00272 return set( id.wheel(), 00273 id.station(), 00274 id.sector(), 00275 id.superLayer(), 00276 meanT0, 00277 meanTtrig, 00278 meanMtime, 00279 meanNoise, 00280 meanAfterPulse, 00281 meanResolution, 00282 meanEfficiency, 00283 unit ); 00284 }
int DTPerformance::set | ( | int | wheelId, | |
int | stationId, | |||
int | sectorId, | |||
int | slId, | |||
float | meanT0, | |||
float | meanTtrig, | |||
float | meanMtime, | |||
float | meanNoise, | |||
float | meanAfterPulse, | |||
float | meanResolution, | |||
float | meanEfficiency, | |||
DTTimeUnits::type | unit = DTTimeUnits::counts | |||
) |
Definition at line 190 of file DTPerformance.cc.
References cacheMap(), data, dataList, DTBufferTree< Key, Content >::find(), DTDataBuffer< Key, Content >::findBuffer(), DTBufferTree< Key, Content >::insert(), getDQMSummary::key, mapName(), DTPerformanceData::meanAfterPulse, DTPerformanceData::meanEfficiency, DTPerformanceData::meanMtime, DTPerformanceData::meanNoise, DTPerformanceData::meanResolution, DTPerformanceData::meanT0, DTPerformanceData::meanTtrig, DTTimeUnits::ns, nsPerCount, edm::second(), and DTPerformanceId::stationId.
Referenced by DTPerformanceHandler::getNewObjects().
00201 { 00202 00203 if ( unit == DTTimeUnits::ns ) { 00204 meanT0 /= nsPerCount; 00205 meanTtrig /= nsPerCount; 00206 meanMtime /= nsPerCount; 00207 } 00208 00209 std::string mName = mapName(); 00210 DTBufferTree<int,int>* dBuf = 00211 DTDataBuffer<int,int>::findBuffer( mName ); 00212 if ( dBuf == 0 ) { 00213 cacheMap(); 00214 dBuf = 00215 DTDataBuffer<int,int>::findBuffer( mName ); 00216 } 00217 std::vector<int> chanKey; 00218 chanKey.reserve(4); 00219 chanKey.push_back( wheelId ); 00220 chanKey.push_back( stationId ); 00221 chanKey.push_back( sectorId ); 00222 chanKey.push_back( slId ); 00223 int ientry; 00224 int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry ); 00225 00226 if ( !searchStatus ) { 00227 DTPerformanceData& data( dataList[ientry].second ); 00228 data.meanT0 = meanT0; 00229 data.meanTtrig = meanTtrig; 00230 data.meanMtime = meanMtime; 00231 data.meanNoise = meanNoise; 00232 data.meanAfterPulse = meanAfterPulse; 00233 data.meanResolution = meanResolution; 00234 data.meanEfficiency = meanEfficiency; 00235 return -1; 00236 } 00237 else { 00238 DTPerformanceId key; 00239 key. wheelId = wheelId; 00240 key.stationId = stationId; 00241 key. sectorId = sectorId; 00242 key. slId = slId; 00243 DTPerformanceData data; 00244 data.meanT0 = meanT0; 00245 data.meanTtrig = meanTtrig; 00246 data.meanMtime = meanMtime; 00247 data.meanNoise = meanNoise; 00248 data.meanAfterPulse = meanAfterPulse; 00249 data.meanResolution = meanResolution; 00250 data.meanEfficiency = meanEfficiency; 00251 ientry = dataList.size(); 00252 dataList.push_back( std::pair<DTPerformanceId,DTPerformanceData>( 00253 key, data ) ); 00254 dBuf->insert( chanKey.begin(), chanKey.end(), ientry ); 00255 return 0; 00256 } 00257 00258 return 99; 00259 00260 }
int DTPerformance::setSLPerformance | ( | const DTSuperLayerId & | id, | |
float | meanT0, | |||
float | meanTtrig, | |||
float | meanMtime, | |||
float | meanNoise, | |||
float | meanAfterPulse, | |||
float | meanResolution, | |||
float | meanEfficiency, | |||
DTTimeUnits::type | unit = DTTimeUnits::counts | |||
) | [inline] |
Definition at line 157 of file DTPerformance.h.
References unit().
00166 { return set( id, 00167 meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse, 00168 meanResolution, meanEfficiency, unit ); };
int DTPerformance::setSLPerformance | ( | int | wheelId, | |
int | stationId, | |||
int | sectorId, | |||
int | slId, | |||
float | meanT0, | |||
float | meanTtrig, | |||
float | meanMtime, | |||
float | meanNoise, | |||
float | meanAfterPulse, | |||
float | meanResolution, | |||
float | meanEfficiency, | |||
DTTimeUnits::type | unit = DTTimeUnits::counts | |||
) | [inline] |
Definition at line 142 of file DTPerformance.h.
References unit().
00154 { return set( wheelId, stationId, sectorId, slId, 00155 meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse, 00156 meanResolution, meanEfficiency, unit ); };
void DTPerformance::setUnit | ( | float | unit | ) |
Definition at line 287 of file DTPerformance.cc.
References nsPerCount.
00287 { 00288 nsPerCount = unit; 00289 }
int DTPerformance::slPerformance | ( | const DTSuperLayerId & | id, | |
float & | meanT0, | |||
float & | meanTtrig, | |||
float & | meanMtime, | |||
float & | meanNoise, | |||
float & | meanAfterPulse, | |||
float & | meanResolution, | |||
float & | meanEfficiency, | |||
DTTimeUnits::type | unit = DTTimeUnits::counts | |||
) | const [inline] |
Definition at line 99 of file DTPerformance.h.
References unit().
00108 { return get( id, 00109 meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse, 00110 meanResolution, meanEfficiency, unit ); };
int DTPerformance::slPerformance | ( | int | wheelId, | |
int | stationId, | |||
int | sectorId, | |||
int | slId, | |||
float & | meanT0, | |||
float & | meanTtrig, | |||
float & | meanMtime, | |||
float & | meanNoise, | |||
float & | meanAfterPulse, | |||
float & | meanResolution, | |||
float & | meanEfficiency, | |||
DTTimeUnits::type | unit = DTTimeUnits::counts | |||
) | const [inline] |
Operations.
get content
Definition at line 84 of file DTPerformance.h.
References unit().
00096 { return get( wheelId, stationId, sectorId, slId, 00097 meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse, 00098 meanResolution, meanEfficiency, unit ); };
float DTPerformance::unit | ( | ) | const |
Definition at line 167 of file DTPerformance.cc.
References nsPerCount.
Referenced by setSLPerformance(), and slPerformance().
00167 { 00168 return nsPerCount; 00169 }
std::string & DTPerformance::version | ( | ) |
Definition at line 178 of file DTPerformance.cc.
References dataVersion.
00178 { 00179 return dataVersion; 00180 }
const std::string & DTPerformance::version | ( | ) | const |
access version
Definition at line 173 of file DTPerformance.cc.
References dataVersion.
00173 { 00174 return dataVersion; 00175 }
std::vector< std::pair<DTPerformanceId,DTPerformanceData> > DTPerformance::dataList [private] |
Definition at line 204 of file DTPerformance.h.
Referenced by begin(), cacheMap(), clear(), DTPerformance(), end(), get(), and set().
std::string DTPerformance::dataVersion [private] |
float DTPerformance::nsPerCount [private] |