CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

DTReadOutMapping Class Reference

#include <DTReadOutMapping.h>

List of all members.

Public Types

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

Public Member Functions

const_iterator begin () const
void clear ()
 clear map
 DTReadOutMapping (const std::string &cell_map_version, const std::string &rob_map_version)
 DTReadOutMapping ()
const_iterator end () const
const DTReadOutMappingfullMap () const
 Expand to full map.
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
std::string & mapCellTdc ()
const std::string & mapCellTdc () const
 access parent maps identifiers
std::string & mapRobRos ()
const std::string & mapRobRos () const
type mapType () const
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
int readOutToGeometry (int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
 transform identifiers
 ~DTReadOutMapping ()

Private Member Functions

void cacheMap () const
 read and store full content
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.

{ plain, compact };

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.

                                  :
  cellMapVersion( " " ),
   robMapVersion( " " ) {
  readOutChannelDriftTubeMap.reserve( 2000 );
  mType = rgBuf = rgROB = rgROS = rgDDU = grBuf = 0;
  grROB = grROS = grDDU = 0;
}
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.

                                                                       :
  cellMapVersion( cell_map_version ),
   robMapVersion(  rob_map_version ) {
  readOutChannelDriftTubeMap.reserve( 2000 );
  mType = rgBuf = rgROB = rgROS = rgDDU = grBuf = 0;
  grROB = grROS = grDDU = 0;
}
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.

                                    {

  delete mType;
  delete rgBuf;

  delete rgROB;
  delete rgROS;
  delete rgDDU;
  delete grBuf;

  if ( grROB != 0 ) {
    std::vector<std::vector<int>*> gr_list = grROB->contList();
    std::vector<std::vector<int>*>::const_iterator gr_iter = gr_list.begin();
    std::vector<std::vector<int>*>::const_iterator gr_iend = gr_list.end();
    while ( gr_iter != gr_iend ) delete *gr_iter++;
  }
  if ( grROS != 0 ) {
    std::vector<std::vector<int>*> gr_list = grROS->contList();
    std::vector<std::vector<int>*>::const_iterator gr_iter = gr_list.begin();
    std::vector<std::vector<int>*>::const_iterator gr_iend = gr_list.end();
    while ( gr_iter != gr_iend ) delete *gr_iter++;
  }
  if ( grDDU != 0 ) {
    std::vector<std::vector<int>*> gr_list = grDDU->contList();
    std::vector<std::vector<int>*>::const_iterator gr_iter = gr_list.begin();
    std::vector<std::vector<int>*>::const_iterator gr_iend = gr_list.end();
    while ( gr_iter != gr_iend ) delete *gr_iter++;
  }

  delete grROB;
  delete grROS;
  delete 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().

                                                             {
  return readOutChannelDriftTubeMap.begin();
}
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().

                                      {

  DTBufferTree<int,int>** pmType;
  pmType = const_cast<DTBufferTree<int,int>**>( &mType );
  *pmType = new DTBufferTree<int,int>;

  mType->insert( 0, 0 );

  DTBufferTree<int,int>** prgBuf;
  prgBuf = const_cast<DTBufferTree<int,int>**>( &rgBuf );
  *prgBuf = new DTBufferTree<int,int>;
  DTBufferTree<int,int>** pgrBuf;
  pgrBuf = const_cast<DTBufferTree<int,int>**>( &grBuf );
  *pgrBuf = new DTBufferTree<int,int>;

  DTBufferTree<int,int>** prgROB;
  prgROB = const_cast<DTBufferTree<int,int>**>( &rgROB );
  *prgROB = new DTBufferTree<int,int>;
  DTBufferTree<int,int>** prgROS;
  prgROS = const_cast<DTBufferTree<int,int>**>( &rgROS );
  *prgROS = new DTBufferTree<int,int>;
  DTBufferTree<int,int>** prgDDU;
  prgDDU = const_cast<DTBufferTree<int,int>**>( &rgDDU );
  *prgDDU = new DTBufferTree<int,int>;
  rgROB->setDefault( 0 );
  rgROS->setDefault( 0 );
  rgDDU->setDefault( 0 );

  DTBufferTree<int,std::vector<int>*>** pgrROB;
  pgrROB = const_cast<DTBufferTree<int,std::vector<int>*>**>( &grROB );
  *pgrROB = new DTBufferTree<int,std::vector<int>*>;
  DTBufferTree<int,std::vector<int>*>** pgrROS;
  pgrROS = const_cast<DTBufferTree<int,std::vector<int>*>**>( &grROS );
  *pgrROS = new DTBufferTree<int,std::vector<int>*>;
  DTBufferTree<int,std::vector<int>*>** pgrDDU;
  pgrDDU = const_cast<DTBufferTree<int,std::vector<int>*>**>( &grDDU );
  *pgrDDU = new DTBufferTree<int,std::vector<int>*>;
  grROB->setDefault( 0 );
  grROS->setDefault( 0 );
  grDDU->setDefault( 0 );

  int entryNum = 0;
  int entryMax = readOutChannelDriftTubeMap.size();
  std::vector<int> cellKey;
  cellKey.reserve(6);
  std::vector<int> chanKey;
  chanKey.reserve(5);
  int defaultValue = 0;
  int key;
  int val;
  int rosMapKey = 0;
  int robMapKey = 0;
  std::map<int,std::vector<int>*> dduEntries;
  for ( entryNum = 0; entryNum < entryMax; entryNum++ ) {

    const DTReadOutGeometryLink& link( readOutChannelDriftTubeMap[entryNum] );

    key = link.dduId;
    val = link.stationId;
    if ( key > 0x3fffffff ) {
      if ( link.  tdcId > 0x3fffffff ) {
        mType->insert( 0, defaultValue = link.  tdcId );
        rosMapKey = key;
      }
      else {
        mType->insert( 0, defaultValue = link.wheelId );
        robMapKey = key;
      }
    }

    if ( defaultValue == 0 ) {

      chanKey.clear();
      chanKey.push_back( link.    dduId );
      chanKey.push_back( link.    rosId );
      chanKey.push_back( link.    robId );
      chanKey.push_back( link.    tdcId );
      chanKey.push_back( link.channelId );

      rgBuf->insert( chanKey.begin(), chanKey.end(), entryNum );

      cellKey.clear();
      cellKey.push_back( link.  wheelId );
      cellKey.push_back( link.stationId );
      cellKey.push_back( link. sectorId );
      cellKey.push_back( link.     slId );
      cellKey.push_back( link.  layerId );
      cellKey.push_back( link.   cellId );

      grBuf->insert( cellKey.begin(), cellKey.end(), entryNum );

    }

    if ( key == robMapKey ) {

      chanKey.clear();
      chanKey.push_back( link.    rosId );
      chanKey.push_back( link.    tdcId );
      chanKey.push_back( link.channelId );
      rgROB->insert( chanKey.begin(), chanKey.end(), entryNum );

      cellKey.clear();
      cellKey.push_back( link. cellId );
      cellKey.push_back( link.layerId );
      cellKey.push_back( link.   slId );
      std::vector<int>* robMLgr;
      grROB->find( cellKey.begin(), cellKey.end(), robMLgr );
      if ( robMLgr == 0 ) grROB->insert( cellKey.begin(), cellKey.end(),
                                         robMLgr = new std::vector<int> );
      robMLgr->push_back( entryNum );

    }

    if ( key == rosMapKey ) {

      chanKey.clear();
      chanKey.push_back( link.rosId );
      chanKey.push_back( link.robId );
      rgROS->insert( chanKey.begin(), chanKey.end(), entryNum );

      cellKey.clear();
      cellKey.push_back( link.   cellId );
      cellKey.push_back( link.stationId );
      std::vector<int>* rosMLgr;
      grROS->find( cellKey.begin(), cellKey.end(), rosMLgr );
      if ( rosMLgr == 0 ) grROS->insert( cellKey.begin(), cellKey.end(),
                                         rosMLgr = new std::vector<int> );
      rosMLgr->push_back( entryNum );

    }

    if ( ( key < 0x3fffffff ) &&
         ( val > 0x3fffffff ) ) {

      chanKey.clear();
      chanKey.push_back( link.dduId );
      chanKey.push_back( link.rosId );
      rgDDU->insert( chanKey.begin(), chanKey.end(), entryNum );

      int mapId = link.cellId;
      std::vector<int>* dduMLgr;
      std::map<int,std::vector<int>*>::const_iterator dduEntIter =
                                       dduEntries.find( mapId );
      if ( dduEntIter == dduEntries.end() )
           dduEntries.insert( std::pair<int,std::vector<int>*>( mapId,
                               dduMLgr = new std::vector<int> ) );
      else                     dduMLgr = dduEntIter->second;
      dduMLgr->push_back( entryNum );

    }

  }

  if ( defaultValue != 0 ) {
    for ( entryNum = 0; entryNum < entryMax; entryNum++ ) {
      const DTReadOutGeometryLink& link( 
            readOutChannelDriftTubeMap[entryNum] );
      key = link.dduId;
      if ( key != rosMapKey ) continue;
      int    mapId = link.   rosId;
      int  whchkId = link. wheelId;
      int secchkId = link.sectorId;

      std::vector<int>* dduMLgr;
      std::map<int,std::vector<int>*>::const_iterator dduEntIter =
                                       dduEntries.find( mapId );
      if ( dduEntIter != dduEntries.end() ) dduMLgr = dduEntIter->second;
      else                                  continue;
      std::vector<int>::const_iterator dduIter = dduMLgr->begin();
      std::vector<int>::const_iterator dduIend = dduMLgr->end();
      while( dduIter != dduIend ) {
        int ientry = *dduIter++;
        const DTReadOutGeometryLink& lros(
              readOutChannelDriftTubeMap[ientry] );
        int  wheelId =  whchkId;
        int sectorId = secchkId;
        if (  wheelId == defaultValue )  wheelId = lros. wheelId;
        if ( sectorId == defaultValue ) sectorId = lros.sectorId;
        cellKey.clear();
        cellKey.push_back(    mapId );
        cellKey.push_back(  wheelId );
        cellKey.push_back( sectorId );
        std::vector<int>* dduMLgr = 0;
        grDDU->find( cellKey.begin(), cellKey.end(), dduMLgr );
        if ( dduMLgr == 0 ) grDDU->insert( cellKey.begin(), cellKey.end(),
                                           dduMLgr = new std::vector<int> );
        dduMLgr->push_back( ientry );
      }

    }

    std::map<int,std::vector<int>*>::const_iterator dduEntIter =
                                                    dduEntries.begin();
    std::map<int,std::vector<int>*>::const_iterator dduEntIend =
                                                    dduEntries.end();
    while ( dduEntIter != dduEntIend ) {
      const std::pair<int,std::vector<int>*>& dduEntry = *dduEntIter++;
      delete dduEntry.second;
    }

    delete rgBuf;
    delete grBuf;
  *prgBuf = new DTBufferTree<int,int>;
  *pgrBuf = new DTBufferTree<int,int>;

  }

  return;

}
void DTReadOutMapping::clear ( void  )

clear map

Definition at line 424 of file DTReadOutMapping.cc.

References grBuf, mType, readOutChannelDriftTubeMap, and rgBuf.

                             {
  delete rgBuf;
  delete grBuf;
  delete mType;
  rgBuf = grBuf = mType = 0;
  readOutChannelDriftTubeMap.clear();
  return;
}
DTReadOutMapping::const_iterator DTReadOutMapping::end ( void  ) const

Definition at line 503 of file DTReadOutMapping.cc.

References readOutChannelDriftTubeMap.

Referenced by DTCompactMapPluginHandler::expandMap().

                                                           {
  return readOutChannelDriftTubeMap.end();
}
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.

                                                        {
  if ( mapType() == plain ) return this;
  DTCompactMapAbstractHandler* cmHandler =
                               DTCompactMapAbstractHandler::getInstance();
  if ( cmHandler == 0 ) {
      std::cout << "CondCoreDTPlugins library not loaded, "
                << "compactMapHandler plugin missing" << std::endl;
    return 0;
  }
  return cmHandler->expandMap( *this );
}
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().

                                                                {

  dduId =
  rosId =
  robId =
  tdcId =
  channelId = 0;

  if ( ( mType == 0 ) ||
       ( grBuf == 0 ) ||
       ( grROB == 0 ) ||
       ( grROS == 0 ) ||
       ( grDDU == 0 ) ) cacheMap();

  int defaultValue;
  mType->find( 0, defaultValue );
  if ( defaultValue ) {

    int loop1 = 0;
    int loop2 = 0;
    int loop3 = 0;
    int loop0 = 0;

    int searchStatus;
    int mapId = 0;
    std::vector<int>* robMLgr;
    std::vector<int>* rosMLgr;
    std::vector<int>* dduMLgr;

    std::vector<int> cellKey;
    cellKey.reserve(6);
    cellKey.push_back(  cellId );
    cellKey.push_back( layerId );
    cellKey.push_back(    slId );
    std::vector<int> stdcKey = cellKey;
    searchStatus = grROB->find( cellKey.begin(), cellKey.end(), robMLgr );
    if ( searchStatus ) return searchStatus;
    if ( !( robMLgr->size() ) ) return 1;
    std::vector<int>::const_iterator tdc_iter = robMLgr->begin();
    std::vector<int>::const_iterator tdc_iend = robMLgr->end();
    while( tdc_iter != tdc_iend ) {
      loop1++;
      const DTReadOutGeometryLink& ltdc(
            readOutChannelDriftTubeMap[*tdc_iter++] );
      channelId = ltdc.channelId;
          tdcId = ltdc.    tdcId;
      mapId = ltdc.rosId;
      cellKey.clear();
      cellKey.push_back( mapId );
      cellKey.push_back( stationId );
      std::vector<int> srosKey = cellKey;
      searchStatus = grROS->find( cellKey.begin(), cellKey.end(), rosMLgr );
      if ( searchStatus ) continue;
      if ( !( rosMLgr->size() ) ) continue;
      std::vector<int>::const_iterator ros_iter = rosMLgr->begin();
      std::vector<int>::const_iterator ros_iend = rosMLgr->end();
      while( ros_iter != ros_iend ) {
        loop2++;
        const DTReadOutGeometryLink& lros(
              readOutChannelDriftTubeMap[*ros_iter++] );
        int secCk = lros.sectorId;
        int wheCk = lros. wheelId;
        if ( ( secCk != defaultValue ) && 
             ( secCk != sectorId     ) ) continue;
        if ( ( wheCk != defaultValue ) && 
             ( wheCk !=  wheelId     ) ) continue;
        robId = lros.robId;
        mapId = lros.rosId;
        cellKey.clear();
        cellKey.push_back(    mapId );
        cellKey.push_back(  wheelId );
        cellKey.push_back( sectorId );
        std::vector<int> sdduKey = cellKey;
        searchStatus = grDDU->find( cellKey.begin(), cellKey.end(), dduMLgr );
        if ( searchStatus ) continue;
        if ( !( dduMLgr->size() ) ) continue;
        if ( searchStatus ) return searchStatus;
        if ( !( dduMLgr->size() ) ) return 1;
        loop0++;
        std::vector<int>::const_iterator ddu_iter = dduMLgr->begin();
        std::vector<int>::const_iterator ddu_iend = dduMLgr->end();
        while( ddu_iter != ddu_iend ) {
          loop3++;
          const DTReadOutGeometryLink& lddu(
                readOutChannelDriftTubeMap[*ddu_iter++] );
          mapId = lros.rosId;
          if ( ( ( sectorId == secCk ) || 
                 ( sectorId == lddu.sectorId ) ) &&
               ( (  wheelId == wheCk ) || 
                 (  wheelId == lddu.wheelId ) ) ) {
            rosId = lddu.rosId;
            dduId = lddu.dduId;
            return 0;
          }
        }
      }
    }

    return 1;

  }

  std::vector<int> cellKey;
  cellKey.reserve(6);
  cellKey.push_back(   wheelId );
  cellKey.push_back( stationId );
  cellKey.push_back(  sectorId );
  cellKey.push_back(      slId );
  cellKey.push_back(   layerId );
  cellKey.push_back(    cellId );
  int ientry;
  int searchStatus = grBuf->find( cellKey.begin(), cellKey.end(), ientry );
  if ( !searchStatus ) {
    const DTReadOutGeometryLink& link( readOutChannelDriftTubeMap[ientry] );
        dduId = link.    dduId;
        rosId = link.    rosId;
        robId = link.    robId;
        tdcId = link.    tdcId;
    channelId = link.channelId;
  }

  return searchStatus;

}
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().

                                                                {
  return geometryToReadOut( wireId.wheel(),
                  wireId.station(),
                  wireId.sector(),
                  wireId.superLayer(),
                  wireId.layer(),
                  wireId.wire(),
                                       dduId,
                                       rosId,
                                       robId,
                                       tdcId,
                                   channelId);
}
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().

                                                                 {
  DTReadOutGeometryLink link;
  link.    dduId =     dduId;
  link.    rosId =     rosId;
  link.    robId =     robId;
  link.    tdcId =     tdcId;
  link.channelId = channelId;
  link.  wheelId =   wheelId;
  link.stationId = stationId;
  link. sectorId =  sectorId;
  link.     slId =      slId;
  link.  layerId =   layerId;
  link.   cellId =    cellId;

  int ientry = readOutChannelDriftTubeMap.size();
  readOutChannelDriftTubeMap.push_back( link );

  if ( rgBuf == 0 ) {
    DTBufferTree<int,int>** prgBuf;
    prgBuf = const_cast<DTBufferTree<int,int>**>( &rgBuf );
    *prgBuf = new DTBufferTree<int,int>;
  }
  if ( grBuf == 0 ) {
    DTBufferTree<int,int>** pgrBuf;
    pgrBuf = const_cast<DTBufferTree<int,int>**>( &grBuf );
    *pgrBuf = new DTBufferTree<int,int>;
  }

  std::vector<int> cellKey;
  cellKey.reserve(6);
  cellKey.push_back(   wheelId );
  cellKey.push_back( stationId );
  cellKey.push_back(  sectorId );
  cellKey.push_back(      slId );
  cellKey.push_back(   layerId );
  cellKey.push_back(    cellId );
  int grStatus =
  grBuf->insert( cellKey.begin(), cellKey.end(), ientry );
  std::vector<int> chanKey;
  chanKey.reserve(5);
  chanKey.push_back(     dduId );
  chanKey.push_back(     rosId );
  chanKey.push_back(     robId );
  chanKey.push_back(     tdcId );
  chanKey.push_back( channelId );
  int rgStatus =
  rgBuf->insert( chanKey.begin(), chanKey.end(), ientry );

  if ( grStatus || rgStatus ) return 1;
  else                        return 0;

}
const std::string & DTReadOutMapping::mapCellTdc ( ) const

access parent maps identifiers

Definition at line 403 of file DTReadOutMapping.cc.

References cellMapVersion.

Referenced by DTCompactMapPluginHandler::expandMap().

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

Definition at line 408 of file DTReadOutMapping.cc.

References cellMapVersion.

                                        {
  return cellMapVersion;
}
std::string DTReadOutMapping::mapNameGR ( ) const [private]

Definition at line 521 of file DTReadOutMapping.cc.

References cellMapVersion, mergeVDriftHistosByStation::name, and robMapVersion.

                                            {
  std::stringstream name;
  name << cellMapVersion << "_" << robMapVersion << "_map_GR" << this;
  return name.str();
}
std::string DTReadOutMapping::mapNameRG ( ) const [private]

Definition at line 528 of file DTReadOutMapping.cc.

References cellMapVersion, mergeVDriftHistosByStation::name, and robMapVersion.

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

Definition at line 414 of file DTReadOutMapping.cc.

References robMapVersion.

Referenced by DTCompactMapPluginHandler::expandMap().

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

Definition at line 419 of file DTReadOutMapping.cc.

References robMapVersion.

                                       {
  return 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().

                                                     {
  if ( mType == 0 ) cacheMap();
  int defaultValue;
  mType->find( 0, defaultValue );
  if ( defaultValue ) return compact;
  else                return plain;
}
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.

                                                                  {

  int   wheelId;
  int stationId;
  int  sectorId;
  int      slId;
  int   layerId;
  int    cellId;

  int status = readOutToGeometry(      dduId,
                                       rosId,
                                       robId,
                                       tdcId,
                                   channelId,
                                     wheelId,
                                   stationId,
                                    sectorId,
                                        slId,
                                     layerId,
                                      cellId );

  wireId = DTWireId( wheelId, stationId, sectorId, slId, layerId, cellId );
  return status;

}
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.

                                                                {

  wheelId   =
  stationId =
  sectorId  =
  slId      =
  layerId   =
  cellId    = 0;

  if ( ( mType == 0 ) ||
       ( rgBuf == 0 ) ||
       ( rgROB == 0 ) ||
       ( rgROS == 0 ) ||
       ( rgDDU == 0 ) ) cacheMap();

  int defaultValue;
  mType->find( 0, defaultValue );
  if ( defaultValue ) {

    int searchStatus;
    int ientry;

    std::vector<int> dduKey;
    dduKey.reserve( 5 );
    dduKey.push_back( dduId );
    dduKey.push_back( rosId );
    searchStatus = rgDDU->find( dduKey.begin(), dduKey.end(), ientry );
    if ( searchStatus ) return searchStatus;
    const DTReadOutGeometryLink& lros( readOutChannelDriftTubeMap[ientry] );
      wheelId = lros.  wheelId;
     sectorId = lros. sectorId;

    std::vector<int> rosKey;
    rosKey.reserve( 5 );
    rosKey.push_back( lros. cellId );
    rosKey.push_back( robId );
    searchStatus = rgROS->find( rosKey.begin(), rosKey.end(), ientry );
    if ( searchStatus ) return searchStatus;
    const DTReadOutGeometryLink& lrob( readOutChannelDriftTubeMap[ientry] );
    if ( lrob.  wheelId != defaultValue )  wheelId = lrob.  wheelId;
    stationId = lrob.stationId;
    if ( lrob. sectorId != defaultValue ) sectorId = lrob. sectorId;

    std::vector<int> robKey;
    robKey.reserve( 5 );
    robKey.push_back( lrob. cellId );
    robKey.push_back(     tdcId );
    robKey.push_back( channelId );
    searchStatus = rgROB->find( robKey.begin(), robKey.end(), ientry );
    if ( searchStatus ) return searchStatus;
    const DTReadOutGeometryLink& ltdc( readOutChannelDriftTubeMap[ientry] );
         slId = ltdc.     slId;
      layerId = ltdc.  layerId;
       cellId = ltdc.   cellId;
    return 0;

  }

  std::vector<int> chanKey;
  chanKey.reserve(5);
  chanKey.push_back(     dduId );
  chanKey.push_back(     rosId );
  chanKey.push_back(     robId );
  chanKey.push_back(     tdcId );
  chanKey.push_back( channelId );
  int ientry;
  int searchStatus = rgBuf->find( chanKey.begin(), chanKey.end(), ientry );
  if ( !searchStatus ) {
    const DTReadOutGeometryLink& link( readOutChannelDriftTubeMap[ientry] );
      wheelId = link.  wheelId;
    stationId = link.stationId;
     sectorId = link. sectorId;
         slId = link.     slId;
      layerId = link.  layerId;
       cellId = link.   cellId;
  }

  return searchStatus;

}

Member Data Documentation

std::string DTReadOutMapping::cellMapVersion [private]

Definition at line 149 of file DTReadOutMapping.h.

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

DTBufferTree<int, std::vector<int>*>* DTReadOutMapping::grDDU [private]
DTBufferTree<int, std::vector<int>*>* DTReadOutMapping::grROB [private]
DTBufferTree<int, std::vector<int>*>* DTReadOutMapping::grROS [private]
std::string DTReadOutMapping::robMapVersion [private]

Definition at line 150 of file DTReadOutMapping.h.

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