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 int pos=0)
 don't use this constructor unless you have a good reason More...
 
 CTPPSPixelFramePosition (unsigned short FEDId, unsigned short FMCId, unsigned short ChannelIdx, unsigned short ROC)
 the preferred constructor 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 27 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 40 of file CTPPSPixelFramePosition.h.

40  : rawPosition(pos) {}
41 

◆ CTPPSPixelFramePosition() [2/2]

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

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

Definition at line 44 of file CTPPSPixelFramePosition.h.

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

◆ ~CTPPSPixelFramePosition()

CTPPSPixelFramePosition::~CTPPSPixelFramePosition ( )
inline

Definition at line 46 of file CTPPSPixelFramePosition.h.

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

References maskFEDId, offsetFEDId, and rawPosition.

Member Function Documentation

◆ checkXMLAttributeFlag()

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

returns true if all attributes have been set

Definition at line 101 of file CTPPSPixelFramePosition.h.

◆ getChannelIdx()

unsigned short CTPPSPixelFramePosition::getChannelIdx ( ) const
inline

Definition at line 58 of file CTPPSPixelFramePosition.h.

62 { return (rawPosition >> offsetROC) & maskROC; }

◆ getFEDId()

unsigned short CTPPSPixelFramePosition::getFEDId ( ) const
inline

recomended getters and setters

Definition at line 50 of file CTPPSPixelFramePosition.h.

◆ getFMCId()

unsigned short CTPPSPixelFramePosition::getFMCId ( ) const
inline

Definition at line 74 of file CTPPSPixelFramePosition.h.

78 { return rawPosition; }

◆ getRawPosition()

unsigned int CTPPSPixelFramePosition::getRawPosition ( ) const
inline

Definition at line 82 of file CTPPSPixelFramePosition.h.

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

References rawPosition.

◆ getROC()

unsigned short CTPPSPixelFramePosition::getROC ( ) const
inline

Definition at line 66 of file CTPPSPixelFramePosition.h.

70 { return (rawPosition >> offsetFMCId) & maskFMCId; }

◆ operator<()

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

Definition at line 84 of file CTPPSPixelFramePosition.h.

◆ operator==()

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

Definition at line 86 of file CTPPSPixelFramePosition.h.

◆ printXML()

void CTPPSPixelFramePosition::printXML ( )

prints XML formatted DAQ channel to stdout

Definition at line 22 of file CTPPSPixelFramePosition.cc.

23  {
24  edm::LogInfo("printXML") << "\" FEDId=\"" << getFEDId() << "\" FMCId=\"" << getFMCId() << "\" ChannelIdx=\""
25  << getChannelIdx() << "\" ROC=\"" << getROC() << "\"";

References sipixelconstants::functions::getROC().

◆ 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 60 of file CTPPSPixelFramePosition.h.

62  { return (rawPosition >> offsetROC) & maskROC; }
63 
64  void setROC(unsigned short v) {

◆ setFEDId()

void CTPPSPixelFramePosition::setFEDId ( unsigned short  v)
inline

Definition at line 52 of file CTPPSPixelFramePosition.h.

55 
56  void setChannelIdx(unsigned short v) {

◆ setFMCId()

void CTPPSPixelFramePosition::setFMCId ( unsigned short  v)
inline

Definition at line 76 of file CTPPSPixelFramePosition.h.

78  { return rawPosition; }
79 
80  bool operator<(const CTPPSPixelFramePosition &pos) const { return (rawPosition < pos.rawPosition); }

◆ setROC()

void CTPPSPixelFramePosition::setROC ( unsigned short  v)
inline

Definition at line 68 of file CTPPSPixelFramePosition.h.

70  { return (rawPosition >> offsetFMCId) & maskFMCId; }
71 
72  void setFMCId(unsigned short v) {

◆ 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 29 of file CTPPSPixelFramePosition.cc.

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;

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

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 106 of file CTPPSPixelFramePosition.h.

◆ cond::serialization::access

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

Definition at line 106 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 16 of file CTPPSPixelFramePosition.cc.

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

Member Data Documentation

◆ maskChannelIdx

const unsigned int CTPPSPixelFramePosition::maskChannelIdx = 0x3F
static

Definition at line 35 of file CTPPSPixelFramePosition.h.

◆ maskFEDId

const unsigned int CTPPSPixelFramePosition::maskFEDId = 0xFFF
static

Definition at line 37 of file CTPPSPixelFramePosition.h.

Referenced by ~CTPPSPixelFramePosition().

◆ maskFMCId

const unsigned int CTPPSPixelFramePosition::maskFMCId = 0x1
static

Definition at line 36 of file CTPPSPixelFramePosition.h.

◆ maskROC

const unsigned int CTPPSPixelFramePosition::maskROC = 0x3
static

Definition at line 34 of file CTPPSPixelFramePosition.h.

◆ offsetChannelIdx

const unsigned int CTPPSPixelFramePosition::offsetChannelIdx = 2
static

Definition at line 35 of file CTPPSPixelFramePosition.h.

◆ offsetFEDId

const unsigned int CTPPSPixelFramePosition::offsetFEDId = 9
static

Definition at line 37 of file CTPPSPixelFramePosition.h.

Referenced by ~CTPPSPixelFramePosition().

◆ offsetFMCId

const unsigned int CTPPSPixelFramePosition::offsetFMCId = 8
static

Definition at line 36 of file CTPPSPixelFramePosition.h.

◆ offsetROC

const unsigned int CTPPSPixelFramePosition::offsetROC = 0
static

Definition at line 34 of file CTPPSPixelFramePosition.h.

◆ rawPosition

unsigned int CTPPSPixelFramePosition::rawPosition
protected

Definition at line 104 of file CTPPSPixelFramePosition.h.

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

CTPPSPixelFramePosition::offsetChannelIdx
static const unsigned int offsetChannelIdx
Definition: CTPPSPixelFramePosition.h:35
CTPPSPixelFramePosition::setFEDId
void setFEDId(unsigned short v)
Definition: CTPPSPixelFramePosition.h:52
CTPPSPixelFramePosition::operator<
bool operator<(const CTPPSPixelFramePosition &pos) const
Definition: CTPPSPixelFramePosition.h:84
CTPPSPixelFramePosition::rawPosition
unsigned int rawPosition
Definition: CTPPSPixelFramePosition.h:104
pos
Definition: PixelAliasList.h:18
CTPPSPixelFramePosition::getChannelIdx
unsigned short getChannelIdx() const
Definition: CTPPSPixelFramePosition.h:58
CTPPSPixelFramePosition
Definition: CTPPSPixelFramePosition.h:27
personalPlayback.fp
fp
Definition: personalPlayback.py:523
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
findQualityFiles.v
v
Definition: findQualityFiles.py:179
CTPPSPixelFramePosition::offsetFMCId
static const unsigned int offsetFMCId
Definition: CTPPSPixelFramePosition.h:36
CTPPSPixelFramePosition::setChannelIdx
void setChannelIdx(unsigned short v)
Definition: CTPPSPixelFramePosition.h:60
CTPPSPixelFramePosition::maskFEDId
static const unsigned int maskFEDId
Definition: CTPPSPixelFramePosition.h:37
CTPPSPixelFramePosition::offsetROC
static const unsigned int offsetROC
Definition: CTPPSPixelFramePosition.h:34
alignCSCRings.s
s
Definition: alignCSCRings.py:92
CTPPSPixelFramePosition::maskFMCId
static const unsigned int maskFMCId
Definition: CTPPSPixelFramePosition.h:36
CTPPSPixelFramePosition::offsetFEDId
static const unsigned int offsetFEDId
Definition: CTPPSPixelFramePosition.h:37
CTPPSPixelFramePosition::maskROC
static const unsigned int maskROC
Definition: CTPPSPixelFramePosition.h:34
CTPPSPixelFramePosition::maskChannelIdx
static const unsigned int maskChannelIdx
Definition: CTPPSPixelFramePosition.h:35
value
Definition: value.py:1
CTPPSPixelFramePosition::setFMCId
void setFMCId(unsigned short v)
Definition: CTPPSPixelFramePosition.h:76
CTPPSPixelFramePosition::getFMCId
unsigned short getFMCId() const
Definition: CTPPSPixelFramePosition.h:74
CTPPSPixelFramePosition::setROC
void setROC(unsigned short v)
Definition: CTPPSPixelFramePosition.h:68
CTPPSPixelFramePosition::getFEDId
unsigned short getFEDId() const
recomended getters and setters
Definition: CTPPSPixelFramePosition.h:50
CTPPSPixelFramePosition::getROC
unsigned short getROC() const
Definition: CTPPSPixelFramePosition.h:66
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117