CMS 3D CMS Logo

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

#include <LinkBoardSpec.h>

Public Member Functions

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

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.

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

9 {
10  theFebs.push_back(feb);
11 }
std::vector< FebConnectorSpec > theFebs
Definition: LinkBoardSpec.h:43
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().

14 {
15  //FIXME - temporary implementaion, to be replace by LUT (in preparation)
16  typedef std::vector<FebConnectorSpec>::const_iterator IT;
17  for (IT it=theFebs.begin(); it != theFebs.end(); it++) {
18  if(febInputNum==it->linkBoardInputNum()) return &(*it);
19  }
20  return 0;
21 }
std::vector< LinkConnSpec >::const_iterator IT
std::vector< FebConnectorSpec > theFebs
Definition: LinkBoardSpec.h:43
const std::vector<FebConnectorSpec>& LinkBoardSpec::febs ( ) const
inline

Definition at line 34 of file LinkBoardSpec.h.

References theFebs.

Referenced by RPCReadOutMapping::rawDataFrame().

34 { return theFebs; }
std::vector< FebConnectorSpec > theFebs
Definition: LinkBoardSpec.h:43
std::string LinkBoardSpec::linkBoardName ( ) const

LB name as in OMDS.

Definition at line 23 of file LinkBoardSpec.cc.

References theCode, and theLinkBoardNumInLink.

24 {
25  std::ostringstream lbName;
26  std::string char1Val[2]={"B","E"}; // 1,2
27  std::string char2Val[3]={"N","M","P"}; // 0,1,2
28  std::string char4Val[9]={"0","1","2","3","A","B","C","D","E"}; // 0,...,8
29  int n3=theCode%10;
30  int num3=(theCode%100)/10;
31  int n2=(theCode%1000)/100;
32  int n1=(theCode%10000)/1000;
33  int wheel=(theCode%100000)/10000;
34  if(n2==0)wheel=-wheel;
35  int sector=theCode/100000;
36  std::string sign="";
37  if(wheel>0) sign="+";
38  lbName <<"LB_R"<<char1Val[n1-1]<<sign<<wheel<<"_S"<<sector<<"_"<<char1Val[n1-1]<<char2Val[n2]<<num3<<char4Val[n3]<<"_CH"<<theLinkBoardNumInLink;
39  return lbName.str();
40 }
int theLinkBoardNumInLink
Definition: LinkBoardSpec.h:41
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().

24 { return theLinkBoardNumInLink; }
int theLinkBoardNumInLink
Definition: LinkBoardSpec.h:41
bool LinkBoardSpec::master ( )
inline

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

Definition at line 21 of file LinkBoardSpec.h.

References theMaster.

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

debud printout

Definition at line 42 of file LinkBoardSpec.cc.

References theFebs, theLinkBoardNumInLink, and theMaster.

Referenced by RPCReadOutMapping::detUnitFrame().

43 {
44  std::ostringstream str;
45  std::string type = (theMaster) ? "master" : "slave";
46  str <<" LinkBoardSpec: " << std::endl
47  <<" --->" <<type<<" linkBoardNumInLink: " << theLinkBoardNumInLink
48  << std::endl;
49  depth--;
50  if (depth >=0) {
51  typedef std::vector<FebConnectorSpec>::const_iterator IT;
52  for (IT it=theFebs.begin(); it != theFebs.end(); it++) str << (*it).print(depth);
53  }
54  return str.str();
55 }
type
Definition: HCALResponse.h:22
int theLinkBoardNumInLink
Definition: LinkBoardSpec.h:41
std::vector< LinkConnSpec >::const_iterator IT
std::vector< FebConnectorSpec > theFebs
Definition: LinkBoardSpec.h:43

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

int LinkBoardSpec::theLinkBoardNumInLink
private

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