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 
13 // Local include(s):
18 
19 namespace LVL1MUONIF {
20 
34 
35  public:
38  virtual ~Lvl1MuCTPIInputPhase1();
39 
41 
42 
43  // data from each sector logic is identifed by
44  // System Address : Barrel=0, Endcap=1, Forward=2
45  // Sub-system Address : A_side(Z>0) =1, C_side(Z<0) =0
46  // Sector Address : Barrel=0-31, Endcap=0-47, Forward=0-23
47  enum MuonSystem { Barrel = 0, Endcap = 1, Forward = 2 };
48  enum MuonSubSystem { A_side = 1, C_side = 0};
49  enum { NumberOfMuonSystem = 3 };
50  enum { NumberOfMuonSubSystem = 2 };
51  enum { NumberOfBarrelSector = 32 };
52  enum { NumberOfEndcapSector = 48 };
53  enum { NumberOfForwardSector = 24 };
54 
55 
56  static size_t idBarrelSystem();
57  static size_t numberOfBarrelSector();
58  static size_t idEndcapSystem();
59  static size_t numberOfEndcapSector();
60  static size_t idForwardSystem();
61  static size_t numberOfForwardSector();
62  static size_t idSideA();
63  static size_t idSideC();
64  static size_t numberOfSystems();
65  static size_t numberOfSector(MuonSystem system);
66 
67 
68  const Lvl1MuSectorLogicDataPhase1& getSectorLogicData( size_t systemAddress,
69  size_t subSystemAddress,
70  size_t sectorAddress,
71  int bcid=0 ) const;
72  std::shared_ptr<Lvl1MuSectorLogicDataPhase1> getSectorLogicDataPtr( size_t systemAddress,
73  size_t subSystemAddress,
74  size_t sectorAddress,
75  int bcid=0 ) const;
76 
78  size_t systemAddress,
79  size_t subSystemAddress,
80  size_t sectorAddress,
81  int bcid=0 );
82 
84  size_t systemAddress,
85  size_t subSystemAddress,
86  size_t sectorAddress,
87  int bcid=0 );
88 
94  void merge( const Lvl1MuCTPIInputPhase1& another );
95 
96  void clear( size_t systemAddress );
98  void clearAll();
99 
101  bool isEmpty( size_t systemAddress,
102  int bcid=0 ) const;
103 
105  bool isEmptyAll(int bcid=0) const;
106 
109  bool hasOutOfTimeCandidates(size_t systemAddress) const;
110 
111  friend std::ostream& operator<<( std::ostream&, const Lvl1MuCTPIInputPhase1& );
112 
113  size_t getSystemIndex(size_t systemAddress,
114  size_t subSystemAddress,
115  size_t sectorAddress ) const;
116 
117  size_t getBcidIndex(size_t systemAddress,
118  int bcid=0) const;
119 
120  typedef std::vector<std::shared_ptr <Lvl1MuSectorLogicDataPhase1> > Lvl1MuVect;
121  typedef std::pair<int, Lvl1MuVect> Lvl1MuVectWithBC;
122  const std::vector<Lvl1MuVectWithBC>& getData(MuonSystem system) const;
123 
124  private:
125 
126  size_t reserve( size_t systemAddress ,
127  int bcid=0 );
128 
130 
131  std::vector<Lvl1MuVectWithBC> m_data[ NumberOfMuonSystem ];
132  }; // class Lvl1MuCTPIInputPhase1
133 
134  inline size_t Lvl1MuCTPIInputPhase1::idBarrelSystem() { return Barrel; }
136  inline size_t Lvl1MuCTPIInputPhase1::idEndcapSystem() { return Endcap; }
140  inline size_t Lvl1MuCTPIInputPhase1::idSideA() { return A_side; }
141  inline size_t Lvl1MuCTPIInputPhase1::idSideC() { return C_side; }
144  {
145  if (system == Barrel) return numberOfBarrelSector();
146  else if (system == Endcap) return numberOfEndcapSector();
147  else return numberOfForwardSector();
148  }
149 
150  inline bool Lvl1MuCTPIInputPhase1::hasOutOfTimeCandidates(size_t systemAddress) const
151  {
152  if ( systemAddress < NumberOfMuonSystem) {
153  return m_isFilledOutOfTimeCandidates[systemAddress];
154  }
155  return false;
156  }
157 
158  inline size_t Lvl1MuCTPIInputPhase1::getSystemIndex(size_t systemAddress,
159  size_t subSystemAddress,
160  size_t sectorAddress ) const
161  {
162  if (systemAddress==0) {
163  return NumberOfBarrelSector*subSystemAddress+sectorAddress;
164  } else if (systemAddress==1) {
165  return NumberOfEndcapSector*subSystemAddress+sectorAddress;
166  } else {
167  return NumberOfForwardSector*subSystemAddress+sectorAddress;
168  }
169  }
170  inline size_t Lvl1MuCTPIInputPhase1::getBcidIndex(size_t systemAddress,
171  int bcid) const
172  {
173  for( size_t ip=0; ip<m_data[systemAddress].size(); ip++){
174  int bc=((m_data[systemAddress]).at(ip)).first;
175  if (bc == bcid) return ip;
176  }
177  return -1;
178  }
179 
180  inline const std::vector<Lvl1MuCTPIInputPhase1::Lvl1MuVectWithBC>&
182  { return m_data[system]; }
183 
184 } // namespace LVL1MUONIF
185 
186 #include "AthenaKernel/CLASS_DEF.h"
188 
189 #endif // TRIGT1INTERFACES_LVL1MUCTPIINPUTPHASE1_H
Lvl1MuEndcapSectorLogicDataPhase1.h
LVL1MUONIF::Lvl1MuCTPIInputPhase1::NumberOfForwardSector
@ NumberOfForwardSector
Definition: Lvl1MuCTPIInputPhase1.h:53
LVL1MUONIF::Lvl1MuCTPIInputPhase1::setSectorLogicData
void setSectorLogicData(const Lvl1MuSectorLogicDataPhase1 &data, size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0)
Definition: Lvl1MuCTPIInputPhase1.cxx:74
LVL1MUONIF::Lvl1MuCTPIInputPhase1::isEmptyAll
bool isEmptyAll(int bcid=0) const
Return "true" if data of all systems for this bcid is empty.
Definition: Lvl1MuCTPIInputPhase1.cxx:179
LVL1MUONIF::Lvl1MuCTPIInputPhase1::Lvl1MuVect
std::vector< std::shared_ptr< Lvl1MuSectorLogicDataPhase1 > > Lvl1MuVect
Definition: Lvl1MuCTPIInputPhase1.h:120
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LVL1MUONIF::Lvl1MuCTPIInputPhase1::idForwardSystem
static size_t idForwardSystem()
Definition: Lvl1MuCTPIInputPhase1.h:138
LVL1MUONIF::Lvl1MuCTPIInputPhase1::NumberOfBarrelSector
@ NumberOfBarrelSector
Definition: Lvl1MuCTPIInputPhase1.h:51
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:119
LVL1MUONIF::Lvl1MuCTPIInputPhase1::m_isFilledOutOfTimeCandidates
bool m_isFilledOutOfTimeCandidates[NumberOfMuonSystem]
Definition: Lvl1MuCTPIInputPhase1.h:129
LVL1MUONIF
Namespace for the LVL1 muon interface classes.
Definition: Lvl1MuBarrelSectorLogicData.cxx:9
LVL1MUONIF::Lvl1MuCTPIInputPhase1::Lvl1MuVectWithBC
std::pair< int, Lvl1MuVect > Lvl1MuVectWithBC
Definition: Lvl1MuCTPIInputPhase1.h:121
LVL1MUONIF::Lvl1MuCTPIInputPhase1
Class representing (part of) the input data to the MuCTPI for Phase 1.
Definition: Lvl1MuCTPIInputPhase1.h:33
LVL1MUONIF::Lvl1MuCTPIInputPhase1::m_data
std::vector< Lvl1MuVectWithBC > m_data[NumberOfMuonSystem]
Definition: Lvl1MuCTPIInputPhase1.h:131
LVL1MUONIF::Lvl1MuCTPIInputPhase1::operator=
Lvl1MuCTPIInputPhase1 & operator=(const Lvl1MuCTPIInputPhase1 &right)
Definition: Lvl1MuCTPIInputPhase1.cxx:28
LVL1MUONIF::Lvl1MuCTPIInputPhase1::getBcidIndex
size_t getBcidIndex(size_t systemAddress, int bcid=0) const
Definition: Lvl1MuCTPIInputPhase1.h:170
LVL1MUONIF::Lvl1MuCTPIInputPhase1::clear
void clear(size_t systemAddress)
Definition: Lvl1MuCTPIInputPhase1.cxx:188
LVL1MUONIF::Lvl1MuCTPIInputPhase1::operator<<
friend std::ostream & operator<<(std::ostream &, const Lvl1MuCTPIInputPhase1 &)
Definition: Lvl1MuCTPIInputPhase1.cxx:201
LVL1MUONIF::Lvl1MuCTPIInputPhase1::MuonSystem
MuonSystem
Definition: Lvl1MuCTPIInputPhase1.h:47
LVL1MUONIF::Lvl1MuCTPIInputPhase1::MuonSubSystem
MuonSubSystem
Definition: Lvl1MuCTPIInputPhase1.h:48
LVL1MUONIF::Lvl1MuCTPIInputPhase1::~Lvl1MuCTPIInputPhase1
virtual ~Lvl1MuCTPIInputPhase1()
Definition: Lvl1MuCTPIInputPhase1.cxx:22
LVL1MUONIF::Lvl1MuCTPIInputPhase1::NumberOfMuonSubSystem
@ NumberOfMuonSubSystem
Definition: Lvl1MuCTPIInputPhase1.h:50
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:47
LVL1MUONIF::Lvl1MuCTPIInputPhase1::numberOfSystems
static size_t numberOfSystems()
Definition: Lvl1MuCTPIInputPhase1.h:142
LVL1MUONIF::Lvl1MuCTPIInputPhase1::idSideA
static size_t idSideA()
Definition: Lvl1MuCTPIInputPhase1.h:140
LVL1MUONIF::Lvl1MuCTPIInputPhase1::getSystemIndex
size_t getSystemIndex(size_t systemAddress, size_t subSystemAddress, size_t sectorAddress) const
Definition: Lvl1MuCTPIInputPhase1.h:158
LVL1MUONIF::Lvl1MuCTPIInputPhase1::clearAll
void clearAll()
Clear Sector Logic data.
Definition: Lvl1MuCTPIInputPhase1.cxx:193
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:143
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:150
LVL1MUONIF::Lvl1MuCTPIInputPhase1::getSectorLogicData
const Lvl1MuSectorLogicDataPhase1 & getSectorLogicData(size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0) const
Definition: Lvl1MuCTPIInputPhase1.cxx:46
LVL1MUONIF::Lvl1MuCTPIInputPhase1::NumberOfEndcapSector
@ NumberOfEndcapSector
Definition: Lvl1MuCTPIInputPhase1.h:52
LVL1MUONIF::Lvl1MuCTPIInputPhase1::getSectorLogicDataPtr
std::shared_ptr< Lvl1MuSectorLogicDataPhase1 > getSectorLogicDataPtr(size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0) const
Definition: Lvl1MuCTPIInputPhase1.cxx:61
LVL1MUONIF::Lvl1MuCTPIInputPhase1::Barrel
@ Barrel
Definition: Lvl1MuCTPIInputPhase1.h:47
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
LVL1MUONIF::Lvl1MuCTPIInputPhase1::idEndcapSystem
static size_t idEndcapSystem()
Definition: Lvl1MuCTPIInputPhase1.h:136
LVL1MUONIF::Lvl1MuCTPIInputPhase1::numberOfBarrelSector
static size_t numberOfBarrelSector()
Definition: Lvl1MuCTPIInputPhase1.h:135
LVL1MUONIF::Lvl1MuCTPIInputPhase1::isEmpty
bool isEmpty(size_t systemAddress, int bcid=0) const
Return "true" if data of specified system is empty.
Definition: Lvl1MuCTPIInputPhase1.cxx:169
LVL1MUONIF::Lvl1MuCTPIInputPhase1::idSideC
static size_t idSideC()
Definition: Lvl1MuCTPIInputPhase1.h:141
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:64
DeMoScan.first
bool first
Definition: DeMoScan.py:534
LVL1MUONIF::Lvl1MuCTPIInputPhase1::NumberOfMuonSystem
@ NumberOfMuonSystem
Definition: Lvl1MuCTPIInputPhase1.h:49
LVL1MUONIF::Lvl1MuCTPIInputPhase1::idBarrelSystem
static size_t idBarrelSystem()
Definition: Lvl1MuCTPIInputPhase1.h:134
LVL1MUONIF::Lvl1MuCTPIInputPhase1::numberOfEndcapSector
static size_t numberOfEndcapSector()
Definition: Lvl1MuCTPIInputPhase1.h:137
LVL1MUONIF::Lvl1MuCTPIInputPhase1::Lvl1MuCTPIInputPhase1
Lvl1MuCTPIInputPhase1()
Definition: Lvl1MuCTPIInputPhase1.cxx:11
LVL1MUONIF::Lvl1MuCTPIInputPhase1::C_side
@ C_side
Definition: Lvl1MuCTPIInputPhase1.h:48
LVL1MUONIF::Lvl1MuCTPIInputPhase1::A_side
@ A_side
Definition: Lvl1MuCTPIInputPhase1.h:48
LVL1MUONIF::Lvl1MuCTPIInputPhase1::reserve
size_t reserve(size_t systemAddress, int bcid=0)
Definition: Lvl1MuCTPIInputPhase1.cxx:136
CLASS_DEF.h
macros to associate a CLID to a type
Lvl1MuSectorLogicDataPhase1.h
LVL1MUONIF::Lvl1MuCTPIInputPhase1::numberOfForwardSector
static size_t numberOfForwardSector()
Definition: Lvl1MuCTPIInputPhase1.h:139
LVL1MUONIF::Lvl1MuCTPIInputPhase1::Endcap
@ Endcap
Definition: Lvl1MuCTPIInputPhase1.h:47
LVL1MUONIF::Lvl1MuCTPIInputPhase1::getData
const std::vector< Lvl1MuVectWithBC > & getData(MuonSystem system) const
Definition: Lvl1MuCTPIInputPhase1.h:181