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 Member Functions | Private Attributes | Friends
FebConnectorSpec Class Reference

#include <FebConnectorSpec.h>

Public Member Functions

void addStrips (int algo)
 add strip info More...
 
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 More...
 
const int nstrips () const
 
std::string print (int depth=0) const
 debug More...
 
const uint32_t & rawId () const
 DetUnit to which data belongs. More...
 
const ChamberStripSpec strip (int pinNumber) const
 strip info for input pin More...
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

int theAlgo
 
ChamberLocationSpec theChamber
 
FebLocationSpec theFeb
 
int theLinkBoardInputNum
 
uint32_t theRawId
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

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 23 of file FebConnectorSpec.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file FebConnectorSpec.h.

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

Definition at line 6 of file FebConnectorSpec.cc.

9  theChamber(chamber),
10  theFeb(feb),
11  theAlgo(0),
12  theRawId(0)
13 { }
FebLocationSpec theFeb
ChamberLocationSpec theChamber

Member Function Documentation

void FebConnectorSpec::addStrips ( int  algo)
inline

add strip info

Definition at line 32 of file FebConnectorSpec.h.

References ecalcalib_dqm_sourceclient-live_cfg::algo, and theAlgo.

Referenced by RPCEMap::convert().

const int FebConnectorSpec::cablePinNum ( int  istrip) const

Definition at line 50 of file FebConnectorSpec.cc.

References theAlgo.

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

50  {
51  int nStrips = theAlgo/10000;
52  if (istrip<0 || istrip>nStrips-1) return 0;
53  int pinAlgo=theAlgo%100;
54  if (pinAlgo>3) pinAlgo=pinAlgo-4;
55  bool holeatpin9=(pinAlgo==0 && istrip>6);
56  int thePin = istrip+pinAlgo+holeatpin9+2*(pinAlgo==0);
57  return thePin;
58 }
const ChamberLocationSpec& FebConnectorSpec::chamber ( ) const
inline

Definition at line 42 of file FebConnectorSpec.h.

References theChamber.

Referenced by RPCReadOutMapping::getLBforChamber(), and geometryXMLparser.CSCAlignable::index().

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

Definition at line 40 of file FebConnectorSpec.cc.

References theAlgo.

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

40  {
41  int nStrips = theAlgo/10000;
42  if (istrip<0 || istrip>nStrips-1) return 0;
43  int firstChamberStrip=(theAlgo-10000*nStrips)/100;
44  int pinAlgo=theAlgo-10000*nStrips-100*firstChamberStrip;
45  int theStrip=firstChamberStrip+istrip;
46  if (pinAlgo>3) theStrip=firstChamberStrip-istrip;
47  return theStrip;
48 }
const int FebConnectorSpec::cmsStripNum ( int  istrip) const
inline

Definition at line 49 of file FebConnectorSpec.h.

Referenced by print().

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

Definition at line 43 of file FebConnectorSpec.h.

References theFeb.

43 { return theFeb; }
FebLocationSpec theFeb
int FebConnectorSpec::linkBoardInputNum ( ) const
inline

this FEB channel in LinkBoard

Definition at line 29 of file FebConnectorSpec.h.

References theLinkBoardInputNum.

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

29 { return theLinkBoardInputNum; }
const int FebConnectorSpec::nstrips ( ) const
inline

Definition at line 45 of file FebConnectorSpec.h.

References theAlgo.

Referenced by RPCReadOutMapping::rawDataFrame().

45 { 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(), ChamberStripSpec::print(), ChamberLocationSpec::print(), FebLocationSpec::print(), rawId(), theAlgo, theChamber, and theFeb.

69 {
70  std::ostringstream str;
71  str << "FebConnectorSpec in LinkBoardNum ="<<linkBoardInputNum()
72  <<" rawId: " << rawId() <<std::endl;
73  RPCDetId aDet(rawId());
74  str<<aDet<<std::endl;
75  str << theChamber.print(depth)<< std::endl << theFeb.print(depth) ;
76  depth--;
77  if (depth >=0) {
78  int nStrips=theAlgo/10000;
79  for (int istrip=0; istrip<nStrips; istrip++) {
80  ChamberStripSpec aStrip={cablePinNum(istrip),chamberStripNum(istrip),cmsStripNum(istrip)};
81  str << aStrip.print(depth);
82  }
83  }
84  return str.str();
85 }
const int cablePinNum(int istrip) const
const uint32_t & rawId() const
DetUnit to which data belongs.
std::string print(int depth=0) const
debug printout
const int cmsStripNum(int istrip) const
const int chamberStripNum(int istrip) const
std::string print(int depth=0) const
FebLocationSpec theFeb
int linkBoardInputNum() const
this FEB channel in LinkBoard
std::string print(int depth=0) const
debug printout
ChamberLocationSpec theChamber
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().

61 {
62  DBSpecToDetUnit toDU;
63  if (!theRawId) theRawId = toDU(theChamber, theFeb);
64  return theRawId;
65 }
FebLocationSpec theFeb
ChamberLocationSpec theChamber
template<class Archive >
void FebConnectorSpec::serialize ( Archive &  ar,
const unsigned int  version 
)
private
const ChamberStripSpec FebConnectorSpec::strip ( int  pinNumber) const

strip info for input pin

Definition at line 15 of file FebConnectorSpec.cc.

References slope, and theAlgo.

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

16 {
17  int nStrips=theAlgo/10000;
18  int firstChamberStrip=(theAlgo-10000*nStrips)/100;
19  int pinAlgo=theAlgo-10000*nStrips-100*firstChamberStrip;
20  int slope=1;
21  if (pinAlgo > 3) {
22  pinAlgo=pinAlgo-4;
23  slope=-1;
24  }
25  bool valid=true;
26  if (pinNumber < pinAlgo) valid=false;
27  if (!pinAlgo && (pinNumber < 2)) valid=false;
28  if (pinAlgo && (pinNumber > pinAlgo+nStrips-1)) valid=false;
29  if (!pinAlgo && (pinNumber > nStrips+2 || pinNumber == 9)) valid=false;
30  int chamberStripNumber=-1;
31  if (valid) {
32  if (pinAlgo !=0) chamberStripNumber=firstChamberStrip+slope*(pinNumber-pinAlgo);
33  else if (pinNumber < 9) chamberStripNumber=firstChamberStrip+slope*(pinNumber-2);
34  else chamberStripNumber=firstChamberStrip+slope*(pinNumber-3);
35  }
36  ChamberStripSpec aStrip={pinNumber,chamberStripNumber,0};
37  return aStrip;
38 }
static const double slope[3]

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 65 of file FebConnectorSpec.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 65 of file FebConnectorSpec.h.

Member Data Documentation

int FebConnectorSpec::theAlgo
private

Definition at line 62 of file FebConnectorSpec.h.

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

ChamberLocationSpec FebConnectorSpec::theChamber
private

Definition at line 59 of file FebConnectorSpec.h.

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

FebLocationSpec FebConnectorSpec::theFeb
private

Definition at line 60 of file FebConnectorSpec.h.

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

int FebConnectorSpec::theLinkBoardInputNum
private

Definition at line 57 of file FebConnectorSpec.h.

Referenced by linkBoardInputNum().

uint32_t FebConnectorSpec::theRawId
mutableprivate

Definition at line 63 of file FebConnectorSpec.h.

Referenced by rawId().