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
DTReadOutMapping Class Reference

#include <DTReadOutMapping.h>

Public Types

typedef std::vector
< DTReadOutGeometryLink >
::const_iterator 
const_iterator
 Access methods to the connections. More...
 
enum  type { plain, compact }
 

Public Member Functions

const_iterator begin () const
 
void clear ()
 clear map More...
 
 DTReadOutMapping ()
 
 DTReadOutMapping (const std::string &cell_map_version, const std::string &rob_map_version)
 
const_iterator end () const
 
const DTReadOutMappingfullMap () const
 Expand to full map. More...
 
int geometryToReadOut (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, int &dduId, int &rosId, int &robId, int &tdcId, int &channelId) const
 
int geometryToReadOut (const DTWireId &wireId, int &dduId, int &rosId, int &robId, int &tdcId, int &channelId) const
 
int insertReadOutGeometryLink (int dduId, int rosId, int robId, int tdcId, int channelId, int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId)
 insert connection More...
 
const std::string & mapCellTdc () const
 access parent maps identifiers More...
 
std::string & mapCellTdc ()
 
const std::string & mapRobRos () const
 
std::string & mapRobRos ()
 
type mapType () const
 
int readOutToGeometry (int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
 transform identifiers More...
 
int readOutToGeometry (int dduId, int rosId, int robId, int tdcId, int channelId, int &wheelId, int &stationId, int &sectorId, int &slId, int &layerId, int &cellId) const
 
 ~DTReadOutMapping ()
 

Private Member Functions

void cacheMap () const
 read and store full content More...
 
std::string mapNameGR () const
 
std::string mapNameRG () const
 

Private Attributes

std::string cellMapVersion
 
DTBufferTree< int, int > * grBuf
 
DTBufferTree< int, std::vector
< int > * > * 
grDDU
 
DTBufferTree< int, std::vector
< int > * > * 
grROB
 
DTBufferTree< int, std::vector
< int > * > * 
grROS
 
DTBufferTree< int, int > * mType
 
std::vector
< DTReadOutGeometryLink
readOutChannelDriftTubeMap
 
DTBufferTree< int, int > * rgBuf
 
DTBufferTree< int, int > * rgDDU
 
DTBufferTree< int, int > * rgROB
 
DTBufferTree< int, int > * rgROS
 
std::string robMapVersion
 

Detailed Description

Description: Class to map read-out channels to physical drift tubes

Date:
2011/02/08 15:48:27
Revision:
1.8
Author
Paolo Ronchese INFN Padova

Definition at line 57 of file DTReadOutMapping.h.

Member Typedef Documentation

Access methods to the connections.

Definition at line 140 of file DTReadOutMapping.h.

Member Enumeration Documentation

Enumerator
plain 
compact 

Definition at line 71 of file DTReadOutMapping.h.

Constructor & Destructor Documentation

DTReadOutMapping::DTReadOutMapping ( )

Constructor

Definition at line 36 of file DTReadOutMapping.cc.

References grBuf, grDDU, grROB, grROS, mType, readOutChannelDriftTubeMap, rgBuf, rgDDU, rgROB, and rgROS.

36  :
37  cellMapVersion( " " ),
38  robMapVersion( " " ) {
39  readOutChannelDriftTubeMap.reserve( 2000 );
40  mType = rgBuf = rgROB = rgROS = rgDDU = grBuf = 0;
41  grROB = grROS = grDDU = 0;
42 }
std::string robMapVersion
DTBufferTree< int, std::vector< int > * > * grROB
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
DTBufferTree< int, int > * rgROS
DTBufferTree< int, std::vector< int > * > * grROS
DTBufferTree< int, int > * mType
DTBufferTree< int, int > * rgROB
DTBufferTree< int, int > * grBuf
DTBufferTree< int, int > * rgBuf
DTBufferTree< int, int > * rgDDU
std::string cellMapVersion
DTBufferTree< int, std::vector< int > * > * grDDU
DTReadOutMapping::DTReadOutMapping ( const std::string &  cell_map_version,
const std::string &  rob_map_version 
)

Definition at line 45 of file DTReadOutMapping.cc.

References grBuf, grDDU, grROB, grROS, mType, readOutChannelDriftTubeMap, rgBuf, rgDDU, rgROB, and rgROS.

46  :
47  cellMapVersion( cell_map_version ),
48  robMapVersion( rob_map_version ) {
49  readOutChannelDriftTubeMap.reserve( 2000 );
50  mType = rgBuf = rgROB = rgROS = rgDDU = grBuf = 0;
51  grROB = grROS = grDDU = 0;
52 }
std::string robMapVersion
DTBufferTree< int, std::vector< int > * > * grROB
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
DTBufferTree< int, int > * rgROS
DTBufferTree< int, std::vector< int > * > * grROS
DTBufferTree< int, int > * mType
DTBufferTree< int, int > * rgROB
DTBufferTree< int, int > * grBuf
DTBufferTree< int, int > * rgBuf
DTBufferTree< int, int > * rgDDU
std::string cellMapVersion
DTBufferTree< int, std::vector< int > * > * grDDU
DTReadOutMapping::~DTReadOutMapping ( )

Destructor

Definition at line 72 of file DTReadOutMapping.cc.

References DTBufferTree< Key, Content >::contList(), grBuf, grDDU, grROB, grROS, mType, rgBuf, rgDDU, rgROB, and rgROS.

72  {
73 
74  delete mType;
75  delete rgBuf;
76 
77  delete rgROB;
78  delete rgROS;
79  delete rgDDU;
80  delete grBuf;
81 
82  if ( grROB != 0 ) {
83  std::vector<std::vector<int>*> gr_list = grROB->contList();
84  std::vector<std::vector<int>*>::const_iterator gr_iter = gr_list.begin();
85  std::vector<std::vector<int>*>::const_iterator gr_iend = gr_list.end();
86  while ( gr_iter != gr_iend ) delete *gr_iter++;
87  }
88  if ( grROS != 0 ) {
89  std::vector<std::vector<int>*> gr_list = grROS->contList();
90  std::vector<std::vector<int>*>::const_iterator gr_iter = gr_list.begin();
91  std::vector<std::vector<int>*>::const_iterator gr_iend = gr_list.end();
92  while ( gr_iter != gr_iend ) delete *gr_iter++;
93  }
94  if ( grDDU != 0 ) {
95  std::vector<std::vector<int>*> gr_list = grDDU->contList();
96  std::vector<std::vector<int>*>::const_iterator gr_iter = gr_list.begin();
97  std::vector<std::vector<int>*>::const_iterator gr_iend = gr_list.end();
98  while ( gr_iter != gr_iend ) delete *gr_iter++;
99  }
100 
101  delete grROB;
102  delete grROS;
103  delete grDDU;
104 
105 }
DTBufferTree< int, std::vector< int > * > * grROB
std::vector< DTReadOutGeometryLink >::const_iterator const_iterator
Access methods to the connections.
DTBufferTree< int, int > * rgROS
std::vector< Content > contList()
DTBufferTree< int, std::vector< int > * > * grROS
DTBufferTree< int, int > * mType
DTBufferTree< int, int > * rgROB
DTBufferTree< int, int > * grBuf
DTBufferTree< int, int > * rgBuf
DTBufferTree< int, int > * rgDDU
DTBufferTree< int, std::vector< int > * > * grDDU

Member Function Documentation

DTReadOutMapping::const_iterator DTReadOutMapping::begin ( void  ) const

Definition at line 498 of file DTReadOutMapping.cc.

References readOutChannelDriftTubeMap.

Referenced by DTCompactMapPluginHandler::expandMap().

498  {
499  return readOutChannelDriftTubeMap.begin();
500 }
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
void DTReadOutMapping::cacheMap ( ) const
private

read and store full content

Definition at line 535 of file DTReadOutMapping.cc.

References DTReadOutGeometryLink::cellId, DTReadOutGeometryLink::channelId, DTReadOutGeometryLink::dduId, DTBufferTree< Key, Content >::find(), grBuf, grDDU, grROB, grROS, DTBufferTree< Key, Content >::insert(), combine::key, DTReadOutGeometryLink::layerId, link(), mType, readOutChannelDriftTubeMap, rgBuf, rgDDU, rgROB, rgROS, DTReadOutGeometryLink::robId, DTReadOutGeometryLink::rosId, DTReadOutGeometryLink::sectorId, DTBufferTree< Key, Content >::setDefault(), DTReadOutGeometryLink::stationId, and DTReadOutGeometryLink::wheelId.

Referenced by geometryToReadOut(), mapType(), and readOutToGeometry().

535  {
536 
537  DTBufferTree<int,int>** pmType;
538  pmType = const_cast<DTBufferTree<int,int>**>( &mType );
539  *pmType = new DTBufferTree<int,int>;
540 
541  mType->insert( 0, 0 );
542 
543  DTBufferTree<int,int>** prgBuf;
544  prgBuf = const_cast<DTBufferTree<int,int>**>( &rgBuf );
545  *prgBuf = new DTBufferTree<int,int>;
546  DTBufferTree<int,int>** pgrBuf;
547  pgrBuf = const_cast<DTBufferTree<int,int>**>( &grBuf );
548  *pgrBuf = new DTBufferTree<int,int>;
549 
550  DTBufferTree<int,int>** prgROB;
551  prgROB = const_cast<DTBufferTree<int,int>**>( &rgROB );
552  *prgROB = new DTBufferTree<int,int>;
553  DTBufferTree<int,int>** prgROS;
554  prgROS = const_cast<DTBufferTree<int,int>**>( &rgROS );
555  *prgROS = new DTBufferTree<int,int>;
556  DTBufferTree<int,int>** prgDDU;
557  prgDDU = const_cast<DTBufferTree<int,int>**>( &rgDDU );
558  *prgDDU = new DTBufferTree<int,int>;
559  rgROB->setDefault( 0 );
560  rgROS->setDefault( 0 );
561  rgDDU->setDefault( 0 );
562 
564  pgrROB = const_cast<DTBufferTree<int,std::vector<int>*>**>( &grROB );
565  *pgrROB = new DTBufferTree<int,std::vector<int>*>;
567  pgrROS = const_cast<DTBufferTree<int,std::vector<int>*>**>( &grROS );
568  *pgrROS = new DTBufferTree<int,std::vector<int>*>;
570  pgrDDU = const_cast<DTBufferTree<int,std::vector<int>*>**>( &grDDU );
571  *pgrDDU = new DTBufferTree<int,std::vector<int>*>;
572  grROB->setDefault( 0 );
573  grROS->setDefault( 0 );
574  grDDU->setDefault( 0 );
575 
576  int entryNum = 0;
577  int entryMax = readOutChannelDriftTubeMap.size();
578  std::vector<int> cellKey;
579  cellKey.reserve(6);
580  std::vector<int> chanKey;
581  chanKey.reserve(5);
582  int defaultValue = 0;
583  int key;
584  int val;
585  int rosMapKey = 0;
586  int robMapKey = 0;
587  std::map<int,std::vector<int>*> dduEntries;
588  for ( entryNum = 0; entryNum < entryMax; entryNum++ ) {
589 
591 
592  key = link.dduId;
593  val = link.stationId;
594  if ( key > 0x3fffffff ) {
595  if ( link. tdcId > 0x3fffffff ) {
596  mType->insert( 0, defaultValue = link. tdcId );
597  rosMapKey = key;
598  }
599  else {
600  mType->insert( 0, defaultValue = link.wheelId );
601  robMapKey = key;
602  }
603  }
604 
605  if ( defaultValue == 0 ) {
606 
607  chanKey.clear();
608  chanKey.push_back( link. dduId );
609  chanKey.push_back( link. rosId );
610  chanKey.push_back( link. robId );
611  chanKey.push_back( link. tdcId );
612  chanKey.push_back( link.channelId );
613 
614  rgBuf->insert( chanKey.begin(), chanKey.end(), entryNum );
615 
616  cellKey.clear();
617  cellKey.push_back( link. wheelId );
618  cellKey.push_back( link.stationId );
619  cellKey.push_back( link. sectorId );
620  cellKey.push_back( link. slId );
621  cellKey.push_back( link. layerId );
622  cellKey.push_back( link. cellId );
623 
624  grBuf->insert( cellKey.begin(), cellKey.end(), entryNum );
625 
626  }
627 
628  if ( key == robMapKey ) {
629 
630  chanKey.clear();
631  chanKey.push_back( link. rosId );
632  chanKey.push_back( link. tdcId );
633  chanKey.push_back( link.channelId );
634  rgROB->insert( chanKey.begin(), chanKey.end(), entryNum );
635 
636  cellKey.clear();
637  cellKey.push_back( link. cellId );
638  cellKey.push_back( link.layerId );
639  cellKey.push_back( link. slId );
640  std::vector<int>* robMLgr;
641  grROB->find( cellKey.begin(), cellKey.end(), robMLgr );
642  if ( robMLgr == 0 ) grROB->insert( cellKey.begin(), cellKey.end(),
643  robMLgr = new std::vector<int> );
644  robMLgr->push_back( entryNum );
645 
646  }
647 
648  if ( key == rosMapKey ) {
649 
650  chanKey.clear();
651  chanKey.push_back( link.rosId );
652  chanKey.push_back( link.robId );
653  rgROS->insert( chanKey.begin(), chanKey.end(), entryNum );
654 
655  cellKey.clear();
656  cellKey.push_back( link. cellId );
657  cellKey.push_back( link.stationId );
658  std::vector<int>* rosMLgr;
659  grROS->find( cellKey.begin(), cellKey.end(), rosMLgr );
660  if ( rosMLgr == 0 ) grROS->insert( cellKey.begin(), cellKey.end(),
661  rosMLgr = new std::vector<int> );
662  rosMLgr->push_back( entryNum );
663 
664  }
665 
666  if ( ( key < 0x3fffffff ) &&
667  ( val > 0x3fffffff ) ) {
668 
669  chanKey.clear();
670  chanKey.push_back( link.dduId );
671  chanKey.push_back( link.rosId );
672  rgDDU->insert( chanKey.begin(), chanKey.end(), entryNum );
673 
674  int mapId = link.cellId;
675  std::vector<int>* dduMLgr;
676  std::map<int,std::vector<int>*>::const_iterator dduEntIter =
677  dduEntries.find( mapId );
678  if ( dduEntIter == dduEntries.end() )
679  dduEntries.insert( std::pair<int,std::vector<int>*>( mapId,
680  dduMLgr = new std::vector<int> ) );
681  else dduMLgr = dduEntIter->second;
682  dduMLgr->push_back( entryNum );
683 
684  }
685 
686  }
687 
688  if ( defaultValue != 0 ) {
689  for ( entryNum = 0; entryNum < entryMax; entryNum++ ) {
690  const DTReadOutGeometryLink& link(
691  readOutChannelDriftTubeMap[entryNum] );
692  key = link.dduId;
693  if ( key != rosMapKey ) continue;
694  int mapId = link. rosId;
695  int whchkId = link. wheelId;
696  int secchkId = link.sectorId;
697 
698  std::vector<int>* dduMLgr;
699  std::map<int,std::vector<int>*>::const_iterator dduEntIter =
700  dduEntries.find( mapId );
701  if ( dduEntIter != dduEntries.end() ) dduMLgr = dduEntIter->second;
702  else continue;
703  std::vector<int>::const_iterator dduIter = dduMLgr->begin();
704  std::vector<int>::const_iterator dduIend = dduMLgr->end();
705  while( dduIter != dduIend ) {
706  int ientry = *dduIter++;
707  const DTReadOutGeometryLink& lros(
708  readOutChannelDriftTubeMap[ientry] );
709  int wheelId = whchkId;
710  int sectorId = secchkId;
711  if ( wheelId == defaultValue ) wheelId = lros. wheelId;
712  if ( sectorId == defaultValue ) sectorId = lros.sectorId;
713  cellKey.clear();
714  cellKey.push_back( mapId );
715  cellKey.push_back( wheelId );
716  cellKey.push_back( sectorId );
717  std::vector<int>* dduMLgr = 0;
718  grDDU->find( cellKey.begin(), cellKey.end(), dduMLgr );
719  if ( dduMLgr == 0 ) grDDU->insert( cellKey.begin(), cellKey.end(),
720  dduMLgr = new std::vector<int> );
721  dduMLgr->push_back( ientry );
722  }
723 
724  }
725 
726  std::map<int,std::vector<int>*>::const_iterator dduEntIter =
727  dduEntries.begin();
728  std::map<int,std::vector<int>*>::const_iterator dduEntIend =
729  dduEntries.end();
730  while ( dduEntIter != dduEntIend ) {
731  const std::pair<int,std::vector<int>*>& dduEntry = *dduEntIter++;
732  delete dduEntry.second;
733  }
734 
735  delete rgBuf;
736  delete grBuf;
737  *prgBuf = new DTBufferTree<int,int>;
738  *pgrBuf = new DTBufferTree<int,int>;
739 
740  }
741 
742  return;
743 
744 }
DTBufferTree< int, std::vector< int > * > * grROB
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
std::vector< DTReadOutGeometryLink >::const_iterator const_iterator
Access methods to the connections.
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
std::string link(std::string &nm, std::string &ns)
Definition: hierarchy.cc:47
DTBufferTree< int, int > * rgROS
static void setDefault(const Content &def)
DTBufferTree< int, std::vector< int > * > * grROS
DTBufferTree< int, int > * mType
DTBufferTree< int, int > * rgROB
DTBufferTree< int, int > * grBuf
int find(ElementKey fKey, ElementKey lKey, Content &cont)
DTBufferTree< int, int > * rgBuf
list key
Definition: combine.py:13
DTBufferTree< int, int > * rgDDU
DTBufferTree< int, std::vector< int > * > * grDDU
void DTReadOutMapping::clear ( void  )
DTReadOutMapping::const_iterator DTReadOutMapping::end ( void  ) const

Definition at line 503 of file DTReadOutMapping.cc.

References readOutChannelDriftTubeMap.

Referenced by Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), and DTCompactMapPluginHandler::expandMap().

503  {
504  return readOutChannelDriftTubeMap.end();
505 }
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
const DTReadOutMapping * DTReadOutMapping::fullMap ( ) const

Expand to full map.

Definition at line 508 of file DTReadOutMapping.cc.

References gather_cfg::cout, DTCompactMapAbstractHandler::expandMap(), DTCompactMapAbstractHandler::getInstance(), mapType(), and plain.

508  {
509  if ( mapType() == plain ) return this;
510  DTCompactMapAbstractHandler* cmHandler =
512  if ( cmHandler == 0 ) {
513  std::cout << "CondCoreDTPlugins library not loaded, "
514  << "compactMapHandler plugin missing" << std::endl;
515  return 0;
516  }
517  return cmHandler->expandMap( *this );
518 }
static DTCompactMapAbstractHandler * getInstance()
get static object
virtual DTReadOutMapping * expandMap(const DTReadOutMapping &compMap)
expand compact map
tuple cout
Definition: gather_cfg.py:121
type mapType() const
int DTReadOutMapping::geometryToReadOut ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
int &  dduId,
int &  rosId,
int &  robId,
int &  tdcId,
int &  channelId 
) const

Definition at line 257 of file DTReadOutMapping.cc.

References cacheMap(), DTReadOutGeometryLink::channelId, DTReadOutGeometryLink::dduId, DTBufferTree< Key, Content >::find(), grBuf, grDDU, grROB, grROS, link(), mType, readOutChannelDriftTubeMap, DTReadOutGeometryLink::robId, DTReadOutGeometryLink::rosId, DTReadOutGeometryLink::sectorId, and DTReadOutGeometryLink::wheelId.

Referenced by geometryToReadOut().

267  {
268 
269  dduId =
270  rosId =
271  robId =
272  tdcId =
273  channelId = 0;
274 
275  if ( ( mType == 0 ) ||
276  ( grBuf == 0 ) ||
277  ( grROB == 0 ) ||
278  ( grROS == 0 ) ||
279  ( grDDU == 0 ) ) cacheMap();
280 
281  int defaultValue;
282  mType->find( 0, defaultValue );
283  if ( defaultValue ) {
284 
285  int loop1 = 0;
286  int loop2 = 0;
287  int loop3 = 0;
288  int loop0 = 0;
289 
290  int searchStatus;
291  int mapId = 0;
292  std::vector<int>* robMLgr;
293  std::vector<int>* rosMLgr;
294  std::vector<int>* dduMLgr;
295 
296  std::vector<int> cellKey;
297  cellKey.reserve(6);
298  cellKey.push_back( cellId );
299  cellKey.push_back( layerId );
300  cellKey.push_back( slId );
301  std::vector<int> stdcKey = cellKey;
302  searchStatus = grROB->find( cellKey.begin(), cellKey.end(), robMLgr );
303  if ( searchStatus ) return searchStatus;
304  if ( !( robMLgr->size() ) ) return 1;
305  std::vector<int>::const_iterator tdc_iter = robMLgr->begin();
306  std::vector<int>::const_iterator tdc_iend = robMLgr->end();
307  while( tdc_iter != tdc_iend ) {
308  loop1++;
309  const DTReadOutGeometryLink& ltdc(
310  readOutChannelDriftTubeMap[*tdc_iter++] );
311  channelId = ltdc.channelId;
312  tdcId = ltdc. tdcId;
313  mapId = ltdc.rosId;
314  cellKey.clear();
315  cellKey.push_back( mapId );
316  cellKey.push_back( stationId );
317  std::vector<int> srosKey = cellKey;
318  searchStatus = grROS->find( cellKey.begin(), cellKey.end(), rosMLgr );
319  if ( searchStatus ) continue;
320  if ( !( rosMLgr->size() ) ) continue;
321  std::vector<int>::const_iterator ros_iter = rosMLgr->begin();
322  std::vector<int>::const_iterator ros_iend = rosMLgr->end();
323  while( ros_iter != ros_iend ) {
324  loop2++;
325  const DTReadOutGeometryLink& lros(
326  readOutChannelDriftTubeMap[*ros_iter++] );
327  int secCk = lros.sectorId;
328  int wheCk = lros. wheelId;
329  if ( ( secCk != defaultValue ) &&
330  ( secCk != sectorId ) ) continue;
331  if ( ( wheCk != defaultValue ) &&
332  ( wheCk != wheelId ) ) continue;
333  robId = lros.robId;
334  mapId = lros.rosId;
335  cellKey.clear();
336  cellKey.push_back( mapId );
337  cellKey.push_back( wheelId );
338  cellKey.push_back( sectorId );
339  std::vector<int> sdduKey = cellKey;
340  searchStatus = grDDU->find( cellKey.begin(), cellKey.end(), dduMLgr );
341  if ( searchStatus ) continue;
342  if ( !( dduMLgr->size() ) ) continue;
343  if ( searchStatus ) return searchStatus;
344  if ( !( dduMLgr->size() ) ) return 1;
345  loop0++;
346  std::vector<int>::const_iterator ddu_iter = dduMLgr->begin();
347  std::vector<int>::const_iterator ddu_iend = dduMLgr->end();
348  while( ddu_iter != ddu_iend ) {
349  loop3++;
350  const DTReadOutGeometryLink& lddu(
351  readOutChannelDriftTubeMap[*ddu_iter++] );
352  mapId = lros.rosId;
353  if ( ( ( sectorId == secCk ) ||
354  ( sectorId == lddu.sectorId ) ) &&
355  ( ( wheelId == wheCk ) ||
356  ( wheelId == lddu.wheelId ) ) ) {
357  rosId = lddu.rosId;
358  dduId = lddu.dduId;
359  return 0;
360  }
361  }
362  }
363  }
364 
365  return 1;
366 
367  }
368 
369  std::vector<int> cellKey;
370  cellKey.reserve(6);
371  cellKey.push_back( wheelId );
372  cellKey.push_back( stationId );
373  cellKey.push_back( sectorId );
374  cellKey.push_back( slId );
375  cellKey.push_back( layerId );
376  cellKey.push_back( cellId );
377  int ientry;
378  int searchStatus = grBuf->find( cellKey.begin(), cellKey.end(), ientry );
379  if ( !searchStatus ) {
381  dduId = link. dduId;
382  rosId = link. rosId;
383  robId = link. robId;
384  tdcId = link. tdcId;
385  channelId = link.channelId;
386  }
387 
388  return searchStatus;
389 
390 }
DTBufferTree< int, std::vector< int > * > * grROB
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
std::string link(std::string &nm, std::string &ns)
Definition: hierarchy.cc:47
DTBufferTree< int, std::vector< int > * > * grROS
DTBufferTree< int, int > * mType
DTBufferTree< int, int > * grBuf
int find(ElementKey fKey, ElementKey lKey, Content &cont)
void cacheMap() const
read and store full content
DTBufferTree< int, std::vector< int > * > * grDDU
int DTReadOutMapping::geometryToReadOut ( const DTWireId wireId,
int &  dduId,
int &  rosId,
int &  robId,
int &  tdcId,
int &  channelId 
) const

Definition at line 237 of file DTReadOutMapping.cc.

References geometryToReadOut(), DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), DTChamberId::wheel(), and DTWireId::wire().

242  {
243  return geometryToReadOut( wireId.wheel(),
244  wireId.station(),
245  wireId.sector(),
246  wireId.superLayer(),
247  wireId.layer(),
248  wireId.wire(),
249  dduId,
250  rosId,
251  robId,
252  tdcId,
253  channelId);
254 }
int layer() const
Return the layer number.
Definition: DTLayerId.h:55
int superLayer() const
Return the superlayer number.
int wire() const
Return the wire number.
Definition: DTWireId.h:58
int geometryToReadOut(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, int &dduId, int &rosId, int &robId, int &tdcId, int &channelId) const
int sector() const
Definition: DTChamberId.h:63
int station() const
Return the station number.
Definition: DTChamberId.h:53
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
int DTReadOutMapping::insertReadOutGeometryLink ( int  dduId,
int  rosId,
int  robId,
int  tdcId,
int  channelId,
int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId 
)

insert connection

Definition at line 434 of file DTReadOutMapping.cc.

References DTReadOutGeometryLink::channelId, grBuf, DTBufferTree< Key, Content >::insert(), link(), readOutChannelDriftTubeMap, rgBuf, and DTReadOutGeometryLink::stationId.

Referenced by DTCompactMapPluginHandler::expandMap(), and DTReadOutMappingHandler::getNewObjects().

444  {
446  link. dduId = dduId;
447  link. rosId = rosId;
448  link. robId = robId;
449  link. tdcId = tdcId;
450  link.channelId = channelId;
451  link. wheelId = wheelId;
452  link.stationId = stationId;
453  link. sectorId = sectorId;
454  link. slId = slId;
455  link. layerId = layerId;
456  link. cellId = cellId;
457 
458  int ientry = readOutChannelDriftTubeMap.size();
459  readOutChannelDriftTubeMap.push_back( link );
460 
461  if ( rgBuf == 0 ) {
462  DTBufferTree<int,int>** prgBuf;
463  prgBuf = const_cast<DTBufferTree<int,int>**>( &rgBuf );
464  *prgBuf = new DTBufferTree<int,int>;
465  }
466  if ( grBuf == 0 ) {
467  DTBufferTree<int,int>** pgrBuf;
468  pgrBuf = const_cast<DTBufferTree<int,int>**>( &grBuf );
469  *pgrBuf = new DTBufferTree<int,int>;
470  }
471 
472  std::vector<int> cellKey;
473  cellKey.reserve(6);
474  cellKey.push_back( wheelId );
475  cellKey.push_back( stationId );
476  cellKey.push_back( sectorId );
477  cellKey.push_back( slId );
478  cellKey.push_back( layerId );
479  cellKey.push_back( cellId );
480  int grStatus =
481  grBuf->insert( cellKey.begin(), cellKey.end(), ientry );
482  std::vector<int> chanKey;
483  chanKey.reserve(5);
484  chanKey.push_back( dduId );
485  chanKey.push_back( rosId );
486  chanKey.push_back( robId );
487  chanKey.push_back( tdcId );
488  chanKey.push_back( channelId );
489  int rgStatus =
490  rgBuf->insert( chanKey.begin(), chanKey.end(), ientry );
491 
492  if ( grStatus || rgStatus ) return 1;
493  else return 0;
494 
495 }
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
std::string link(std::string &nm, std::string &ns)
Definition: hierarchy.cc:47
DTBufferTree< int, int > * grBuf
DTBufferTree< int, int > * rgBuf
const std::string & DTReadOutMapping::mapCellTdc ( ) const

access parent maps identifiers

Definition at line 403 of file DTReadOutMapping.cc.

References cellMapVersion.

Referenced by DTCompactMapPluginHandler::expandMap().

403  {
404  return cellMapVersion;
405 }
std::string cellMapVersion
std::string & DTReadOutMapping::mapCellTdc ( )

Definition at line 408 of file DTReadOutMapping.cc.

References cellMapVersion.

408  {
409  return cellMapVersion;
410 }
std::string cellMapVersion
std::string DTReadOutMapping::mapNameGR ( ) const
private

Definition at line 521 of file DTReadOutMapping.cc.

References cellMapVersion, mergeVDriftHistosByStation::name, and robMapVersion.

521  {
522  std::stringstream name;
523  name << cellMapVersion << "_" << robMapVersion << "_map_GR" << this;
524  return name.str();
525 }
std::string robMapVersion
std::string cellMapVersion
std::string DTReadOutMapping::mapNameRG ( ) const
private

Definition at line 528 of file DTReadOutMapping.cc.

References cellMapVersion, mergeVDriftHistosByStation::name, and robMapVersion.

528  {
529  std::stringstream name;
530  name << cellMapVersion << "_" << robMapVersion << "_map_RG" << this;
531  return name.str();
532 }
std::string robMapVersion
std::string cellMapVersion
const std::string & DTReadOutMapping::mapRobRos ( ) const

Definition at line 414 of file DTReadOutMapping.cc.

References robMapVersion.

Referenced by DTCompactMapPluginHandler::expandMap().

414  {
415  return robMapVersion;
416 }
std::string robMapVersion
std::string & DTReadOutMapping::mapRobRos ( )

Definition at line 419 of file DTReadOutMapping.cc.

References robMapVersion.

419  {
420  return robMapVersion;
421 }
std::string robMapVersion
DTReadOutMapping::type DTReadOutMapping::mapType ( ) const

Definition at line 393 of file DTReadOutMapping.cc.

References cacheMap(), compact, DTBufferTree< Key, Content >::find(), mType, and plain.

Referenced by fullMap().

393  {
394  if ( mType == 0 ) cacheMap();
395  int defaultValue;
396  mType->find( 0, defaultValue );
397  if ( defaultValue ) return compact;
398  else return plain;
399 }
DTBufferTree< int, int > * mType
int find(ElementKey fKey, ElementKey lKey, Content &cont)
void cacheMap() const
read and store full content
int DTReadOutMapping::readOutToGeometry ( int  dduId,
int  rosId,
int  robId,
int  tdcId,
int  channelId,
DTWireId wireId 
) const

transform identifiers

Operations

Definition at line 113 of file DTReadOutMapping.cc.

References ntuplemaker::status.

118  {
119 
120  int wheelId;
121  int stationId;
122  int sectorId;
123  int slId;
124  int layerId;
125  int cellId;
126 
127  int status = readOutToGeometry( dduId,
128  rosId,
129  robId,
130  tdcId,
131  channelId,
132  wheelId,
133  stationId,
134  sectorId,
135  slId,
136  layerId,
137  cellId );
138 
139  wireId = DTWireId( wheelId, stationId, sectorId, slId, layerId, cellId );
140  return status;
141 
142 }
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
tuple status
Definition: ntuplemaker.py:245
int DTReadOutMapping::readOutToGeometry ( int  dduId,
int  rosId,
int  robId,
int  tdcId,
int  channelId,
int &  wheelId,
int &  stationId,
int &  sectorId,
int &  slId,
int &  layerId,
int &  cellId 
) const

Definition at line 145 of file DTReadOutMapping.cc.

References cacheMap(), DTBufferTree< Key, Content >::find(), link(), mType, readOutChannelDriftTubeMap, rgBuf, rgDDU, rgROB, rgROS, and DTReadOutGeometryLink::stationId.

155  {
156 
157  wheelId =
158  stationId =
159  sectorId =
160  slId =
161  layerId =
162  cellId = 0;
163 
164  if ( ( mType == 0 ) ||
165  ( rgBuf == 0 ) ||
166  ( rgROB == 0 ) ||
167  ( rgROS == 0 ) ||
168  ( rgDDU == 0 ) ) cacheMap();
169 
170  int defaultValue;
171  mType->find( 0, defaultValue );
172  if ( defaultValue ) {
173 
174  int searchStatus;
175  int ientry;
176 
177  std::vector<int> dduKey;
178  dduKey.reserve( 5 );
179  dduKey.push_back( dduId );
180  dduKey.push_back( rosId );
181  searchStatus = rgDDU->find( dduKey.begin(), dduKey.end(), ientry );
182  if ( searchStatus ) return searchStatus;
183  const DTReadOutGeometryLink& lros( readOutChannelDriftTubeMap[ientry] );
184  wheelId = lros. wheelId;
185  sectorId = lros. sectorId;
186 
187  std::vector<int> rosKey;
188  rosKey.reserve( 5 );
189  rosKey.push_back( lros. cellId );
190  rosKey.push_back( robId );
191  searchStatus = rgROS->find( rosKey.begin(), rosKey.end(), ientry );
192  if ( searchStatus ) return searchStatus;
193  const DTReadOutGeometryLink& lrob( readOutChannelDriftTubeMap[ientry] );
194  if ( lrob. wheelId != defaultValue ) wheelId = lrob. wheelId;
195  stationId = lrob.stationId;
196  if ( lrob. sectorId != defaultValue ) sectorId = lrob. sectorId;
197 
198  std::vector<int> robKey;
199  robKey.reserve( 5 );
200  robKey.push_back( lrob. cellId );
201  robKey.push_back( tdcId );
202  robKey.push_back( channelId );
203  searchStatus = rgROB->find( robKey.begin(), robKey.end(), ientry );
204  if ( searchStatus ) return searchStatus;
205  const DTReadOutGeometryLink& ltdc( readOutChannelDriftTubeMap[ientry] );
206  slId = ltdc. slId;
207  layerId = ltdc. layerId;
208  cellId = ltdc. cellId;
209  return 0;
210 
211  }
212 
213  std::vector<int> chanKey;
214  chanKey.reserve(5);
215  chanKey.push_back( dduId );
216  chanKey.push_back( rosId );
217  chanKey.push_back( robId );
218  chanKey.push_back( tdcId );
219  chanKey.push_back( channelId );
220  int ientry;
221  int searchStatus = rgBuf->find( chanKey.begin(), chanKey.end(), ientry );
222  if ( !searchStatus ) {
224  wheelId = link. wheelId;
225  stationId = link.stationId;
226  sectorId = link. sectorId;
227  slId = link. slId;
228  layerId = link. layerId;
229  cellId = link. cellId;
230  }
231 
232  return searchStatus;
233 
234 }
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
std::string link(std::string &nm, std::string &ns)
Definition: hierarchy.cc:47
DTBufferTree< int, int > * rgROS
DTBufferTree< int, int > * mType
DTBufferTree< int, int > * rgROB
int find(ElementKey fKey, ElementKey lKey, Content &cont)
DTBufferTree< int, int > * rgBuf
void cacheMap() const
read and store full content
DTBufferTree< int, int > * rgDDU

Member Data Documentation

std::string DTReadOutMapping::cellMapVersion
private

Definition at line 149 of file DTReadOutMapping.h.

Referenced by mapCellTdc(), mapNameGR(), and mapNameRG().

DTBufferTree<int,int>* DTReadOutMapping::grBuf
private
DTBufferTree<int, std::vector<int>*>* DTReadOutMapping::grDDU
private
DTBufferTree<int, std::vector<int>*>* DTReadOutMapping::grROB
private
DTBufferTree<int, std::vector<int>*>* DTReadOutMapping::grROS
private
DTBufferTree<int,int>* DTReadOutMapping::mType
private
std::vector<DTReadOutGeometryLink> DTReadOutMapping::readOutChannelDriftTubeMap
private
DTBufferTree<int,int>* DTReadOutMapping::rgBuf
private
DTBufferTree<int,int>* DTReadOutMapping::rgDDU
private
DTBufferTree<int,int>* DTReadOutMapping::rgROB
private
DTBufferTree<int,int>* DTReadOutMapping::rgROS
private
std::string DTReadOutMapping::robMapVersion
private

Definition at line 150 of file DTReadOutMapping.h.

Referenced by mapNameGR(), mapNameRG(), and mapRobRos().