ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1MUONIF::Lvl1MuCTPIInput Class Referencefinal

Class representing (part of) the input data to the MuCTPI. More...

#include <Lvl1MuCTPIInput.h>

Collaboration diagram for LVL1MUONIF::Lvl1MuCTPIInput:

Public Member Functions

 Lvl1MuCTPIInput ()
 Lvl1MuCTPIInput (const Lvl1MuCTPIInput &)
 ~Lvl1MuCTPIInput ()=default
Lvl1MuCTPIInputoperator= (const Lvl1MuCTPIInput &right)
const Lvl1MuSectorLogicDatagetSectorLogicData (size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0) const
void setSectorLogicData (const Lvl1MuSectorLogicData &data, size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0)
void setSectorLogicData (const unsigned int &sectorWord, size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0)
void merge (const Lvl1MuCTPIInput &another)
 Merge SectorLogic data of another object into this data of a system (Barrel, Endcap or Forward) is not overwritten if this object already has corresponding data.
void clear (size_t systemAddress)
void clearAll ()
 Clear Sector Logic data.
bool isEmpty (size_t systemAddress, int bcid=0) const
 Return "true" if data of specified system is empty.
bool isEmptyAll (int bcid=0) const
 Return "true" if data of all systems for this bcid is empty.
bool hasOutOfTimeCandidates (size_t systemAddress) const
 Return "true" if data of specified system is filled for bunches other than 'current' bunch.

Static Public Member Functions

static size_t idBarrelSystem ()
static size_t numberOfBarrelSector ()
static size_t idEndcapSystem ()
static size_t numberOfEndcapSector ()
static size_t idForwardSystem ()
static size_t numberOfForwardSector ()
static size_t idSideA ()
static size_t idSideC ()

Protected Types

enum  MuonSystem { Barrel = 0 , Endcap = 1 , Forward = 2 }
enum  MuonSubSystem { A_side = 1 , C_side = 0 }
enum  { NumberOfMuonSystem = 3 }
enum  { NumberOfMuonSubSystem = 2 }
enum  { NumberOfBarrelSector = 32 }
enum  { NumberOfEndcapSector = 48 }
enum  { NumberOfForwardSector = 24 }

Private Types

typedef std::vector< std::shared_ptr< Lvl1MuSectorLogicData > > Lvl1MuVect
typedef std::pair< int, Lvl1MuVectLvl1MuVectWithBC

Private Member Functions

size_t reserve (size_t systemAddress, int bcid=0)
 To store object to file. (NOT TO BE USED ANYMORE...)
size_t getSystemIndex (size_t systemAddress, size_t subSystemAddress, size_t sectorAddress) const
size_t getBcidIndex (size_t systemAddress, int bcid=0) const

Private Attributes

std::array< bool, NumberOfMuonSystemm_isFilledOutOfTimeCandidates
std::vector< Lvl1MuVectWithBCm_data [NumberOfMuonSystem]

Friends

std::ostream & operator<< (std::ostream &out, const Lvl1MuCTPIInput &right)

Detailed Description

Class representing (part of) the input data to the MuCTPI.

   This class can represent the full input data coming from the
   SL boards to the MuCTPI, or it can just represent a part of it.
   (Let's say only the data coming from the RPC simulation.)
See also
LVL1MUONIF::Lvl1MuBarrelSectorLogicData
LVL1MUONIF::Lvl1MuEndcapSectorLogicData
LVL1MUONIF::Lvl1MuForwardSectorLogicData
Revision
782811
Date
2016-11-07 18:20:40 +0100 (Mon, 07 Nov 2016)

Definition at line 37 of file Lvl1MuCTPIInput.h.

Member Typedef Documentation

◆ Lvl1MuVect

typedef std::vector<std::shared_ptr <Lvl1MuSectorLogicData> > LVL1MUONIF::Lvl1MuCTPIInput::Lvl1MuVect
private

Definition at line 161 of file Lvl1MuCTPIInput.h.

◆ Lvl1MuVectWithBC

Definition at line 162 of file Lvl1MuCTPIInput.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
NumberOfMuonSubSystem 

Definition at line 54 of file Lvl1MuCTPIInput.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
NumberOfBarrelSector 

Definition at line 55 of file Lvl1MuCTPIInput.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
NumberOfForwardSector 

Definition at line 57 of file Lvl1MuCTPIInput.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
NumberOfEndcapSector 

Definition at line 56 of file Lvl1MuCTPIInput.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
NumberOfMuonSystem 

Definition at line 53 of file Lvl1MuCTPIInput.h.

◆ MuonSubSystem

Enumerator
A_side 
C_side 

Definition at line 52 of file Lvl1MuCTPIInput.h.

◆ MuonSystem

Enumerator
Barrel 
Endcap 
Forward 

Definition at line 51 of file Lvl1MuCTPIInput.h.

Constructor & Destructor Documentation

◆ Lvl1MuCTPIInput() [1/2]

LVL1MUONIF::Lvl1MuCTPIInput::Lvl1MuCTPIInput ( )

Definition at line 12 of file Lvl1MuCTPIInput.cxx.

12 {
14 }
std::array< bool, NumberOfMuonSystem > m_isFilledOutOfTimeCandidates

◆ Lvl1MuCTPIInput() [2/2]

LVL1MUONIF::Lvl1MuCTPIInput::Lvl1MuCTPIInput ( const Lvl1MuCTPIInput & right)

Definition at line 17 of file Lvl1MuCTPIInput.cxx.

17 {
18 *this = right;
19 }

◆ ~Lvl1MuCTPIInput()

LVL1MUONIF::Lvl1MuCTPIInput::~Lvl1MuCTPIInput ( )
default

Member Function Documentation

◆ clear()

void LVL1MUONIF::Lvl1MuCTPIInput::clear ( size_t systemAddress)

Definition at line 173 of file Lvl1MuCTPIInput.cxx.

173 {
174 std::cout << "TW: SysAd: in " << systemAddress << " size: " << m_data[systemAddress].size() << std::endl;
175 m_data[systemAddress].clear();
176 }
std::vector< Lvl1MuVectWithBC > m_data[NumberOfMuonSystem]

◆ clearAll()

void LVL1MUONIF::Lvl1MuCTPIInput::clearAll ( )

Clear Sector Logic data.

Definition at line 179 of file Lvl1MuCTPIInput.cxx.

179 {
180 for ( size_t id = 0; id < NumberOfMuonSystem; id++ ) {
181 m_data[ id ].clear();
182 }
183
184
185 }

◆ getBcidIndex()

size_t LVL1MUONIF::Lvl1MuCTPIInput::getBcidIndex ( size_t systemAddress,
int bcid = 0 ) const
inlineprivate

Definition at line 148 of file Lvl1MuCTPIInput.h.

150 {
151 for( size_t ip=0; ip<m_data[systemAddress].size(); ip++){
152 int bc=((m_data[systemAddress]).at(ip)).first;
153 if (bc == bcid) return ip;
154 }
155 return -1;
156 };

◆ getSectorLogicData()

const Lvl1MuSectorLogicData & LVL1MUONIF::Lvl1MuCTPIInput::getSectorLogicData ( size_t systemAddress,
size_t subSystemAddress,
size_t sectorAddress,
int bcid = 0 ) const

Definition at line 42 of file Lvl1MuCTPIInput.cxx.

45 {
46
47 static const Lvl1MuBarrelSectorLogicData dummy;
48 for( size_t ip=0; ip<m_data[systemAddress].size(); ip++){
49 int bc=((m_data[systemAddress]).at(ip)).first;
50 if (bc != bcid) continue;
51 const Lvl1MuVect &vecSL( ((m_data[systemAddress]).at(ip)).second);
52 return *(vecSL.at(getSystemIndex(systemAddress,subSystemAddress,sectorAddress)));
53 }
54 return dummy;
55 }
std::vector< std::shared_ptr< Lvl1MuSectorLogicData > > Lvl1MuVect
size_t getSystemIndex(size_t systemAddress, size_t subSystemAddress, size_t sectorAddress) const

◆ getSystemIndex()

size_t LVL1MUONIF::Lvl1MuCTPIInput::getSystemIndex ( size_t systemAddress,
size_t subSystemAddress,
size_t sectorAddress ) const
inlineprivate

Definition at line 135 of file Lvl1MuCTPIInput.h.

138 {
139 if (systemAddress==0) {
140 return NumberOfBarrelSector*subSystemAddress+sectorAddress;
141 } else if (systemAddress==1) {
142 return NumberOfEndcapSector*subSystemAddress+sectorAddress;
143 } else {
144 return NumberOfForwardSector*subSystemAddress+sectorAddress;
145 }
146 }

◆ hasOutOfTimeCandidates()

bool LVL1MUONIF::Lvl1MuCTPIInput::hasOutOfTimeCandidates ( size_t systemAddress) const
inline

Return "true" if data of specified system is filled for bunches other than 'current' bunch.

Definition at line 106 of file Lvl1MuCTPIInput.h.

107 {
108 if ( systemAddress < NumberOfMuonSystem) {
109 return m_isFilledOutOfTimeCandidates[systemAddress];
110 }
111 return false;
112 }

◆ idBarrelSystem()

size_t LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem ( )
inlinestatic

Definition at line 60 of file Lvl1MuCTPIInput.h.

60{ return Barrel; }

◆ idEndcapSystem()

size_t LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem ( )
inlinestatic

Definition at line 62 of file Lvl1MuCTPIInput.h.

62{ return Endcap; }

◆ idForwardSystem()

size_t LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem ( )
inlinestatic

Definition at line 64 of file Lvl1MuCTPIInput.h.

64{ return Forward; }

◆ idSideA()

size_t LVL1MUONIF::Lvl1MuCTPIInput::idSideA ( )
inlinestatic

Definition at line 66 of file Lvl1MuCTPIInput.h.

66{ return A_side; }

◆ idSideC()

size_t LVL1MUONIF::Lvl1MuCTPIInput::idSideC ( )
inlinestatic

Definition at line 67 of file Lvl1MuCTPIInput.h.

67{ return C_side; }

◆ isEmpty()

bool LVL1MUONIF::Lvl1MuCTPIInput::isEmpty ( size_t systemAddress,
int bcid = 0 ) const

Return "true" if data of specified system is empty.

Definition at line 154 of file Lvl1MuCTPIInput.cxx.

155 {
156 for( size_t ip=0; ip<m_data[systemAddress].size(); ip++){
157 int bc=((m_data[systemAddress]).at(ip)).first;
158 if (bc == bcid) return false;
159 }
160 return true;
161 }

◆ isEmptyAll()

bool LVL1MUONIF::Lvl1MuCTPIInput::isEmptyAll ( int bcid = 0) const

Return "true" if data of all systems for this bcid is empty.

Definition at line 164 of file Lvl1MuCTPIInput.cxx.

164 {
165 if ( isEmpty(Barrel,bcid) && isEmpty(Endcap,bcid) && isEmpty(Forward,bcid) ) {
166 return true;
167 } else {
168 return false;
169 }
170 }
bool isEmpty(size_t systemAddress, int bcid=0) const
Return "true" if data of specified system is empty.

◆ merge()

void LVL1MUONIF::Lvl1MuCTPIInput::merge ( const Lvl1MuCTPIInput & another)

Merge SectorLogic data of another object into this data of a system (Barrel, Endcap or Forward) is not overwritten if this object already has corresponding data.

Definition at line 104 of file Lvl1MuCTPIInput.cxx.

104 {
105 if ( this == &right ) return;
106
107 for (size_t idSys=0; idSys<NumberOfMuonSystem; idSys++){
108 for( size_t ip=0; ip<right.m_data[idSys].size(); ip++){
109 int bc=((right.m_data[idSys]).at(ip)).first;
110 if (isEmpty( idSys, bc)){
111 Lvl1MuVect vSL(((right.m_data[idSys]).at(ip)).second);
112 m_data[idSys].emplace_back(bc,std::move(vSL));
113 m_isFilledOutOfTimeCandidates[idSys] = right.m_isFilledOutOfTimeCandidates[idSys];
114 }
115 }
116 }
117
118 }

◆ numberOfBarrelSector()

size_t LVL1MUONIF::Lvl1MuCTPIInput::numberOfBarrelSector ( )
inlinestatic

Definition at line 61 of file Lvl1MuCTPIInput.h.

61{ return NumberOfBarrelSector; }

◆ numberOfEndcapSector()

size_t LVL1MUONIF::Lvl1MuCTPIInput::numberOfEndcapSector ( )
inlinestatic

Definition at line 63 of file Lvl1MuCTPIInput.h.

63{ return NumberOfEndcapSector; }

◆ numberOfForwardSector()

size_t LVL1MUONIF::Lvl1MuCTPIInput::numberOfForwardSector ( )
inlinestatic

Definition at line 65 of file Lvl1MuCTPIInput.h.

65{ return NumberOfForwardSector; }

◆ operator=()

Lvl1MuCTPIInput & LVL1MUONIF::Lvl1MuCTPIInput::operator= ( const Lvl1MuCTPIInput & right)

Definition at line 24 of file Lvl1MuCTPIInput.cxx.

24 {
25 if ( this != &right ) {
26 clearAll();
27 for (size_t idSys=0; idSys<NumberOfMuonSystem; idSys++){
28 for( size_t ip=0; ip<right.m_data[idSys].size(); ip++){
29 int bc=((right.m_data[idSys]).at(ip)).first;
30 Lvl1MuVect vSL(((right.m_data[idSys]).at(ip)).second);
31 m_data[idSys].emplace_back(bc,std::move(vSL));
32 }
33 m_isFilledOutOfTimeCandidates[idSys] = right.m_isFilledOutOfTimeCandidates[idSys];
34 }
35 }
36 return *this;
37 }
void clearAll()
Clear Sector Logic data.

◆ reserve()

size_t LVL1MUONIF::Lvl1MuCTPIInput::reserve ( size_t systemAddress,
int bcid = 0 )
private

To store object to file. (NOT TO BE USED ANYMORE...)

To retrieve object from file. (NOT TO BE USED ANYMORE...)

Definition at line 121 of file Lvl1MuCTPIInput.cxx.

122 {
123
124 Lvl1MuVect vecSL;
125
126 if ( systemAddress == Barrel ) {
128 for ( size_t id = 0; id < NumberOfBarrelSector*NumberOfMuonSubSystem; id++ ) {
129 vecSL.emplace_back(std::make_shared<Lvl1MuBarrelSectorLogicData>());
130 }
131
132 } else if ( systemAddress == Endcap ) {
134 for ( size_t id = 0; id < NumberOfEndcapSector*NumberOfMuonSubSystem; id++ ) {
135 vecSL.emplace_back(std::make_shared<Lvl1MuEndcapSectorLogicData>());
136 }
137
138 } else if ( systemAddress == Forward ) {
140 for ( size_t id = 0; id < NumberOfForwardSector*NumberOfMuonSubSystem; id++ ) {
141 vecSL.emplace_back(std::make_shared<Lvl1MuForwardSectorLogicData>());
142 }
143 }
144
145 size_t ip = m_data[systemAddress].size();
146 m_data[systemAddress].emplace_back( bcid, std::move(vecSL) );
147
148 if (bcid!=0) m_isFilledOutOfTimeCandidates[systemAddress] = true;
149
150 return ip;
151 }

◆ setSectorLogicData() [1/2]

void LVL1MUONIF::Lvl1MuCTPIInput::setSectorLogicData ( const Lvl1MuSectorLogicData & data,
size_t systemAddress,
size_t subSystemAddress,
size_t sectorAddress,
int bcid = 0 )

Definition at line 58 of file Lvl1MuCTPIInput.cxx.

62 {
63 size_t ip=0;
64 if (isEmpty(systemAddress,bcid)) {
65 ip = reserve( systemAddress, bcid );
66 } else {
67 ip = getBcidIndex( systemAddress, bcid );
68 }
69
70 const Lvl1MuVect &vecSL((((m_data[systemAddress]).at(ip)).second));
71 size_t idx= getSystemIndex(systemAddress,subSystemAddress,sectorAddress);
72 if ( systemAddress == Barrel ) {
73 *static_cast<Lvl1MuBarrelSectorLogicData*>(vecSL.at(idx).get()) = data;
74 } else if ( systemAddress == Endcap ) {
75 *static_cast<Lvl1MuEndcapSectorLogicData*>(vecSL.at(idx).get())= data;
76 } else if ( systemAddress == Forward ) {
77 *static_cast<Lvl1MuForwardSectorLogicData*>(vecSL.at(idx).get())= data;
78 }
79 }
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
size_t reserve(size_t systemAddress, int bcid=0)
To store object to file. (NOT TO BE USED ANYMORE...)
size_t getBcidIndex(size_t systemAddress, int bcid=0) const
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130

◆ setSectorLogicData() [2/2]

void LVL1MUONIF::Lvl1MuCTPIInput::setSectorLogicData ( const unsigned int & sectorWord,
size_t systemAddress,
size_t subSystemAddress,
size_t sectorAddress,
int bcid = 0 )

Definition at line 82 of file Lvl1MuCTPIInput.cxx.

86 {
87 // convert to SectorLogicData
88 Lvl1MuSectorLogicData * pData;
89 if ( systemAddress == Barrel ) {
90 pData = new Lvl1MuBarrelSectorLogicData();
91 } else if ( systemAddress == Endcap ) {
92 pData = new Lvl1MuEndcapSectorLogicData();
93 } else if ( systemAddress == Forward ) {
94 pData = new Lvl1MuForwardSectorLogicData();
95 } else {
96 return ;
97 }
98 pData->convertFromWordFormat( sectorWord );
99 setSectorLogicData( *pData, systemAddress, subSystemAddress, sectorAddress, bcid );
100 delete pData;
101 }
void setSectorLogicData(const Lvl1MuSectorLogicData &data, size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0)

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const Lvl1MuCTPIInput & right )
friend

Definition at line 218 of file Lvl1MuCTPIInput.cxx.

218 {
219
220 size_t systemAddress;
221 size_t subSystemAddress;
222 size_t side, id;
223
224 out << "--------- Barrel Sector ---------------------------" << std::endl;
225 systemAddress = right.idBarrelSystem();
226 for ( side = 0; side < right.NumberOfMuonSubSystem; ++side ) {
227 if ( side == 0 ) {
228 out << " ------ A Side (Z>0) ---------------------------" << std::endl;
229 subSystemAddress = right.idSideA();
230 } else {
231 out << " ------ C Side (Z<0) ---------------------------" << std::endl;
232 subSystemAddress = right.idSideC();
233 }
234 for ( id = 0; id < right.numberOfBarrelSector() ;++id ) {
235 out << " --- Sector ID : " << id << " ----------" << std::endl;
236 for( size_t ip=0; ip < right.m_data[systemAddress].size(); ip++){
237 int bc=((right.m_data[systemAddress]).at(ip)).first;
238 out << right.getSectorLogicData( systemAddress, subSystemAddress, id, bc );
239 out << " BC: " << bc;
240 out << std::endl;
241 }
242 }
243 }
244
245 out << "--------- Endcap Sector ---------------------------" << std::endl;
246 systemAddress = right.idEndcapSystem();
247 for ( side = 0; side < right.NumberOfMuonSubSystem; ++side ) {
248 if ( side == 0 ) {
249 out << " ------ A Side (Z>0) ---------------------------" << std::endl;
250 subSystemAddress = right.idSideA();
251 } else {
252 out << " ------ C Side (Z<0) ---------------------------" << std::endl;
253 subSystemAddress = right.idSideC();
254 }
255 for ( id = 0; id < right.numberOfEndcapSector() ;++id ) {
256 out << " --- Sector ID : " << id << " ----------" << std::endl;
257 for( size_t ip=0; ip < right.m_data[systemAddress].size(); ip++){
258 int bc=((right.m_data[systemAddress]).at(ip)).first;
259 out << right.getSectorLogicData( systemAddress, subSystemAddress, id, bc );
260 out << " BC: " << bc;
261 out << std::endl;
262 }
263 }
264 }
265
266 out << "--------- Forward Sector ---------------------------" << std::endl;
267 systemAddress = right.idForwardSystem();
268 for ( side = 0; side < right.NumberOfMuonSubSystem; ++side ) {
269 if ( side == 0 ) {
270 out << " ------ A Side (Z>0) ---------------------------" << std::endl;
271 subSystemAddress = right.idSideA();
272 } else {
273 out << " ------ C Side (Z<0) ---------------------------" << std::endl;
274 subSystemAddress = right.idSideC();
275 }
276 for ( id = 0; id < right.numberOfForwardSector() ;++id ) {
277 out << " --- Sector ID : " << id << " ----------" << std::endl;
278 for( size_t ip=0; ip < right.m_data[systemAddress].size(); ip++){
279 int bc=((right.m_data[systemAddress]).at(ip)).first;
280 out << right.getSectorLogicData( systemAddress, subSystemAddress, id, bc );
281 out << " BC: " << bc;
282 out << std::endl;
283 }
284 }
285 }
286
287 return out;
288 }

Member Data Documentation

◆ m_data

std::vector<Lvl1MuVectWithBC> LVL1MUONIF::Lvl1MuCTPIInput::m_data[NumberOfMuonSystem]
private

Definition at line 163 of file Lvl1MuCTPIInput.h.

◆ m_isFilledOutOfTimeCandidates

std::array<bool, NumberOfMuonSystem> LVL1MUONIF::Lvl1MuCTPIInput::m_isFilledOutOfTimeCandidates
private

Definition at line 158 of file Lvl1MuCTPIInput.h.


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