CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
omtf::EleIndex Class Reference

#include <OmtfEleIndex.h>

Public Member Functions

unsigned int amc () const
 
 EleIndex ()
 
 EleIndex (const std::string &board, unsigned int link)
 
 EleIndex (unsigned int fed, unsigned int amc, unsigned int link)
 
unsigned int fed () const
 
unsigned int link () const
 
bool operator< (const EleIndex &o) const
 

Private Attributes

uint32_t packed_
 

Friends

std::ostream & operator<< (std::ostream &out, const EleIndex &o)
 

Detailed Description

Definition at line 9 of file OmtfEleIndex.h.

Constructor & Destructor Documentation

◆ EleIndex() [1/3]

omtf::EleIndex::EleIndex ( )
inline

Definition at line 11 of file OmtfEleIndex.h.

11 : packed_(0) {}
uint32_t packed_
Definition: OmtfEleIndex.h:38

◆ EleIndex() [2/3]

omtf::EleIndex::EleIndex ( const std::string &  board,
unsigned int  link 
)
inline

Definition at line 12 of file OmtfEleIndex.h.

References fed(), link(), and packed_.

12  {
13  unsigned int fed = 0;
14  if (board.substr(4, 1) == "n")
15  fed = 1380;
16  else if (board.substr(4, 1) == "p")
17  fed = 1381;
18  unsigned int amc = std::stoi(board.substr(5, 1));
19  packed_ = fed * 1000 + amc * 100 + link;
20  }
unsigned int link() const
Definition: OmtfEleIndex.h:24
unsigned int fed() const
Definition: OmtfEleIndex.h:22
Definition: AMCSpec.h:8
uint32_t packed_
Definition: OmtfEleIndex.h:38

◆ EleIndex() [3/3]

omtf::EleIndex::EleIndex ( unsigned int  fed,
unsigned int  amc,
unsigned int  link 
)
inline

Definition at line 21 of file OmtfEleIndex.h.

References fed(), link(), and packed_.

21 { packed_ = fed * 1000 + amc * 100 + link; }
unsigned int link() const
Definition: OmtfEleIndex.h:24
unsigned int fed() const
Definition: OmtfEleIndex.h:22
Definition: AMCSpec.h:8
uint32_t packed_
Definition: OmtfEleIndex.h:38

Member Function Documentation

◆ amc()

unsigned int omtf::EleIndex::amc ( ) const
inline

Definition at line 23 of file OmtfEleIndex.h.

References packed_.

Referenced by omtf::RpcPacker::pack().

23 { return ((packed_ / 100) % 10); }
uint32_t packed_
Definition: OmtfEleIndex.h:38

◆ fed()

unsigned int omtf::EleIndex::fed ( ) const
inline

Definition at line 22 of file OmtfEleIndex.h.

References packed_.

Referenced by EleIndex(), and omtf::RpcPacker::pack().

22 { return packed_ / 1000; }
uint32_t packed_
Definition: OmtfEleIndex.h:38

◆ link()

unsigned int omtf::EleIndex::link ( void  ) const
inline

Definition at line 24 of file OmtfEleIndex.h.

References packed_.

Referenced by EleIndex(), and omtf::RpcPacker::pack().

24 { return packed_ % 100; }
uint32_t packed_
Definition: OmtfEleIndex.h:38

◆ operator<()

bool omtf::EleIndex::operator< ( const EleIndex o) const
inline

Definition at line 35 of file OmtfEleIndex.h.

References packed_.

35 { return this->packed_ < o.packed_; }
uint32_t packed_
Definition: OmtfEleIndex.h:38

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const EleIndex o 
)
friend

Definition at line 25 of file OmtfEleIndex.h.

25  {
26  out << "OMTF";
27  if (o.fed() == 1380)
28  out << "n";
29  if (o.fed() == 1381)
30  out << "p";
31  out << o.amc();
32  out << " (fed: " << o.fed() << "), ln: " << o.link();
33  return out;
34  }

Member Data Documentation

◆ packed_

uint32_t omtf::EleIndex::packed_
private

Definition at line 38 of file OmtfEleIndex.h.

Referenced by amc(), EleIndex(), fed(), link(), and operator<().