CMS 3D CMS Logo

Public Member Functions | Private Attributes

LinkBoardSpec Class Reference

#include <LinkBoardSpec.h>

List of all members.

Public Member Functions

void add (const FebConnectorSpec &feb)
 attach feb
const FebConnectorSpecfeb (int febInputNum) const
 get Feb by its connection number to this board
const std::vector
< FebConnectorSpec > & 
febs () const
std::string linkBoardName () const
 LB name as in OMDS.
int linkBoardNumInLink () const
 this LB number in link
 LinkBoardSpec ()
 dummy
 LinkBoardSpec (bool master, int linkBoardNumInLin, int lbCode)
bool master ()
 true if master LB (is it of any use?)
std::string print (int depth=0) const
 debud printout

Private Attributes

int theCode
std::vector< FebConnectorSpectheFebs
int theLinkBoardNumInLink
bool theMaster

Detailed Description

RPC LinkBoard Specification for readout decoding. Provide chamber location specification (as in DB throught FEBs)

Definition at line 11 of file LinkBoardSpec.h.


Constructor & Destructor Documentation

LinkBoardSpec::LinkBoardSpec ( ) [inline]

dummy

Definition at line 14 of file LinkBoardSpec.h.

{}
LinkBoardSpec::LinkBoardSpec ( bool  master,
int  linkBoardNumInLin,
int  lbCode 
)

real ctor specifyig LB if this LB is master, its number in link, and which chamber it is serving

Definition at line 5 of file LinkBoardSpec.cc.


Member Function Documentation

void LinkBoardSpec::add ( const FebConnectorSpec feb)

attach feb

Definition at line 8 of file LinkBoardSpec.cc.

References theFebs.

Referenced by RPCEMap::convert().

{
  theFebs.push_back(feb);
}
const FebConnectorSpec * LinkBoardSpec::feb ( int  febInputNum) const

get Feb by its connection number to this board

Definition at line 13 of file LinkBoardSpec.cc.

References theFebs.

Referenced by RPCReadOutMapping::detUnitFrame(), RPCReadOutMapping::getLBforChamber(), and RPCReadOutMapping::getRAWSpecForCMSChamberSrip().

{
  //FIXME - temporary implementaion, to be replace by LUT (in preparation)
  typedef std::vector<FebConnectorSpec>::const_iterator IT;
  for (IT it=theFebs.begin(); it != theFebs.end(); it++) {
    if(febInputNum==it->linkBoardInputNum()) return &(*it);
  }
  return 0;
}
const std::vector<FebConnectorSpec>& LinkBoardSpec::febs ( ) const [inline]

Definition at line 34 of file LinkBoardSpec.h.

References theFebs.

Referenced by RPCReadOutMapping::rawDataFrame().

{ return theFebs; }
std::string LinkBoardSpec::linkBoardName ( ) const

LB name as in OMDS.

Definition at line 23 of file LinkBoardSpec.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, theCode, and theLinkBoardNumInLink.

{
  std::ostringstream lbName;
  std::string char1Val[2]={"B","E"};                              // 1,2
  std::string char2Val[3]={"N","M","P"};                          // 0,1,2
  std::string char4Val[9]={"0","1","2","3","A","B","C","D","E"};  // 0,...,8
  int n3=theCode%10;
  int num3=(theCode%100)/10;
  int n2=(theCode%1000)/100;
  int n1=(theCode%10000)/1000;
  int wheel=(theCode%100000)/10000;
  if(n2==0)wheel=-wheel;
  int sector=theCode/100000;
  std::string sign="";
  if(wheel>0) sign="+";
  lbName <<"LB_R"<<char1Val[n1-1]<<sign<<wheel<<"_S"<<sector<<"_"<<char1Val[n1-1]<<char2Val[n2]<<num3<<char4Val[n3]<<"_CH"<<theLinkBoardNumInLink;
  return lbName.str();
}
int LinkBoardSpec::linkBoardNumInLink ( ) const [inline]

this LB number in link

Definition at line 24 of file LinkBoardSpec.h.

References theLinkBoardNumInLink.

Referenced by RPCReadOutMappingWithFastSearch::init(), and RPCReadOutMapping::rawDataFrame().

bool LinkBoardSpec::master ( ) [inline]

true if master LB (is it of any use?)

Definition at line 21 of file LinkBoardSpec.h.

References theMaster.

{ return theMaster; }
std::string LinkBoardSpec::print ( int  depth = 0) const

debud printout

Definition at line 42 of file LinkBoardSpec.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, theFebs, theLinkBoardNumInLink, and theMaster.

Referenced by RPCReadOutMapping::detUnitFrame().

{
  std::ostringstream str;
  std::string type = (theMaster) ? "master" : "slave";
  str <<" LinkBoardSpec: " << std::endl
            <<" --->" <<type<<" linkBoardNumInLink: " << theLinkBoardNumInLink 
            << std::endl;
  depth--;
  if (depth >=0) {
    typedef std::vector<FebConnectorSpec>::const_iterator IT;
    for (IT it=theFebs.begin(); it != theFebs.end(); it++) str << (*it).print(depth);
  }
  return str.str();
}

Member Data Documentation

int LinkBoardSpec::theCode [private]

Definition at line 42 of file LinkBoardSpec.h.

Referenced by linkBoardName().

std::vector<FebConnectorSpec> LinkBoardSpec::theFebs [private]

Definition at line 43 of file LinkBoardSpec.h.

Referenced by add(), feb(), febs(), and print().

Definition at line 41 of file LinkBoardSpec.h.

Referenced by linkBoardName(), linkBoardNumInLink(), and print().

bool LinkBoardSpec::theMaster [private]

Definition at line 40 of file LinkBoardSpec.h.

Referenced by master(), and print().