CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Friends
TotemFramePosition Class Reference

#include <TotemFramePosition.h>

Public Member Functions

unsigned short getFEDId () const
 recomended getters and setters More...
 
unsigned short getGOHId () const
 
unsigned short getIdxInFiber () const
 
unsigned short getOptoRxId () const
 
unsigned int getRawPosition () const
 don't use this method unless you have a good reason More...
 
unsigned short getSubSystemId () const
 the getters and setters below are deprecated More...
 
unsigned short getTOTFEDId () const
 
bool operator< (const TotemFramePosition &pos) const
 
bool operator== (const TotemFramePosition &pos) const
 
void printXML ()
 prints XML formatted DAQ channel to stdout More...
 
void setFEDId (unsigned short v)
 
void setGOHId (unsigned short v)
 
void setIdxInFiber (unsigned short v)
 
void setOptoRxId (unsigned short v)
 
void setSubSystemId (unsigned short v)
 
void setTOTFEDId (unsigned short v)
 
unsigned char setXMLAttribute (const std::string &attribute, const std::string &value, unsigned char &flag)
 
 TotemFramePosition (unsigned int pos=0)
 don't use this constructor unless you have a good reason More...
 
 TotemFramePosition (unsigned short SubSystemId, unsigned short TOTFEDId, unsigned short OptoRxId, unsigned short GOHId, unsigned short IdxInFiber)
 the preferred constructor More...
 
 ~TotemFramePosition ()
 

Static Public Member Functions

static bool checkXMLAttributeFlag (unsigned char flag)
 returns true if all attributes have been set More...
 

Static Public Attributes

static const unsigned int maskFEDId = 0x3FF
 
static const unsigned int maskGOHId = 0xF
 
static const unsigned int maskIdxInFiber = 0xF
 
static const unsigned int maskOptoRxId = 0x3
 
static const unsigned int maskSubSystemId = 0x7
 
static const unsigned int maskTOTFEDId = 0x1F
 
static const unsigned int offsetFEDId = 8
 
static const unsigned int offsetGOHId = 4
 
static const unsigned int offsetIdxInFiber = 0
 
static const unsigned int offsetOptoRxId = 8
 
static const unsigned int offsetSubSystemId = 15
 
static const unsigned int offsetTOTFEDId = 10
 

Protected Attributes

unsigned int rawPosition
 

Friends

std::ostream & operator<< (std::ostream &s, const TotemFramePosition &fp)
 

Detailed Description

Uniquely identifies the DAQ channel through which a VFAT frame has been received.

The internal representation has the following structure:

* |                   32 bits raw position                    |
* | 12 bits | 2 bits |  10 bits | 4 bits |       4 bits       |
* |  empty  | empty  |  FED ID  | GOH ID | index within fiber |
* 

In the old (TOTEM only) scheme, the FED ID was further split

* |  3 bits   |  5 bits   |  2 bits   |
* | SubSystem | TOTFED ID | OptoRx ID |
* 

IMPORTANT: This splitting is only supported for backward compatibility and should not be used anymore.

Definition at line 31 of file TotemFramePosition.h.

Constructor & Destructor Documentation

◆ TotemFramePosition() [1/2]

TotemFramePosition::TotemFramePosition ( unsigned short  SubSystemId,
unsigned short  TOTFEDId,
unsigned short  OptoRxId,
unsigned short  GOHId,
unsigned short  IdxInFiber 
)
inline

the preferred constructor

Definition at line 47 of file TotemFramePosition.h.

48  : rawPosition(IdxInFiber << offsetIdxInFiber | GOHId << offsetGOHId | OptoRxId << offsetOptoRxId |
49  TOTFEDId << offsetTOTFEDId | SubSystemId << offsetSubSystemId) {}
50 
52  TotemFramePosition(unsigned int pos = 0) : rawPosition(pos) {}
53 

◆ TotemFramePosition() [2/2]

TotemFramePosition::TotemFramePosition ( unsigned int  pos = 0)
inline

don't use this constructor unless you have a good reason

Definition at line 56 of file TotemFramePosition.h.

58 { return (rawPosition >> offsetFEDId) & maskFEDId; }

◆ ~TotemFramePosition()

TotemFramePosition::~TotemFramePosition ( )
inline

Definition at line 58 of file TotemFramePosition.h.

58 { return (rawPosition >> offsetFEDId) & maskFEDId; }

References maskFEDId, offsetFEDId, and rawPosition.

Member Function Documentation

◆ checkXMLAttributeFlag()

static bool TotemFramePosition::checkXMLAttributeFlag ( unsigned char  flag)
inlinestatic

returns true if all attributes have been set

Definition at line 133 of file TotemFramePosition.h.

◆ getFEDId()

unsigned short TotemFramePosition::getFEDId ( ) const
inline

recomended getters and setters

Definition at line 62 of file TotemFramePosition.h.

66 { return (rawPosition >> offsetGOHId) & maskGOHId; }

◆ getGOHId()

unsigned short TotemFramePosition::getGOHId ( ) const
inline

Definition at line 70 of file TotemFramePosition.h.

Referenced by RawToDigiConverter::run().

◆ getIdxInFiber()

unsigned short TotemFramePosition::getIdxInFiber ( ) const
inline

Definition at line 78 of file TotemFramePosition.h.

Referenced by RawToDigiConverter::run().

◆ getOptoRxId()

unsigned short TotemFramePosition::getOptoRxId ( ) const
inline

Definition at line 104 of file TotemFramePosition.h.

109 { return rawPosition; }

Referenced by RawToDigiConverter::run().

◆ getRawPosition()

unsigned int TotemFramePosition::getRawPosition ( ) const
inline

don't use this method unless you have a good reason

Definition at line 113 of file TotemFramePosition.h.

113 { return (rawPosition == pos.rawPosition); }

References rawPosition.

◆ getSubSystemId()

unsigned short TotemFramePosition::getSubSystemId ( ) const
inline

the getters and setters below are deprecated

Definition at line 88 of file TotemFramePosition.h.

92 { return (rawPosition >> offsetTOTFEDId) & maskTOTFEDId; }

Referenced by RawToDigiConverter::run().

◆ getTOTFEDId()

unsigned short TotemFramePosition::getTOTFEDId ( ) const
inline

Definition at line 96 of file TotemFramePosition.h.

100 { return (rawPosition >> offsetOptoRxId) & maskOptoRxId; }

Referenced by RawToDigiConverter::run().

◆ operator<()

bool TotemFramePosition::operator< ( const TotemFramePosition pos) const
inline

Definition at line 115 of file TotemFramePosition.h.

◆ operator==()

bool TotemFramePosition::operator== ( const TotemFramePosition pos) const
inline

Definition at line 117 of file TotemFramePosition.h.

◆ printXML()

void TotemFramePosition::printXML ( )

prints XML formatted DAQ channel to stdout

Definition at line 23 of file TotemFramePosition.cc.

24  {
25  cout << "\" FEDId=\"" << getFEDId() << "\" GOHId=\"" << getGOHId() << "\" IdxInFiber=\"" << getIdxInFiber() << "\"";

References gather_cfg::cout.

◆ setFEDId()

void TotemFramePosition::setFEDId ( unsigned short  v)
inline

Definition at line 64 of file TotemFramePosition.h.

66  { return (rawPosition >> offsetGOHId) & maskGOHId; }
67 
68  void setGOHId(unsigned short v) {

◆ setGOHId()

void TotemFramePosition::setGOHId ( unsigned short  v)
inline

Definition at line 72 of file TotemFramePosition.h.

75 
76  void setIdxInFiber(unsigned short v) {

◆ setIdxInFiber()

void TotemFramePosition::setIdxInFiber ( unsigned short  v)
inline

Definition at line 80 of file TotemFramePosition.h.

◆ setOptoRxId()

void TotemFramePosition::setOptoRxId ( unsigned short  v)
inline

Definition at line 106 of file TotemFramePosition.h.

109  { return rawPosition; }
110 

◆ setSubSystemId()

void TotemFramePosition::setSubSystemId ( unsigned short  v)
inline

Definition at line 90 of file TotemFramePosition.h.

92  { return (rawPosition >> offsetTOTFEDId) & maskTOTFEDId; }
93 
94  void setTOTFEDId(unsigned short v) {

◆ setTOTFEDId()

void TotemFramePosition::setTOTFEDId ( unsigned short  v)
inline

Definition at line 98 of file TotemFramePosition.h.

100  { return (rawPosition >> offsetOptoRxId) & maskOptoRxId; }
101 
102  void setOptoRxId(unsigned short v) {

◆ setXMLAttribute()

unsigned char TotemFramePosition::setXMLAttribute ( const std::string &  attribute,
const std::string &  value,
unsigned char &  flag 
)

Sets attribute with XML name 'attribute' and value 'value'. Also turns on attribute presents bit in the flag parameter returns 0 if the attribute is known, non-zero value else

Definition at line 29 of file TotemFramePosition.cc.

32  {
33  unsigned int v = atoi(value.c_str());
34 
35  if (attribute == "FEDId") {
36  setFEDId(v);
37  flag |= 0x1C; // SubSystem + TOTFED + OptoRx
38  return 0;
39  }
40 
41  if (attribute == "SubSystemId") {
43  flag |= 0x10;
44  return 0;
45  }
46 
47  if (attribute == "TOTFEDId") {
48  setTOTFEDId(v);
49  flag |= 0x8;
50  return 0;
51  }
52 
53  if (attribute == "OptoRxId") {
54  setOptoRxId(v);
55  flag |= 0x4;
56  return 0;
57  }
58 
59  if (attribute == "GOHId") {
60  setGOHId(v);
61  flag |= 0x2;
62  return 0;
63  }
64 
65  if (attribute == "IdxInFiber") {
67  flag |= 0x1;
68  return 0;
69  }
70 
71  return 1;

References RemoveAddSevLevel::flag, and findQualityFiles::v.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const TotemFramePosition fp 
)
friend

Condensed representation of the DAQ channel. prints 5-digit hex number, the digits correspond to SubSystem, TOTFED ID, OptoRx ID, GOH ID, index within fiber in this order

Definition at line 17 of file TotemFramePosition.cc.

18  {
19  return s << fp.getFEDId() << ":" << fp.getGOHId() << ":" << fp.getIdxInFiber();

Member Data Documentation

◆ maskFEDId

const unsigned int TotemFramePosition::maskFEDId = 0x3FF
static

Definition at line 40 of file TotemFramePosition.h.

Referenced by ~TotemFramePosition().

◆ maskGOHId

const unsigned int TotemFramePosition::maskGOHId = 0xF
static

Definition at line 39 of file TotemFramePosition.h.

◆ maskIdxInFiber

const unsigned int TotemFramePosition::maskIdxInFiber = 0xF
static

Definition at line 38 of file TotemFramePosition.h.

◆ maskOptoRxId

const unsigned int TotemFramePosition::maskOptoRxId = 0x3
static

Definition at line 42 of file TotemFramePosition.h.

◆ maskSubSystemId

const unsigned int TotemFramePosition::maskSubSystemId = 0x7
static

Definition at line 44 of file TotemFramePosition.h.

◆ maskTOTFEDId

const unsigned int TotemFramePosition::maskTOTFEDId = 0x1F
static

Definition at line 43 of file TotemFramePosition.h.

◆ offsetFEDId

const unsigned int TotemFramePosition::offsetFEDId = 8
static

Definition at line 40 of file TotemFramePosition.h.

Referenced by ~TotemFramePosition().

◆ offsetGOHId

const unsigned int TotemFramePosition::offsetGOHId = 4
static

Definition at line 39 of file TotemFramePosition.h.

◆ offsetIdxInFiber

const unsigned int TotemFramePosition::offsetIdxInFiber = 0
static

Definition at line 38 of file TotemFramePosition.h.

◆ offsetOptoRxId

const unsigned int TotemFramePosition::offsetOptoRxId = 8
static

Definition at line 42 of file TotemFramePosition.h.

◆ offsetSubSystemId

const unsigned int TotemFramePosition::offsetSubSystemId = 15
static

Definition at line 44 of file TotemFramePosition.h.

◆ offsetTOTFEDId

const unsigned int TotemFramePosition::offsetTOTFEDId = 10
static

Definition at line 43 of file TotemFramePosition.h.

◆ rawPosition

unsigned int TotemFramePosition::rawPosition
protected

Definition at line 136 of file TotemFramePosition.h.

Referenced by getRawPosition(), and ~TotemFramePosition().

TotemFramePosition::maskSubSystemId
static const unsigned int maskSubSystemId
Definition: TotemFramePosition.h:44
TotemFramePosition::offsetFEDId
static const unsigned int offsetFEDId
Definition: TotemFramePosition.h:40
TotemFramePosition::offsetIdxInFiber
static const unsigned int offsetIdxInFiber
Definition: TotemFramePosition.h:38
TotemFramePosition::offsetOptoRxId
static const unsigned int offsetOptoRxId
Definition: TotemFramePosition.h:42
TotemFramePosition::offsetGOHId
static const unsigned int offsetGOHId
Definition: TotemFramePosition.h:39
TotemFramePosition::maskGOHId
static const unsigned int maskGOHId
Definition: TotemFramePosition.h:39
TotemFramePosition::rawPosition
unsigned int rawPosition
Definition: TotemFramePosition.h:136
TotemFramePosition::offsetSubSystemId
static const unsigned int offsetSubSystemId
Definition: TotemFramePosition.h:44
TotemFramePosition::setSubSystemId
void setSubSystemId(unsigned short v)
Definition: TotemFramePosition.h:90
TotemFramePosition::TotemFramePosition
TotemFramePosition(unsigned short SubSystemId, unsigned short TOTFEDId, unsigned short OptoRxId, unsigned short GOHId, unsigned short IdxInFiber)
the preferred constructor
Definition: TotemFramePosition.h:47
gather_cfg.cout
cout
Definition: gather_cfg.py:144
pos
Definition: PixelAliasList.h:18
personalPlayback.fp
fp
Definition: personalPlayback.py:523
findQualityFiles.v
v
Definition: findQualityFiles.py:179
TotemFramePosition::maskOptoRxId
static const unsigned int maskOptoRxId
Definition: TotemFramePosition.h:42
TotemFramePosition::maskFEDId
static const unsigned int maskFEDId
Definition: TotemFramePosition.h:40
alignCSCRings.s
s
Definition: alignCSCRings.py:92
TotemFramePosition::setTOTFEDId
void setTOTFEDId(unsigned short v)
Definition: TotemFramePosition.h:98
TotemFramePosition::getIdxInFiber
unsigned short getIdxInFiber() const
Definition: TotemFramePosition.h:78
TotemFramePosition::maskTOTFEDId
static const unsigned int maskTOTFEDId
Definition: TotemFramePosition.h:43
TotemFramePosition::getGOHId
unsigned short getGOHId() const
Definition: TotemFramePosition.h:70
TotemFramePosition::setIdxInFiber
void setIdxInFiber(unsigned short v)
Definition: TotemFramePosition.h:80
value
Definition: value.py:1
TotemFramePosition::setFEDId
void setFEDId(unsigned short v)
Definition: TotemFramePosition.h:64
TotemFramePosition::setOptoRxId
void setOptoRxId(unsigned short v)
Definition: TotemFramePosition.h:106
TotemFramePosition::offsetTOTFEDId
static const unsigned int offsetTOTFEDId
Definition: TotemFramePosition.h:43
TotemFramePosition::maskIdxInFiber
static const unsigned int maskIdxInFiber
Definition: TotemFramePosition.h:38
TotemFramePosition::getFEDId
unsigned short getFEDId() const
recomended getters and setters
Definition: TotemFramePosition.h:62
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
TotemFramePosition::setGOHId
void setGOHId(unsigned short v)
Definition: TotemFramePosition.h:72