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

Class representing data from a barrel SL board. More...

#include <Lvl1MuBarrelSectorLogicDataPhase1.h>

Inheritance diagram for LVL1MUONIF::Lvl1MuBarrelSectorLogicDataPhase1:
Collaboration diagram for LVL1MUONIF::Lvl1MuBarrelSectorLogicDataPhase1:

Public Types

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

Public Member Functions

 Lvl1MuBarrelSectorLogicDataPhase1 ()
virtual ~Lvl1MuBarrelSectorLogicDataPhase1 ()
Lvl1MuBarrelSectorLogicDataPhase1operator= (const Lvl1MuSectorLogicDataPhase1 &right)
virtual SectorLogicWord getWordFormat () const override
 Get data in 32 bit word format.
virtual const Lvl1MuSectorLogicDataPhase1convertFromWordFormat (const SectorLogicWord &) override
 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 override
 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 a barrel SL board.

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

Definition at line 26 of file Lvl1MuBarrelSectorLogicDataPhase1.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

◆ Lvl1MuBarrelSectorLogicDataPhase1()

LVL1MUONIF::Lvl1MuBarrelSectorLogicDataPhase1::Lvl1MuBarrelSectorLogicDataPhase1 ( )

◆ ~Lvl1MuBarrelSectorLogicDataPhase1()

virtual LVL1MUONIF::Lvl1MuBarrelSectorLogicDataPhase1::~Lvl1MuBarrelSectorLogicDataPhase1 ( )
inlinevirtual

Definition at line 30 of file Lvl1MuBarrelSectorLogicDataPhase1.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::Lvl1MuBarrelSectorLogicDataPhase1::convertFromWordFormat ( const SectorLogicWord & value)
overridevirtual

Convert SectorLogicDataPhase1 from 32 bit word data.

Implements LVL1MUONIF::Lvl1MuSectorLogicDataPhase1.

Definition at line 112 of file Lvl1MuBarrelSectorLogicDataPhase1.cxx.

112 {
113
114 unsigned int val;
115 unsigned int pos=0;
116 unsigned int len=0;
117 for (size_t i=0;i<NCAND[m_id_system];i++)
118 {
119 //track current position and length of current data
120 len=0;
121 pos=0;
122 bool noROI=0;
123
124 // Candidate 'i' will be offset by 16*i bits
125 //0-4: ROI - 5 bits
127 val = (value.first >> (i*16+pos)) & len;
128 if (val == len)
129 {
130 noROI=1;
131 roi(i, -1);
132 ovl(i, -1);
133 }
134 else roi(i, val);
135 pos += len;
136
137 //5-7: Nothing - 3 bits
138 len=3;
139 pos += len;
140
141 //8-10: pT - 3 bits
143 val = (value.first >> (i*16+pos)) & len;
144 if (val == len) pt(i, -1);
145 else pt(i, val);
146 pos += len;
147
148 //11: Nothing - 1 bit
149 len=1;
150 pos += len;
151
152 //12: 2 candidates in ROI
154 val = (value.first >> (i*16+pos)) & len;
155 if (val == len) set2candidates(i);
156 else clear2candidates(i);
157 pos += len;
158
159 //13-14: overlap
161 val = (value.first >> (i*16+pos)) & len;
162 if (!noROI) ovl(i, val);
163 pos += len;
164
165 //15: charge?
167 val = (value.first >> (i*16+pos)) & len;
168 if (val > 0) charge(i, +1);
169 else charge(i, -1); // should this be -1 or 0?
170 pos += len;
171 }
172
173 // Global+BCID flags (bits 32-47)
174 len=0;
175 pos=0;
176
177 //0-11: BCID
179 val = value.second & len;
180 bcid(val);
181 pos += len;
182
183 //12: > 2 candidates
185 val = (value.second >> pos) & len;
186 if (val) set2candidatesInSector();
188 pos += len;
189
190 //13-15: other global flags
191
192
193 return *this;
194 }
static const unsigned int NBITS_CHARGE[3]
static const unsigned int NBITS_ROI[3]
static const unsigned int NBITS_OVL[3]
static const unsigned int NBITS_IS2CANDIDATESINSECTOR[3]
static const unsigned int NBITS_PT[3]
static const unsigned int NBITS_BCID[3]
static const unsigned int NBITS_IS2CANDIDATES[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::Lvl1MuBarrelSectorLogicDataPhase1::getWordFormat ( ) const
overridevirtual

Get data in 32 bit word format.

Implements LVL1MUONIF::Lvl1MuSectorLogicDataPhase1.

Definition at line 38 of file Lvl1MuBarrelSectorLogicDataPhase1.cxx.

38 {
39
40 SectorLogicWord val(std::make_pair(0, 0));
41 unsigned int len=0;
42 unsigned int pos=0;
43 for (size_t i=0;i<NCAND[m_id_system];i++)
44 {
45 //track current position and length of current data
46 len=0;
47 pos=0;
48 bool noROI=0;
49
50 // Candidate 'i' will be offset by 16*i bits
51 //0-4: ROI - 5 bits
53 if (roi(i) < 0)
54 {
55 val.first |= len << (i*16+pos);
56 noROI=1;
57 }
58 else val.first |= (roi(i) & len) << (i*16+pos);
59 pos += len;
60
61 //5-7: Nothing - 3 bits
62 len=3;
63 pos += len;
64
65 //8-10: pT - 3 bits
67 if (pt(i) < 0) val.first |= len << (i*16+pos);
68 else val.first |= (pt(i) & len) << (i*16+pos);
69 pos += len;
70
71 //11: Nothing - 1 bit
72 len=1;
73 pos += len;
74
75 //12: 2 candidates in ROI
77 val.first |= (is2candidates(i) & len) << (i*16+pos);
78 pos += len;
79
80 //13-14: overlap
82 if (!noROI || ovl(i) < 0) val.first |= len << (i*16+pos);
83 else val.first |= (ovl(i) & len) << (i*16+pos);
84 pos += len;
85
86 //15: charge?
88 if (charge(i) > 0) val.first |= (1 >> (i*16+pos)) & len;
89 pos += len;
90 }
91
92
93
94 // Global+BCID flags (bits 32-47)
95 len=0;
96 pos=0;
97
98 //0-11: BCID
100 val.second |= ( bcid() & len);
101 pos += len;
102
103 //12-15: global flags
105 if (is2candidatesInSector()) val.second |= (1 >> pos) & len;
106
107
108 return val;
109 }
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=()

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

Definition at line 19 of file Lvl1MuBarrelSectorLogicDataPhase1.cxx.

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

◆ 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::Lvl1MuBarrelSectorLogicDataPhase1::printOut ( std::ostream & out) const
overrideprotectedvirtual

print out data

Implements LVL1MUONIF::Lvl1MuSectorLogicDataPhase1.

Definition at line 197 of file Lvl1MuBarrelSectorLogicDataPhase1.cxx.

197 {
198
199 for (size_t i=0;i<NCAND[m_id_system];i++)
200 {
201 out << "Bit 0-4 " << " ROI<" << i+1 << "> ";
202 if (roi(i) == -1) out << "NA" << std::endl;
203 else out << std::setw(8) << roi(i) << std::endl;
204
205 out << "Bit 8-10 "<< "Pt" << i+1 << " ";
206 if (pt(i) == -1) out << "No Hit" << std::endl;
207 else out << pt(i) << std::endl;
208
209 out << "Bit 12 "<<"2 candidates in ROI<" << i+1 << "> ";
210 out << std::setw(8) << is2candidates(i) << std::endl;
211
212 out << "Bit 13-14 "<<"overlap<"<<i+1<<"> ";
213 out << std::setw(8) << ovl(i) << std::endl;
214
215 out << "Bit 15 "<<"charge<"<<i+1<<"> ";
216 out << std::setw(8) << charge(i) << std::endl;
217 }
218 out << "Bit 0-11 " << " BCID ";
219 out << std::setw( 8 ) << bcid() << std::endl;
220
221 out << "Bit 12 " << " >2candidates in a sector ";
222 out << std::setw( 8 ) << m_2candidatesInSector << std::endl;
223
224 }

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