ATLAS Offline Software
PrioritySet.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include <iostream>
7 
8 
9 using namespace std;
10 
12  : L1DataBaseclass(),m_Priorities(N_PRIORITIES,"LOW")
13 {}
14 
15 void
16 TrigConf::PrioritySet::setPriorities(const std::string p[], const unsigned int size) {
17  if (size > N_PRIORITIES) std::cerr
18  << "setPriorities >> number of priorities too high: " << size << std::endl;
19  for (unsigned int i=0; i<size; i++) m_Priorities.at(i) = p[i];
20 }
21 
22 void
23 TrigConf::PrioritySet::setPriorities(const std::vector<std::string>& vec) {
24  if (vec.size() > N_PRIORITIES) std::cerr
25  << "setPriorities >> number of priorities too high: " << vec.size() << std::endl;
26  for (unsigned int i=0; i<vec.size(); ++i) m_Priorities.at(i) = vec[i];
27 }
28 
29 void
30 TrigConf::PrioritySet::print(const std::string& indent, unsigned int detail) const {
31  if(detail>=5) {
32  cout << indent << "PrioritySet " << name() << endl;
33  cout << indent << "lvl1MasterTableId: " << lvl1MasterTableId() << endl;
34  unsigned int ctpid(0);
35  for(const string& priority: m_Priorities)
36  cout << "\t " << ctpid++ << "\t" << " priority = " << priority << endl;
37  }
38 }
39 
40 
44 void
45 TrigConf::PrioritySet::writeXML(std::ostream & xmlfile, int indentLevel, int indentWidth) const {
46  indent(xmlfile, indentLevel, indentWidth)
47  << "<PrioritySet name=\"" << name() << "\" version=\"" << version() << "\">"
48  << endl;
49  unsigned int ctpid(0);
50  for(const string& priority : m_Priorities) {
51  indent(xmlfile, indentLevel + 1, indentWidth)
52  << "<Priority ctpid=\"" << ctpid++
53  << "\" priority=\"" << priority << "\">"
54  << priority << "</Priority>" << endl;
55  }
56  indent(xmlfile, indentLevel, indentWidth)
57  << "</PrioritySet>" << endl;
58 }
59 
TrigConf::PrioritySet::PrioritySet
PrioritySet()
Definition: PrioritySet.cxx:11
TrigConf::PrioritySet::writeXML
virtual void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
Writes the Prescale item to the XML file.
Definition: PrioritySet.cxx:45
detail
Definition: extract_histogram_tag.cxx:14
python.selector.AtlRunQuerySelectorLhcOlc.priority
priority
Definition: AtlRunQuerySelectorLhcOlc.py:611
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigConf::PrioritySet::print
virtual void print(const std::string &indent="", unsigned int detail=1) const override
Definition: PrioritySet.cxx:30
TrigConf::PrioritySet::setPriorities
void setPriorities(const std::string p[], const unsigned int size)
Definition: PrioritySet.cxx:16
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
PrioritySet.h
get_generator_info.version
version
Definition: get_generator_info.py:33
TrigConf::L1DataBaseclass
Definition: L1DataBaseclass.h:22