ATLAS Offline Software
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 
20 namespace 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 };
51  enum { NumberOfMuonSubSystem = 2 };
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 
135  inline size_t Lvl1MuCTPIInputPhase1::idBarrelSystem() { return Barrel; }
137  inline size_t Lvl1MuCTPIInputPhase1::idEndcapSystem() { return Endcap; }
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>&
183  { return m_data[system]; }
184 
185 } // namespace LVL1MUONIF
186 
187 #include "AthenaKernel/CLASS_DEF.h"
189 
190 #endif // TRIGT1INTERFACES_LVL1MUCTPIINPUTPHASE1_H
Lvl1MuEndcapSectorLogicDataPhase1.h
LVL1MUONIF::Lvl1MuCTPIInputPhase1::setSectorLogicData
void setSectorLogicData(const Lvl1MuSectorLogicDataPhase1 &data, size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0)
Definition: Lvl1MuCTPIInputPhase1.cxx:69
LVL1MUONIF::Lvl1MuCTPIInputPhase1::isEmptyAll
bool isEmptyAll(int bcid=0) const
Return "true" if data of all systems for this bcid is empty.
Definition: Lvl1MuCTPIInputPhase1.cxx:174
LVL1MUONIF::Lvl1MuCTPIInputPhase1::Lvl1MuVect
std::vector< std::shared_ptr< Lvl1MuSectorLogicDataPhase1 > > Lvl1MuVect
Definition: Lvl1MuCTPIInputPhase1.h:121
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LVL1MUONIF::Lvl1MuCTPIInputPhase1::idForwardSystem
static size_t idForwardSystem()
Definition: Lvl1MuCTPIInputPhase1.h:139
LVL1MUONIF::Lvl1MuCTPIInputPhase1::NumberOfMuonSystem
@ NumberOfMuonSystem
Definition: Lvl1MuCTPIInputPhase1.h:50
LVL1MUONIF::Lvl1MuCTPIInputPhase1::NumberOfBarrelSector
@ NumberOfBarrelSector
Definition: Lvl1MuCTPIInputPhase1.h:52
LVL1MUONIF::Lvl1MuCTPIInputPhase1::merge
void merge(const Lvl1MuCTPIInputPhase1 &another)
Merge SectorLogic data of another object into this data of a system (Barrel, Endcap or Forward) is no...
Definition: Lvl1MuCTPIInputPhase1.cxx:114
LVL1MUONIF
Namespace for the LVL1 muon interface classes.
Definition: Lvl1MuBarrelSectorLogicData.cxx:9
LVL1MUONIF::Lvl1MuCTPIInputPhase1::Lvl1MuVectWithBC
std::pair< int, Lvl1MuVect > Lvl1MuVectWithBC
Definition: Lvl1MuCTPIInputPhase1.h:122
LVL1MUONIF::Lvl1MuCTPIInputPhase1::~Lvl1MuCTPIInputPhase1
~Lvl1MuCTPIInputPhase1()=default
LVL1MUONIF::Lvl1MuCTPIInputPhase1
Class representing (part of) the input data to the MuCTPI for Phase 1.
Definition: Lvl1MuCTPIInputPhase1.h:34
LVL1MUONIF::Lvl1MuCTPIInputPhase1::m_data
std::vector< Lvl1MuVectWithBC > m_data[NumberOfMuonSystem]
Definition: Lvl1MuCTPIInputPhase1.h:132
LVL1MUONIF::Lvl1MuCTPIInputPhase1::operator=
Lvl1MuCTPIInputPhase1 & operator=(const Lvl1MuCTPIInputPhase1 &right)
Definition: Lvl1MuCTPIInputPhase1.cxx:23
LVL1MUONIF::Lvl1MuCTPIInputPhase1::getBcidIndex
size_t getBcidIndex(size_t systemAddress, int bcid=0) const
Definition: Lvl1MuCTPIInputPhase1.h:171
LVL1MUONIF::Lvl1MuCTPIInputPhase1::clear
void clear(size_t systemAddress)
Definition: Lvl1MuCTPIInputPhase1.cxx:183
LVL1MUONIF::Lvl1MuCTPIInputPhase1::NumberOfMuonSubSystem
@ NumberOfMuonSubSystem
Definition: Lvl1MuCTPIInputPhase1.h:51
LVL1MUONIF::Lvl1MuCTPIInputPhase1::operator<<
friend std::ostream & operator<<(std::ostream &, const Lvl1MuCTPIInputPhase1 &)
Definition: Lvl1MuCTPIInputPhase1.cxx:196
LVL1MUONIF::Lvl1MuCTPIInputPhase1::MuonSystem
MuonSystem
Definition: Lvl1MuCTPIInputPhase1.h:48
LVL1MUONIF::Lvl1MuCTPIInputPhase1::MuonSubSystem
MuonSubSystem
Definition: Lvl1MuCTPIInputPhase1.h:49
Lvl1MuBarrelSectorLogicDataPhase1.h
LVL1MUONIF::Lvl1MuSectorLogicDataPhase1::SectorLogicWord
std::pair< unsigned long int, unsigned short int > SectorLogicWord
Definition: Lvl1MuSectorLogicDataPhase1.h:45
LVL1MUONIF::Lvl1MuCTPIInputPhase1::Forward
@ Forward
Definition: Lvl1MuCTPIInputPhase1.h:48
LVL1MUONIF::Lvl1MuCTPIInputPhase1::numberOfSystems
static size_t numberOfSystems()
Definition: Lvl1MuCTPIInputPhase1.h:143
LVL1MUONIF::Lvl1MuCTPIInputPhase1::idSideA
static size_t idSideA()
Definition: Lvl1MuCTPIInputPhase1.h:141
LVL1MUONIF::Lvl1MuCTPIInputPhase1::getSystemIndex
size_t getSystemIndex(size_t systemAddress, size_t subSystemAddress, size_t sectorAddress) const
Definition: Lvl1MuCTPIInputPhase1.h:159
LVL1MUONIF::Lvl1MuCTPIInputPhase1::clearAll
void clearAll()
Clear Sector Logic data.
Definition: Lvl1MuCTPIInputPhase1.cxx:188
Lvl1MuForwardSectorLogicDataPhase1.h
LVL1MUONIF::Lvl1MuSectorLogicDataPhase1
Base class for the data coming from one SL board.
Definition: Lvl1MuSectorLogicDataPhase1.h:35
LVL1MUONIF::Lvl1MuCTPIInputPhase1::numberOfSector
static size_t numberOfSector(MuonSystem system)
Definition: Lvl1MuCTPIInputPhase1.h:144
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
LVL1MUONIF::Lvl1MuCTPIInputPhase1::hasOutOfTimeCandidates
bool hasOutOfTimeCandidates(size_t systemAddress) const
Return "true" if data of specified system is filled for bunches other than 'current' bunch
Definition: Lvl1MuCTPIInputPhase1.h:151
LVL1MUONIF::Lvl1MuCTPIInputPhase1::getSectorLogicData
const Lvl1MuSectorLogicDataPhase1 & getSectorLogicData(size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0) const
Definition: Lvl1MuCTPIInputPhase1.cxx:41
columnar::final
CM final
Definition: ColumnAccessor.h:106
LVL1MUONIF::Lvl1MuCTPIInputPhase1::getSectorLogicDataPtr
std::shared_ptr< Lvl1MuSectorLogicDataPhase1 > getSectorLogicDataPtr(size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0) const
Definition: Lvl1MuCTPIInputPhase1.cxx:56
LVL1MUONIF::Lvl1MuCTPIInputPhase1::Barrel
@ Barrel
Definition: Lvl1MuCTPIInputPhase1.h:48
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
LVL1MUONIF::Lvl1MuCTPIInputPhase1::NumberOfEndcapSector
@ NumberOfEndcapSector
Definition: Lvl1MuCTPIInputPhase1.h:53
LVL1MUONIF::Lvl1MuCTPIInputPhase1::idEndcapSystem
static size_t idEndcapSystem()
Definition: Lvl1MuCTPIInputPhase1.h:137
LVL1MUONIF::Lvl1MuCTPIInputPhase1::numberOfBarrelSector
static size_t numberOfBarrelSector()
Definition: Lvl1MuCTPIInputPhase1.h:136
LVL1MUONIF::Lvl1MuCTPIInputPhase1::NumberOfForwardSector
@ NumberOfForwardSector
Definition: Lvl1MuCTPIInputPhase1.h:54
LVL1MUONIF::Lvl1MuCTPIInputPhase1::isEmpty
bool isEmpty(size_t systemAddress, int bcid=0) const
Return "true" if data of specified system is empty.
Definition: Lvl1MuCTPIInputPhase1.cxx:164
LVL1MUONIF::Lvl1MuCTPIInputPhase1::idSideC
static size_t idSideC()
Definition: Lvl1MuCTPIInputPhase1.h:142
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:67
DeMoScan.first
bool first
Definition: DeMoScan.py:534
LVL1MUONIF::Lvl1MuCTPIInputPhase1::idBarrelSystem
static size_t idBarrelSystem()
Definition: Lvl1MuCTPIInputPhase1.h:135
LVL1MUONIF::Lvl1MuCTPIInputPhase1::numberOfEndcapSector
static size_t numberOfEndcapSector()
Definition: Lvl1MuCTPIInputPhase1.h:138
LVL1MUONIF::Lvl1MuCTPIInputPhase1::Lvl1MuCTPIInputPhase1
Lvl1MuCTPIInputPhase1()
Definition: Lvl1MuCTPIInputPhase1.cxx:11
LVL1MUONIF::Lvl1MuCTPIInputPhase1::C_side
@ C_side
Definition: Lvl1MuCTPIInputPhase1.h:49
LVL1MUONIF::Lvl1MuCTPIInputPhase1::A_side
@ A_side
Definition: Lvl1MuCTPIInputPhase1.h:49
LVL1MUONIF::Lvl1MuCTPIInputPhase1::reserve
size_t reserve(size_t systemAddress, int bcid=0)
Definition: Lvl1MuCTPIInputPhase1.cxx:131
LVL1MUONIF::Lvl1MuCTPIInputPhase1::m_isFilledOutOfTimeCandidates
std::array< bool, NumberOfMuonSystem > m_isFilledOutOfTimeCandidates
Definition: Lvl1MuCTPIInputPhase1.h:130
CLASS_DEF.h
macros to associate a CLID to a type
Lvl1MuSectorLogicDataPhase1.h
LVL1MUONIF::Lvl1MuCTPIInputPhase1::numberOfForwardSector
static size_t numberOfForwardSector()
Definition: Lvl1MuCTPIInputPhase1.h:140
LVL1MUONIF::Lvl1MuCTPIInputPhase1::Endcap
@ Endcap
Definition: Lvl1MuCTPIInputPhase1.h:48
LVL1MUONIF::Lvl1MuCTPIInputPhase1::getData
const std::vector< Lvl1MuVectWithBC > & getData(MuonSystem system) const
Definition: Lvl1MuCTPIInputPhase1.h:182