ATLAS Offline Software
L1BunchGroupSet.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGCONFDATA_L1BUNCHGROUPSET_H
6 #define TRIGCONFDATA_L1BUNCHGROUPSET_H
7 
9 
10 #include <map>
11 #include <vector>
12 #include <memory>
13 
14 namespace TrigConf {
15 
20  class L1BunchGroup final : public DataStructure {
21  public:
22 
25 
26  L1BunchGroup(const L1BunchGroup &) = delete;
27  L1BunchGroup& operator=(const L1BunchGroup&) = delete;
29 
33  L1BunchGroup(const ptree & data);
34 
36  virtual ~L1BunchGroup() override = default;
37 
38  virtual std::string className() const override { return "L1BunchGroup"; }
39 
40  size_t id() const { return m_id; }
41 
43  std::size_t size() const;
44 
46  size_t nGroups() const { return m_bunchdef.size(); }
47 
49  bool contains(size_t bcid) const;
50 
52  std::vector<uint16_t> bunches() const;
53 
55  const std::vector<std::pair<size_t,size_t>>& trains() const { return m_bunchdef; }
56 
57  private:
58 
60  virtual void update() override { load(); };
61  void load();
62 
63  size_t m_id { 0 };
64 
65  std::vector<std::pair<size_t,size_t>> m_bunchdef;
66  };
67 
68 
69 
71  class L1BunchGroupSet final : public DataStructure {
72  public:
73 
76 
79 
80  L1BunchGroupSet(const L1BunchGroupSet &) = default;
83 
87  L1BunchGroupSet(const ptree & data);
88 
90  virtual ~L1BunchGroupSet();
91 
92  virtual std::string className() const override { return "L1BunchGroupSet"; }
93 
95  unsigned int bgsk() const { return m_bgsk; }
96  void setBGSK(unsigned int bgsk) { m_bgsk = bgsk; }
97 
101  const std::shared_ptr<L1BunchGroup> & getBunchGroup(const std::string & name) const;
102 
104  const std::shared_ptr<L1BunchGroup> & getBunchGroup(size_t id) const;
105 
107  constexpr std::size_t maxNBunchGroups() const { return L1BunchGroupSet::s_maxBunchGroups; }
108 
110  std::size_t size() const;
111 
113  std::size_t sizeNonEmpty() const;
114 
116  bgPattern_t bgPattern(size_t bcid) const;
117 
119  void printSummary(bool detailed = false) const;
120 
122  virtual void clear() override;
123 
124  private:
125 
127  virtual void update() override { load(); };
128  void load();
129 
131  static const size_t s_maxBunchGroups { 16 };
132 
134  unsigned int m_bgsk {0};
135 
137  std::map<std::string, size_t> m_bunchGroupsByName;
138 
140  std::vector<std::shared_ptr<L1BunchGroup>> m_bunchGroups;
141  };
142 
143 }
144 
145 #ifndef TRIGCONF_STANDALONE
146 #ifndef XAOD_STANDALONE
147 
148 #include "AthenaKernel/CLASS_DEF.h"
150 
151 #include "AthenaKernel/CondCont.h"
153 
154 #endif
155 #endif
156 
157 #endif
TrigConf::DataStructure::data
const ptree & data() const
Access to the underlying data, if needed.
Definition: DataStructure.h:83
TrigConf::L1BunchGroup::update
virtual void update() override
Update the internal data after modification of the data object.
Definition: L1BunchGroupSet.h:60
TrigConf::L1BunchGroupSet::setBGSK
void setBGSK(unsigned int bgsk)
Definition: L1BunchGroupSet.h:96
TrigConf::L1BunchGroupSet::m_bunchGroupsByName
std::map< std::string, size_t > m_bunchGroupsByName
maps bgrp name (BGRP0, BGRP1,...) to bunchgroup
Definition: L1BunchGroupSet.h:137
TrigConf::L1BunchGroup::operator=
L1BunchGroup & operator=(const L1BunchGroup &)=delete
TrigConf::L1BunchGroupSet::bgPattern_t
uint16_t bgPattern_t
type for bunchgroup pattern bitset
Definition: L1BunchGroupSet.h:75
TrigConf::L1BunchGroupSet::~L1BunchGroupSet
virtual ~L1BunchGroupSet()
Destructor.
Definition: L1BunchGroupSet.cxx:89
TrigConf::L1BunchGroup::className
virtual std::string className() const override
A string that is the name of the class.
Definition: L1BunchGroupSet.h:38
TrigConf::L1BunchGroup::bunches
std::vector< uint16_t > bunches() const
list of all bunches
Definition: L1BunchGroupSet.cxx:56
CONDCONT_DEF
CONDCONT_DEF(TrigConf::L1BunchGroupSet, 63006439)
TrigConf::L1BunchGroupSet::s_maxBunchGroups
static const size_t s_maxBunchGroups
Hardware limit for number of bunch group.
Definition: L1BunchGroupSet.h:131
TrigConf::L1BunchGroupSet::getBunchGroup
const std::shared_ptr< L1BunchGroup > & getBunchGroup(const std::string &name) const
Accessor to the bunchgroup by name.
Definition: L1BunchGroupSet.cxx:118
TrigConf::L1BunchGroup::trains
const std::vector< std::pair< size_t, size_t > > & trains() const
bunch trains (pairs: 1st bunch in train, and train length)
Definition: L1BunchGroupSet.h:55
TrigConf::L1BunchGroupSet::className
virtual std::string className() const override
A string that is the name of the class.
Definition: L1BunchGroupSet.h:92
TrigConf::L1BunchGroupSet::load
void load()
Definition: L1BunchGroupSet.cxx:93
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::L1BunchGroupSet::L1BunchGroupSet
L1BunchGroupSet(const L1BunchGroupSet &)=default
TrigConf::L1BunchGroup::nGroups
size_t nGroups() const
Accessor to the number of groups of consecutive bunches.
Definition: L1BunchGroupSet.h:46
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TrigConf::L1BunchGroup::size
std::size_t size() const
Accessor to the number of bunches.
Definition: L1BunchGroupSet.cxx:37
TrigConf::L1BunchGroup::id
size_t id() const
Definition: L1BunchGroupSet.h:40
TrigConf::L1BunchGroupSet::size
std::size_t size() const
Accessor to the number of defined bunchgroups.
Definition: L1BunchGroupSet.cxx:128
TrigConf::L1BunchGroupSet::L1BunchGroupSet
L1BunchGroupSet()
Constructor.
Definition: L1BunchGroupSet.cxx:79
TrigConf::L1BunchGroupSet::maxNBunchGroups
constexpr std::size_t maxNBunchGroups() const
Maximum number of bunchgroups.
Definition: L1BunchGroupSet.h:107
TrigConf::L1BunchGroupSet::sizeNonEmpty
std::size_t sizeNonEmpty() const
Accessor to the number of non-empty bunchgroups.
Definition: L1BunchGroupSet.cxx:133
TrigConf::L1BunchGroup::m_id
size_t m_id
Definition: L1BunchGroupSet.h:63
TrigConf::L1BunchGroupSet
L1 board configuration.
Definition: L1BunchGroupSet.h:71
TrigConf::L1BunchGroupSet::bgPattern
bgPattern_t bgPattern(size_t bcid) const
Return word with bit-pattern of fired bunchgroups for given bcid.
Definition: L1BunchGroupSet.cxx:138
TrigConf::name
Definition: HLTChainList.h:35
TrigConf::L1BunchGroupSet::printSummary
void printSummary(bool detailed=false) const
print a more or less detailed summary
Definition: L1BunchGroupSet.cxx:150
TrigConf::L1BunchGroup::L1BunchGroup
L1BunchGroup(L1BunchGroup &&)=delete
TrigConf::L1BunchGroup::L1BunchGroup
L1BunchGroup()
Constructor.
TrigConf::L1BunchGroupSet::m_bunchGroups
std::vector< std::shared_ptr< L1BunchGroup > > m_bunchGroups
vector of size 16 (L1BunchGroup::s_maxBunchGroups
Definition: L1BunchGroupSet.h:140
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
TrigConf::DataStructure
Base class for Trigger configuration data and wrapper around underlying representation.
Definition: DataStructure.h:37
TrigConf::L1BunchGroupSet::clear
virtual void clear() override
Clearing the configuration data.
Definition: L1BunchGroupSet.cxx:110
TrigConf::L1BunchGroup::m_bunchdef
std::vector< std::pair< size_t, size_t > > m_bunchdef
Definition: L1BunchGroupSet.h:65
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
TrigConf::L1BunchGroupSet::m_bgsk
unsigned int m_bgsk
the bunch group key
Definition: L1BunchGroupSet.h:134
TrigConf::L1BunchGroup::load
void load()
Definition: L1BunchGroupSet.cxx:22
TrigConf::L1BunchGroup::~L1BunchGroup
virtual ~L1BunchGroup() override=default
Destructor.
TrigConf::L1BunchGroup::contains
bool contains(size_t bcid) const
check if bunchgroup contains a certain bunch
Definition: L1BunchGroupSet.cxx:46
TrigConf::L1BunchGroupSet::bgsk
unsigned int bgsk() const
setter and getter for the bunch group key
Definition: L1BunchGroupSet.h:95
TrigConf::L1BunchGroupSet::L1BunchGroupSet
L1BunchGroupSet(L1BunchGroupSet &&)=delete
DataStructure.h
TrigConf::DataStructure::ptree
boost::property_tree::ptree ptree
Definition: DataStructure.h:40
CLASS_DEF.h
macros to associate a CLID to a type
TrigConf::L1BunchGroup::L1BunchGroup
L1BunchGroup(const L1BunchGroup &)=delete
TrigConf::L1BunchGroupSet::operator=
L1BunchGroupSet & operator=(const L1BunchGroupSet &)=delete
TrigConf::L1BunchGroup
Bunchgroup and BunchgroupSet representation.
Definition: L1BunchGroupSet.h:20
TrigConf::L1BunchGroupSet::update
virtual void update() override
Update the internal members.
Definition: L1BunchGroupSet.h:127