ATLAS Offline Software
Loading...
Searching...
No Matches
BunchGroupCondData.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
3 */
10
11
13#include <stdexcept>
14
15
20{
21 // Reserve all vectors to their full size.
22 for (unsigned int i = 0; i < NBUNCHGROUPS; i++) {
23 m_bunchGroups[i].reserve (NBCID);
24 }
25}
26
27
34const std::vector<unsigned int>&
35BunchGroupCondData::bunchGroup (unsigned int group) const
36{
37 if (group >= NBUNCHGROUPS) {
38 throw std::out_of_range ("BunchGroupCondData::bunchGroup");
39 }
40 return m_bunchGroups[group];
41}
42
43
49void BunchGroupCondData::addBCID (unsigned int bcid, uint8_t mask)
50{
51 for (size_t i = 0; i < NBUNCHGROUPS; i++) {
52 if ((mask & (1<<i)) != 0) {
53 m_bunchGroups[i].push_back (bcid);
54 }
55 }
56}
57
58
63{
64 for (unsigned int i = 0; i < NBUNCHGROUPS; i++) {
65 m_bunchGroups[i].shrink_to_fit();
66 }
67}
Holds data on filled bunches.
void shrink()
Shrink all vectors to size.
static constexpr unsigned int NBCID
Maximum size of BCID vectors.
std::vector< unsigned int > m_bunchGroups[NBUNCHGROUPS]
BCIDs of filled bunches, per group.
BunchGroupCondData()
Constructor.
void addBCID(unsigned int bcid, uint8_t mask)
Add informatin for one BCID.
static constexpr unsigned int NBUNCHGROUPS
Number of bunch groups.
const std::vector< unsigned int > & bunchGroup(unsigned int group) const
Return filled BCIDs for one bunch group.