CMS 3D CMS Logo

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

#include <CTPPSPixelFramePosition.h>

Public Member Functions

 CTPPSPixelFramePosition (unsigned short FEDId, unsigned short FMCId, unsigned short ChannelIdx, unsigned short ROC)
 the preferred constructor More...
 
 CTPPSPixelFramePosition (unsigned int pos=0)
 don't use this constructor unless you have a good reason More...
 
unsigned short getChannelIdx () const
 
unsigned short getFEDId () const
 recomended getters and setters More...
 
unsigned short getFMCId () const
 
unsigned int getRawPosition () const
 
unsigned short getROC () const
 
bool operator< (const CTPPSPixelFramePosition &pos) const
 
bool operator== (const CTPPSPixelFramePosition &pos) const
 
void printXML ()
 prints XML formatted DAQ channel to stdout More...
 
void setChannelIdx (unsigned short v)
 
void setFEDId (unsigned short v)
 
void setFMCId (unsigned short v)
 
void setROC (unsigned short v)
 
unsigned char setXMLAttribute (const std::string &attribute, const std::string &value, unsigned char &flag)
 
 ~CTPPSPixelFramePosition ()
 

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 maskChannelIdx = 0x3F
 
static const unsigned int maskFEDId = 0xFFF
 
static const unsigned int maskFMCId = 0x1
 
static const unsigned int maskROC = 0x3
 
static const unsigned int offsetChannelIdx = 2
 
static const unsigned int offsetFEDId = 9
 
static const unsigned int offsetFMCId = 8
 
static const unsigned int offsetROC = 0
 

Protected Attributes

unsigned int rawPosition
 

Private Member Functions

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

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 
std::ostream & operator<< (std::ostream &s, const CTPPSPixelFramePosition &fp)
 

Detailed Description

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

The internal representation has the following structure:

* |                                     32 bits raw position                                                                      |
* | 11 bits  |   12 bits |  1  bit          |      6 bits                        |  2bits     |
* |  empty   |  FED ID  |    FMC   0-1  |   fiber index      0-12          | ROC 0-2 |
* 

Definition at line 28 of file CTPPSPixelFramePosition.h.

Constructor & Destructor Documentation

◆ CTPPSPixelFramePosition() [1/2]

CTPPSPixelFramePosition::CTPPSPixelFramePosition ( unsigned short  FEDId,
unsigned short  FMCId,
unsigned short  ChannelIdx,
unsigned short  ROC 
)
inline

the preferred constructor

Definition at line 36 of file CTPPSPixelFramePosition.h.

37  : rawPosition(ROC << offsetROC | ChannelIdx << offsetChannelIdx | FMCId << FMCId | FEDId << offsetFEDId) {}
static const unsigned int offsetROC
static const unsigned int offsetFEDId
static const unsigned int offsetChannelIdx

◆ CTPPSPixelFramePosition() [2/2]

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

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

Definition at line 40 of file CTPPSPixelFramePosition.h.

◆ ~CTPPSPixelFramePosition()

CTPPSPixelFramePosition::~CTPPSPixelFramePosition ( )
inline

Definition at line 42 of file CTPPSPixelFramePosition.h.

42 {}

Member Function Documentation

◆ checkXMLAttributeFlag()

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

returns true if all attributes have been set

Definition at line 97 of file CTPPSPixelFramePosition.h.

References RemoveAddSevLevel::flag.

97 { return (flag == 0xF); }

◆ getChannelIdx()

unsigned short CTPPSPixelFramePosition::getChannelIdx ( ) const
inline

Definition at line 54 of file CTPPSPixelFramePosition.h.

References maskChannelIdx, offsetChannelIdx, and rawPosition.

static const unsigned int maskChannelIdx
static const unsigned int offsetChannelIdx

◆ getFEDId()

unsigned short CTPPSPixelFramePosition::getFEDId ( ) const
inline

recomended getters and setters

Definition at line 46 of file CTPPSPixelFramePosition.h.

References maskFEDId, offsetFEDId, and rawPosition.

46 { return (rawPosition >> offsetFEDId) & maskFEDId; }
static const unsigned int offsetFEDId
static const unsigned int maskFEDId

◆ getFMCId()

unsigned short CTPPSPixelFramePosition::getFMCId ( ) const
inline

Definition at line 70 of file CTPPSPixelFramePosition.h.

References maskFMCId, offsetFMCId, and rawPosition.

70 { return (rawPosition >> offsetFMCId) & maskFMCId; }
static const unsigned int offsetFMCId
static const unsigned int maskFMCId

◆ getRawPosition()

unsigned int CTPPSPixelFramePosition::getRawPosition ( ) const
inline

Definition at line 78 of file CTPPSPixelFramePosition.h.

References rawPosition.

78 { return rawPosition; }

◆ getROC()

unsigned short CTPPSPixelFramePosition::getROC ( ) const
inline

Definition at line 62 of file CTPPSPixelFramePosition.h.

References maskROC, offsetROC, and rawPosition.

62 { return (rawPosition >> offsetROC) & maskROC; }
static const unsigned int offsetROC
static const unsigned int maskROC

◆ operator<()

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

Definition at line 80 of file CTPPSPixelFramePosition.h.

References rawPosition.

80 { return (rawPosition < pos.rawPosition); }

◆ operator==()

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

Definition at line 82 of file CTPPSPixelFramePosition.h.

References rawPosition.

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

◆ printXML()

void CTPPSPixelFramePosition::printXML ( )

prints XML formatted DAQ channel to stdout

Definition at line 23 of file CTPPSPixelFramePosition.cc.

References sipixelconstants::functions::getROC().

23  {
24  edm::LogInfo("printXML") << "\" FEDId=\"" << getFEDId() << "\" FMCId=\"" << getFMCId() << "\" ChannelIdx=\""
25  << getChannelIdx() << "\" ROC=\"" << getROC() << "\"";
26 }
unsigned short getFMCId() const
unsigned short getFEDId() const
recomended getters and setters
unsigned short getChannelIdx() const
unsigned short getROC() const
Log< level::Info, false > LogInfo

◆ serialize()

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

◆ setChannelIdx()

void CTPPSPixelFramePosition::setChannelIdx ( unsigned short  v)
inline

Definition at line 56 of file CTPPSPixelFramePosition.h.

References maskChannelIdx, offsetChannelIdx, rawPosition, and findQualityFiles::v.

56  {
57  v &= maskChannelIdx;
58  rawPosition &= 0xFFFFFFFF - (maskChannelIdx << offsetChannelIdx);
60  }
static const unsigned int maskChannelIdx
static const unsigned int offsetChannelIdx

◆ setFEDId()

void CTPPSPixelFramePosition::setFEDId ( unsigned short  v)
inline

Definition at line 48 of file CTPPSPixelFramePosition.h.

References maskFEDId, offsetFEDId, rawPosition, and findQualityFiles::v.

48  {
49  v &= maskFEDId;
50  rawPosition &= 0xFFFFFFFF - (maskFEDId << offsetFEDId);
51  rawPosition |= (v << offsetFEDId);
52  }
static const unsigned int offsetFEDId
static const unsigned int maskFEDId

◆ setFMCId()

void CTPPSPixelFramePosition::setFMCId ( unsigned short  v)
inline

Definition at line 72 of file CTPPSPixelFramePosition.h.

References maskFMCId, offsetFMCId, rawPosition, and findQualityFiles::v.

72  {
73  v &= maskFMCId;
74  rawPosition &= 0xFFFFFFFF - (maskFMCId << offsetFMCId);
75  rawPosition |= (v << offsetFMCId);
76  }
static const unsigned int offsetFMCId
static const unsigned int maskFMCId

◆ setROC()

void CTPPSPixelFramePosition::setROC ( unsigned short  v)
inline

Definition at line 64 of file CTPPSPixelFramePosition.h.

References maskROC, offsetROC, rawPosition, and findQualityFiles::v.

64  {
65  v &= maskROC;
66  rawPosition &= 0xFFFFFFFF - (maskROC << offsetROC);
67  rawPosition |= (v << offsetROC);
68  }
static const unsigned int offsetROC
static const unsigned int maskROC

◆ setXMLAttribute()

unsigned char CTPPSPixelFramePosition::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 30 of file CTPPSPixelFramePosition.cc.

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

32  {
33  unsigned int v = atoi(value.c_str());
34 
35  if (attribute == "FEDId") {
36  setFEDId(v);
37  flag |= 0x8;
38  return 0;
39  }
40 
41  if (attribute == "FMC") {
42  setFMCId(v);
43  flag |= 0x4;
44  return 0;
45  }
46 
47  if (attribute == "FEDChannel") {
49  flag |= 0x2;
50  return 0;
51  }
52 
53  if (attribute == "ROCinChannel") {
54  setROC(v);
55  flag |= 0x1;
56  return 0;
57  }
58 
59  return 1;
60 }
void setChannelIdx(unsigned short v)
void setFMCId(unsigned short v)
void setROC(unsigned short v)
Definition: value.py:1
void setFEDId(unsigned short v)

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 102 of file CTPPSPixelFramePosition.h.

◆ cond::serialization::access

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

Definition at line 102 of file CTPPSPixelFramePosition.h.

◆ operator<<

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

Condensed representation of the DAQ channel. prints 5-digit hex number,

Definition at line 17 of file CTPPSPixelFramePosition.cc.

17  {
18  return s << fp.getFEDId() << ":" << fp.getFMCId() << ":" << fp.getChannelIdx() << ":" << fp.getROC();
19 }

Member Data Documentation

◆ maskChannelIdx

const unsigned int CTPPSPixelFramePosition::maskChannelIdx = 0x3F
static

Definition at line 31 of file CTPPSPixelFramePosition.h.

Referenced by getChannelIdx(), and setChannelIdx().

◆ maskFEDId

const unsigned int CTPPSPixelFramePosition::maskFEDId = 0xFFF
static

Definition at line 33 of file CTPPSPixelFramePosition.h.

Referenced by getFEDId(), and setFEDId().

◆ maskFMCId

const unsigned int CTPPSPixelFramePosition::maskFMCId = 0x1
static

Definition at line 32 of file CTPPSPixelFramePosition.h.

Referenced by getFMCId(), and setFMCId().

◆ maskROC

const unsigned int CTPPSPixelFramePosition::maskROC = 0x3
static

Definition at line 30 of file CTPPSPixelFramePosition.h.

Referenced by getROC(), and setROC().

◆ offsetChannelIdx

const unsigned int CTPPSPixelFramePosition::offsetChannelIdx = 2
static

Definition at line 31 of file CTPPSPixelFramePosition.h.

Referenced by getChannelIdx(), and setChannelIdx().

◆ offsetFEDId

const unsigned int CTPPSPixelFramePosition::offsetFEDId = 9
static

Definition at line 33 of file CTPPSPixelFramePosition.h.

Referenced by getFEDId(), and setFEDId().

◆ offsetFMCId

const unsigned int CTPPSPixelFramePosition::offsetFMCId = 8
static

Definition at line 32 of file CTPPSPixelFramePosition.h.

Referenced by getFMCId(), and setFMCId().

◆ offsetROC

const unsigned int CTPPSPixelFramePosition::offsetROC = 0
static

Definition at line 30 of file CTPPSPixelFramePosition.h.

Referenced by getROC(), and setROC().

◆ rawPosition

unsigned int CTPPSPixelFramePosition::rawPosition
protected