test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes | Friends
OmtfName Class Reference

#include <OmtfName.h>

Public Types

enum  Board {
  OMTFn1 =-1, OMTFn2 =-2, OMTFn3 =-3, OMTFn4 =-4,
  OMTFn5 =-5, OMTFn6 =-6, OMTFp1 = 1, OMTFp2 = 2,
  OMTFp3 = 3, OMTFp4 = 4, OMTFp5 = 5, OMTFp6 = 6,
  UNKNOWN = 0
}
 

Public Member Functions

std::string name () const
 
 OmtfName (Board board=UNKNOWN)
 
 OmtfName (const std::string &name)
 
 OmtfName (unsigned int iProcesor, int endcap)
 
 OmtfName (unsigned int iProcesor, l1t::tftype endcap)
 
 operator int () const
 
bool operator!= (const OmtfName &o) const
 
bool operator== (const OmtfName &o) const
 
int position () const
 
unsigned int processor () const
 
l1t::tftype tftype () const
 

Private Attributes

Board theBoard
 

Friends

std::ostream & operator<< (std::ostream &out, const OmtfName &n)
 

Detailed Description

Definition at line 10 of file OmtfName.h.

Member Enumeration Documentation

Enumerator
OMTFn1 
OMTFn2 
OMTFn3 
OMTFn4 
OMTFn5 
OMTFn6 
OMTFp1 
OMTFp2 
OMTFp3 
OMTFp4 
OMTFp5 
OMTFp6 
UNKNOWN 

Definition at line 13 of file OmtfName.h.

Constructor & Destructor Documentation

OmtfName::OmtfName ( Board  board = UNKNOWN)
inline

Definition at line 19 of file OmtfName.h.

19 : theBoard(board) { }
Board theBoard
Definition: OmtfName.h:42
OmtfName::OmtfName ( const std::string &  name)

Definition at line 22 of file OmtfName.cc.

References OMTFn1, OMTFn2, OMTFn3, OMTFn4, OMTFn5, OMTFn6, OMTFp1, OMTFp2, OMTFp3, OMTFp4, OMTFp5, OMTFp6, and theBoard.

23 {
24  if (board=="OMTFn1") theBoard = OMTFn1;
25  else if (board=="OMTFn2") theBoard = OMTFn2;
26  else if (board=="OMTFn3") theBoard = OMTFn3;
27  else if (board=="OMTFn4") theBoard = OMTFn4;
28  else if (board=="OMTFn5") theBoard = OMTFn5;
29  else if (board=="OMTFn6") theBoard = OMTFn6;
30  else if (board=="OMTFp1") theBoard = OMTFp1;
31  else if (board=="OMTFp2") theBoard = OMTFp2;
32  else if (board=="OMTFp3") theBoard = OMTFp3;
33  else if (board=="OMTFp4") theBoard = OMTFp4;
34  else if (board=="OMTFp5") theBoard = OMTFp5;
35  else if (board=="OMTFp6") theBoard = OMTFp6;
36  else theBoard = OMTFp6;
37 }
Board theBoard
Definition: OmtfName.h:42
OmtfName::OmtfName ( unsigned int  iProcesor,
int  endcap 
)
explicit

Definition at line 8 of file OmtfName.cc.

References funct::abs(), position(), FWPFMaths::sgn(), and theBoard.

9 {
10  int iproc = (iProcesor <=5 ) ? static_cast<int>(iProcesor) : -1;
11  int position = (abs(endcap)==1) ? endcap : 0;
12  theBoard = static_cast<Board>( sgn(position)*(iproc+1) );
13 }
Board theBoard
Definition: OmtfName.h:42
float sgn(float val)
Definition: FWPFMaths.cc:9
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int position() const
Definition: OmtfName.cc:58
OmtfName::OmtfName ( unsigned int  iProcesor,
l1t::tftype  endcap 
)
explicit

Definition at line 15 of file OmtfName.cc.

References l1t::omtf_neg, l1t::omtf_pos, position(), FWPFMaths::sgn(), and theBoard.

16 {
17  int iproc = (iProcesor <=5 ) ? static_cast<int>(iProcesor) : -1;
18  int position = (endcap == l1t::omtf_pos ) ? 1 : ( (endcap == l1t::omtf_neg ) ? -1 : 0);
19  theBoard = static_cast<Board>( sgn(position)*(iproc+1) );
20 }
Board theBoard
Definition: OmtfName.h:42
float sgn(float val)
Definition: FWPFMaths.cc:9
int position() const
Definition: OmtfName.cc:58

Member Function Documentation

std::string OmtfName::name ( void  ) const

Definition at line 39 of file OmtfName.cc.

References OMTFn1, OMTFn2, OMTFn3, OMTFn4, OMTFn5, OMTFn6, OMTFp1, OMTFp2, OMTFp3, OMTFp4, OMTFp5, OMTFp6, and theBoard.

Referenced by cuy.divideElement::__init__(), cuy.plotElement::__init__(), cuy.additionElement::__init__(), cuy.superimposeElement::__init__(), cuy.graphElement::__init__(), config.CFG::__str__(), validation.Sample::digest(), VIDSelectorBase.VIDSelectorBase::initialize(), and XMLConfigWriter::writeEventData().

40 {
41  switch (theBoard) {
42  case (OMTFn1) : return "OMTFn1";
43  case (OMTFn2) : return "OMTFn2";
44  case (OMTFn3) : return "OMTFn3";
45  case (OMTFn4) : return "OMTFn4";
46  case (OMTFn5) : return "OMTFn5";
47  case (OMTFn6) : return "OMTFn6";
48  case (OMTFp1) : return "OMTFp1";
49  case (OMTFp2) : return "OMTFp2";
50  case (OMTFp3) : return "OMTFp3";
51  case (OMTFp4) : return "OMTFp4";
52  case (OMTFp5) : return "OMTFp5";
53  case (OMTFp6) : return "OMTFp6";
54  default: return "UNKNOWN";
55  }
56 }
Board theBoard
Definition: OmtfName.h:42
OmtfName::operator int ( ) const
inline

Definition at line 30 of file OmtfName.h.

References theBoard.

30 { return theBoard; }
Board theBoard
Definition: OmtfName.h:42
bool OmtfName::operator!= ( const OmtfName o) const
inline

Definition at line 32 of file OmtfName.h.

References connectstrParser::o.

32 { return !(*this==o);}
bool OmtfName::operator== ( const OmtfName o) const
inline

Definition at line 31 of file OmtfName.h.

References theBoard.

31 { return theBoard == o.theBoard; }
Board theBoard
Definition: OmtfName.h:42
int OmtfName::position ( ) const

Definition at line 58 of file OmtfName.cc.

References FWPFMaths::sgn(), and theBoard.

Referenced by OmtfName(), and XMLConfigWriter::writeEventData().

58 { return sgn(theBoard); }
Board theBoard
Definition: OmtfName.h:42
float sgn(float val)
Definition: FWPFMaths.cc:9
unsigned int OmtfName::processor ( ) const

Definition at line 60 of file OmtfName.cc.

References funct::abs(), and theBoard.

Referenced by XMLConfigWriter::writeEventData().

60 { return abs(theBoard)-1; }
Board theBoard
Definition: OmtfName.h:42
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
l1t::tftype OmtfName::tftype ( ) const

Definition at line 62 of file OmtfName.cc.

References l1t::omtf_neg, l1t::omtf_pos, FWPFMaths::sgn(), and theBoard.

62 { return sgn(theBoard) > 0 ? l1t::omtf_pos : l1t::omtf_neg; }
Board theBoard
Definition: OmtfName.h:42
float sgn(float val)
Definition: FWPFMaths.cc:9

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const OmtfName n 
)
friend

Definition at line 44 of file OmtfName.h.

44  {
45  out << n.name(); return out;
46  }
std::string name() const
Definition: OmtfName.cc:39

Member Data Documentation

Board OmtfName::theBoard
private

Definition at line 42 of file OmtfName.h.

Referenced by name(), OmtfName(), operator int(), operator==(), position(), processor(), and tftype().