ATLAS Offline Software
Loading...
Searching...
No Matches
CMAidentity Class Reference

#include <CMAidentity.h>

Collaboration diagram for CMAidentity:

Classes

struct  defineParams

Public Types

typedef std::pair< int, int > Offline_indexes
typedef std::string PhiCoverage

Public Member Functions

 CMAidentity (const defineParams &pars)
 CMAidentity (ViewType, CMAcoverage, int, int, int, int, int)
 CMAidentity (ViewType, CMAcoverage, int)
 CMAidentity (ViewType, CMAcoverage, Offline_indexes &)
 CMAidentity (ViewType, CMAcoverage, int, int)
 ~CMAidentity ()=default
 CMAidentity (const CMAidentity &)=default
CMAidentityoperator= (const CMAidentity &)=default
bool operator== (const CMAidentity &) const
bool operator!= (const CMAidentity &) const
bool operator< (const CMAidentity &) const
ViewType type () const
CMAcoverage coverage () const
int number () const
int eta_index () const
int phi_index () const
int PAD_index () const
int Ixx_index () const
void inversion ()
CMAidentityoperator+= (const CMAidentity &)

Static Public Member Functions

static bool coverage (const std::string &, CMAcoverage &)
static const char * covtag (const CMAcoverage co)
static const std::string name (const ViewType, const CMAcoverage)

Static Public Attributes

static const char CoverageTAG [3][5] = {{"even"}, {"odd"}, {""}}

Private Member Functions

CMAcoverage which_sector (PhiCoverage)

Private Attributes

defineParams m_params {}

Friends

std::ostream & operator<< (std::ostream &stream, const CMAidentity &id)

Detailed Description

Definition at line 16 of file CMAidentity.h.

Member Typedef Documentation

◆ Offline_indexes

typedef std::pair<int, int> CMAidentity::Offline_indexes

Definition at line 18 of file CMAidentity.h.

◆ PhiCoverage

typedef std::string CMAidentity::PhiCoverage

Definition at line 19 of file CMAidentity.h.

Constructor & Destructor Documentation

◆ CMAidentity() [1/6]

CMAidentity::CMAidentity ( const defineParams & pars)

Definition at line 29 of file CMAidentity.cxx.

29: m_params{pars} {}
defineParams m_params
Definition CMAidentity.h:43

◆ CMAidentity() [2/6]

CMAidentity::CMAidentity ( ViewType view,
CMAcoverage side,
int number,
int eta_index,
int phi_index,
int PAD_index,
int Ixx_index )

Definition at line 31 of file CMAidentity.cxx.

31 {
32 m_params.view = view;
33 m_params.coverage = side;
34 m_params.seqNumber = number;
35 m_params.etaIndex = eta_index;
36 m_params.phiIndex = phi_index;
37 m_params.padIndex = PAD_index;
38 m_params.IxxIndex = Ixx_index;
39}
int number() const
int Ixx_index() const
int PAD_index() const
int eta_index() const
int phi_index() const

◆ CMAidentity() [3/6]

CMAidentity::CMAidentity ( ViewType view,
CMAcoverage side,
int number )

Definition at line 41 of file CMAidentity.cxx.

41 {
42 m_params.view = view;
43 m_params.coverage = side;
44 m_params.seqNumber = number;
45}

◆ CMAidentity() [4/6]

CMAidentity::CMAidentity ( ViewType view,
CMAcoverage side,
Offline_indexes & indexes )

Definition at line 47 of file CMAidentity.cxx.

47 {
48 m_params.view = view;
49 m_params.coverage = side;
50 m_params.etaIndex = indexes.first;
51 m_params.phiIndex = indexes.second;
52}

◆ CMAidentity() [5/6]

CMAidentity::CMAidentity ( ViewType view,
CMAcoverage side,
int PAD,
int Ixx )

Definition at line 54 of file CMAidentity.cxx.

54 {
55 m_params.view = view;
56 m_params.coverage = side;
57 m_params.padIndex = PAD;
58 m_params.IxxIndex = Ixx;
59}

◆ ~CMAidentity()

CMAidentity::~CMAidentity ( )
default

◆ CMAidentity() [6/6]

CMAidentity::CMAidentity ( const CMAidentity & )
default

Member Function Documentation

◆ coverage() [1/2]

CMAcoverage CMAidentity::coverage ( ) const

Definition at line 118 of file CMAidentity.cxx.

118{ return m_params.coverage; }

◆ coverage() [2/2]

bool CMAidentity::coverage ( const std::string & side,
CMAcoverage & cov )
static

Definition at line 12 of file CMAidentity.cxx.

12 {
13 for (int i = EvenSectors; i <= AllSectors; ++i) {
14 std::string tag(CoverageTAG[i]);
15 if (side == tag) {
16 cov = (CMAcoverage)i;
17 return true;
18 }
19 }
20 return false;
21}
CMAcoverage
Definition CMAidentity.h:14
@ AllSectors
Definition CMAidentity.h:14
@ EvenSectors
Definition CMAidentity.h:14
static const char CoverageTAG[3][5]
Definition CMAidentity.h:10

◆ covtag()

const char * CMAidentity::covtag ( const CMAcoverage co)
inlinestatic

Definition at line 24 of file CMAidentity.h.

24{ return CoverageTAG[co]; }

◆ eta_index()

int CMAidentity::eta_index ( ) const

Definition at line 120 of file CMAidentity.cxx.

120{ return m_params.etaIndex; }

◆ inversion()

void CMAidentity::inversion ( )

Definition at line 96 of file CMAidentity.cxx.

96{ m_params.IxxIndex = (m_params.IxxIndex == 0) ? 1 : 0; }

◆ Ixx_index()

int CMAidentity::Ixx_index ( ) const

Definition at line 123 of file CMAidentity.cxx.

123{ return m_params.IxxIndex; }

◆ name()

const std::string CMAidentity::name ( const ViewType view,
const CMAcoverage coverage )
static

Definition at line 23 of file CMAidentity.cxx.

23 {
24 std::string cover(CMAidentity::covtag(coverage));
25 std::string side = view == ViewType::Eta ? "Eta" : (view == ViewType::Phi ? "Phi" : "NoView");
26 std::string v_name = cover + side + "CMA";
27 return v_name;
28}
@ Phi
Definition RPCdef.h:8
@ Eta
Definition RPCdef.h:8
static const char * covtag(const CMAcoverage co)
Definition CMAidentity.h:24
static bool coverage(const std::string &, CMAcoverage &)

◆ number()

int CMAidentity::number ( ) const

Definition at line 119 of file CMAidentity.cxx.

119{ return m_params.seqNumber; }

◆ operator!=()

bool CMAidentity::operator!= ( const CMAidentity & id) const

Definition at line 75 of file CMAidentity.cxx.

75{ return !(*this == id); }

◆ operator+=()

CMAidentity & CMAidentity::operator+= ( const CMAidentity & id)

Definition at line 86 of file CMAidentity.cxx.

86 {
87 if (*this != id) return *this;
88 if (m_params.seqNumber == -1) m_params.seqNumber = id.number();
89 if (m_params.etaIndex == -1) m_params.etaIndex = id.eta_index();
90 if (m_params.phiIndex == -1) m_params.phiIndex = id.phi_index();
91 if (m_params.padIndex == -1) m_params.padIndex = id.PAD_index();
92 if (m_params.IxxIndex == -1) m_params.IxxIndex = id.Ixx_index();
93 return *this;
94}

◆ operator<()

bool CMAidentity::operator< ( const CMAidentity & id) const

Definition at line 77 of file CMAidentity.cxx.

77 {
78 if (*this == id) return false;
79 if (m_params.view < id.type()) return true;
80 if (m_params.coverage < id.coverage()) return true;
81 int id1 = m_params.etaIndex * 10 + m_params.phiIndex;
82 int id2 = id.eta_index() * 10 + id.phi_index();
83 return id1 < id2;
84}
HWIdentifier id2

◆ operator=()

CMAidentity & CMAidentity::operator= ( const CMAidentity & )
default

◆ operator==()

bool CMAidentity::operator== ( const CMAidentity & id) const

Definition at line 61 of file CMAidentity.cxx.

61 {
62 if (m_params.view == id.type() && m_params.coverage == id.coverage()) {
63 if (number() >= 0)
64 if (number() == id.number()) return true;
65
66 if (m_params.etaIndex >= 0)
67 if (m_params.etaIndex == id.eta_index() && m_params.phiIndex == id.phi_index()) return true;
68
69 if (m_params.padIndex >= 0)
70 if (m_params.padIndex == id.PAD_index() && m_params.IxxIndex == id.Ixx_index()) return true;
71 }
72 return false;
73}

◆ PAD_index()

int CMAidentity::PAD_index ( ) const

Definition at line 122 of file CMAidentity.cxx.

122{ return m_params.padIndex; }

◆ phi_index()

int CMAidentity::phi_index ( ) const

Definition at line 121 of file CMAidentity.cxx.

121{ return m_params.phiIndex; }

◆ type()

ViewType CMAidentity::type ( ) const

Definition at line 117 of file CMAidentity.cxx.

117{ return m_params.view; }

◆ which_sector()

CMAcoverage CMAidentity::which_sector ( PhiCoverage )
private

◆ operator<<

std::ostream & operator<< ( std::ostream & stream,
const CMAidentity & id )
friend

Definition at line 98 of file CMAidentity.cxx.

98 {
99 char exttag[5] = {' ', ' ', ' ', ' ', '\0'};
100 const char* tag = CMAidentity::covtag(id.m_params.coverage);
101 for (int i = 0; i < 5; ++i) {
102 if (tag[i] == '\0') break;
103 exttag[i] = tag[i];
104 }
105
106 std::string covtag(exttag);
107
108 std::string type = (id.type() == Phi) ? " phi cma " + covtag : " eta cma " + covtag;
109 if (!covtag.empty()) type = type + " ";
110 stream << type << std::setw(2) << id.number() << ": Eta ";
111 stream << std::setw(2) << id.eta_index();
112 stream << " Phi " << std::setw(2) << id.phi_index();
113 stream << " PAD " << std::setw(2) << id.PAD_index();
114 stream << " Ixx " << std::setw(2) << id.Ixx_index();
115 return stream;
116}
ViewType type() const

Member Data Documentation

◆ CoverageTAG

const char CMAidentity::CoverageTAG = {{"even"}, {"odd"}, {""}}
static

Definition at line 10 of file CMAidentity.h.

◆ m_params

defineParams CMAidentity::m_params {}
private

Definition at line 43 of file CMAidentity.h.

43{};

The documentation for this class was generated from the following files: