ATLAS Offline Software
Loading...
Searching...
No Matches
Lvl1MuCTPIInputPhase1.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef TRIGT1INTERFACES_LVL1MUCTPIINPUTPHASE1_H
5#define TRIGT1INTERFACES_LVL1MUCTPIINPUTPHASE1_H
6
7// System include(s):
8#include <iosfwd>
9#include <vector>
10#include <utility>
11#include <memory>
12#include <array>
13
14// Local include(s):
19
20namespace LVL1MUONIF {
21
35
36 public:
40
42
43
44 // data from each sector logic is identifed by
45 // System Address : Barrel=0, Endcap=1, Forward=2
46 // Sub-system Address : A_side(Z>0) =1, C_side(Z<0) =0
47 // Sector Address : Barrel=0-31, Endcap=0-47, Forward=0-23
48 enum MuonSystem { Barrel = 0, Endcap = 1, Forward = 2 };
49 enum MuonSubSystem { A_side = 1, C_side = 0};
50 enum { NumberOfMuonSystem = 3 };
52 enum { NumberOfBarrelSector = 32 };
53 enum { NumberOfEndcapSector = 48 };
54 enum { NumberOfForwardSector = 24 };
55
56
57 static size_t idBarrelSystem();
58 static size_t numberOfBarrelSector();
59 static size_t idEndcapSystem();
60 static size_t numberOfEndcapSector();
61 static size_t idForwardSystem();
62 static size_t numberOfForwardSector();
63 static size_t idSideA();
64 static size_t idSideC();
65 static size_t numberOfSystems();
66 static size_t numberOfSector(MuonSystem system);
67
68
69 const Lvl1MuSectorLogicDataPhase1& getSectorLogicData( size_t systemAddress,
70 size_t subSystemAddress,
71 size_t sectorAddress,
72 int bcid=0 ) const;
73 std::shared_ptr<Lvl1MuSectorLogicDataPhase1> getSectorLogicDataPtr( size_t systemAddress,
74 size_t subSystemAddress,
75 size_t sectorAddress,
76 int bcid=0 ) const;
77
79 size_t systemAddress,
80 size_t subSystemAddress,
81 size_t sectorAddress,
82 int bcid=0 );
83
85 size_t systemAddress,
86 size_t subSystemAddress,
87 size_t sectorAddress,
88 int bcid=0 );
89
95 void merge( const Lvl1MuCTPIInputPhase1& another );
96
97 void clear( size_t systemAddress );
99 void clearAll();
100
102 bool isEmpty( size_t systemAddress,
103 int bcid=0 ) const;
104
106 bool isEmptyAll(int bcid=0) const;
107
110 bool hasOutOfTimeCandidates(size_t systemAddress) const;
111
112 friend std::ostream& operator<<( std::ostream&, const Lvl1MuCTPIInputPhase1& );
113
114 size_t getSystemIndex(size_t systemAddress,
115 size_t subSystemAddress,
116 size_t sectorAddress ) const;
117
118 size_t getBcidIndex(size_t systemAddress,
119 int bcid=0) const;
120
121 typedef std::vector<std::shared_ptr <Lvl1MuSectorLogicDataPhase1> > Lvl1MuVect;
122 typedef std::pair<int, Lvl1MuVect> Lvl1MuVectWithBC;
123 const std::vector<Lvl1MuVectWithBC>& getData(MuonSystem system) const;
124
125 private:
126
127 size_t reserve( size_t systemAddress ,
128 int bcid=0 );
129
130 std::array<bool, NumberOfMuonSystem> m_isFilledOutOfTimeCandidates;
131
132 std::vector<Lvl1MuVectWithBC> m_data[ NumberOfMuonSystem ];
133 }; // class Lvl1MuCTPIInputPhase1
134
141 inline size_t Lvl1MuCTPIInputPhase1::idSideA() { return A_side; }
142 inline size_t Lvl1MuCTPIInputPhase1::idSideC() { return C_side; }
145 {
146 if (system == Barrel) return numberOfBarrelSector();
147 else if (system == Endcap) return numberOfEndcapSector();
148 else return numberOfForwardSector();
149 }
150
151 inline bool Lvl1MuCTPIInputPhase1::hasOutOfTimeCandidates(size_t systemAddress) const
152 {
153 if ( systemAddress < NumberOfMuonSystem) {
154 return m_isFilledOutOfTimeCandidates[systemAddress];
155 }
156 return false;
157 }
158
159 inline size_t Lvl1MuCTPIInputPhase1::getSystemIndex(size_t systemAddress,
160 size_t subSystemAddress,
161 size_t sectorAddress ) const
162 {
163 if (systemAddress==0) {
164 return NumberOfBarrelSector*subSystemAddress+sectorAddress;
165 } else if (systemAddress==1) {
166 return NumberOfEndcapSector*subSystemAddress+sectorAddress;
167 } else {
168 return NumberOfForwardSector*subSystemAddress+sectorAddress;
169 }
170 }
171 inline size_t Lvl1MuCTPIInputPhase1::getBcidIndex(size_t systemAddress,
172 int bcid) const
173 {
174 for( size_t ip=0; ip<m_data[systemAddress].size(); ip++){
175 int bc=((m_data[systemAddress]).at(ip)).first;
176 if (bc == bcid) return ip;
177 }
178 return -1;
179 }
180
181 inline const std::vector<Lvl1MuCTPIInputPhase1::Lvl1MuVectWithBC>&
184
185} // namespace LVL1MUONIF
186
189
190#endif // TRIGT1INTERFACES_LVL1MUCTPIINPUTPHASE1_H
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Class representing (part of) the input data to the MuCTPI for Phase 1.
const Lvl1MuSectorLogicDataPhase1 & getSectorLogicData(size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0) const
Lvl1MuCTPIInputPhase1 & operator=(const Lvl1MuCTPIInputPhase1 &right)
size_t getBcidIndex(size_t systemAddress, int bcid=0) const
bool isEmptyAll(int bcid=0) const
Return "true" if data of all systems for this bcid is empty.
void clearAll()
Clear Sector Logic data.
static size_t numberOfSector(MuonSystem system)
size_t reserve(size_t systemAddress, int bcid=0)
bool isEmpty(size_t systemAddress, int bcid=0) const
Return "true" if data of specified system is empty.
std::vector< std::shared_ptr< Lvl1MuSectorLogicDataPhase1 > > Lvl1MuVect
void setSectorLogicData(const Lvl1MuSectorLogicDataPhase1 &data, size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0)
std::vector< Lvl1MuVectWithBC > m_data[NumberOfMuonSystem]
std::array< bool, NumberOfMuonSystem > m_isFilledOutOfTimeCandidates
const std::vector< Lvl1MuVectWithBC > & getData(MuonSystem system) const
friend std::ostream & operator<<(std::ostream &, const Lvl1MuCTPIInputPhase1 &)
size_t getSystemIndex(size_t systemAddress, size_t subSystemAddress, size_t sectorAddress) const
bool hasOutOfTimeCandidates(size_t systemAddress) const
Return "true" if data of specified system is filled for bunches other than 'current' bunch.
std::pair< int, Lvl1MuVect > Lvl1MuVectWithBC
std::shared_ptr< Lvl1MuSectorLogicDataPhase1 > getSectorLogicDataPtr(size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0) const
Base class for the data coming from one SL board.
std::pair< unsigned long int, unsigned short int > SectorLogicWord
Namespace for the LVL1 muon interface classes.
Definition merge.py:1