CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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.

7  : theLinkBoardInputNum(num), theChamber(chamber), theFeb(feb), theAlgo(0), theRawId(0) {}
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 theAlgo.

Referenced by RPCEMap::convert().

const int FebConnectorSpec::cablePinNum ( int  istrip) const

Definition at line 52 of file FebConnectorSpec.cc.

References me0TriggerPseudoDigis_cff::nStrips, and theAlgo.

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

52  {
53  int nStrips = theAlgo / 10000;
54  if (istrip < 0 || istrip > nStrips - 1)
55  return 0;
56  int pinAlgo = theAlgo % 100;
57  if (pinAlgo > 3)
58  pinAlgo = pinAlgo - 4;
59  bool holeatpin9 = (pinAlgo == 0 && istrip > 6);
60  int thePin = istrip + pinAlgo + holeatpin9 + 2 * (pinAlgo == 0);
61  return thePin;
62 }
tuple nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
const ChamberLocationSpec& FebConnectorSpec::chamber ( ) const
inline

Definition at line 40 of file FebConnectorSpec.h.

References theChamber.

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

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

Definition at line 40 of file FebConnectorSpec.cc.

References me0TriggerPseudoDigis_cff::nStrips, and theAlgo.

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

40  {
41  int nStrips = theAlgo / 10000;
42  if (istrip < 0 || istrip > nStrips - 1)
43  return 0;
44  int firstChamberStrip = (theAlgo - 10000 * nStrips) / 100;
45  int pinAlgo = theAlgo - 10000 * nStrips - 100 * firstChamberStrip;
46  int theStrip = firstChamberStrip + istrip;
47  if (pinAlgo > 3)
48  theStrip = firstChamberStrip - istrip;
49  return theStrip;
50 }
tuple nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
const int FebConnectorSpec::cmsStripNum ( int  istrip) const
inline

Definition at line 47 of file FebConnectorSpec.h.

Referenced by print().

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

Definition at line 41 of file FebConnectorSpec.h.

References theFeb.

41 { 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 43 of file FebConnectorSpec.h.

References theAlgo.

Referenced by RPCReadOutMapping::rawDataFrame().

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

debug

Definition at line 71 of file FebConnectorSpec.cc.

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

71  {
72  std::ostringstream str;
73  str << "FebConnectorSpec in LinkBoardNum =" << linkBoardInputNum() << " rawId: " << rawId() << std::endl;
74  RPCDetId aDet(rawId());
75  str << aDet << std::endl;
76  str << theChamber.print(depth) << std::endl << theFeb.print(depth);
77  depth--;
78  if (depth >= 0) {
79  int nStrips = theAlgo / 10000;
80  for (int istrip = 0; istrip < nStrips; istrip++) {
81  ChamberStripSpec aStrip = {cablePinNum(istrip), chamberStripNum(istrip), cmsStripNum(istrip)};
82  str << aStrip.print(depth);
83  }
84  }
85  return str.str();
86 }
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
tuple nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
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
#define str(s)
const uint32_t & FebConnectorSpec::rawId ( ) const

DetUnit to which data belongs.

Definition at line 64 of file FebConnectorSpec.cc.

References theChamber, theFeb, and theRawId.

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

64  {
65  DBSpecToDetUnit toDU;
66  if (!theRawId)
67  theRawId = toDU(theChamber, theFeb);
68  return theRawId;
69 }
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 9 of file FebConnectorSpec.cc.

References me0TriggerPseudoDigis_cff::nStrips, slope, and theAlgo.

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

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

friend class boost::serialization::access
friend

Definition at line 63 of file FebConnectorSpec.h.

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

Definition at line 63 of file FebConnectorSpec.h.

Member Data Documentation

int FebConnectorSpec::theAlgo
private

Definition at line 60 of file FebConnectorSpec.h.

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

ChamberLocationSpec FebConnectorSpec::theChamber
private

Definition at line 57 of file FebConnectorSpec.h.

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

FebLocationSpec FebConnectorSpec::theFeb
private

Definition at line 58 of file FebConnectorSpec.h.

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

int FebConnectorSpec::theLinkBoardInputNum
private

Definition at line 55 of file FebConnectorSpec.h.

Referenced by linkBoardInputNum().

uint32_t FebConnectorSpec::theRawId
mutableprivate

Definition at line 61 of file FebConnectorSpec.h.

Referenced by rawId().