ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigEvent
TrigMonitoringEvent
src
TrigConfSeq.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// C/C++
6
#include <algorithm>
7
#include <sstream>
8
#include <iostream>
9
10
#include "
AthenaKernel/errorcheck.h
"
11
#include "
TrigMonitoringEvent/TrigConfSeq.h
"
12
13
14
15
//--------------------------------------------------------------------------------------
16
TrigConfSeq::TrigConfSeq
(
unsigned
int
id
,
17
unsigned
int
index
,
18
const
std::string &name)
19
:
m_output_te_name
(name),
20
m_output_te_index
(
index
),
21
m_output_te_id
(id),
22
m_topo_te
(0)
23
{
24
}
25
26
//--------------------------------------------------------------------------------------
27
void
TrigConfSeq::clearStrings
()
28
{
29
//
30
// Clear all string variables
31
//
32
m_output_te_name
.clear();
33
for
(
unsigned
int
i = 0; i <
m_alg
.size(); ++i)
m_alg
[i].
clearStrings
();
34
}
35
36
//--------------------------------------------------------------------------------------
37
const
TrigConfAlg
&
TrigConfSeq::getAlg
(
unsigned
int
pos)
const
38
{
39
if
(pos >=
m_alg
.size()) {
40
REPORT_MESSAGE_WITH_CONTEXT
(MSG::ERROR,
"TrigConfSeq"
)
41
<<
"getAlg("
<< pos <<
") error! Index is greater than alg size="
<<
m_alg
.size() <<
" for "
<<
m_output_te_name
;
42
return
m_alg
.front();
43
}
44
if
(
m_alg
[pos].getPosition() != pos) {
45
REPORT_MESSAGE_WITH_CONTEXT
(MSG::ERROR,
"TrigConfSeq"
)
46
<<
"getAlg("
<< pos <<
") error! Index mismatch: "
<<
m_alg
[pos].getPosition() <<
"!="
<< pos;
47
}
48
49
return
m_alg
[pos];
50
}
51
52
//--------------------------------------------------------------------------------------
53
std::vector<TrigConfAlg>::const_iterator
TrigConfSeq::findName
(
const
std::string &aname)
const
54
{
55
// find first algorithm by name
56
std::vector<TrigConfAlg>::const_iterator it =
m_alg
.begin();
57
58
for
(; it !=
m_alg
.end(); ++it) {
59
if
(it->getName() == aname)
break
;
60
}
61
62
return
it;
63
}
64
65
//--------------------------------------------------------------------------------------
66
std::vector<TrigConfAlg>::const_iterator
TrigConfSeq::findType
(
const
std::string &atype)
const
67
{
68
// find first algorithm by type
69
std::vector<TrigConfAlg>::const_iterator it =
m_alg
.begin();
70
71
for
(; it !=
m_alg
.end(); ++it) {
72
if
(it->getType() == atype)
break
;
73
}
74
75
return
it;
76
}
77
78
//--------------------------------------------------------------------------------------
79
bool
TrigConfSeq::matchAlgName
(
const
std::string &aname)
const
80
{
81
//
82
// Match algorithm name to a list of my configured algorithms
83
//
84
return
(
TrigConfSeq::findName
(aname) !=
m_alg
.end());
85
}
86
87
//--------------------------------------------------------------------------------------
88
bool
TrigConfSeq::matchAlgType
(
const
std::string &atype)
const
89
{
90
//
91
// Match algorithm type to a list of my configured algorithms
92
//
93
return
(
TrigConfSeq::findType
(atype) !=
m_alg
.end());
94
}
95
96
//--------------------------------------------------------------------------------------
97
void
TrigConfSeq::print
(std::ostream &os)
const
98
{
99
os <<
str
(*
this
) << std::endl;
100
}
101
void
TrigConfSeq::print
()
const
102
{
103
std::cout <<
str
(*
this
) << std::endl;
104
}
105
106
//--------------------------------------------------------------------------------------
107
std::string
str
(
const
TrigConfSeq
&o)
108
{
109
std::stringstream s;
110
s <<
"TrigConfSeq: "
<< o.
getName
() <<
" id="
<< o.
getId
()
111
<<
" contains "
<< o.
getAlg
().size() <<
" algorithm(s): \n"
;
112
113
for
(
unsigned
int
i = 0; i < o.
getAlg
().
size
(); ++i) {
114
s <<
" "
<<
str
(o.
getAlg
()[i]) <<
"\n"
;
115
}
116
117
return
s.str();
118
}
errorcheck.h
Helpers for checking error return status codes and reporting errors.
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:345
size
size_t size() const
Number of registered mappings.
TrigConfSeq.h
TrigConfAlg
Definition
TrigConfAlg.h:25
TrigConfSeq
Definition
TrigConfSeq.h:30
TrigConfSeq::print
void print() const
Definition
TrigConfSeq.cxx:101
TrigConfSeq::findType
std::vector< TrigConfAlg >::const_iterator findType(const std::string &atype) const
Definition
TrigConfSeq.cxx:66
TrigConfSeq::m_alg
std::vector< TrigConfAlg > m_alg
Definition
TrigConfSeq.h:72
TrigConfSeq::clearStrings
void clearStrings()
Definition
TrigConfSeq.cxx:27
TrigConfSeq::matchAlgType
bool matchAlgType(const std::string &atype) const
Definition
TrigConfSeq.cxx:88
TrigConfSeq::matchAlgName
bool matchAlgName(const std::string &aname) const
Definition
TrigConfSeq.cxx:79
TrigConfSeq::TrigConfSeq
TrigConfSeq()=default
TrigConfSeq::m_output_te_id
uint32_t m_output_te_id
Definition
TrigConfSeq.h:70
TrigConfSeq::findName
std::vector< TrigConfAlg >::const_iterator findName(const std::string &aname) const
Definition
TrigConfSeq.cxx:53
TrigConfSeq::getAlg
const TrigConfAlg & getAlg(unsigned int pos) const
Definition
TrigConfSeq.cxx:37
TrigConfSeq::getName
const std::string & getName() const
Definition
TrigConfSeq.h:44
TrigConfSeq::m_topo_te
uint32_t m_topo_te
Definition
TrigConfSeq.h:71
TrigConfSeq::m_output_te_index
uint16_t m_output_te_index
Definition
TrigConfSeq.h:69
TrigConfSeq::getId
uint32_t getId() const
Definition
TrigConfSeq.h:43
TrigConfSeq::m_output_te_name
std::string m_output_te_name
Definition
TrigConfSeq.h:68
TrigConfSeq::getAlg
const std::vector< TrigConfAlg > & getAlg() const
Definition
TrigConfSeq.h:50
index
Definition
index.py:1
str
Definition
BTagTrackIpAccessor.cxx:11
Generated on
for ATLAS Offline Software by
1.17.0