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) {}

◆ EleIndex() [2/3]

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

Definition at line 12 of file OmtfEleIndex.h.

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  }

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

◆ EleIndex() [3/3]

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

Definition at line 21 of file OmtfEleIndex.h.

21 { packed_ = fed * 1000 + amc * 100 + link; }

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

Member Function Documentation

◆ amc()

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

Definition at line 23 of file OmtfEleIndex.h.

23 { return ((packed_ / 100) % 10); }

References packed_.

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

◆ fed()

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

Definition at line 22 of file OmtfEleIndex.h.

22 { return packed_ / 1000; }

References packed_.

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

◆ link()

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

Definition at line 24 of file OmtfEleIndex.h.

24 { return packed_ % 100; }

References packed_.

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

◆ operator<()

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

Definition at line 35 of file OmtfEleIndex.h.

35 { return this->packed_ < o.packed_; }

References packed_.

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<().

omtf::EleIndex::packed_
uint32_t packed_
Definition: OmtfEleIndex.h:38
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
omtf::EleIndex::link
unsigned int link() const
Definition: OmtfEleIndex.h:24
omtf::EleIndex::fed
unsigned int fed() const
Definition: OmtfEleIndex.h:22
amc
Definition: AMCSpec.h:8
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31