ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1MUONIF::Lvl1MuEndcapSectorLogicDataPhase1 Class Reference

Class representing data from an endcap SL board. More...

#include <Lvl1MuEndcapSectorLogicDataPhase1.h>

Inheritance diagram for LVL1MUONIF::Lvl1MuEndcapSectorLogicDataPhase1:
Collaboration diagram for LVL1MUONIF::Lvl1MuEndcapSectorLogicDataPhase1:

Public Types

typedef std::pair< unsigned long int, unsigned short int > SectorLogicWord

Public Member Functions

 Lvl1MuEndcapSectorLogicDataPhase1 ()
 ~Lvl1MuEndcapSectorLogicDataPhase1 ()
Lvl1MuEndcapSectorLogicDataPhase1operator= (const Lvl1MuSectorLogicDataPhase1 &right)
SectorLogicWord getWordFormat () const
 Get data in 32 bit word format.
const Lvl1MuSectorLogicDataPhase1convertFromWordFormat (const SectorLogicWord &)
 Convert SectorLogicDataPhase1 from 32 bit word data.
bool is2candidatesInSector () const
int bcid () const
void bcid (int value)
int nsw () const
void nsw (int value)
int roi (size_t id) const
void roi (size_t id, int value)
int ovl (size_t id) const
void ovl (size_t id, int value)
int pt (size_t id) const
void pt (size_t id, int value)
int charge (size_t id) const
void charge (size_t id, int value)
bool is2candidates (size_t id) const
int goodmf (size_t id) const
void goodmf (size_t id, int value)
int innercoin (size_t id) const
void innercoin (size_t id, int value)
int bw2or3 (size_t id) const
void bw2or3 (size_t id, int value)
int veto (size_t id) const
void veto (size_t id, int value)
void set2candidatesInSector ()
void clear2candidatesInSector ()
void set2candidates (size_t id)
void clear2candidates (size_t id)
void clear ()
int getSystemId () const

Protected Member Functions

virtual void printOut (std::ostream &out) const
 print out data
void initialize ()

Protected Attributes

bool m_2candidatesInSector
std::vector< int > m_roi
std::vector< int > m_ovl
std::vector< int > m_pt
std::vector< bool > m_2candidates
int m_bcid
int m_nsw
std::vector< int > m_charge
int m_id_system
std::vector< int > m_goodmf
std::vector< int > m_innercoin
std::vector< int > m_bw2or3
std::vector< int > m_veto

Detailed Description

Class representing data from an endcap SL board.

   This class representds the data coming from a single
   TGC endcap SL board to the MuCTPI.
See also
LVL1MUONIF::Lvl1MuSectorLogicDataPhase1
Revision
187728
Date
2009-05-27 18:18:06 +0200 (Wed, 27 May 2009)

Definition at line 26 of file Lvl1MuEndcapSectorLogicDataPhase1.h.

Member Typedef Documentation

◆ SectorLogicWord

typedef std::pair<unsigned long int, unsigned short int> LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::SectorLogicWord
inherited

Definition at line 45 of file Lvl1MuSectorLogicDataPhase1.h.

Constructor & Destructor Documentation

◆ Lvl1MuEndcapSectorLogicDataPhase1()

LVL1MUONIF::Lvl1MuEndcapSectorLogicDataPhase1::Lvl1MuEndcapSectorLogicDataPhase1 ( )

◆ ~Lvl1MuEndcapSectorLogicDataPhase1()

LVL1MUONIF::Lvl1MuEndcapSectorLogicDataPhase1::~Lvl1MuEndcapSectorLogicDataPhase1 ( )
inline

Definition at line 30 of file Lvl1MuEndcapSectorLogicDataPhase1.h.

30{}

Member Function Documentation

◆ bcid() [1/2]

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::bcid ( ) const
inlineinherited

◆ bcid() [2/2]

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::bcid ( int value)
inlineinherited

Definition at line 62 of file Lvl1MuSectorLogicDataPhase1.h.

62{ m_bcid = value; }

◆ bw2or3() [1/2]

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::bw2or3 ( size_t id) const
inlineinherited

◆ bw2or3() [2/2]

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::bw2or3 ( size_t id,
int value )
inlineinherited

Definition at line 72 of file Lvl1MuSectorLogicDataPhase1.h.

72{m_bw2or3[ id ] = value; }

◆ charge() [1/2]

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::charge ( size_t id) const
inlineinherited

Definition at line 53 of file Lvl1MuSectorLogicDataPhase1.h.

◆ charge() [2/2]

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::charge ( size_t id,
int value )
inlineinherited

Definition at line 67 of file Lvl1MuSectorLogicDataPhase1.h.

67{ m_charge[ id ] = value; }

◆ clear()

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::clear ( )
inherited

Definition at line 86 of file Lvl1MuSectorLogicDataPhase1.cxx.

86 {
88 m_bcid = 0;
89 m_nsw = 0;
90 for ( size_t i = 0; i < NCAND[m_id_system]; ++i ) {
91 m_roi[ i ] = -1;
92 m_ovl[ i ] = -1;
93 m_pt[ i ] = -1;
94 m_charge[ i ] = -1;
95 m_2candidates[ i ] = false;
96 m_goodmf[ i ] = -1;
97 m_innercoin[ i ] = -1;
98 m_bw2or3[ i ] = -1;
99 m_veto[ i ] = 0;
100 }
101 }
static const size_t NCAND[3]

◆ clear2candidates()

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::clear2candidates ( size_t id)
inlineinherited

Definition at line 69 of file Lvl1MuSectorLogicDataPhase1.h.

69{ m_2candidates[ id ] = false; }

◆ clear2candidatesInSector()

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::clear2candidatesInSector ( )
inlineinherited

Definition at line 61 of file Lvl1MuSectorLogicDataPhase1.h.

61{ m_2candidatesInSector = false;}

◆ convertFromWordFormat()

const Lvl1MuSectorLogicDataPhase1 & LVL1MUONIF::Lvl1MuEndcapSectorLogicDataPhase1::convertFromWordFormat ( const SectorLogicWord & value)
virtual

Convert SectorLogicDataPhase1 from 32 bit word data.

Implements LVL1MUONIF::Lvl1MuSectorLogicDataPhase1.

Definition at line 108 of file Lvl1MuEndcapSectorLogicDataPhase1.cxx.

108 {
109
110 unsigned int val;
111 unsigned int pos=0;
112 unsigned int len=0;
113 for (size_t i=0;i<NCAND[m_id_system];i++)
114 {
115 //track current position and length of current data
116 len=0;
117 pos=0;
118
119 // Candidate 'i' will be offset by 16*i bits
120 //0-7: ROI - 8 bits
122 val = (value.first >> (i*16+pos)) & len;
123 if (val == len) roi(i, -1);
124 else roi(i, val);
125 pos += len;
126
127 //8-11: pT - 4 bits
129 val = (value.first >> (i*16+pos)) & len;
130 if (val == len) pt(i, -1);
131 else pt(i, val);
132 pos += len;
133
134 //12: charge
136 val = (value.first >> (i*16+pos)) & len;
137 if (val > 0) charge(i, +1);
138 else charge(i, -1);
139 pos += len;
140
141 //13: 2 or 3 hits in BW
143 val = (value.first >> (i*16+pos)) & len;
144 bw2or3(i, val);
145 pos += len;
146
147 //14: inner coincidence
149 val = (value.first >> (i*16+pos)) & len;
150 innercoin(i, val);
151 pos += len;
152
153 //15: GoodMF
155 val = (value.first >> (i*16+pos)) & len;
156 goodmf(i, val);
157 pos += len;
158 }
159
160 // Global+BCID flags (bits 32-47)
161 len=0;
162 pos=0;
163
164 //0-11: BCID
166 val = value.second & len;
167 bcid(val);
168 pos += len;
169
170 //12: > 2 candidates
172 val = (value.second >> pos) & len;
173 if (val) set2candidatesInSector();
175
176 //13: nsw monitoring
178 val = (value.second >> pos) & len;
179 nsw(val);
180
181 //14-15: other global flags (empty for now)
182
183 return *this;
184 }
static const unsigned int NBITS_CHARGE[3]
static const unsigned int NBITS_ROI[3]
static const unsigned int NBITS_BW2OR3[3]
static const unsigned int NBITS_IS2CANDIDATESINSECTOR[3]
static const unsigned int NBITS_GOODMF[3]
static const unsigned int NBITS_PT[3]
static const unsigned int NBITS_NSWMON[3]
static const unsigned int NBITS_BCID[3]
static const unsigned int NBITS_INNERCOIN[3]

◆ getSystemId()

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::getSystemId ( ) const
inlineinherited

Definition at line 84 of file Lvl1MuSectorLogicDataPhase1.h.

84{ return m_id_system; }

◆ getWordFormat()

Lvl1MuSectorLogicDataPhase1::SectorLogicWord LVL1MUONIF::Lvl1MuEndcapSectorLogicDataPhase1::getWordFormat ( ) const
virtual

Get data in 32 bit word format.

Implements LVL1MUONIF::Lvl1MuSectorLogicDataPhase1.

Definition at line 39 of file Lvl1MuEndcapSectorLogicDataPhase1.cxx.

39 {
40
41 SectorLogicWord val(std::make_pair(0, 0));
42 unsigned int len=0;
43 unsigned int pos=0;
44 for (size_t i=0;i<NCAND[m_id_system];i++)
45 {
46 //track current position and length of current data
47 len=0;
48 pos=0;
49
50 // Candidate 'i' will be offset by 16*i bits
51 //0-7: ROI - 8 bits
53 if (roi(i) < 0) val.first |= len << (i*16+pos);
54 else val.first |= (roi(i) & len) << (i*16+pos);
55 pos += len;
56
57 //8-11: pT - 4 bits
59 val.first |= (pt(i) & len) << (i*16+pos);
60 pos += len;
61
62 //12: charge
64 val.first |= (charge(i) & len) << (i*16+pos);
65 pos += len;
66
67 //13: 2 or 3 hits in BW
69 val.first |= (bw2or3(i) & len) << (i*16+pos);
70 pos += len;
71
72 //14: inner coincidence
74 if (charge(i) > 0) val.first |= (1 >> (i*16+pos)) & len;
75 pos += len;
76
77 //15: GoodMF
79 val.first |= (goodmf(i) & len) << (i*16+pos);
80 pos += len;
81 }
82
83
84 // Global+BCID flags (bits 32-47)
85 len=0;
86 pos=0;
87
88 //0-11: BCID
90 val.second |= ( bcid() & len);
91 pos += len;
92
93 //12-15: global flags
94 //12: >1cand/sector
96 if (is2candidatesInSector()) val.second |= (1 >> pos) & len;
97 pos += len;
98
99 //13: nsw monitoring
101 if (nsw()) val.second |= (1 >> pos) & len;
102 pos += len;
103
104 return val;
105 }
std::pair< unsigned long int, unsigned short int > SectorLogicWord

◆ goodmf() [1/2]

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::goodmf ( size_t id) const
inlineinherited

Definition at line 55 of file Lvl1MuSectorLogicDataPhase1.h.

55{ return m_goodmf[ id ]; }

◆ goodmf() [2/2]

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::goodmf ( size_t id,
int value )
inlineinherited

Definition at line 70 of file Lvl1MuSectorLogicDataPhase1.h.

70{m_goodmf[ id ] = value; }

◆ initialize()

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::initialize ( )
protectedinherited

Definition at line 35 of file Lvl1MuSectorLogicDataPhase1.cxx.

36 {
37 if (m_id_system == -1) return;
38
39 size_t ncand = NCAND[m_id_system];
40 for ( size_t i = 0; i < ncand; ++i ) {
41 m_roi.push_back(-1);
42 m_ovl.push_back(-1);
43 m_pt.push_back(-1);
44 m_charge.push_back(+1);
45 m_2candidates.push_back(false);
46 m_goodmf.push_back(-1);
47 m_innercoin.push_back(-1);
48 m_bw2or3.push_back(-1);
49 m_veto.push_back(0);
50 }
51 }

◆ innercoin() [1/2]

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::innercoin ( size_t id) const
inlineinherited

Definition at line 56 of file Lvl1MuSectorLogicDataPhase1.h.

56{ return m_innercoin[ id ]; }

◆ innercoin() [2/2]

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::innercoin ( size_t id,
int value )
inlineinherited

Definition at line 71 of file Lvl1MuSectorLogicDataPhase1.h.

71{m_innercoin[ id ] = value; }

◆ is2candidates()

bool LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::is2candidates ( size_t id) const
inlineinherited

Definition at line 54 of file Lvl1MuSectorLogicDataPhase1.h.

54{ return m_2candidates[ id ]; } // per ROI (not used for mult counting)

◆ is2candidatesInSector()

bool LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::is2candidatesInSector ( ) const
inlineinherited

Definition at line 47 of file Lvl1MuSectorLogicDataPhase1.h.

47{ return m_2candidatesInSector; } // MORE than two candidates per sector

◆ nsw() [1/2]

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::nsw ( ) const
inlineinherited

Definition at line 49 of file Lvl1MuSectorLogicDataPhase1.h.

49{return m_nsw; } // NSW monitoring bit

◆ nsw() [2/2]

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::nsw ( int value)
inlineinherited

Definition at line 63 of file Lvl1MuSectorLogicDataPhase1.h.

63{m_nsw = value; }

◆ operator=()

Lvl1MuEndcapSectorLogicDataPhase1 & LVL1MUONIF::Lvl1MuEndcapSectorLogicDataPhase1::operator= ( const Lvl1MuSectorLogicDataPhase1 & right)

Definition at line 18 of file Lvl1MuEndcapSectorLogicDataPhase1.cxx.

18 {
19 if ( ( right.getSystemId() == m_id_system ) &&
20 ( this != &right ) ) {
21 m_bcid = right.bcid();
22 m_nsw = right.nsw();
23 m_2candidatesInSector = right.is2candidatesInSector();
24 for ( size_t i = 0; i < NCAND[m_id_system]; ++i ) {
25 m_roi[ i ] = right.roi( i );
26 m_ovl[ i ] = right.ovl( i );
27 m_pt[ i ] = right.pt( i );
28 m_charge[ i ] = right.charge( i );
29 m_2candidates[ i ] = right.is2candidates( i );
30 m_goodmf[ i ] = right.goodmf(i);
31 m_innercoin[ i ] = right.innercoin(i);
32 m_bw2or3[ i ] = right.bw2or3(i);
33 m_veto[ i ] = right.veto(i);
34 }
35 }
36 return *this;
37 }

◆ ovl() [1/2]

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::ovl ( size_t id) const
inlineinherited

Definition at line 51 of file Lvl1MuSectorLogicDataPhase1.h.

51{ return m_ovl[ id ]; }

◆ ovl() [2/2]

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::ovl ( size_t id,
int value )
inlineinherited

Definition at line 65 of file Lvl1MuSectorLogicDataPhase1.h.

65{ m_ovl[ id ] = value; }

◆ printOut()

void LVL1MUONIF::Lvl1MuEndcapSectorLogicDataPhase1::printOut ( std::ostream & out) const
protectedvirtual

print out data

Implements LVL1MUONIF::Lvl1MuSectorLogicDataPhase1.

Definition at line 187 of file Lvl1MuEndcapSectorLogicDataPhase1.cxx.

187 {
188
189 for (size_t i=0;i<NCAND[m_id_system];i++)
190 {
191 out << "Bit 0-7 " << " ROI<" << i+1 << "> ";
192 if (roi(i) == -1) out << "NA" << std::endl;
193 else out << std::setw(8) << roi(i) << std::endl;
194
195 out << "Bit 8-11 "<< "Pt" << i+1 << " ";
196 if (pt(i) == -1) out << "No Hit" << std::endl;
197 else out << pt(i) << std::endl;
198
199 out << "Bit 12 "<<"2 candidates in ROI<" << i+1 << "> ";
200 out << std::setw(8) << is2candidates(i) << std::endl;
201
202 out << "Bit 13-14 "<<"overlap<"<<i+1<<"> ";
203 out << std::setw(8) << ovl(i) << std::endl;
204
205 out << "Bit 15 "<<"charge<"<<i+1<<"> ";
206 out << std::setw(8) << charge(i) << std::endl;
207 }
208 out << "Bit 0-11 " << " BCID ";
209 out << std::setw( 8 ) << bcid() << std::endl;
210
211 out << "Bit 12 " << " >2candidates in a sector ";
212 out << std::setw( 8 ) << m_2candidatesInSector << std::endl;
213
214 out << "Bit 13 " << " NSW monitoring ";
215 out << std::setw( 8 ) << m_nsw << std::endl;
216 }

◆ pt() [1/2]

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::pt ( size_t id) const
inlineinherited

Definition at line 52 of file Lvl1MuSectorLogicDataPhase1.h.

52{ return m_pt[ id ]; }

◆ pt() [2/2]

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::pt ( size_t id,
int value )
inlineinherited

Definition at line 66 of file Lvl1MuSectorLogicDataPhase1.h.

66{ m_pt[ id ] = value; }

◆ roi() [1/2]

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::roi ( size_t id) const
inlineinherited

Definition at line 50 of file Lvl1MuSectorLogicDataPhase1.h.

50{ return m_roi[ id ]; }

◆ roi() [2/2]

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::roi ( size_t id,
int value )
inlineinherited

Definition at line 64 of file Lvl1MuSectorLogicDataPhase1.h.

64{ m_roi[ id ] = value; }

◆ set2candidates()

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::set2candidates ( size_t id)
inlineinherited

Definition at line 68 of file Lvl1MuSectorLogicDataPhase1.h.

68{ m_2candidates[ id ] = true; }

◆ set2candidatesInSector()

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::set2candidatesInSector ( )
inlineinherited

Definition at line 60 of file Lvl1MuSectorLogicDataPhase1.h.

60{ m_2candidatesInSector = true; }

◆ veto() [1/2]

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::veto ( size_t id) const
inlineinherited

Definition at line 58 of file Lvl1MuSectorLogicDataPhase1.h.

58{return m_veto[ id ]; } // veto candidate for multiplicity counting due to overlap removal

◆ veto() [2/2]

void LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::veto ( size_t id,
int value )
inlineinherited

Definition at line 73 of file Lvl1MuSectorLogicDataPhase1.h.

73{m_veto[ id ] = value; }

Member Data Documentation

◆ m_2candidates

std::vector<bool> LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_2candidates
protectedinherited

Definition at line 95 of file Lvl1MuSectorLogicDataPhase1.h.

◆ m_2candidatesInSector

bool LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_2candidatesInSector
protectedinherited

Definition at line 91 of file Lvl1MuSectorLogicDataPhase1.h.

◆ m_bcid

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_bcid
protectedinherited

Definition at line 96 of file Lvl1MuSectorLogicDataPhase1.h.

◆ m_bw2or3

std::vector<int> LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_bw2or3
protectedinherited

Definition at line 102 of file Lvl1MuSectorLogicDataPhase1.h.

◆ m_charge

std::vector<int> LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_charge
protectedinherited

Definition at line 98 of file Lvl1MuSectorLogicDataPhase1.h.

◆ m_goodmf

std::vector<int> LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_goodmf
protectedinherited

Definition at line 100 of file Lvl1MuSectorLogicDataPhase1.h.

◆ m_id_system

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_id_system
protectedinherited

Definition at line 99 of file Lvl1MuSectorLogicDataPhase1.h.

◆ m_innercoin

std::vector<int> LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_innercoin
protectedinherited

Definition at line 101 of file Lvl1MuSectorLogicDataPhase1.h.

◆ m_nsw

int LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_nsw
protectedinherited

Definition at line 97 of file Lvl1MuSectorLogicDataPhase1.h.

◆ m_ovl

std::vector<int> LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_ovl
protectedinherited

Definition at line 93 of file Lvl1MuSectorLogicDataPhase1.h.

◆ m_pt

std::vector<int> LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_pt
protectedinherited

Definition at line 94 of file Lvl1MuSectorLogicDataPhase1.h.

◆ m_roi

std::vector<int> LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_roi
protectedinherited

Definition at line 92 of file Lvl1MuSectorLogicDataPhase1.h.

◆ m_veto

std::vector<int> LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::m_veto
protectedinherited

Definition at line 103 of file Lvl1MuSectorLogicDataPhase1.h.


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