CMS 3D CMS Logo

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, 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
}
 
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, 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
 
std::string name () const
 
 OmtfName (Board board=UNKNOWN)
 
 OmtfName (const std::string &name)
 
 OmtfName (Board board=UNKNOWN)
 
 OmtfName (const std::string &name)
 
 OmtfName (unsigned int iProcesor, int endcap)
 
 OmtfName (unsigned int iProcesor, int endcap, const OMTFConfiguration *omtfConfig)
 
 OmtfName (unsigned int iProcesor, l1t::tftype endcap)
 
 OmtfName (unsigned int iProcesor, l1t::tftype endcap, const OMTFConfiguration *omtfConfig)
 
 OmtfName (unsigned int iProcesor, const OMTFConfiguration *omtfConfig)
 
 operator int () const
 
 operator int () const
 
bool operator!= (const OmtfName &o) const
 
bool operator!= (const OmtfName &o) const
 
bool operator== (const OmtfName &o) const
 
bool operator== (const OmtfName &o) const
 
int position () const
 
int position () const
 
unsigned int processor () const
 
unsigned int processor () const
 
l1t::tftype tftype () const
 
l1t::tftype tftype () const
 

Private Attributes

Board theBoard
 

Friends

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

Detailed Description

Definition at line 9 of file OmtfName.h.

Member Enumeration Documentation

◆ Board [1/2]

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

Definition at line 11 of file OmtfName.h.

11  {
12  OMTFn1 = -1,
13  OMTFn2 = -2,
14  OMTFn3 = -3,
15  OMTFn4 = -4,
16  OMTFn5 = -5,
17  OMTFn6 = -6,
18  OMTFp1 = 1,
19  OMTFp2 = 2,
20  OMTFp3 = 3,
21  OMTFp4 = 4,
22  OMTFp5 = 5,
23  OMTFp6 = 6,
24  UNKNOWN = 0
25  };

◆ Board [2/2]

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

Definition at line 13 of file OmtfName.h.

13  {
14  OMTFn1 = -1,
15  OMTFn2 = -2,
16  OMTFn3 = -3,
17  OMTFn4 = -4,
18  OMTFn5 = -5,
19  OMTFn6 = -6,
20  OMTFp1 = 1,
21  OMTFp2 = 2,
22  OMTFp3 = 3,
23  OMTFp4 = 4,
24  OMTFp5 = 5,
25  OMTFp6 = 6,
26  UNKNOWN = 0
27  };

Constructor & Destructor Documentation

◆ OmtfName() [1/9]

OmtfName::OmtfName ( Board  board = UNKNOWN)
inline

Definition at line 28 of file OmtfName.h.

28 : theBoard(board) {}
Board theBoard
Definition: OmtfName.h:49

◆ OmtfName() [2/9]

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.

22  {
23  if (board == "OMTFn1")
24  theBoard = OMTFn1;
25  else if (board == "OMTFn2")
26  theBoard = OMTFn2;
27  else if (board == "OMTFn3")
28  theBoard = OMTFn3;
29  else if (board == "OMTFn4")
30  theBoard = OMTFn4;
31  else if (board == "OMTFn5")
32  theBoard = OMTFn5;
33  else if (board == "OMTFn6")
34  theBoard = OMTFn6;
35  else if (board == "OMTFp1")
36  theBoard = OMTFp1;
37  else if (board == "OMTFp2")
38  theBoard = OMTFp2;
39  else if (board == "OMTFp3")
40  theBoard = OMTFp3;
41  else if (board == "OMTFp4")
42  theBoard = OMTFp4;
43  else if (board == "OMTFp5")
44  theBoard = OMTFp5;
45  else if (board == "OMTFp6")
46  theBoard = OMTFp6;
47  else
48  theBoard = OMTFp6;
49 }
Board theBoard
Definition: OmtfName.h:49

◆ OmtfName() [3/9]

OmtfName::OmtfName ( unsigned int  iProcesor,
int  endcap 
)
explicit

Definition at line 10 of file OmtfName.cc.

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

10  {
11  int iproc = (iProcesor <= 5) ? static_cast<int>(iProcesor) : -1;
12  int position = (abs(endcap) == 1) ? endcap : 0;
13  theBoard = static_cast<Board>(sgn(position) * (iproc + 1));
14 }
Board theBoard
Definition: OmtfName.h:49
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:82

◆ OmtfName() [4/9]

OmtfName::OmtfName ( unsigned int  iProcesor,
l1t::tftype  endcap 
)
explicit

Definition at line 16 of file OmtfName.cc.

References makeMuonMisalignmentScenario::endcap, 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:49
float sgn(float val)
Definition: FWPFMaths.cc:9
int position() const
Definition: OmtfName.cc:82

◆ OmtfName() [5/9]

OmtfName::OmtfName ( Board  board = UNKNOWN)
inline

Definition at line 30 of file OmtfName.h.

30 : theBoard(board) {}
Board theBoard
Definition: OmtfName.h:49

◆ OmtfName() [6/9]

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

◆ OmtfName() [7/9]

OmtfName::OmtfName ( unsigned int  iProcesor,
int  endcap,
const OMTFConfiguration omtfConfig 
)
explicit

Definition at line 10 of file OmtfName.cc.

References funct::abs(), makeMuonMisalignmentScenario::endcap, OMTFConfiguration::nProcessors(), position(), FWPFMaths::sgn(), and theBoard.

10  {
11  int iproc = (iProcesor < omtfConfig->nProcessors()) ? static_cast<int>(iProcesor) : -1;
12  int position = (abs(endcap) == 1) ? endcap : 0;
13  theBoard = static_cast<Board>(sgn(position) * (iproc + 1));
14 }
Board theBoard
Definition: OmtfName.h:49
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:82
unsigned int nProcessors() const

◆ OmtfName() [8/9]

OmtfName::OmtfName ( unsigned int  iProcesor,
l1t::tftype  endcap,
const OMTFConfiguration omtfConfig 
)
explicit

Definition at line 16 of file OmtfName.cc.

References makeMuonMisalignmentScenario::endcap, OMTFConfiguration::nProcessors(), l1t::omtf_neg, l1t::omtf_pos, position(), FWPFMaths::sgn(), and theBoard.

16  {
17  int iproc = (iProcesor < omtfConfig->nProcessors()) ? 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:49
float sgn(float val)
Definition: FWPFMaths.cc:9
int position() const
Definition: OmtfName.cc:82
unsigned int nProcessors() const

◆ OmtfName() [9/9]

OmtfName::OmtfName ( unsigned int  iProcesor,
const OMTFConfiguration omtfConfig 
)
explicit

Definition at line 22 of file OmtfName.cc.

References OMTFConfiguration::nProcessors(), and theBoard.

22  {
23  int board = 0;
24  if (iProcesor < omtfConfig->nProcessors()) //OMTFn
25  board = -iProcesor - 1;
26  else //OMTFp
27  board = iProcesor - (omtfConfig->nProcessors() - 1);
28  theBoard = static_cast<Board>(board);
29 }
Board theBoard
Definition: OmtfName.h:49
unsigned int nProcessors() const

Member Function Documentation

◆ name() [1/2]

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

Definition at line 51 of file OmtfName.cc.

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

Referenced by config.CFG::__str__(), validation.Sample::digest(), VIDSelectorBase.VIDSelectorBase::initialize(), EventCapture::observeEventEnd(), XMLEventWriter::observeProcesorBegin(), and XMLConfigWriter::writeEventData().

51  {
52  switch (theBoard) {
53  case (OMTFn1):
54  return "OMTFn1";
55  case (OMTFn2):
56  return "OMTFn2";
57  case (OMTFn3):
58  return "OMTFn3";
59  case (OMTFn4):
60  return "OMTFn4";
61  case (OMTFn5):
62  return "OMTFn5";
63  case (OMTFn6):
64  return "OMTFn6";
65  case (OMTFp1):
66  return "OMTFp1";
67  case (OMTFp2):
68  return "OMTFp2";
69  case (OMTFp3):
70  return "OMTFp3";
71  case (OMTFp4):
72  return "OMTFp4";
73  case (OMTFp5):
74  return "OMTFp5";
75  case (OMTFp6):
76  return "OMTFp6";
77  default:
78  return "UNKNOWN";
79  }
80 }
Board theBoard
Definition: OmtfName.h:49

◆ name() [2/2]

std::string OmtfName::name ( ) const

◆ operator int() [1/2]

OmtfName::operator int ( ) const
inline

Definition at line 38 of file OmtfName.h.

References theBoard.

38 { return theBoard; }
Board theBoard
Definition: OmtfName.h:49

◆ operator int() [2/2]

OmtfName::operator int ( ) const
inline

Definition at line 43 of file OmtfName.h.

References theBoard.

43 { return theBoard; }
Board theBoard
Definition: OmtfName.h:49

◆ operator!=() [1/2]

bool OmtfName::operator!= ( const OmtfName o) const
inline

Definition at line 40 of file OmtfName.h.

References EcalTangentSkim_cfg::o.

40 { return !(*this == o); }

◆ operator!=() [2/2]

bool OmtfName::operator!= ( const OmtfName o) const
inline

Definition at line 45 of file OmtfName.h.

References EcalTangentSkim_cfg::o.

45 { return !(*this == o); }

◆ operator==() [1/2]

bool OmtfName::operator== ( const OmtfName o) const
inline

Definition at line 39 of file OmtfName.h.

References EcalTangentSkim_cfg::o, and theBoard.

39 { return theBoard == o.theBoard; }
Board theBoard
Definition: OmtfName.h:49

◆ operator==() [2/2]

bool OmtfName::operator== ( const OmtfName o) const
inline

Definition at line 44 of file OmtfName.h.

References EcalTangentSkim_cfg::o, and theBoard.

44 { return theBoard == o.theBoard; }
Board theBoard
Definition: OmtfName.h:49

◆ position() [1/2]

int OmtfName::position ( ) const

Definition at line 82 of file OmtfName.cc.

References FWPFMaths::sgn(), and theBoard.

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

82 { return sgn(theBoard); }
Board theBoard
Definition: OmtfName.h:49
float sgn(float val)
Definition: FWPFMaths.cc:9

◆ position() [2/2]

int OmtfName::position ( ) const

◆ processor() [1/2]

unsigned int OmtfName::processor ( ) const

Definition at line 84 of file OmtfName.cc.

References funct::abs(), and theBoard.

Referenced by XMLConfigWriter::writeEventData().

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

◆ processor() [2/2]

unsigned int OmtfName::processor ( ) const

◆ tftype() [1/2]

l1t::tftype OmtfName::tftype ( ) const

Definition at line 86 of file OmtfName.cc.

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

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

◆ tftype() [2/2]

l1t::tftype OmtfName::tftype ( ) const

Friends And Related Function Documentation

◆ operator<< [1/2]

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

Definition at line 51 of file OmtfName.h.

51  {
52  out << n.name();
53  return out;
54  }

◆ operator<< [2/2]

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

Definition at line 56 of file OmtfName.h.

56  {
57  out << n.name();
58  return out;
59  }

Member Data Documentation

◆ theBoard

Board OmtfName::theBoard
private

Definition at line 49 of file OmtfName.h.

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