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::CTPPSPixelFramePosition ( unsigned short  FEDId,
unsigned short  FMCId,
unsigned short  ChannelIdx,
unsigned short  ROC 
)
inline

the preferred constructor

Definition at line 38 of file CTPPSPixelFramePosition.h.

38  :
39  rawPosition(ROC<<offsetROC | ChannelIdx<<offsetChannelIdx | FMCId<<FMCId | FEDId<<offsetFEDId )
40  {
41  }
static const unsigned int offsetROC
static const unsigned int offsetFEDId
static const unsigned int offsetChannelIdx
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.

44  : rawPosition(pos)
45  {
46  }
CTPPSPixelFramePosition::~CTPPSPixelFramePosition ( )
inline

Definition at line 48 of file CTPPSPixelFramePosition.h.

49  {
50  }

Member Function Documentation

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

returns true if all attributes have been set

Definition at line 106 of file CTPPSPixelFramePosition.h.

Referenced by CTPPSPixelDAQMappingESSourceXML::ChipFramePosition().

107  {
108  return (flag == 0xF);
109  }
unsigned short CTPPSPixelFramePosition::getChannelIdx ( ) const
inline

Definition at line 62 of file CTPPSPixelFramePosition.h.

References maskChannelIdx, and rawPosition.

Referenced by operator<<().

static const unsigned int maskChannelIdx
static const unsigned int offsetChannelIdx
unsigned short CTPPSPixelFramePosition::getFEDId ( ) const
inline

recomended getters and setters

Definition at line 54 of file CTPPSPixelFramePosition.h.

References maskFEDId, and rawPosition.

Referenced by operator<<().

55  {
56  return (rawPosition >> offsetFEDId) & maskFEDId;
57  }
static const unsigned int offsetFEDId
static const unsigned int maskFEDId
unsigned short CTPPSPixelFramePosition::getFMCId ( ) const
inline

Definition at line 72 of file CTPPSPixelFramePosition.h.

References maskFMCId, and rawPosition.

Referenced by operator<<().

72 { return (rawPosition >> offsetFMCId) & maskFMCId; }
static const unsigned int offsetFMCId
static const unsigned int maskFMCId
unsigned int CTPPSPixelFramePosition::getRawPosition ( ) const
inline

Definition at line 78 of file CTPPSPixelFramePosition.h.

References rawPosition.

79  {
80  return rawPosition;
81  }
unsigned short CTPPSPixelFramePosition::getROC ( ) const
inline

Definition at line 67 of file CTPPSPixelFramePosition.h.

References maskROC, and rawPosition.

Referenced by operator<<().

67 { return (rawPosition >> offsetROC) & maskROC; }
static const unsigned int offsetROC
static const unsigned int maskROC
bool CTPPSPixelFramePosition::operator< ( const CTPPSPixelFramePosition pos) const
inline

Definition at line 83 of file CTPPSPixelFramePosition.h.

References rawPosition.

84  {
85  return (rawPosition < pos.rawPosition);
86  }
bool CTPPSPixelFramePosition::operator== ( const CTPPSPixelFramePosition pos) const
inline
void CTPPSPixelFramePosition::printXML ( )

prints XML formatted DAQ channel to stdout

Definition at line 28 of file CTPPSPixelFramePosition.cc.

Referenced by operator==().

29 {
30  edm::LogInfo("printXML") << "\" FEDId=\"" << getFEDId()
31  << "\" FMCId=\"" << getFMCId()
32  << "\" ChannelIdx=\"" << getChannelIdx()
33  << "\" ROC=\"" << getROC()
34  << "\"";
35 }
unsigned short getFMCId() const
unsigned short getChannelIdx() const
unsigned short getROC() const
unsigned short getFEDId() const
recomended getters and setters
template<class Archive >
void CTPPSPixelFramePosition::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void CTPPSPixelFramePosition::setChannelIdx ( unsigned short  v)
inline
void CTPPSPixelFramePosition::setFEDId ( unsigned short  v)
inline

Definition at line 59 of file CTPPSPixelFramePosition.h.

References maskFEDId, offsetFEDId, and rawPosition.

60  { v &= maskFEDId; rawPosition &= 0xFFFFFFFF - (maskFEDId << offsetFEDId); rawPosition |= (v << offsetFEDId); }
static const unsigned int offsetFEDId
static const unsigned int maskFEDId
void CTPPSPixelFramePosition::setFMCId ( unsigned short  v)
inline

Definition at line 74 of file CTPPSPixelFramePosition.h.

References maskFMCId, offsetFMCId, and rawPosition.

75  { v &= maskFMCId; rawPosition &= 0xFFFFFFFF - (maskFMCId << offsetFMCId); rawPosition |= (v << offsetFMCId); }
static const unsigned int offsetFMCId
static const unsigned int maskFMCId
void CTPPSPixelFramePosition::setROC ( unsigned short  v)
inline

Definition at line 69 of file CTPPSPixelFramePosition.h.

References maskROC, offsetROC, and rawPosition.

70  { v &= maskROC; rawPosition &= 0xFFFFFFFF - (maskROC << offsetROC); rawPosition |= (v << offsetROC); }
static const unsigned int offsetROC
static const unsigned int maskROC
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 39 of file CTPPSPixelFramePosition.cc.

References findQualityFiles::v.

Referenced by CTPPSPixelDAQMappingESSourceXML::ChipFramePosition(), and operator==().

41 {
42  unsigned int v = atoi(value.c_str());
43 
44  if (attribute == "FEDId")
45  {
46  setFEDId(v);
47  flag |= 0x8;
48  return 0;
49  }
50 
51  if (attribute == "FMC")
52  {
53  setFMCId(v);
54  flag |= 0x4;
55  return 0;
56  }
57 
58  if (attribute == "FEDChannel")
59  {
60  setChannelIdx(v);
61  flag |= 0x2;
62  return 0;
63  }
64 
65  if (attribute == "ROCinChannel")
66  {
67  setROC(v);
68  flag |= 0x1;
69  return 0;
70  }
71 
72  return 1;
73 }
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

friend class boost::serialization::access
friend

Definition at line 114 of file CTPPSPixelFramePosition.h.

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

Definition at line 114 of file CTPPSPixelFramePosition.h.

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.

Referenced by operator==().

18 {
19  return s
20  << fp.getFEDId() << ":"
21  << fp.getFMCId() << ":"
22  << fp.getChannelIdx() << ":"
23  << fp.getROC();
24 }
unsigned short getFMCId() const
unsigned short getChannelIdx() const
unsigned short getROC() const
unsigned short getFEDId() const
recomended getters and setters

Member Data Documentation

const unsigned int CTPPSPixelFramePosition::maskChannelIdx = 0x3F
static

Definition at line 32 of file CTPPSPixelFramePosition.h.

Referenced by getChannelIdx(), and setChannelIdx().

const unsigned int CTPPSPixelFramePosition::maskFEDId = 0xFFF
static

Definition at line 34 of file CTPPSPixelFramePosition.h.

Referenced by getFEDId(), and setFEDId().

const unsigned int CTPPSPixelFramePosition::maskFMCId = 0x1
static

Definition at line 33 of file CTPPSPixelFramePosition.h.

Referenced by getFMCId(), and setFMCId().

const unsigned int CTPPSPixelFramePosition::maskROC = 0x3
static

Definition at line 31 of file CTPPSPixelFramePosition.h.

Referenced by getROC(), and setROC().

const unsigned int CTPPSPixelFramePosition::offsetChannelIdx = 2
static

Definition at line 32 of file CTPPSPixelFramePosition.h.

Referenced by setChannelIdx().

const unsigned int CTPPSPixelFramePosition::offsetFEDId = 9
static

Definition at line 34 of file CTPPSPixelFramePosition.h.

Referenced by setFEDId().

const unsigned int CTPPSPixelFramePosition::offsetFMCId = 8
static

Definition at line 33 of file CTPPSPixelFramePosition.h.

Referenced by setFMCId().

const unsigned int CTPPSPixelFramePosition::offsetROC = 0
static

Definition at line 31 of file CTPPSPixelFramePosition.h.

Referenced by setROC().

unsigned int CTPPSPixelFramePosition::rawPosition
protected