#include <DTMtime.h>
Public Types | |
typedef std::vector< std::pair < DTMtimeId, DTMtimeData > >::const_iterator | const_iterator |
Access methods to data. | |
Public Member Functions | |
const_iterator | begin () const |
void | clear () |
reset content | |
DTMtime () | |
DTMtime (const std::string &version) | |
const_iterator | end () const |
int | get (int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const |
int | get (int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTVelocityUnits::type unit) const |
int | get (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &mTime, float &mTrms, DTTimeUnits::type unit) const |
int | get (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &mTime, float &mTrms, DTVelocityUnits::type unit) const |
int | get (const DTSuperLayerId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const |
int | get (const DTSuperLayerId &id, float &mTime, float &mTrms, DTVelocityUnits::type unit) const |
int | get (const DetId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const |
int | get (const DetId &id, float &mTime, float &mTrms, DTVelocityUnits::type unit) const |
int | set (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float mTime, float mTrms, DTVelocityUnits::type unit) |
int | set (const DetId &id, float mTime, float mTrms, DTTimeUnits::type unit) |
int | set (const DetId &id, float mTime, float mTrms, DTVelocityUnits::type unit) |
int | set (const DTSuperLayerId &id, float mTime, float mTrms, DTVelocityUnits::type unit) |
int | set (int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit) |
int | set (int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTVelocityUnits::type unit) |
int | set (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float mTime, float mTrms, DTTimeUnits::type unit) |
int | set (const DTSuperLayerId &id, float mTime, float mTrms, DTTimeUnits::type unit) |
int | setSLMtime (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float mTime, float mTrms, DTTimeUnits::type unit) |
int | setSLMtime (int wheelId, int stationId, int sectorId, int slId, float mTime, float mTrms, DTTimeUnits::type unit) |
int | setSLMtime (const DTSuperLayerId &id, float mTime, float mTrms, DTTimeUnits::type unit) |
int | setSLMtime (const DetId &id, float mTime, float mTrms, DTTimeUnits::type unit) |
void | setUnit (float unit) |
int | slMtime (int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const |
get content | |
int | slMtime (const DetId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const |
int | slMtime (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &mTime, float &mTrms, DTTimeUnits::type unit) const |
int | slMtime (const DTSuperLayerId &id, float &mTime, float &mTrms, DTTimeUnits::type unit) const |
float | unit () const |
std::string & | version () |
const std::string & | version () const |
access version | |
~DTMtime () | |
Private Member Functions | |
void | cacheMap () const |
read and store full content | |
std::string | mapName () const |
Private Attributes | |
std::vector< std::pair < DTMtimeId, DTMtimeData > > | dataList |
std::string | dataVersion |
DTBufferTree< int, int > * | dBuf |
float | nsPerCount |
Description: Class to hold drift tubes mean-times ( SL by SL mean-time calculation )
typedef std::vector< std::pair<DTMtimeId, DTMtimeData> >::const_iterator DTMtime::const_iterator |
DTMtime::DTMtime | ( | ) |
Constructor
Definition at line 34 of file DTMtime.cc.
References dataList, and dBuf.
: dataVersion( " " ), nsPerCount( 25.0 / 32.0 ) { dataList.reserve( 1000 ); dBuf = 0; }
DTMtime::DTMtime | ( | const std::string & | version | ) |
Definition at line 42 of file DTMtime.cc.
References dataList, and dBuf.
: dataVersion( version ), nsPerCount( 25.0 / 32.0 ) { dataList.reserve( 1000 ); dBuf = 0; }
DTMtime::~DTMtime | ( | ) |
Destructor
Definition at line 69 of file DTMtime.cc.
References dBuf.
{ // DTDataBuffer<int,int>::dropBuffer( mapName() ); delete dBuf; }
DTMtime::const_iterator DTMtime::begin | ( | void | ) | const |
void DTMtime::cacheMap | ( | ) | const [private] |
read and store full content
Definition at line 456 of file DTMtime.cc.
References dataList, dBuf, DTBufferTree< Key, Content >::insert(), and DTMtimeId::stationId.
Referenced by get(), and set().
{ // std::string mName = mapName(); // DTBufferTree<int,int>* dBuf = // DTDataBuffer<int,int>::openBuffer( mName ); DTBufferTree<int,int>** pBuf; pBuf = const_cast<DTBufferTree<int,int>**>( &dBuf ); *pBuf = new DTBufferTree<int,int>; int entryNum = 0; int entryMax = dataList.size(); std::vector<int> chanKey; chanKey.reserve(6); while ( entryNum < entryMax ) { const DTMtimeId& chan = dataList[entryNum].first; chanKey.clear(); chanKey.push_back( chan. wheelId ); chanKey.push_back( chan.stationId ); chanKey.push_back( chan. sectorId ); chanKey.push_back( chan. slId ); chanKey.push_back( chan. layerId ); chanKey.push_back( chan. cellId ); dBuf->insert( chanKey.begin(), chanKey.end(), entryNum++ ); } return; }
void DTMtime::clear | ( | void | ) |
DTMtime::const_iterator DTMtime::end | ( | void | ) | const |
int DTMtime::get | ( | int | wheelId, |
int | stationId, | ||
int | sectorId, | ||
int | slId, | ||
float & | mTime, | ||
float & | mTrms, | ||
DTTimeUnits::type | unit | ||
) | const |
Definition at line 86 of file DTMtime.cc.
References unit().
Referenced by DTRunConditionVar::analyze(), DTLinearDriftFromDBAlgo::compute(), DTVDriftSegment::compute(), and DTVDriftWriter::endJob().
{ return get( wheelId, stationId, sectorId, slId, 0, 0, mTime, mTrms, unit ); }
int DTMtime::get | ( | int | wheelId, |
int | stationId, | ||
int | sectorId, | ||
int | slId, | ||
int | layerId, | ||
int | cellId, | ||
float & | mTime, | ||
float & | mTrms, | ||
DTVelocityUnits::type | unit | ||
) | const |
Definition at line 162 of file DTMtime.cc.
References DTVelocityUnits::cm_per_count, DTVelocityUnits::cm_per_ns, DTTimeUnits::counts, nsPerCount, and ntuplemaker::status.
{ int status = get( wheelId, stationId, sectorId, slId, layerId, cellId, mTime, mTrms, DTTimeUnits::counts ); if ( unit == DTVelocityUnits::cm_per_count ) { mTime = 2.1 / mTime; mTrms *= mTime; } if ( unit == DTVelocityUnits::cm_per_ns ) { mTime = 2.1 / mTime; mTrms *= mTime; mTime /= nsPerCount; } return status; }
int DTMtime::get | ( | const DTSuperLayerId & | id, |
float & | mTime, | ||
float & | mTrms, | ||
DTTimeUnits::type | unit | ||
) | const |
Definition at line 187 of file DTMtime.cc.
References unit().
{ return get( id.wheel(), id.station(), id.sector(), id.superLayer(), 0, 0, mTime, mTrms, unit ); }
int DTMtime::get | ( | const DTSuperLayerId & | id, |
float & | mTime, | ||
float & | mTrms, | ||
DTVelocityUnits::type | unit | ||
) | const |
Definition at line 199 of file DTMtime.cc.
References unit().
{ return get( id.wheel(), id.station(), id.sector(), id.superLayer(), 0, 0, mTime, mTrms, unit ); }
int DTMtime::get | ( | const DetId & | id, |
float & | mTime, | ||
float & | mTrms, | ||
DTTimeUnits::type | unit | ||
) | const |
Definition at line 211 of file DTMtime.cc.
References DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), unit(), DTChamberId::wheel(), and DTWireId::wire().
int DTMtime::get | ( | const DetId & | id, |
float & | mTime, | ||
float & | mTrms, | ||
DTVelocityUnits::type | unit | ||
) | const |
Definition at line 226 of file DTMtime.cc.
References DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), unit(), DTChamberId::wheel(), and DTWireId::wire().
int DTMtime::get | ( | int | wheelId, |
int | stationId, | ||
int | sectorId, | ||
int | slId, | ||
float & | mTime, | ||
float & | mTrms, | ||
DTVelocityUnits::type | unit | ||
) | const |
Definition at line 100 of file DTMtime.cc.
References unit().
{ return get( wheelId, stationId, sectorId, slId, 0, 0, mTime, mTrms, unit ); }
int DTMtime::get | ( | int | wheelId, |
int | stationId, | ||
int | sectorId, | ||
int | slId, | ||
int | layerId, | ||
int | cellId, | ||
float & | mTime, | ||
float & | mTrms, | ||
DTTimeUnits::type | unit | ||
) | const |
Definition at line 114 of file DTMtime.cc.
References cacheMap(), data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTMtimeData::mTime, DTMtimeData::mTrms, DTTimeUnits::ns, nsPerCount, and edm::second().
{ mTime = mTrms = 0.0; // std::string mName = mapName(); // DTBufferTree<int,int>* dBuf = // DTDataBuffer<int,int>::findBuffer( mName ); // if ( dBuf == 0 ) { // cacheMap(); // dBuf = // DTDataBuffer<int,int>::findBuffer( mName ); // } if ( dBuf == 0 ) cacheMap(); std::vector<int> chanKey; chanKey.reserve(6); chanKey.push_back( wheelId ); chanKey.push_back( stationId ); chanKey.push_back( sectorId ); chanKey.push_back( slId ); chanKey.push_back( layerId ); chanKey.push_back( cellId ); int ientry; int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry ); if ( !searchStatus ) { const DTMtimeData& data( dataList[ientry].second ); mTime = data.mTime; mTrms = data.mTrms; if ( unit == DTTimeUnits::ns ) { mTime *= nsPerCount; mTrms *= nsPerCount; } } return searchStatus; }
std::string DTMtime::mapName | ( | ) | const [private] |
Definition at line 449 of file DTMtime.cc.
References dataVersion, and mergeVDriftHistosByStation::name.
{ std::stringstream name; name << dataVersion << "_map_Mtime" << this; return name.str(); }
int DTMtime::set | ( | const DetId & | id, |
float | mTime, | ||
float | mTrms, | ||
DTTimeUnits::type | unit | ||
) |
Definition at line 404 of file DTMtime.cc.
References DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), unit(), DTChamberId::wheel(), and DTWireId::wire().
int DTMtime::set | ( | int | wheelId, |
int | stationId, | ||
int | sectorId, | ||
int | slId, | ||
float | mTime, | ||
float | mTrms, | ||
DTTimeUnits::type | unit | ||
) |
Definition at line 266 of file DTMtime.cc.
References unit().
Referenced by DTVDriftWriter::endJob(), DTVDriftCalibration::endJob(), DTMtimeHandler::getNewObjects(), and DTFakeVDriftESProducer::produce().
{ return set( wheelId, stationId, sectorId, slId, 0, 0, mTime, mTrms, unit ); }
int DTMtime::set | ( | int | wheelId, |
int | stationId, | ||
int | sectorId, | ||
int | slId, | ||
float | mTime, | ||
float | mTrms, | ||
DTVelocityUnits::type | unit | ||
) |
Definition at line 279 of file DTMtime.cc.
References unit().
{ return set( wheelId, stationId, sectorId, slId, 0, 0, mTime, mTrms, unit ); }
int DTMtime::set | ( | int | wheelId, |
int | stationId, | ||
int | sectorId, | ||
int | slId, | ||
int | layerId, | ||
int | cellId, | ||
float | mTime, | ||
float | mTrms, | ||
DTTimeUnits::type | unit | ||
) |
Definition at line 292 of file DTMtime.cc.
References cacheMap(), data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTBufferTree< Key, Content >::insert(), combine::key, DTMtimeData::mTime, DTMtimeData::mTrms, DTTimeUnits::ns, nsPerCount, edm::second(), and DTMtimeId::stationId.
{ if ( unit == DTTimeUnits::ns ) { mTime /= nsPerCount; mTrms /= nsPerCount; } // std::string mName = mapName(); // DTBufferTree<int,int>* dBuf = // DTDataBuffer<int,int>::findBuffer( mName ); // if ( dBuf == 0 ) { // cacheMap(); // dBuf = // DTDataBuffer<int,int>::findBuffer( mName ); // } if ( dBuf == 0 ) cacheMap(); std::vector<int> chanKey; chanKey.reserve(6); chanKey.push_back( wheelId ); chanKey.push_back( stationId ); chanKey.push_back( sectorId ); chanKey.push_back( slId ); chanKey.push_back( layerId ); chanKey.push_back( cellId ); int ientry; int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry ); if ( !searchStatus ) { DTMtimeData& data( dataList[ientry].second ); data.mTime = mTime; data.mTrms = mTrms; return -1; } else { DTMtimeId key; key. wheelId = wheelId; key.stationId = stationId; key. sectorId = sectorId; key. slId = slId; key. layerId = layerId; key. cellId = cellId; DTMtimeData data; data.mTime = mTime; data.mTrms = mTrms; ientry = dataList.size(); dataList.push_back( std::pair<DTMtimeId,DTMtimeData>( key, data ) ); dBuf->insert( chanKey.begin(), chanKey.end(), ientry ); return 0; } return 99; }
int DTMtime::set | ( | int | wheelId, |
int | stationId, | ||
int | sectorId, | ||
int | slId, | ||
int | layerId, | ||
int | cellId, | ||
float | mTime, | ||
float | mTrms, | ||
DTVelocityUnits::type | unit | ||
) |
Definition at line 355 of file DTMtime.cc.
References DTVelocityUnits::cm_per_count, DTVelocityUnits::cm_per_ns, DTTimeUnits::counts, and nsPerCount.
{ if ( unit == DTVelocityUnits::cm_per_count ) { mTrms /= mTime; mTime = 2.1 / mTime; } if ( unit == DTVelocityUnits::cm_per_ns ) { mTime *= nsPerCount; mTrms /= mTime; mTime = 2.1 / mTime; } return set( wheelId, stationId, sectorId, slId, layerId, cellId, mTime, mTrms, DTTimeUnits::counts ); }
int DTMtime::set | ( | const DTSuperLayerId & | id, |
float | mTime, | ||
float | mTrms, | ||
DTTimeUnits::type | unit | ||
) |
Definition at line 380 of file DTMtime.cc.
References unit().
{ return set( id.wheel(), id.station(), id.sector(), id.superLayer(), 0, 0, mTime, mTrms, unit ); }
int DTMtime::set | ( | const DTSuperLayerId & | id, |
float | mTime, | ||
float | mTrms, | ||
DTVelocityUnits::type | unit | ||
) |
Definition at line 392 of file DTMtime.cc.
References unit().
{ return set( id.wheel(), id.station(), id.sector(), id.superLayer(), 0, 0, mTime, mTrms, unit ); }
int DTMtime::set | ( | const DetId & | id, |
float | mTime, | ||
float | mTrms, | ||
DTVelocityUnits::type | unit | ||
) |
Definition at line 419 of file DTMtime.cc.
References DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), unit(), DTChamberId::wheel(), and DTWireId::wire().
int DTMtime::setSLMtime | ( | const DTSuperLayerId & | id, |
float | mTime, | ||
float | mTrms, | ||
DTTimeUnits::type | unit | ||
) | [inline] |
int DTMtime::setSLMtime | ( | int | wheelId, |
int | stationId, | ||
int | sectorId, | ||
int | slId, | ||
float | mTime, | ||
float | mTrms, | ||
DTTimeUnits::type | unit | ||
) | [inline] |
int DTMtime::setSLMtime | ( | int | wheelId, |
int | stationId, | ||
int | sectorId, | ||
int | slId, | ||
int | layerId, | ||
int | cellId, | ||
float | mTime, | ||
float | mTrms, | ||
DTTimeUnits::type | unit | ||
) | [inline] |
int DTMtime::setSLMtime | ( | const DetId & | id, |
float | mTime, | ||
float | mTrms, | ||
DTTimeUnits::type | unit | ||
) | [inline] |
void DTMtime::setUnit | ( | float | unit | ) |
Definition at line 434 of file DTMtime.cc.
References nsPerCount, and unit().
{ nsPerCount = unit; }
int DTMtime::slMtime | ( | int | wheelId, |
int | stationId, | ||
int | sectorId, | ||
int | slId, | ||
int | layerId, | ||
int | cellId, | ||
float & | mTime, | ||
float & | mTrms, | ||
DTTimeUnits::type | unit | ||
) | const [inline] |
int DTMtime::slMtime | ( | const DetId & | id, |
float & | mTime, | ||
float & | mTrms, | ||
DTTimeUnits::type | unit | ||
) | const [inline] |
int DTMtime::slMtime | ( | int | wheelId, |
int | stationId, | ||
int | sectorId, | ||
int | slId, | ||
float & | mTime, | ||
float & | mTrms, | ||
DTTimeUnits::type | unit | ||
) | const [inline] |
int DTMtime::slMtime | ( | const DTSuperLayerId & | id, |
float & | mTime, | ||
float & | mTrms, | ||
DTTimeUnits::type | unit | ||
) | const [inline] |
float DTMtime::unit | ( | ) | const |
Definition at line 241 of file DTMtime.cc.
References nsPerCount.
Referenced by get(), set(), setSLMtime(), setUnit(), and slMtime().
{ return nsPerCount; }
const std::string & DTMtime::version | ( | ) | const |
access version
Definition at line 247 of file DTMtime.cc.
References dataVersion.
Referenced by DTLinearDriftFromDBAlgo::setES().
{ return dataVersion; }
std::string & DTMtime::version | ( | ) |
std::vector< std::pair<DTMtimeId,DTMtimeData> > DTMtime::dataList [private] |
std::string DTMtime::dataVersion [private] |
DTBufferTree<int,int>* DTMtime::dBuf [private] |
Definition at line 267 of file DTMtime.h.
Referenced by cacheMap(), clear(), DTMtime(), get(), set(), and ~DTMtime().