CMS 3D CMS Logo

Public Member Functions | Private Attributes

FebConnectorSpec Class Reference

#include <FebConnectorSpec.h>

List of all members.

Public Member Functions

void addStrips (int algo)
 add strip info
const int cablePinNum (int istrip) const
const ChamberLocationSpecchamber () const
const int chamberStripNum (int istrip) const
const int cmsStripNum (int istrip) const
const FebLocationSpecfeb () const
 FebConnectorSpec (int num=-1)
 FebConnectorSpec (int num, const ChamberLocationSpec &chamber, const FebLocationSpec &feb)
int linkBoardInputNum () const
 this FEB channel in LinkBoard
const int nstrips () const
std::string print (int depth=0) const
 debug
const uint32_t & rawId () const
 DetUnit to which data belongs.
const ChamberStripSpec strip (int pinNumber) const
 strip info for input pin

Private Attributes

int theAlgo
ChamberLocationSpec theChamber
FebLocationSpec theFeb
int theLinkBoardInputNum
uint32_t theRawId

Detailed Description

Specifies the input for LinkBoard. In hardware the data goes through FEB connector which collects data from input strips. This class provides access to strip on one side and DetUnit location (through ChamberLocationSpec and FebSpec info) on the other side.

FIXME - afer debug fill theRawId in constructor and remove theChamber,theFeb

Definition at line 21 of file FebConnectorSpec.h.


Constructor & Destructor Documentation

FebConnectorSpec::FebConnectorSpec ( int  num = -1) [inline]

Definition at line 23 of file FebConnectorSpec.h.

FebConnectorSpec::FebConnectorSpec ( int  num,
const ChamberLocationSpec chamber,
const FebLocationSpec feb 
)

Definition at line 6 of file FebConnectorSpec.cc.

  : theLinkBoardInputNum(num),
    theChamber(chamber),
    theFeb(feb),
    theAlgo(0),
    theRawId(0)
{ }

Member Function Documentation

void FebConnectorSpec::addStrips ( int  algo) [inline]

add strip info

Definition at line 30 of file FebConnectorSpec.h.

References theAlgo.

Referenced by RPCEMap::convert().

                           {
    theAlgo = algo;
  }
const int FebConnectorSpec::cablePinNum ( int  istrip) const

Definition at line 50 of file FebConnectorSpec.cc.

References theAlgo.

Referenced by print(), and RPCReadOutMapping::rawDataFrame().

                                                        {
  int nStrips = theAlgo/10000;
  if (istrip<0 || istrip>nStrips-1) return 0;
  int pinAlgo=theAlgo%100;
  if (pinAlgo>3) pinAlgo=pinAlgo-4;
  bool holeatpin9=(pinAlgo==0 && istrip>6);
  int thePin = istrip+pinAlgo+holeatpin9+2*(pinAlgo==0);
  return thePin;
}
const ChamberLocationSpec& FebConnectorSpec::chamber ( ) const [inline]

Definition at line 40 of file FebConnectorSpec.h.

References theChamber.

Referenced by RPCReadOutMapping::getLBforChamber().

{ return theChamber; }
const int FebConnectorSpec::chamberStripNum ( int  istrip) const

Definition at line 40 of file FebConnectorSpec.cc.

References theAlgo.

Referenced by print(), and RPCReadOutMapping::rawDataFrame().

                                                            {
  int nStrips = theAlgo/10000;
  if (istrip<0 || istrip>nStrips-1) return 0;
  int firstChamberStrip=(theAlgo-10000*nStrips)/100;
  int pinAlgo=theAlgo-10000*nStrips-100*firstChamberStrip;
  int theStrip=firstChamberStrip+istrip;
  if (pinAlgo>3) theStrip=firstChamberStrip-istrip;
  return theStrip;
}
const int FebConnectorSpec::cmsStripNum ( int  istrip) const [inline]

Definition at line 47 of file FebConnectorSpec.h.

Referenced by print().

{ return 0; }
const FebLocationSpec& FebConnectorSpec::feb ( ) const [inline]

Definition at line 41 of file FebConnectorSpec.h.

References theFeb.

{ return theFeb; }
int FebConnectorSpec::linkBoardInputNum ( ) const [inline]

this FEB channel in LinkBoard

Definition at line 27 of file FebConnectorSpec.h.

References theLinkBoardInputNum.

Referenced by print(), and RPCReadOutMapping::rawDataFrame().

const int FebConnectorSpec::nstrips ( ) const [inline]

Definition at line 43 of file FebConnectorSpec.h.

References theAlgo.

Referenced by RPCReadOutMapping::rawDataFrame().

{ return theAlgo/10000; }
std::string FebConnectorSpec::print ( int  depth = 0) const

debug

Definition at line 68 of file FebConnectorSpec.cc.

References cablePinNum(), chamberStripNum(), cmsStripNum(), linkBoardInputNum(), FebLocationSpec::print(), ChamberLocationSpec::print(), ChamberStripSpec::print(), rawId(), theAlgo, theChamber, and theFeb.

{
  std::ostringstream str;
  str << "FebConnectorSpec in LinkBoardNum ="<<linkBoardInputNum()
      <<" rawId: " << rawId() <<std::endl;
  RPCDetId aDet(rawId());
  str<<aDet<<std::endl;
  str << theChamber.print(depth)<< std::endl << theFeb.print(depth) ;
  depth--;
  if (depth >=0) {
    int nStrips=theAlgo/10000;
    for (int istrip=0; istrip<nStrips; istrip++) {
      ChamberStripSpec aStrip={cablePinNum(istrip),chamberStripNum(istrip),cmsStripNum(istrip)};
      str << aStrip.print(depth); 
    }
  }
  return str.str();
}
const uint32_t & FebConnectorSpec::rawId ( ) const

DetUnit to which data belongs.

Definition at line 60 of file FebConnectorSpec.cc.

References theChamber, theFeb, and theRawId.

Referenced by RPCReadOutMapping::detUnitFrame(), RPCReadOutMapping::getRAWSpecForCMSChamberSrip(), print(), and RPCReadOutMapping::rawDataFrame().

{
  DBSpecToDetUnit toDU;
  if (!theRawId)  theRawId = toDU(theChamber, theFeb);
  return theRawId;
}
const ChamberStripSpec FebConnectorSpec::strip ( int  pinNumber) const

strip info for input pin

Definition at line 15 of file FebConnectorSpec.cc.

References slope, theAlgo, and TrackValidation_HighPurity_cff::valid.

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

{
  int nStrips=theAlgo/10000;
  int firstChamberStrip=(theAlgo-10000*nStrips)/100;
  int pinAlgo=theAlgo-10000*nStrips-100*firstChamberStrip;
  int slope=1;
  if (pinAlgo > 3) {
    pinAlgo=pinAlgo-4;
    slope=-1;
  }
  bool valid=true;
  if (pinNumber < pinAlgo) valid=false;
  if (!pinAlgo && (pinNumber < 2)) valid=false;
  if (pinAlgo && (pinNumber > pinAlgo+nStrips-1)) valid=false;
  if (!pinAlgo && (pinNumber > nStrips+2 || pinNumber == 9)) valid=false;
  int chamberStripNumber=-1;
  if (valid) {
    if (pinAlgo !=0) chamberStripNumber=firstChamberStrip+slope*(pinNumber-pinAlgo);
    else if (pinNumber < 9) chamberStripNumber=firstChamberStrip+slope*(pinNumber-2);
    else chamberStripNumber=firstChamberStrip+slope*(pinNumber-3);
  }
  ChamberStripSpec aStrip={pinNumber,chamberStripNumber,0};
  return aStrip;
}

Member Data Documentation

Definition at line 60 of file FebConnectorSpec.h.

Referenced by addStrips(), cablePinNum(), chamberStripNum(), nstrips(), print(), and strip().

Definition at line 57 of file FebConnectorSpec.h.

Referenced by chamber(), print(), and rawId().

Definition at line 58 of file FebConnectorSpec.h.

Referenced by feb(), print(), and rawId().

Definition at line 55 of file FebConnectorSpec.h.

Referenced by linkBoardInputNum().

uint32_t FebConnectorSpec::theRawId [mutable, private]

Definition at line 61 of file FebConnectorSpec.h.

Referenced by rawId().