ATLAS Offline Software
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
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 &, const CMAidentity &)
 

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

◆ 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.

◆ 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;
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;
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;
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 }

◆ covtag()

static 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 }

◆ 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 }

◆ 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

Friends And Related Function Documentation

◆ 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 }

Member Data Documentation

◆ CoverageTAG

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

Definition at line 21 of file CMAidentity.h.

◆ m_params

defineParams CMAidentity::m_params {}
private

Definition at line 43 of file CMAidentity.h.


The documentation for this class was generated from the following files:
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
CMAidentity::CoverageTAG
static const char CoverageTAG[3][5]
Definition: CMAidentity.h:21
CMAidentity::type
ViewType type() const
Definition: CMAidentity.cxx:117
CMAcoverage
CMAcoverage
Definition: CMAidentity.h:14
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
Phi
@ Phi
Definition: RPCdef.h:8
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
TRT::Hit::side
@ side
Definition: HitInfo.h:83
CMAidentity::defineParams::IxxIndex
int IxxIndex
PAD index into the sector logic (start from 0)
Definition: CMAidentity.h:38
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:562
lumiFormat.i
int i
Definition: lumiFormat.py:85
EvenSectors
@ EvenSectors
Definition: CMAidentity.h:14
AllSectors
@ AllSectors
Definition: CMAidentity.h:14
CMAidentity::m_params
defineParams m_params
Definition: CMAidentity.h:43
CMAidentity::covtag
static const char * covtag(const CMAcoverage co)
Definition: CMAidentity.h:24
CMAidentity::Ixx_index
int Ixx_index() const
Definition: CMAidentity.cxx:123
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
CMAidentity::eta_index
int eta_index() const
Definition: CMAidentity.cxx:120
CMAidentity::PAD_index
int PAD_index() const
Definition: CMAidentity.cxx:122
CMAidentity::defineParams::view
ViewType view
Definition: CMAidentity.h:34
CMAidentity::defineParams::coverage
CMAcoverage coverage
CMA identity params.
Definition: CMAidentity.h:33
CMAidentity::defineParams::etaIndex
int etaIndex
Matrix type (0 = eta matrix, 1 = phi matrix)
Definition: CMAidentity.h:35
CMAidentity::defineParams::phiIndex
int phiIndex
Matrix eta address (start from 0)
Definition: CMAidentity.h:36
CMAidentity::phi_index
int phi_index() const
Definition: CMAidentity.cxx:121
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
CMAidentity::coverage
CMAcoverage coverage() const
Definition: CMAidentity.cxx:118
CMAidentity::defineParams::seqNumber
int seqNumber
Matrix index into the PAD (start from 0)
Definition: CMAidentity.h:39
CMAidentity::number
int number() const
Definition: CMAidentity.cxx:119
CMAidentity::defineParams::padIndex
int padIndex
Matrix chi address (start from 0)
Definition: CMAidentity.h:37
Eta
@ Eta
Definition: RPCdef.h:8
drawFromPickle.view
view
Definition: drawFromPickle.py:294