37 nsPerCount( 25.0 / 32.0 ) {
47 dataVersion( version ),
48 nsPerCount( 25.0 / 32.0 ) {
111 slId, layerId, cellId,
112 t0mean, t0rms, unit );
113 else return getRandom( wheelId, stationId, sectorId,
114 slId, layerId, cellId,
115 t0mean, t0rms, unit );
133 std::vector<int> chanKey;
135 chanKey.push_back( wheelId );
136 chanKey.push_back( stationId );
137 chanKey.push_back( sectorId );
138 chanKey.push_back( slId );
139 chanKey.push_back( layerId );
140 chanKey.push_back( cellId );
146 int searchStatus =
dBuf->
find( chanKey.begin(), chanKey.end(), ientry );
147 if ( !searchStatus ) {
183 slId, layerId ) ) < 0 ) {
187 std::vector<int> chanKey;
189 chanKey.push_back( wheelId );
190 chanKey.push_back( stationId );
191 chanKey.push_back( sectorId );
192 chanKey.push_back( slId );
193 chanKey.push_back( layerId );
205 lCode = sequenceLay[seqId];
208 int idprev = lCode / mCells;
209 int length = lCode % mCells;
210 int idnext = idprev + length;
214 while ( ( length = idnext - idprev ) >= 2 ) {
215 idtest = idprev + ( length / 2 );
216 int cCell =
dataList[idtest].first.cellId;
217 if ( cCell < cellId ) {
221 if ( cCell > cellId ) {
245 return get(
id.wheel(),
251 t0mean, t0rms,
unit );
300 std::vector<int> chanKey;
302 chanKey.push_back( wheelId );
303 chanKey.push_back( stationId );
304 chanKey.push_back( sectorId );
305 chanKey.push_back( slId );
306 chanKey.push_back( layerId );
307 chanKey.push_back( cellId );
313 int searchStatus =
dBuf->
find( chanKey.begin(), chanKey.end(), ientry );
315 if ( !searchStatus ) {
324 key. wheelId = wheelId;
326 key. sectorId = sectorId;
328 key. layerId = layerId;
329 key. cellId = cellId;
334 dataList.push_back( std::pair<const DTT0Id,DTT0Data>( key, data ) );
336 dBuf->
insert( chanKey.begin(), chanKey.end(), ientry );
349 return set(
id.wheel(),
355 t0mean, t0rms, unit );
368 if (
dBuf == 0 )
return;
369 std::vector< std::pair<DTT0Id,DTT0Data> > tempList;
374 std::vector<int>::const_iterator iter = indexList.begin();
375 std::vector<int>::const_iterator iend = indexList.end();
376 while ( iter != iend ) tempList.push_back(
dataList[*iter++] );
395 std::stringstream
name;
410 std::vector<int>::iterator iter =
sequencePtr->begin();
411 std::vector<int>::iterator iend =
sequencePtr->end();
412 while ( iter != iend ) *iter++ = 0;
418 std::vector<int> chanOld;
419 int lCell = -999999999;
420 bool layerOrder =
true;
427 std::vector<int> chanKey;
430 while ( entryNum < entryMax ) {
436 chan. layerId ) ) < 0 ) {
443 chanKey.push_back( chan. wheelId );
445 chanKey.push_back( chan. sectorId );
446 chanKey.push_back( chan. slId );
447 chanKey.push_back( chan. layerId );
456 1 + ( entryNum * mCells ) );
461 int offset = lCode / mCells;
462 int length = lCode % mCells;
463 int ncells = entryNum -
offset;
468 if ( ( ncells >= mCells ) ||
469 ( ncells != length ) ||
470 ( chanKey[0] != chanOld[0] ) ||
471 ( chanKey[1] != chanOld[1] ) ||
472 ( chanKey[2] != chanOld[2] ) ||
473 ( chanKey[3] != chanOld[3] ) ||
474 ( chanKey[4] != chanOld[4] ) ||
475 ( chan.
cellId <= lCell ) ) layerOrder =
false;
477 ( offset * mCells ) + ncells + 1 );
483 lCode = sequenceLay[seqId];
485 sequenceLay[seqId] = 1 + ( entryNum * mCells );
489 int offset = lCode / mCells;
490 int length = lCode % mCells;
491 int ncells = entryNum -
offset;
492 if ( ( ncells >= mCells ) ||
493 ( ncells != length ) ||
494 ( seqId != oldId ) ||
495 ( chan.
cellId <= lCell ) ) layerOrder =
false;
496 sequenceLay[seqId] = ( offset * mCells ) + ncells + 1;
516 std::vector<int> chanKey;
518 while ( entryNum < entryMax ) {
526 chanKey.push_back( chan. wheelId );
528 chanKey.push_back( chan. sectorId );
529 chanKey.push_back( chan. slId );
530 chanKey.push_back( chan. layerId );
531 chanKey.push_back( chan. cellId );
532 dBuf->
insert( chanKey.begin(), chanKey.end(), entryNum++ );
const_iterator begin() const
int set(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float t0mean, float t0rms, DTTimeUnits::type unit)
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
DTBufferTree< int, int > * dBuf
int getSorted(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
int get(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
int maxCellsPerLayer() const
std::vector< std::pair< DTT0Id, DTT0Data > > dataList
U second(std::pair< T, U > const &p)
int getRandom(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
std::vector< Content > contList()
unsigned int offset(bool)
const_iterator end() const
int find(ElementKey fKey, ElementKey lKey, Content &cont)
DTBufferTree< int, int > * sortedLayers
std::vector< std::pair< DTT0Id, DTT0Data > >::const_iterator const_iterator
Access methods to data.
std::string mapName() const
const std::string & version() const
access version
void clear()
reset content
bool checkOrder() const
read and store full content
std::vector< int > * sequencePtr
static int id(int wheel, int station, int sector, int superlayer, int layer)