ATLAS Offline Software
BunchGroupSet.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <iostream>
8 
9 using namespace std;
10 using namespace TrigConf;
11 
12 
13 BunchGroupSet::BunchGroupSet() : L1DataBaseclass(), m_MenuPartition(0), m_BGpattern(3564) {}
14 
15 BunchGroupSet::BunchGroupSet(const std::vector<BunchGroup>& bgv) :
17  m_MenuPartition(0),
18  m_BunchGroups(bgv),
19  m_BGpattern(3564)
20 {
21  for(const BunchGroup& bg: m_BunchGroups)
22  fillPattern(bg.internalNumber(), bg);
23 }
24 
25 void
27  fillPattern(bg.internalNumber(), bg);
28  m_BunchGroups.push_back(bg);
29 }
30 
31 
32 void
33 BunchGroupSet::setBGName(uint32_t i, const std::string& name) {
34  if(i<m_BunchGroups.size())
35  m_BunchGroups[i].setName(name);
36 }
37 
38 void
40  if(bitpos>=16)
41  return;
42  uint16_t bit = 0x1 << bitpos;
43  const std::vector<int>& b = bg.bunches();
44  for(size_t i=0; i<b.size(); ++i)
45  m_BGpattern[b[i]] |= bit;
46 }
47 
48 
49 void
50 BunchGroupSet::print(const std::string& indent, unsigned int detail) const {
51  if(detail>=1) {
52  cout << indent << "BunchGroupSet " << name();
53  if(id()>0 || version()>0)
54  cout << " (id=" << id() << "/v=" << version() << ")";
55  cout << endl;
56  cout << indent << "Number of bunch groups: " << m_BunchGroups.size() << endl;
57  if(detail>=2) {
58  for(const BunchGroup& bg: m_BunchGroups)
59  bg.print(indent + indent, detail);
60  }
61  }
62 }
63 
64 void
65 BunchGroupSet::writeXML(std::ostream & xmlfile, int indentLevel, int indentWidth) const {
66  indent(xmlfile,indentLevel, indentWidth)
67  << "<BunchGroupSet name=\"" << name() << "\" menuPartition=\"" << m_MenuPartition << "\">" << endl;
68  for(const BunchGroup& bg: m_BunchGroups)
69  bg.writeXML(xmlfile, indentLevel+1, indentWidth);
70  indent(xmlfile,indentLevel, indentWidth)
71  << "</BunchGroupSet>" << endl;
72 }
73 
TrigConf::BunchGroup
Definition: BunchGroup.h:17
TrigConf::TrigConfData::name
const std::string & name() const
Definition: TrigConfData.h:22
StandaloneBunchgroupHandler.bg
bg
Definition: StandaloneBunchgroupHandler.py:243
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigConf::BunchGroupSet::m_MenuPartition
uint16_t m_MenuPartition
Definition: BunchGroupSet.h:43
detail
Definition: extract_histogram_tag.cxx:14
TrigConf::BunchGroupSet::fillPattern
void fillPattern(uint32_t bitpos, const BunchGroup &bg)
Definition: BunchGroupSet.cxx:39
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:18
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
lumiFormat.i
int i
Definition: lumiFormat.py:92
TrigConf::TrigConfData::version
unsigned int version() const
Definition: TrigConfData.h:24
TrigConf::BunchGroupSet::addBunchGroup
void addBunchGroup(const BunchGroup &)
Definition: BunchGroupSet.cxx:26
TrigConf::name
Definition: HLTChainList.h:35
BunchGroupSet.h
TrigConf::TrigConfData::id
unsigned int id() const
Definition: TrigConfData.h:21
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TrigConf::BunchGroupSet::m_BGpattern
std::vector< uint16_t > m_BGpattern
Definition: BunchGroupSet.h:45
TrigConf::BunchGroupSet::print
virtual void print(const std::string &indent="", unsigned int detail=1) const override
Definition: BunchGroupSet.cxx:50
TrigConf::BunchGroupSet::setBGName
void setBGName(uint32_t, const std::string &)
Definition: BunchGroupSet.cxx:33
TrigConf::BunchGroupSet::writeXML
void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
Definition: BunchGroupSet.cxx:65
TrigConf::TrigConfData::indent
std::ostream & indent(std::ostream &o, int lvl, int size) const
Definition: TrigConfData.cxx:23
TrigConf::BunchGroupSet::m_BunchGroups
std::vector< BunchGroup > m_BunchGroups
Definition: BunchGroupSet.h:44
TrigConf::L1DataBaseclass
Definition: L1DataBaseclass.h:22
TrigConf::BunchGroupSet::BunchGroupSet
BunchGroupSet()
Definition: BunchGroupSet.cxx:13