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

omtf::EleIndex::EleIndex ( )
inline

Definition at line 11 of file OmtfEleIndex.h.

11 : packed_(0) {}
uint32_t packed_
Definition: OmtfEleIndex.h:33
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") fed = 1380; else if (board.substr(4,1)=="p") fed = 1381;
15  unsigned int amc = std::stoi( board.substr(5,1) );
16  packed_ = fed*1000+amc*100+link;
17  }
unsigned int fed() const
Definition: OmtfEleIndex.h:19
unsigned int link() const
Definition: OmtfEleIndex.h:21
Definition: AMCSpec.h:8
uint32_t packed_
Definition: OmtfEleIndex.h:33
omtf::EleIndex::EleIndex ( unsigned int  fed,
unsigned int  amc,
unsigned int  link 
)
inline

Definition at line 18 of file OmtfEleIndex.h.

References link(), and packed_.

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

Member Function Documentation

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

Definition at line 20 of file OmtfEleIndex.h.

References packed_.

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

20 { return ( (packed_ /100) %10); }
uint32_t packed_
Definition: OmtfEleIndex.h:33
unsigned int omtf::EleIndex::fed ( ) const
inline

Definition at line 19 of file OmtfEleIndex.h.

References packed_.

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

19 { return packed_/1000; }
uint32_t packed_
Definition: OmtfEleIndex.h:33
unsigned int omtf::EleIndex::link ( void  ) const
inline

Definition at line 21 of file OmtfEleIndex.h.

References packed_.

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

21 { return packed_ % 100; }
uint32_t packed_
Definition: OmtfEleIndex.h:33
bool omtf::EleIndex::operator< ( const EleIndex o) const
inline

Definition at line 30 of file OmtfEleIndex.h.

References packed_.

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

Friends And Related Function Documentation

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

Definition at line 22 of file OmtfEleIndex.h.

22  {
23  out << "OMTF";
24  if (o.fed()==1380) out <<"n";
25  if (o.fed()==1381) out <<"p";
26  out << o.amc();
27  out <<" (fed: "<<o.fed()<<"), ln: " << o.link();
28  return out;
29  }

Member Data Documentation

uint32_t omtf::EleIndex::packed_
private

Definition at line 33 of file OmtfEleIndex.h.

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