CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
DTT0 Class Reference

#include <DTT0.h>

Public Types

typedef std::vector< std::pair
< DTT0Id, DTT0Data >
>::const_iterator 
const_iterator
 Access methods to data. More...
 

Public Member Functions

const_iterator begin () const
 
int cellT0 (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
 get content More...
 
int cellT0 (const DTWireId &id, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
 
void clear ()
 reset content More...
 
 DTT0 ()
 
 DTT0 (const std::string &version)
 
const_iterator end () const
 
int get (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
 
int get (const DTWireId &id, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
 
int set (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float t0mean, float t0rms, DTTimeUnits::type unit)
 
int set (const DTWireId &id, float t0mean, float t0rms, DTTimeUnits::type unit)
 
int setCellT0 (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float t0mean, float t0rms, DTTimeUnits::type unit)
 
int setCellT0 (const DTWireId &id, float t0mean, float t0rms, DTTimeUnits::type unit)
 
void setUnit (float unit)
 
void sortData ()
 
float unit () const
 
const std::string & version () const
 access version More...
 
std::string & version ()
 
 ~DTT0 ()
 

Private Member Functions

void cacheMap () const
 
bool checkOrder () const
 read and store full content More...
 
int getRandom (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
 
int getSorted (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
 
std::string mapName () const
 
int maxCellsPerLayer () const
 

Private Attributes

std::vector< std::pair< DTT0Id,
DTT0Data > > 
dataList
 
std::string dataVersion
 
DTBufferTree< int, int > * dBuf
 
float nsPerCount
 
std::vector< int > * sequencePtr
 
DTBufferTree< int, int > * sortedLayers
 

Detailed Description

Description: Class to hold drift tubes T0s ( cell by cell time offsets )

Date:
2010/03/01 10:27:08
Revision:
1.10
Author
Paolo Ronchese INFN Padova

Definition at line 68 of file DTT0.h.

Member Typedef Documentation

typedef std::vector< std::pair<DTT0Id, DTT0Data> >::const_iterator DTT0::const_iterator

Access methods to data.

Definition at line 158 of file DTT0.h.

Constructor & Destructor Documentation

DTT0::DTT0 ( )

Constructor

Definition at line 35 of file DTT0.cc.

References dataList, dBuf, sequencePtr, and sortedLayers.

35  :
36  dataVersion( " " ),
37  nsPerCount( 25.0 / 32.0 ) {
38  dataList.reserve( 12000 );
39 // dBuf = sortedLayers = 0;
40  dBuf = 0;
41  sortedLayers = 0;
42  sequencePtr = 0;
43 }
DTBufferTree< int, int > * dBuf
Definition: DTT0.h:171
std::string dataVersion
Definition: DTT0.h:164
std::vector< std::pair< DTT0Id, DTT0Data > > dataList
Definition: DTT0.h:167
DTBufferTree< int, int > * sortedLayers
Definition: DTT0.h:170
float nsPerCount
Definition: DTT0.h:165
std::vector< int > * sequencePtr
Definition: DTT0.h:169
DTT0::DTT0 ( const std::string &  version)

Definition at line 46 of file DTT0.cc.

References dataList, dBuf, sequencePtr, and sortedLayers.

46  :
48  nsPerCount( 25.0 / 32.0 ) {
49  dataList.reserve( 12000 );
50 // dBuf = sortedLayers = 0;
51  dBuf = 0;
52  sortedLayers = 0;
53  sequencePtr = 0;
54 }
DTBufferTree< int, int > * dBuf
Definition: DTT0.h:171
std::string dataVersion
Definition: DTT0.h:164
std::vector< std::pair< DTT0Id, DTT0Data > > dataList
Definition: DTT0.h:167
DTBufferTree< int, int > * sortedLayers
Definition: DTT0.h:170
float nsPerCount
Definition: DTT0.h:165
const std::string & version() const
access version
Definition: DTT0.cc:261
std::vector< int > * sequencePtr
Definition: DTT0.h:169
DTT0::~DTT0 ( )

Destructor

Definition at line 76 of file DTT0.cc.

References dBuf, sequencePtr, and sortedLayers.

76  {
77  delete dBuf;
78  delete sortedLayers;
79  delete sequencePtr;
80 }
DTBufferTree< int, int > * dBuf
Definition: DTT0.h:171
DTBufferTree< int, int > * sortedLayers
Definition: DTT0.h:170
std::vector< int > * sequencePtr
Definition: DTT0.h:169

Member Function Documentation

DTT0::const_iterator DTT0::begin ( void  ) const

Definition at line 384 of file DTT0.cc.

References dataList.

Referenced by DTT0Calibration::endJob(), and DTT0CalibrationNew::endJob().

384  {
385  return dataList.begin();
386 }
std::vector< std::pair< DTT0Id, DTT0Data > > dataList
Definition: DTT0.h:167
void DTT0::cacheMap ( ) const
private

Definition at line 507 of file DTT0.cc.

References dataList, dBuf, DTBufferTree< Key, Content >::insert(), sortedLayers, and DTT0Id::stationId.

Referenced by checkOrder(), and set().

507  {
508 
509  delete sortedLayers;
510  sortedLayers = 0;
511 // dBuf = new std::map<int,int>;
513 
514  int entryNum = 0;
515  int entryMax = dataList.size();
516  std::vector<int> chanKey;
517  chanKey.reserve(6);
518  while ( entryNum < entryMax ) {
519 
520  const DTT0Id& chan = dataList[entryNum].first;
521 
522 // DTWireId detId( chan. wheelId, chan.stationId, chan. sectorId,
523 // chan. slId, chan. layerId, chan. cellId );
524 // dBuf->insert( std::pair<int,int>( detId.rawId(), entryNum++ ) );
525  chanKey.clear();
526  chanKey.push_back( chan. wheelId );
527  chanKey.push_back( chan.stationId );
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++ );
533 
534  }
535 
536  return;
537 
538 }
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
DTBufferTree< int, int > * dBuf
Definition: DTT0.h:171
Definition: DTT0.h:38
std::vector< std::pair< DTT0Id, DTT0Data > > dataList
Definition: DTT0.h:167
int stationId
Definition: DTT0.h:46
DTBufferTree< int, int > * sortedLayers
Definition: DTT0.h:170
int DTT0::cellT0 ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float &  t0mean,
float &  t0rms,
DTTimeUnits::type  unit 
) const
inline

get content

Operations

Definition at line 84 of file DTT0.h.

93  { return get( wheelId, stationId, sectorId, slId, layerId, cellId,
94  t0mean, t0rms, unit ); };
float unit() const
Definition: DTT0.cc:255
int DTT0::cellT0 ( const DTWireId id,
float &  t0mean,
float &  t0rms,
DTTimeUnits::type  unit 
) const
inline

Definition at line 95 of file DTT0.h.

References unit().

99  { return get( id, t0mean, t0rms, unit ); };
float unit() const
Definition: DTT0.cc:255
bool DTT0::checkOrder ( ) const
private

read and store full content

Definition at line 401 of file DTT0.cc.

References cacheMap(), DTT0Id::cellId, dataList, DTBufferTree< Key, Content >::find(), DTSequentialLayerNumber::id(), DTBufferTree< Key, Content >::insert(), DTSequentialLayerNumber::max(), maxCellsPerLayer(), evf::evtn::offset(), sequencePtr, sortedLayers, and DTT0Id::stationId.

Referenced by get(), and sortData().

401  {
402 
403  delete sortedLayers;
404  delete sequencePtr;
405 // sortedLayers = new std::map<int,int>;
407 // sequencePtr = new std::vector<int>;
408 // sequencePtr->reserve( DTSequentialLayerNumber::max() + 2 );
409  sequencePtr = new std::vector<int>( DTSequentialLayerNumber::max() + 2 );
410  std::vector<int>::iterator iter = sequencePtr->begin();
411  std::vector<int>::iterator iend = sequencePtr->end();
412  while ( iter != iend ) *iter++ = 0;
413 
414  int entryNum = 0;
415  int mCells = maxCellsPerLayer();
416  int entryMax = dataList.size();
417 // int oldId = 0;
418  std::vector<int> chanOld;
419  int lCell = -999999999;
420  bool layerOrder = true;
421 
422  int lCode;
423  int seqId;
424  int oldId = 0;
425  std::vector<int>& sequenceLay = *sequencePtr;
426 
427  std::vector<int> chanKey;
428  chanKey.reserve(6);
429 
430  while ( entryNum < entryMax ) {
431  const DTT0Id& chan = dataList[entryNum].first;
432  if ( ( seqId = DTSequentialLayerNumber::id( chan. wheelId,
433  chan.stationId,
434  chan. sectorId,
435  chan. slId,
436  chan. layerId ) ) < 0 ) {
437  oldId = 0;
438 // std::cout << "out of sequence" << std::endl;
439 // DTLayerId detId( chan. wheelId, chan.stationId, chan. sectorId,
440 // chan. slId, chan. layerId );
441 // int rawId = detId.rawId();
442  chanKey.clear();
443  chanKey.push_back( chan. wheelId );
444  chanKey.push_back( chan.stationId );
445  chanKey.push_back( chan. sectorId );
446  chanKey.push_back( chan. slId );
447  chanKey.push_back( chan. layerId );
448 // std::map<int,int>::iterator layer_iter = sortedLayers->find( rawId );
449 // std::map<int,int>::iterator layer_iend = sortedLayers->end();
450 // if ( layer_iter == layer_iend ) {
451  if ( sortedLayers->find( chanKey.begin(), chanKey.end(), lCode ) ) {
452 // sortedLayers->insert( std::pair<int,int>( rawId,
453 // 1 + ( entryNum * 1000 ) ) );
454 // oldId = rawId;
455  sortedLayers->insert( chanKey.begin(), chanKey.end(),
456  1 + ( entryNum * mCells ) );
457  chanOld = chanKey;
458  }
459  else {
460 // int& lCode = layer_iter->second;
461  int offset = lCode / mCells;
462  int length = lCode % mCells;
463  int ncells = entryNum - offset;
464 // if ( ( ncells != length ) ||
465 // ( rawId != oldId ) ||
466 // ( chan.cellId <= lCell ) ) layerOrder = false;
467 // layer_iter->second = ( offset * 1000 ) + ncells + 1;
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;
476  sortedLayers->insert( chanKey.begin(), chanKey.end(),
477  ( offset * mCells ) + ncells + 1 );
478  }
479  }
480  else {
481  chanOld.clear();
482 // std::cout << "inside sequence" << std::endl;
483  lCode = sequenceLay[seqId];
484  if ( lCode == 0 ) {
485  sequenceLay[seqId] = 1 + ( entryNum * mCells );
486  oldId = seqId;
487  }
488  else {
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;
497  }
498  }
499  lCell = chan.cellId;
500  entryNum++;
501  }
502  if ( !layerOrder ) cacheMap();
503  return layerOrder;
504 }
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
int cellId
Definition: DTT0.h:50
int maxCellsPerLayer() const
Definition: DTT0.cc:163
Definition: DTT0.h:38
std::vector< std::pair< DTT0Id, DTT0Data > > dataList
Definition: DTT0.h:167
int stationId
Definition: DTT0.h:46
unsigned int offset(bool)
int find(ElementKey fKey, ElementKey lKey, Content &cont)
DTBufferTree< int, int > * sortedLayers
Definition: DTT0.h:170
void cacheMap() const
Definition: DTT0.cc:507
std::vector< int > * sequencePtr
Definition: DTT0.h:169
static int id(int wheel, int station, int sector, int superlayer, int layer)
void DTT0::clear ( void  )
DTT0::const_iterator DTT0::end ( void  ) const

Definition at line 389 of file DTT0.cc.

References dataList.

Referenced by Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), DTT0Calibration::endJob(), and DTT0CalibrationNew::endJob().

389  {
390  return dataList.end();
391 }
std::vector< std::pair< DTT0Id, DTT0Data > > dataList
Definition: DTT0.h:167
int DTT0::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float &  t0mean,
float &  t0rms,
DTTimeUnits::type  unit 
) const

Definition at line 94 of file DTT0.cc.

References checkOrder(), dBuf, getRandom(), getSorted(), and sortedLayers.

Referenced by Options.Options::__getitem__(), and DTConfigPedestals::getOffset().

102  {
103 
104  t0mean =
105  t0rms = 0.0;
106 
107  if ( ( dBuf == 0 ) && ( sortedLayers == 0 ) ) checkOrder();
108 // if ( sortedLayers != 0 ) std::cout << "sorted data" << std::endl;
109 // else std::cout << "random data" << std::endl;
110  if ( sortedLayers != 0 ) return getSorted( wheelId, stationId, sectorId,
111  slId, layerId, cellId,
112  t0mean, t0rms, unit );
113  else return getRandom( wheelId, stationId, sectorId,
114  slId, layerId, cellId,
115  t0mean, t0rms, unit );
116  return -999999999;
117 }
DTBufferTree< int, int > * dBuf
Definition: DTT0.h:171
int getSorted(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
Definition: DTT0.cc:168
int getRandom(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
Definition: DTT0.cc:120
float unit() const
Definition: DTT0.cc:255
DTBufferTree< int, int > * sortedLayers
Definition: DTT0.h:170
bool checkOrder() const
read and store full content
Definition: DTT0.cc:401
int DTT0::get ( const DTWireId id,
float &  t0mean,
float &  t0rms,
DTTimeUnits::type  unit 
) const

Definition at line 241 of file DTT0.cc.

References unit().

Referenced by Options.Options::__getitem__().

244  {
245  return get( id.wheel(),
246  id.station(),
247  id.sector(),
248  id.superLayer(),
249  id.layer(),
250  id.wire(),
251  t0mean, t0rms, unit );
252 }
float unit() const
Definition: DTT0.cc:255
int DTT0::getRandom ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float &  t0mean,
float &  t0rms,
DTTimeUnits::type  unit 
) const
private

Definition at line 120 of file DTT0.cc.

References runTheMatrix::data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTTimeUnits::ns, nsPerCount, edm::second(), DTT0Data::t0mean, and DTT0Data::t0rms.

Referenced by get().

128  {
129 
130 // DTWireId detId( wheelId, stationId, sectorId,
131 // slId, layerId, cellId );
132 // int chanKey = detId.rawId();
133  std::vector<int> chanKey;
134  chanKey.reserve(6);
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 );
141 
142  int ientry;
143 // std::map<int,int>::const_iterator buf_iter = dBuf->find( chanKey );
144 // std::map<int,int>::const_iterator buf_iend = dBuf->end();
145 // int searchStatus = ( buf_iter == buf_iend );
146  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
147  if ( !searchStatus ) {
148 // ientry = buf_iter->second;
149  const DTT0Data& data( dataList[ientry].second );
150  t0mean = data.t0mean;
151  t0rms = data.t0rms;
152  if ( unit == DTTimeUnits::ns ) {
153  t0mean *= nsPerCount;
154  t0rms *= nsPerCount;
155  }
156  }
157 
158  return searchStatus;
159 
160 }
DTBufferTree< int, int > * dBuf
Definition: DTT0.h:171
std::vector< std::pair< DTT0Id, DTT0Data > > dataList
Definition: DTT0.h:167
U second(std::pair< T, U > const &p)
float unit() const
Definition: DTT0.cc:255
int find(ElementKey fKey, ElementKey lKey, Content &cont)
float nsPerCount
Definition: DTT0.h:165
Definition: DTT0.h:55
int DTT0::getSorted ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float &  t0mean,
float &  t0rms,
DTTimeUnits::type  unit 
) const
private

Definition at line 168 of file DTT0.cc.

References runTheMatrix::data, dataList, DTBufferTree< Key, Content >::find(), DTSequentialLayerNumber::id(), maxCellsPerLayer(), DTTimeUnits::ns, nsPerCount, edm::second(), sequencePtr, sortedLayers, DTT0Data::t0mean, and DTT0Data::t0rms.

Referenced by get().

176  {
177 
178  int lCode;
179  int seqId;
180  std::vector<int>& sequenceLay = *sequencePtr;
181 
182  if ( ( seqId = DTSequentialLayerNumber::id( wheelId, stationId, sectorId,
183  slId, layerId ) ) < 0 ) {
184 // DTLayerId detId( wheelId, stationId, sectorId,
185 // slId, layerId );
186 // int chanKey = detId.rawId();
187  std::vector<int> chanKey;
188  chanKey.reserve(6);
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 );
194 
195 // std::map<int,int>::iterator layer_iter = sortedLayers->find( chanKey );
196 // std::map<int,int>::iterator layer_iend = sortedLayers->end();
197 //
198 // if ( layer_iter == layer_iend ) return 1;
199 //
200 // int& lCode = layer_iter->second;
201  if ( sortedLayers->find( chanKey.begin(), chanKey.end(), lCode ) )
202  return 1;
203  }
204  else {
205  lCode = sequenceLay[seqId];
206  }
207  int mCells = maxCellsPerLayer();
208  int idprev = lCode / mCells;
209  int length = lCode % mCells;
210  int idnext = idprev + length;
211 
212  --idprev;
213  int idtest;
214  while ( ( length = idnext - idprev ) >= 2 ) {
215  idtest = idprev + ( length / 2 );
216  int cCell = dataList[idtest].first.cellId;
217  if ( cCell < cellId ) {
218  idprev = idtest;
219  continue;
220  }
221  if ( cCell > cellId ) {
222  idnext = idtest;
223  continue;
224  }
225  idprev = idtest++;
226  idnext = idtest;
227  const DTT0Data& data( dataList[idprev].second );
228  t0mean = data.t0mean;
229  t0rms = data.t0rms;
230  if ( unit == DTTimeUnits::ns ) {
231  t0mean *= nsPerCount;
232  t0rms *= nsPerCount;
233  }
234  return 0;
235  }
236  // std::cout << "cell not found!" << std::endl;
237  return 1;
238 }
int maxCellsPerLayer() const
Definition: DTT0.cc:163
std::vector< std::pair< DTT0Id, DTT0Data > > dataList
Definition: DTT0.h:167
U second(std::pair< T, U > const &p)
float unit() const
Definition: DTT0.cc:255
int find(ElementKey fKey, ElementKey lKey, Content &cont)
DTBufferTree< int, int > * sortedLayers
Definition: DTT0.h:170
float nsPerCount
Definition: DTT0.h:165
std::vector< int > * sequencePtr
Definition: DTT0.h:169
Definition: DTT0.h:55
static int id(int wheel, int station, int sector, int superlayer, int layer)
std::string DTT0::mapName ( ) const
private

Definition at line 394 of file DTT0.cc.

References dataVersion, and mergeVDriftHistosByStation::name.

394  {
395  std::stringstream name;
396  name << dataVersion << "_map_T0" << this;
397  return name.str();
398 }
std::string dataVersion
Definition: DTT0.h:164
int DTT0::maxCellsPerLayer ( ) const
private

Definition at line 163 of file DTT0.cc.

Referenced by checkOrder(), and getSorted().

163  {
164  return 2000;
165 }
int DTT0::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float  t0mean,
float  t0rms,
DTTimeUnits::type  unit 
)

Definition at line 279 of file DTT0.cc.

References cacheMap(), runTheMatrix::data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTBufferTree< Key, Content >::insert(), combine::key, DTTimeUnits::ns, nsPerCount, edm::second(), DTT0Id::stationId, DTT0Data::t0mean, and DTT0Data::t0rms.

Referenced by DTT0Calibration::endJob(), DTT0CalibrationNew::endJob(), DTT0Handler::getNewObjects(), DTFakeT0ESProducer::produce(), set(), and setCellT0().

287  {
288 
289  if ( unit == DTTimeUnits::ns ) {
290  t0mean /= nsPerCount;
291  t0rms /= nsPerCount;
292  }
293 
294  if ( dBuf == 0 ) cacheMap();
295 
296 // DTWireId detId( wheelId, stationId, sectorId,
297 // slId, layerId, cellId );
298 // int chanKey = detId.rawId();
299  if ( dBuf == 0 ) cacheMap();
300  std::vector<int> chanKey;
301  chanKey.reserve(6);
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 );
308 
309  int ientry;
310 // std::map<int,int>::const_iterator buf_iter = dBuf->find( chanKey );
311 // std::map<int,int>::const_iterator buf_iend = dBuf->end();
312 // int searchStatus = ( buf_iter == buf_iend );
313  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
314 
315  if ( !searchStatus ) {
316 // ientry = buf_iter->second;
317  DTT0Data& data( dataList[ientry].second );
318  data.t0mean = t0mean;
319  data.t0rms = t0rms;
320  return -1;
321  }
322  else {
323  DTT0Id key;
324  key. wheelId = wheelId;
325  key.stationId = stationId;
326  key. sectorId = sectorId;
327  key. slId = slId;
328  key. layerId = layerId;
329  key. cellId = cellId;
330  DTT0Data data;
331  data.t0mean = t0mean;
332  data.t0rms = t0rms;
333  ientry = dataList.size();
334  dataList.push_back( std::pair<const DTT0Id,DTT0Data>( key, data ) );
335 // dBuf->insert( std::pair<int,int>( detId.rawId(), ientry ) );
336  dBuf->insert( chanKey.begin(), chanKey.end(), ientry );
337  return 0;
338  }
339 
340  return 99;
341 
342 }
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
DTBufferTree< int, int > * dBuf
Definition: DTT0.h:171
Definition: DTT0.h:38
std::vector< std::pair< DTT0Id, DTT0Data > > dataList
Definition: DTT0.h:167
U second(std::pair< T, U > const &p)
int stationId
Definition: DTT0.h:46
float unit() const
Definition: DTT0.cc:255
int find(ElementKey fKey, ElementKey lKey, Content &cont)
float nsPerCount
Definition: DTT0.h:165
void cacheMap() const
Definition: DTT0.cc:507
list key
Definition: combine.py:13
float t0rms
Definition: DTT0.h:63
float t0mean
Definition: DTT0.h:62
Definition: DTT0.h:55
int DTT0::set ( const DTWireId id,
float  t0mean,
float  t0rms,
DTTimeUnits::type  unit 
)

Definition at line 345 of file DTT0.cc.

References set(), and relativeConstraints::station.

348  {
349  return set( id.wheel(),
350  id.station(),
351  id.sector(),
352  id.superLayer(),
353  id.layer(),
354  id.wire(),
355  t0mean, t0rms, unit );
356 }
int set(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float t0mean, float t0rms, DTTimeUnits::type unit)
Definition: DTT0.cc:279
float unit() const
Definition: DTT0.cc:255
int DTT0::setCellT0 ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
float  t0mean,
float  t0rms,
DTTimeUnits::type  unit 
)
inline

Definition at line 123 of file DTT0.h.

References set().

132  { return set( wheelId, stationId, sectorId, slId, layerId, cellId,
133  t0mean, t0rms, unit ); };
int set(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float t0mean, float t0rms, DTTimeUnits::type unit)
Definition: DTT0.cc:279
float unit() const
Definition: DTT0.cc:255
int DTT0::setCellT0 ( const DTWireId id,
float  t0mean,
float  t0rms,
DTTimeUnits::type  unit 
)
inline

Definition at line 134 of file DTT0.h.

References set().

138  { return set( id, t0mean, t0rms, unit ); };
int set(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float t0mean, float t0rms, DTTimeUnits::type unit)
Definition: DTT0.cc:279
float unit() const
Definition: DTT0.cc:255
void DTT0::setUnit ( float  unit)

Definition at line 359 of file DTT0.cc.

References nsPerCount, and unit().

359  {
360  nsPerCount = unit;
361 }
float unit() const
Definition: DTT0.cc:255
float nsPerCount
Definition: DTT0.h:165
void DTT0::sortData ( )

Definition at line 364 of file DTT0.cc.

References checkOrder(), DTBufferTree< Key, Content >::contList(), dataList, dBuf, and sortedLayers.

364  {
365  if ( sortedLayers != 0 ) return;
366  if ( dBuf == 0 ) checkOrder();
367  if ( sortedLayers != 0 ) return;
368  if ( dBuf == 0 ) return;
369  std::vector< std::pair<DTT0Id,DTT0Data> > tempList;
370 // std::map<int,int>::const_iterator iter = dBuf->begin();
371 // std::map<int,int>::const_iterator iend = dBuf->end();
372 // while ( iter != iend ) tempList.push_back( dataList[iter++->second] );
373  std::vector<int> indexList = dBuf->contList();
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++] );
377  dataList = tempList;
378  delete dBuf;
379  dBuf = 0;
380  return;
381 }
DTBufferTree< int, int > * dBuf
Definition: DTT0.h:171
std::vector< std::pair< DTT0Id, DTT0Data > > dataList
Definition: DTT0.h:167
std::vector< Content > contList()
DTBufferTree< int, int > * sortedLayers
Definition: DTT0.h:170
bool checkOrder() const
read and store full content
Definition: DTT0.cc:401
float DTT0::unit ( ) const

Definition at line 255 of file DTT0.cc.

References nsPerCount.

Referenced by cellT0(), get(), and setUnit().

255  {
256  return nsPerCount;
257 }
float nsPerCount
Definition: DTT0.h:165
const std::string & DTT0::version ( ) const

access version

Definition at line 261 of file DTT0.cc.

References dataVersion.

261  {
262  return dataVersion;
263 }
std::string dataVersion
Definition: DTT0.h:164
std::string & DTT0::version ( )

Definition at line 266 of file DTT0.cc.

References dataVersion.

266  {
267  return dataVersion;
268 }
std::string dataVersion
Definition: DTT0.h:164

Member Data Documentation

std::vector< std::pair<DTT0Id,DTT0Data> > DTT0::dataList
private

Definition at line 167 of file DTT0.h.

Referenced by begin(), cacheMap(), checkOrder(), clear(), DTT0(), end(), getRandom(), getSorted(), set(), and sortData().

std::string DTT0::dataVersion
private

Definition at line 164 of file DTT0.h.

Referenced by mapName(), and version().

DTBufferTree<int,int>* DTT0::dBuf
mutableprivate

Definition at line 171 of file DTT0.h.

Referenced by cacheMap(), clear(), DTT0(), get(), getRandom(), set(), sortData(), and ~DTT0().

float DTT0::nsPerCount
private

Definition at line 165 of file DTT0.h.

Referenced by getRandom(), getSorted(), set(), setUnit(), and unit().

std::vector<int>* DTT0::sequencePtr
mutableprivate

Definition at line 169 of file DTT0.h.

Referenced by checkOrder(), DTT0(), getSorted(), and ~DTT0().

DTBufferTree<int,int>* DTT0::sortedLayers
mutableprivate

Definition at line 170 of file DTT0.h.

Referenced by cacheMap(), checkOrder(), DTT0(), get(), getSorted(), sortData(), and ~DTT0().