CMS 3D CMS Logo

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)
 
 FebConnectorSpec (FebConnectorSpec const &)
 
int linkBoardInputNum () const
 this FEB channel in LinkBoard More...
 
const int nstrips () const
 
FebConnectorSpecoperator= (FebConnectorSpec const &)
 
std::string print (int depth=0) const
 debug More...
 
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
 
std::atomic< 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 24 of file FebConnectorSpec.h.

Constructor & Destructor Documentation

◆ FebConnectorSpec() [1/3]

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

Definition at line 26 of file FebConnectorSpec.h.

◆ FebConnectorSpec() [2/3]

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

Definition at line 6 of file FebConnectorSpec.cc.

std::atomic< uint32_t > theRawId
const ChamberLocationSpec & chamber() const
FebLocationSpec theFeb
ChamberLocationSpec theChamber
const FebLocationSpec & feb() const

◆ FebConnectorSpec() [3/3]

FebConnectorSpec::FebConnectorSpec ( FebConnectorSpec const &  iOther)

Definition at line 9 of file FebConnectorSpec.cc.

10  : theLinkBoardInputNum(iOther.theLinkBoardInputNum),
11  theChamber(iOther.theChamber),
12  theFeb(iOther.theFeb),
13  theAlgo(iOther.theAlgo),
14  theRawId(iOther.theRawId.load()) {}
std::atomic< uint32_t > theRawId
FebLocationSpec theFeb
ChamberLocationSpec theChamber

Member Function Documentation

◆ addStrips()

void FebConnectorSpec::addStrips ( int  algo)
inline

add strip info

Definition at line 36 of file FebConnectorSpec.h.

References theAlgo.

Referenced by RPCEMap::convert().

◆ cablePinNum()

const int FebConnectorSpec::cablePinNum ( int  istrip) const

Definition at line 68 of file FebConnectorSpec.cc.

References me0TriggerPseudoDigis_cff::nStrips, and theAlgo.

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

68  {
69  int nStrips = theAlgo / 10000;
70  if (istrip < 0 || istrip > nStrips - 1)
71  return 0;
72  int pinAlgo = theAlgo % 100;
73  if (pinAlgo > 3)
74  pinAlgo = pinAlgo - 4;
75  bool holeatpin9 = (pinAlgo == 0 && istrip > 6);
76  int thePin = istrip + pinAlgo + holeatpin9 + 2 * (pinAlgo == 0);
77  return thePin;
78 }
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...

◆ chamber()

const ChamberLocationSpec& FebConnectorSpec::chamber ( ) const
inline

Definition at line 44 of file FebConnectorSpec.h.

References theChamber.

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

44 { return theChamber; }
ChamberLocationSpec theChamber

◆ chamberStripNum()

const int FebConnectorSpec::chamberStripNum ( int  istrip) const

Definition at line 56 of file FebConnectorSpec.cc.

References me0TriggerPseudoDigis_cff::nStrips, and theAlgo.

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

56  {
57  int nStrips = theAlgo / 10000;
58  if (istrip < 0 || istrip > nStrips - 1)
59  return 0;
60  int firstChamberStrip = (theAlgo - 10000 * nStrips) / 100;
61  int pinAlgo = theAlgo - 10000 * nStrips - 100 * firstChamberStrip;
62  int theStrip = firstChamberStrip + istrip;
63  if (pinAlgo > 3)
64  theStrip = firstChamberStrip - istrip;
65  return theStrip;
66 }
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...

◆ cmsStripNum()

const int FebConnectorSpec::cmsStripNum ( int  istrip) const
inline

Definition at line 51 of file FebConnectorSpec.h.

Referenced by print().

51 { return 0; }

◆ feb()

const FebLocationSpec& FebConnectorSpec::feb ( ) const
inline

Definition at line 45 of file FebConnectorSpec.h.

References theFeb.

45 { return theFeb; }
FebLocationSpec theFeb

◆ linkBoardInputNum()

int FebConnectorSpec::linkBoardInputNum ( ) const
inline

this FEB channel in LinkBoard

Definition at line 33 of file FebConnectorSpec.h.

References theLinkBoardInputNum.

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

33 { return theLinkBoardInputNum; }

◆ nstrips()

const int FebConnectorSpec::nstrips ( ) const
inline

Definition at line 47 of file FebConnectorSpec.h.

References theAlgo.

Referenced by RPCReadOutMapping::rawDataFrame().

47 { return theAlgo / 10000; }

◆ operator=()

FebConnectorSpec & FebConnectorSpec::operator= ( FebConnectorSpec const &  iOther)

Definition at line 16 of file FebConnectorSpec.cc.

References theAlgo, theChamber, theFeb, theLinkBoardInputNum, and theRawId.

16  {
17  theLinkBoardInputNum = iOther.theLinkBoardInputNum;
18  theChamber = iOther.theChamber;
19  theFeb = iOther.theFeb;
20  theAlgo = iOther.theAlgo;
21  theRawId.store(iOther.theRawId.load());
22  return *this;
23 }
std::atomic< uint32_t > theRawId
FebLocationSpec theFeb
ChamberLocationSpec theChamber

◆ print()

std::string FebConnectorSpec::print ( int  depth = 0) const

debug

Definition at line 89 of file FebConnectorSpec.cc.

References cablePinNum(), chamberStripNum(), cmsStripNum(), hcalRecHitTable_cff::depth, linkBoardInputNum(), me0TriggerPseudoDigis_cff::nStrips, ChamberStripSpec::print(), FebLocationSpec::print(), ChamberLocationSpec::print(), rawId(), str, theAlgo, theChamber, and theFeb.

89  {
90  std::ostringstream str;
91  str << "FebConnectorSpec in LinkBoardNum =" << linkBoardInputNum() << " rawId: " << rawId() << std::endl;
92  RPCDetId aDet(rawId());
93  str << aDet << std::endl;
94  str << theChamber.print(depth) << std::endl << theFeb.print(depth);
95  depth--;
96  if (depth >= 0) {
97  int nStrips = theAlgo / 10000;
98  for (int istrip = 0; istrip < nStrips; istrip++) {
99  ChamberStripSpec aStrip = {cablePinNum(istrip), chamberStripNum(istrip), cmsStripNum(istrip)};
100  str << aStrip.print(depth);
101  }
102  }
103  return str.str();
104 }
uint32_t rawId() const
DetUnit to which data belongs.
std::string print(int depth=0) const
debug printout
std::string print(int depth=0) const
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
int linkBoardInputNum() const
this FEB channel in LinkBoard
const int cmsStripNum(int istrip) const
FebLocationSpec theFeb
ChamberLocationSpec theChamber
std::string print(int depth=0) const
debug printout
const int chamberStripNum(int istrip) const
const int cablePinNum(int istrip) const
#define str(s)

◆ rawId()

uint32_t FebConnectorSpec::rawId ( ) const

DetUnit to which data belongs.

Definition at line 80 of file FebConnectorSpec.cc.

References theChamber, theFeb, and theRawId.

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

80  {
81  DBSpecToDetUnit toDU;
82  if (!theRawId) {
83  uint32_t expected = 0;
84  theRawId.compare_exchange_strong(expected, toDU(theChamber, theFeb));
85  }
86  return theRawId.load();
87 }
std::atomic< uint32_t > theRawId
FebLocationSpec theFeb
ChamberLocationSpec theChamber

◆ serialize()

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

◆ strip()

const ChamberStripSpec FebConnectorSpec::strip ( int  pinNumber) const

strip info for input pin

Definition at line 25 of file FebConnectorSpec.cc.

References me0TriggerPseudoDigis_cff::nStrips, slope, theAlgo, and validateGeometry_cfg::valid.

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

25  {
26  int nStrips = theAlgo / 10000;
27  int firstChamberStrip = (theAlgo - 10000 * nStrips) / 100;
28  int pinAlgo = theAlgo - 10000 * nStrips - 100 * firstChamberStrip;
29  int slope = 1;
30  if (pinAlgo > 3) {
31  pinAlgo = pinAlgo - 4;
32  slope = -1;
33  }
34  bool valid = true;
35  if (pinNumber < pinAlgo)
36  valid = false;
37  if (!pinAlgo && (pinNumber < 2))
38  valid = false;
39  if (pinAlgo && (pinNumber > pinAlgo + nStrips - 1))
40  valid = false;
41  if (!pinAlgo && (pinNumber > nStrips + 2 || pinNumber == 9))
42  valid = false;
43  int chamberStripNumber = -1;
44  if (valid) {
45  if (pinAlgo != 0)
46  chamberStripNumber = firstChamberStrip + slope * (pinNumber - pinAlgo);
47  else if (pinNumber < 9)
48  chamberStripNumber = firstChamberStrip + slope * (pinNumber - 2);
49  else
50  chamberStripNumber = firstChamberStrip + slope * (pinNumber - 3);
51  }
52  ChamberStripSpec aStrip = {pinNumber, chamberStripNumber, 0};
53  return aStrip;
54 }
static const double slope[3]
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 67 of file FebConnectorSpec.h.

◆ cond::serialization::access

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

Definition at line 67 of file FebConnectorSpec.h.

Member Data Documentation

◆ theAlgo

int FebConnectorSpec::theAlgo
private

◆ theChamber

ChamberLocationSpec FebConnectorSpec::theChamber
private

Definition at line 61 of file FebConnectorSpec.h.

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

◆ theFeb

FebLocationSpec FebConnectorSpec::theFeb
private

Definition at line 62 of file FebConnectorSpec.h.

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

◆ theLinkBoardInputNum

int FebConnectorSpec::theLinkBoardInputNum
private

Definition at line 59 of file FebConnectorSpec.h.

Referenced by linkBoardInputNum(), and operator=().

◆ theRawId

std::atomic<uint32_t> FebConnectorSpec::theRawId
mutableprivate

Definition at line 65 of file FebConnectorSpec.h.

Referenced by operator=(), and rawId().