CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions

DTCompactMapPluginHandler Class Reference

#include <DTCompactMapPluginHandler.h>

Inheritance diagram for DTCompactMapPluginHandler:
DTCompactMapAbstractHandler

List of all members.

Public Member Functions

virtual DTReadOutMappingexpandMap (const DTReadOutMapping &compMap)
 expand compact map
virtual ~DTCompactMapPluginHandler ()

Static Public Member Functions

static void build ()
 build static object

Private Member Functions

 DTCompactMapPluginHandler ()
 DTCompactMapPluginHandler (const DTCompactMapPluginHandler &x)
const DTCompactMapPluginHandleroperator= (const DTCompactMapPluginHandler &x)

Detailed Description

Description: Class to hold configuration identifier for chambers

Date:
2011/02/08 15:46:42
Revision:
1.1
Author:
Paolo Ronchese INFN Padova

Definition at line 33 of file DTCompactMapPluginHandler.h.


Constructor & Destructor Documentation

DTCompactMapPluginHandler::~DTCompactMapPluginHandler ( ) [virtual]

Destructor

Definition at line 46 of file DTCompactMapPluginHandler.cc.

                                                      {
}
DTCompactMapPluginHandler::DTCompactMapPluginHandler ( ) [private]

Constructor

Definition at line 33 of file DTCompactMapPluginHandler.cc.

Referenced by build().

                                                     {
//  std::cout << "===================================" << std::endl;
//  std::cout << "=                                 =" << std::endl;
//  std::cout << "=  new DTCompactMapPluginHandler  =" << std::endl;
//  std::cout << "=                                 =" << std::endl;
//  std::cout << "===================================" << std::endl;
//  if ( instance == 0 ) instance = this;
}
DTCompactMapPluginHandler::DTCompactMapPluginHandler ( const DTCompactMapPluginHandler x) [private]

Member Function Documentation

void DTCompactMapPluginHandler::build ( ) [static]

build static object

Operations

Definition at line 53 of file DTCompactMapPluginHandler.cc.

References DTCompactMapPluginHandler(), and DTCompactMapAbstractHandler::instance.

DTReadOutMapping * DTCompactMapPluginHandler::expandMap ( const DTReadOutMapping compMap) [virtual]

expand compact map

Reimplemented from DTCompactMapAbstractHandler.

Definition at line 58 of file DTCompactMapPluginHandler.cc.

References DTReadOutMapping::begin(), DTReadOutGeometryLink::cellId, DTReadOutGeometryLink::channelId, gather_cfg::cout, DTReadOutGeometryLink::dduId, def, DTReadOutMapping::end(), DTReadOutMapping::insertReadOutGeometryLink(), DTReadOutGeometryLink::layerId, DTReadOutMapping::mapCellTdc(), DTReadOutMapping::mapRobRos(), DTReadOutGeometryLink::robId, DTReadOutGeometryLink::rosId, DTReadOutGeometryLink::sectorId, DTReadOutGeometryLink::slId, DTReadOutGeometryLink::stationId, DTReadOutGeometryLink::tdcId, and DTReadOutGeometryLink::wheelId.

                                                                                        {
  std::vector<DTReadOutGeometryLink> entryList;
  DTReadOutMapping::const_iterator compIter = compMap.begin();
  DTReadOutMapping::const_iterator compIend = compMap.end();
  while ( compIter != compIend ) entryList.push_back( *compIter++ );

  std::string
  rosMap = "expand_";
  rosMap += compMap.mapRobRos();
  std::string
  tdcMap = "expand_";
  tdcMap += compMap.mapCellTdc();
  DTReadOutMapping* fullMap = new DTReadOutMapping( tdcMap, rosMap );
  int ddu;
  int ros;
  int rch;
  int tdc;
  int tch;
  int whe;
  int sta;
  int sec;
  int rob;
  int qua;
  int lay;
  int cel;
  int mt1;
  int mi1;
  int mt2;
  int mi2;
  int def;
  int wha;
  int sea;
  std::vector<DTReadOutGeometryLink>::const_iterator iter = entryList.begin();
  std::vector<DTReadOutGeometryLink>::const_iterator iend = entryList.end();
  std::vector<DTReadOutGeometryLink>::const_iterator iros = entryList.end();
  std::vector<DTReadOutGeometryLink>::const_iterator irob = entryList.end();
  std::vector<DTReadOutGeometryLink>::const_iterator itdc = entryList.end();
  while ( iter != iend ) {
    const DTReadOutGeometryLink& rosEntry( *iter++ );
    if ( rosEntry.dduId > 0x3fffffff ) continue;
    ddu = rosEntry.dduId;
    ros = rosEntry.rosId;
    whe = rosEntry.wheelId;
    def = rosEntry.stationId;
    sec = rosEntry.sectorId;
    rob = rosEntry.slId;
    mt1 = rosEntry.layerId;
    mi1 = rosEntry.cellId;
    iros = entryList.begin();
    while ( iros != iend ) {
      wha = whe;
      sea = sec;
      const DTReadOutGeometryLink& rchEntry( *iros++ );
      if ( ( rchEntry.dduId != mt1 ) ||
           ( rchEntry.rosId != mi1 ) ) continue;
      rch =  rchEntry.robId;
      if (   rchEntry.wheelId != def   ) wha = rchEntry.wheelId;
      sta =  rchEntry.stationId;
      if (   rchEntry.sectorId != def   ) sea = rchEntry.sectorId;
      rob =  rchEntry.slId;
      mt2 =  rchEntry.layerId;
      mi2 =  rchEntry.cellId;
      irob = entryList.begin();
      while ( irob != iend ) {
        const DTReadOutGeometryLink& robEntry( *irob++ );
        if ( ( robEntry.dduId != mt2 ) ||
             ( robEntry.rosId != mi2 ) ) continue;
        if (   robEntry.robId != rob   ) {
          std::cout << "ROB mismatch " << rob << " "
                                       << robEntry.robId << std::endl;
        }
        tdc =  robEntry.tdcId;
        tch =  robEntry.channelId;
        qua =  robEntry.slId;
        lay =  robEntry.layerId;
        cel =  robEntry.cellId;
        fullMap->insertReadOutGeometryLink( ddu, ros, rob, tdc, tch,
                                                 wha, sta, sea,
                                                 qua, lay, cel );

      }
    }
  }
  return fullMap;
}
const DTCompactMapPluginHandler& DTCompactMapPluginHandler::operator= ( const DTCompactMapPluginHandler x) [private]