ATLAS Offline Software
Loading...
Searching...
No Matches
PrioritySet.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#include <iostream>
7
8
9using namespace std;
10
14
15void
16TrigConf::PrioritySet::setPriorities(const std::vector<std::string>& vec) {
17 if (vec.size() > N_PRIORITIES) std::cerr
18 << "setPriorities >> number of priorities too high: " << vec.size() << std::endl;
19 for (unsigned int i=0; i<vec.size(); ++i) m_Priorities.at(i) = vec[i];
20}
21
22void
23TrigConf::PrioritySet::print(const std::string& indent, unsigned int detail) const {
24 if(detail>=5) {
25 cout << indent << "PrioritySet " << name() << endl;
26 cout << indent << "lvl1MasterTableId: " << lvl1MasterTableId() << endl;
27 unsigned int ctpid(0);
28 for(const string& priority: m_Priorities)
29 cout << "\t " << ctpid++ << "\t" << " priority = " << priority << endl;
30 }
31}
32
33
37void
38TrigConf::PrioritySet::writeXML(std::ostream & xmlfile, int indentLevel, int indentWidth) const {
39 indent(xmlfile, indentLevel, indentWidth)
40 << "<PrioritySet name=\"" << name() << "\" version=\"" << version() << "\">"
41 << endl;
42 unsigned int ctpid(0);
43 for(const string& priority : m_Priorities) {
44 indent(xmlfile, indentLevel + 1, indentWidth)
45 << "<Priority ctpid=\"" << ctpid++
46 << "\" priority=\"" << priority << "\">"
47 << priority << "</Priority>" << endl;
48 }
49 indent(xmlfile, indentLevel, indentWidth)
50 << "</PrioritySet>" << endl;
51}
52
std::vector< size_t > vec
unsigned int lvl1MasterTableId() const
static const unsigned int N_PRIORITIES
Definition PrioritySet.h:18
virtual void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
Writes the Prescale item to the XML file.
virtual void print(const std::string &indent="", unsigned int detail=1) const override
std::vector< std::string > m_Priorities
Definition PrioritySet.h:32
void setPriorities(const std::vector< std::string > &vec)
std::ostream & indent(std::ostream &o, int lvl, int size) const
unsigned int version() const
static std::vector< std::string > xmlfile
Definition iLumiCalc.h:29
STL namespace.