ATLAS Offline Software
Lvl1MuCTPIInput.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 #ifndef TRIGT1INTERFACES_LVL1MUCTPIINPUT_H
3 /*
4  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
5 */
6 #define TRIGT1INTERFACES_LVL1MUCTPIINPUT_H
7 
8 // System include(s):
9 #include <iosfwd>
10 #include <vector>
11 #include <utility>
12 #include <memory>
13 
14 // Local include(s):
19 
20 namespace LVL1MUONIF {
21 
37 
38  public:
41  virtual ~Lvl1MuCTPIInput();
42 
43  Lvl1MuCTPIInput& operator=( const Lvl1MuCTPIInput& right );
44 
45  protected:
46  // data from each sector logic is identifed by
47  // System Address : Barrel=0, Endcap=1, Forward=2
48  // Sub-system Address : A_side(Z>0) =1, C_side(Z<0) =0
49  // Sector Address : Barrel=0-31, Endcap=0-47, Forward=0-23
50  enum MuonSystem { Barrel = 0, Endcap = 1, Forward = 2 };
51  enum MuonSubSystem { A_side = 1, C_side = 0};
52  enum { NumberOfMuonSystem = 3 };
53  enum { NumberOfMuonSubSystem = 2 };
54  enum { NumberOfBarrelSector = 32 };
55  enum { NumberOfEndcapSector = 48 };
56  enum { NumberOfForwardSector = 24 };
57 
58  public:
59  static size_t idBarrelSystem() { return Barrel; }
60  static size_t numberOfBarrelSector() { return NumberOfBarrelSector; }
61  static size_t idEndcapSystem() { return Endcap; }
62  static size_t numberOfEndcapSector() { return NumberOfEndcapSector; }
63  static size_t idForwardSystem() { return Forward; }
64  static size_t numberOfForwardSector() { return NumberOfForwardSector; }
65  static size_t idSideA() { return A_side; }
66  static size_t idSideC() { return C_side; }
67 
68  const Lvl1MuSectorLogicData& getSectorLogicData( size_t systemAddress,
69  size_t subSystemAddress,
70  size_t sectorAddress,
71  int bcid=0 ) const;
72 
74  size_t systemAddress,
75  size_t subSystemAddress,
76  size_t sectorAddress,
77  int bcid=0 );
78 
79  void setSectorLogicData( const unsigned int & sectorWord,
80  size_t systemAddress,
81  size_t subSystemAddress,
82  size_t sectorAddress,
83  int bcid=0 );
84 
90  void merge( const Lvl1MuCTPIInput& another );
91 
92  void clear( size_t systemAddress );
94  void clearAll();
95 
97  bool isEmpty( size_t systemAddress,
98  int bcid=0 ) const;
99 
101  bool isEmptyAll(int bcid=0) const;
102 
105  bool hasOutOfTimeCandidates(size_t systemAddress) const
106  {
107  if ( systemAddress < NumberOfMuonSystem) {
108  return m_isFilledOutOfTimeCandidates[systemAddress];
109  }
110  return false;
111  }
112 
113  // for testing purposes only
114  // void duplicateToOtherBC(int bcidOffset);
115 
116  friend std::ostream& operator<<( std::ostream&, const Lvl1MuCTPIInput& );
117 
119  //bool storeInWordFormat( std::ofstream& fOut, bool ascii = true );
120 
122  //bool retrieveInWordFormat( std::ifstream& fIn, bool ascii = true );
123 
124  private:
125  //bool storeInWordFormat( std::ofstream& fOut,
126  // bool ascii,
127  // size_t systemAddress,
128  // size_t subSystemAddress,
129  // size_t sectorAddress );
130 
131  size_t reserve( size_t systemAddress ,
132  int bcid=0 );
133 
134  size_t getSystemIndex(size_t systemAddress,
135  size_t subSystemAddress,
136  size_t sectorAddress ) const
137  {
138  if (systemAddress==0) {
139  return NumberOfBarrelSector*subSystemAddress+sectorAddress;
140  } else if (systemAddress==1) {
141  return NumberOfEndcapSector*subSystemAddress+sectorAddress;
142  } else {
143  return NumberOfForwardSector*subSystemAddress+sectorAddress;
144  }
145  }
146 
147  size_t getBcidIndex(size_t systemAddress,
148  int bcid=0) const
149  {
150  for( size_t ip=0; ip<m_data[systemAddress].size(); ip++){
151  int bc=((m_data[systemAddress]).at(ip)).first;
152  if (bc == bcid) return ip;
153  }
154  return -1;
155  };
156 
158 
159 
160  typedef std::vector<std::shared_ptr <Lvl1MuSectorLogicData> > Lvl1MuVect;
161  typedef std::pair<int, Lvl1MuVect> Lvl1MuVectWithBC;
162  std::vector<Lvl1MuVectWithBC> m_data[ NumberOfMuonSystem ];
163 
164  }; // class Lvl1MuCTPIInput
165 
166 } // namespace LVL1MUONIF
167 
168 #include "AthenaKernel/CLASS_DEF.h"
170 
171 #endif // TRIGT1INTERFACES_LVL1MUCTPIINPUT_H
LVL1MUONIF::Lvl1MuCTPIInput::merge
void merge(const Lvl1MuCTPIInput &another)
Merge SectorLogic data of another object into this data of a system (Barrel, Endcap or Forward) is no...
Definition: Lvl1MuCTPIInput.cxx:109
LVL1MUONIF::Lvl1MuCTPIInput::Lvl1MuVectWithBC
std::pair< int, Lvl1MuVect > Lvl1MuVectWithBC
Definition: Lvl1MuCTPIInput.h:161
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LVL1MUONIF::Lvl1MuSectorLogicData
Base class for the data coming from one SL board.
Definition: Lvl1MuSectorLogicData.h:34
LVL1MUONIF::Lvl1MuCTPIInput::setSectorLogicData
void setSectorLogicData(const Lvl1MuSectorLogicData &data, size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0)
Definition: Lvl1MuCTPIInput.cxx:63
LVL1MUONIF::Lvl1MuCTPIInput::Endcap
@ Endcap
Definition: Lvl1MuCTPIInput.h:50
LVL1MUONIF::Lvl1MuCTPIInput::C_side
@ C_side
Definition: Lvl1MuCTPIInput.h:51
LVL1MUONIF::Lvl1MuCTPIInput::NumberOfMuonSystem
@ NumberOfMuonSystem
Definition: Lvl1MuCTPIInput.h:52
LVL1MUONIF::Lvl1MuCTPIInput::Forward
@ Forward
Definition: Lvl1MuCTPIInput.h:50
LVL1MUONIF::Lvl1MuCTPIInput
Class representing (part of) the input data to the MuCTPI.
Definition: Lvl1MuCTPIInput.h:36
LVL1MUONIF::Lvl1MuCTPIInput::operator=
Lvl1MuCTPIInput & operator=(const Lvl1MuCTPIInput &right)
Definition: Lvl1MuCTPIInput.cxx:29
LVL1MUONIF::Lvl1MuCTPIInput::~Lvl1MuCTPIInput
virtual ~Lvl1MuCTPIInput()
Definition: Lvl1MuCTPIInput.cxx:23
LVL1MUONIF
Namespace for the LVL1 muon interface classes.
Definition: Lvl1MuBarrelSectorLogicData.cxx:9
LVL1MUONIF::Lvl1MuCTPIInput::reserve
size_t reserve(size_t systemAddress, int bcid=0)
To store object to file. (NOT TO BE USED ANYMORE...)
Definition: Lvl1MuCTPIInput.cxx:126
LVL1MUONIF::Lvl1MuCTPIInput::getSectorLogicData
const Lvl1MuSectorLogicData & getSectorLogicData(size_t systemAddress, size_t subSystemAddress, size_t sectorAddress, int bcid=0) const
Definition: Lvl1MuCTPIInput.cxx:47
Lvl1MuForwardSectorLogicData.h
LVL1MUONIF::Lvl1MuCTPIInput::numberOfBarrelSector
static size_t numberOfBarrelSector()
Definition: Lvl1MuCTPIInput.h:60
LVL1MUONIF::Lvl1MuCTPIInput::Lvl1MuVect
std::vector< std::shared_ptr< Lvl1MuSectorLogicData > > Lvl1MuVect
Definition: Lvl1MuCTPIInput.h:160
LVL1MUONIF::Lvl1MuCTPIInput::isEmptyAll
bool isEmptyAll(int bcid=0) const
Return "true" if data of all systems for this bcid is empty.
Definition: Lvl1MuCTPIInput.cxx:169
LVL1MUONIF::Lvl1MuCTPIInput::NumberOfEndcapSector
@ NumberOfEndcapSector
Definition: Lvl1MuCTPIInput.h:55
LVL1MUONIF::Lvl1MuCTPIInput::hasOutOfTimeCandidates
bool hasOutOfTimeCandidates(size_t systemAddress) const
Return "true" if data of specified system is filled for bunches other than 'current' bunch
Definition: Lvl1MuCTPIInput.h:105
LVL1MUONIF::Lvl1MuCTPIInput::getSystemIndex
size_t getSystemIndex(size_t systemAddress, size_t subSystemAddress, size_t sectorAddress) const
Definition: Lvl1MuCTPIInput.h:134
LVL1MUONIF::Lvl1MuCTPIInput::idForwardSystem
static size_t idForwardSystem()
Definition: Lvl1MuCTPIInput.h:63
Lvl1MuBarrelSectorLogicData.h
LVL1MUONIF::Lvl1MuCTPIInput::operator<<
friend std::ostream & operator<<(std::ostream &, const Lvl1MuCTPIInput &)
Definition: Lvl1MuCTPIInput.cxx:223
LVL1MUONIF::Lvl1MuCTPIInput::clearAll
void clearAll()
Clear Sector Logic data.
Definition: Lvl1MuCTPIInput.cxx:184
LVL1MUONIF::Lvl1MuCTPIInput::m_isFilledOutOfTimeCandidates
bool m_isFilledOutOfTimeCandidates[NumberOfMuonSystem]
Definition: Lvl1MuCTPIInput.h:155
LVL1MUONIF::Lvl1MuCTPIInput::isEmpty
bool isEmpty(size_t systemAddress, int bcid=0) const
Return "true" if data of specified system is empty.
Definition: Lvl1MuCTPIInput.cxx:159
LVL1MUONIF::Lvl1MuCTPIInput::idBarrelSystem
static size_t idBarrelSystem()
Definition: Lvl1MuCTPIInput.h:59
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
Lvl1MuSectorLogicData.h
LVL1MUONIF::Lvl1MuCTPIInput::A_side
@ A_side
Definition: Lvl1MuCTPIInput.h:51
LVL1MUONIF::Lvl1MuCTPIInput::getBcidIndex
size_t getBcidIndex(size_t systemAddress, int bcid=0) const
Definition: Lvl1MuCTPIInput.h:147
LVL1MUONIF::Lvl1MuCTPIInput::m_data
std::vector< Lvl1MuVectWithBC > m_data[NumberOfMuonSystem]
Definition: Lvl1MuCTPIInput.h:162
LVL1MUONIF::Lvl1MuCTPIInput::MuonSubSystem
MuonSubSystem
Definition: Lvl1MuCTPIInput.h:51
LVL1MUONIF::Lvl1MuCTPIInput::MuonSystem
MuonSystem
Definition: Lvl1MuCTPIInput.h:50
LVL1MUONIF::Lvl1MuCTPIInput::idEndcapSystem
static size_t idEndcapSystem()
Definition: Lvl1MuCTPIInput.h:61
LVL1MUONIF::Lvl1MuCTPIInput::idSideC
static size_t idSideC()
Definition: Lvl1MuCTPIInput.h:66
LVL1MUONIF::Lvl1MuCTPIInput::NumberOfBarrelSector
@ NumberOfBarrelSector
Definition: Lvl1MuCTPIInput.h:54
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
Lvl1MuEndcapSectorLogicData.h
LVL1MUONIF::Lvl1MuCTPIInput::clear
void clear(size_t systemAddress)
Definition: Lvl1MuCTPIInput.cxx:178
LVL1MUONIF::Lvl1MuCTPIInput::numberOfForwardSector
static size_t numberOfForwardSector()
Definition: Lvl1MuCTPIInput.h:64
LVL1MUONIF::Lvl1MuCTPIInput::NumberOfForwardSector
@ NumberOfForwardSector
Definition: Lvl1MuCTPIInput.h:56
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
LVL1MUONIF::Lvl1MuCTPIInput::Barrel
@ Barrel
Definition: Lvl1MuCTPIInput.h:50
DeMoScan.first
bool first
Definition: DeMoScan.py:534
LVL1MUONIF::Lvl1MuCTPIInput::numberOfEndcapSector
static size_t numberOfEndcapSector()
Definition: Lvl1MuCTPIInput.h:62
LVL1MUONIF::Lvl1MuCTPIInput::idSideA
static size_t idSideA()
Definition: Lvl1MuCTPIInput.h:65
LVL1MUONIF::Lvl1MuCTPIInput::Lvl1MuCTPIInput
Lvl1MuCTPIInput()
Definition: Lvl1MuCTPIInput.cxx:12
CLASS_DEF.h
macros to associate a CLID to a type
LVL1MUONIF::Lvl1MuCTPIInput::NumberOfMuonSubSystem
@ NumberOfMuonSubSystem
Definition: Lvl1MuCTPIInput.h:53