ATLAS Offline Software
Loading...
Searching...
No Matches
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
14namespace TrigConf {
15
18
19
20 class L1BunchGroup final : public DataStructure {
21 public:
22
25
26 L1BunchGroup(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
75 typedef uint16_t bgPattern_t;
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
150
151#include "AthenaKernel/CondCont.h"
153
154#endif
155#endif
156
157#endif
#define CONDCONT_DEF(...)
Definition CondCont.h:1413
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
L1BunchGroupSet()
Constructor.
const ptree & data() const
Access to the underlying data, if needed.
DataStructure()
Default constructor, leading to an uninitialized configuration object.
boost::property_tree::ptree ptree
L1 board configuration.
L1BunchGroupSet(const L1BunchGroupSet &)=default
L1BunchGroupSet(L1BunchGroupSet &&)=delete
L1BunchGroupSet & operator=(const L1BunchGroupSet &)=delete
std::vector< std::shared_ptr< L1BunchGroup > > m_bunchGroups
vector of size 16 (L1BunchGroup::s_maxBunchGroups
constexpr std::size_t maxNBunchGroups() const
Maximum number of bunchgroups.
static const size_t s_maxBunchGroups
Hardware limit for number of bunch group.
void setBGSK(unsigned int bgsk)
std::map< std::string, size_t > m_bunchGroupsByName
maps bgrp name (BGRP0, BGRP1,...) to bunchgroup
bgPattern_t bgPattern(size_t bcid) const
Return word with bit-pattern of fired bunchgroups for given bcid.
std::size_t size() const
Accessor to the number of defined bunchgroups.
unsigned int bgsk() const
setter and getter for the bunch group key
const std::shared_ptr< L1BunchGroup > & getBunchGroup(const std::string &name) const
Accessor to the bunchgroup by name.
unsigned int m_bgsk
the bunch group key
virtual void clear() override
Clearing the configuration data.
virtual void update() override
Update the internal members.
uint16_t bgPattern_t
type for bunchgroup pattern bitset
virtual std::string className() const override
A string that is the name of the class.
virtual ~L1BunchGroupSet()
Destructor.
std::size_t sizeNonEmpty() const
Accessor to the number of non-empty bunchgroups.
void printSummary(bool detailed=false) const
print a more or less detailed summary
virtual void update() override
Update the internal data after modification of the data object.
L1BunchGroup(L1BunchGroup &&)=delete
bool contains(size_t bcid) const
check if bunchgroup contains a certain bunch
virtual ~L1BunchGroup() override=default
Destructor.
std::vector< std::pair< size_t, size_t > > m_bunchdef
L1BunchGroup(const L1BunchGroup &)=delete
std::size_t size() const
Accessor to the number of bunches.
const std::vector< std::pair< size_t, size_t > > & trains() const
bunch trains (pairs: 1st bunch in train, and train length)
virtual std::string className() const override
A string that is the name of the class.
L1BunchGroup()
Constructor.
size_t nGroups() const
Accessor to the number of groups of consecutive bunches.
L1BunchGroup & operator=(const L1BunchGroup &)=delete
std::vector< uint16_t > bunches() const
list of all bunches
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22