ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfHLTData
Root
HLTSequence.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigConfHLTData/HLTSequence.h
"
6
#include "
TrigConfL1Data/DiffStruct.h
"
7
#include "
TrigConfHLTData/HLTTriggerElement.h
"
8
9
#include <iostream>
10
#include <sstream>
11
#include <fstream>
12
13
using namespace
std
;
14
using namespace
TrigConf
;
15
16
TrigConf::HLTSequence::HLTSequence
() :
17
m_outputTE
( 0 ),
18
m_topoStartTE
( 0 ),
19
m_level
( 0 )
20
{}
21
22
TrigConf::HLTSequence::HLTSequence
(
const
vector<HLTTriggerElement*>&
inputTEs
,
23
HLTTriggerElement
*
outputTE
,
24
const
vector<string>&
algorithms
) :
25
m_inputTEs
(
inputTEs
),
26
m_outputTE
(
outputTE
),
27
m_algorithms
(
algorithms
)
28
{
29
setName
(
outputTE
->name());
30
}
31
32
TrigConf::HLTSequence::~HLTSequence
( )
33
{
34
for
(
HLTTriggerElement
* te :
m_inputTEs
)
35
delete
te;
36
delete
m_outputTE
;
37
delete
m_topoStartTE
;
38
}
39
40
void
41
TrigConf::HLTSequence::set_outputTE
(
HLTTriggerElement
*
outputTE
) {
42
m_outputTE
=
outputTE
;
43
setName
(
outputTE
->name());
44
}
45
46
unsigned
int
47
TrigConf::HLTSequence::hashId
()
const
{
48
return
m_outputTE
->hashId();
49
}
50
51
52
void
TrigConf::HLTSequence::writeXML
(std::ofstream &
xmlfile
) {
53
54
xmlfile
<<
" <SEQUENCE"
;
55
56
xmlfile
<<
" output=\""
<<
m_outputTE
->name() <<
"\""
;
57
58
xmlfile
<<
" input=\""
;
59
bool
first =
true
;
60
for
(
HLTTriggerElement
* te:
m_inputTEs
) {
61
if
(first) {first=
false
;}
else
{
xmlfile
<<
" "
;}
62
xmlfile
<< te->name();
63
}
64
xmlfile
<<
"\""
;
65
66
xmlfile
<<
" algorithm=\""
;
67
first =
true
;
68
for
(
const
string
& alg:
m_algorithms
) {
69
if
(first) {first=
false
;}
else
{
xmlfile
<<
" "
;}
70
xmlfile
<< alg;
71
}
72
xmlfile
<<
"\""
;
73
74
if
(
m_topoStartTE
) {
75
xmlfile
<<
" topo_start_from=\""
<<
m_topoStartTE
->name() <<
"\""
;
76
}
77
78
xmlfile
<<
"/> "
<< endl;
79
return
;
80
}
81
82
std::string
83
TrigConf::HLTSequence::concise
()
const
{
84
std::stringstream
str
;
85
str
<<
"("
;
86
for
(
TrigConf::HLTTriggerElement
* inputTE :
m_inputTEs
) {
87
str
<< inputTE->name() <<
","
;
88
}
89
str
<<
outputTE
()->name() <<
")"
;
90
return
str
.str();
91
}
92
93
TrigConf::DiffStruct
*
94
TrigConf::HLTSequence::compareTo
(
const
HLTSequence
* o)
const
{
95
DiffStruct
* ds =
new
DiffStruct
(
"SEQUENCE"
,
name
());
96
ds->check(
"number_algs"
, (
unsigned
int
)
algorithms
().
size
(), (
unsigned
int
)o->
algorithms
().size() );
97
ds->check(
"number_inputs"
, (
unsigned
int
)
inputTEs
().
size
(), (
unsigned
int
)o->
inputTEs
().size() );
98
if
(
algorithms
().
size
()==o->
algorithms
().size()) {
99
for
(
size_t
i=0; i<
algorithms
().size(); ++i)
100
ds->check(
"alg_"
+ std::to_string(i),
algorithms
()[i], o->
algorithms
()[i] );
101
}
102
if
(ds->empty()) {
103
delete
ds; ds=0;
104
}
105
return
ds;
106
}
107
108
109
void
110
TrigConf::HLTSequence::print
(
const
std::string&
indent
,
unsigned
int
detail
)
const
{
111
if
(
detail
>=4) {
112
cout <<
indent
<<
"HLTSequence "
;
printNameIdV
();
113
}
114
if
(
detail
>=5) {
115
cout <<
indent
<<
" inputTEs : "
;
116
bool
first =
true
;
117
for
(
HLTTriggerElement
* te:
m_inputTEs
) {
118
if
(first) {first=
false
;}
else
{cout <<
", "
;}
119
cout << *te;
120
}
121
cout << endl;
122
if
(
m_topoStartTE
) {
123
cout <<
indent
<<
" topoStartTE "
<< *
m_topoStartTE
<< endl;
124
}
125
cout <<
indent
<<
" algorithms: "
;
126
first =
true
;
127
uint
width
= 0;
128
for
(
const
string
& alg:
m_algorithms
) {
129
width
+= alg.size();
130
if
(first) {first=
false
;}
else
{cout <<
", "
;
width
+=2; }
131
if
(
width
>=140) {
132
cout << endl <<
indent
<<
" "
;
133
width
=0;
134
}
135
cout << alg;
136
}
137
cout << endl;
138
cout <<
indent
<<
" outputTE : "
<<
outputTE
()->name() << endl;
139
}
140
}
141
142
std::ostream &
143
TrigConf::operator<<
(std::ostream & o,
const
TrigConf::HLTSequence
& s) {
144
o <<
"- -- HLTSequence printout ---------------------------------- "
<< std::endl;
145
o <<
"- -- inputTEs : "
;
146
bool
first =
true
;
147
for
(
TrigConf::HLTTriggerElement
* inputTE : s.m_inputTEs) {
148
if
(first)
149
first =
false
;
150
else
151
o <<
", "
;
152
o << *inputTE;
153
}
154
155
if
(s.m_topoStartTE) {
156
o <<
"\n"
;
157
o <<
"- -- topoStartTE "
;
158
o << *s.m_topoStartTE;
159
}
160
o <<
"\n- -- algorithms"
;
161
first =
true
;
162
for
(
const
std::string&
algorithm
: s.m_algorithms) {
163
if
(first)
164
first =
false
;
165
else
166
o <<
", "
;
167
o <<
algorithm
;
168
}
169
o <<
"\n- -- outputTE : "
; o << *s.outputTE();
170
o <<
"\n- ---------------------------------------------------------- "
<< std::endl;
171
return
o;
172
}
173
174
175
string
HLTSequence::__str__
()
const
{
176
stringstream s;
177
s << *
this
;
178
return
s.str();
179
}
DiffStruct.h
HLTSequence.h
HLTTriggerElement.h
uint
unsigned int uint
Definition
LArOFPhaseFill.cxx:19
size
size_t size() const
Number of registered mappings.
width
const double width
Definition
TTileTripReader.cxx:24
TrigConf::DiffStruct
Definition
DiffStruct.h:14
TrigConf::HLTSequence
HLT sequence configuration information.
Definition
HLTSequence.h:28
TrigConf::HLTSequence::m_inputTEs
std::vector< HLTTriggerElement * > m_inputTEs
list of input trigger elements
Definition
HLTSequence.h:91
TrigConf::HLTSequence::set_outputTE
void set_outputTE(HLTTriggerElement *outputTE)
Definition
HLTSequence.cxx:41
TrigConf::HLTSequence::hashId
unsigned int hashId() const
Definition
HLTSequence.cxx:47
TrigConf::HLTSequence::HLTSequence
HLTSequence()
default constructor
Definition
HLTSequence.cxx:16
TrigConf::HLTSequence::compareTo
DiffStruct * compareTo(const HLTSequence *o) const
Definition
HLTSequence.cxx:94
TrigConf::HLTSequence::m_algorithms
std::vector< std::string > m_algorithms
list of algorithms
Definition
HLTSequence.h:93
TrigConf::HLTSequence::concise
std::string concise() const
Definition
HLTSequence.cxx:83
TrigConf::HLTSequence::inputTEs
std::vector< HLTTriggerElement * > & inputTEs()
accessor to the list of input trigger elements
Definition
HLTSequence.h:48
TrigConf::HLTSequence::m_outputTE
HLTTriggerElement * m_outputTE
list of output trigger elements (just 1)
Definition
HLTSequence.h:92
TrigConf::HLTSequence::~HLTSequence
~HLTSequence()
destructor
Definition
HLTSequence.cxx:32
TrigConf::HLTSequence::__str__
std::string __str__() const
Definition
HLTSequence.cxx:175
TrigConf::HLTSequence::m_topoStartTE
HLTTriggerElement * m_topoStartTE
only for topolical algorithms: specify output TE from previous topological Algo, for combinations
Definition
HLTSequence.h:94
TrigConf::HLTSequence::algorithms
std::vector< std::string > & algorithms()
accessor to the list of algorithms
Definition
HLTSequence.h:50
TrigConf::HLTSequence::m_level
unsigned int m_level
level where sequence is running for a given configuration (to be determined in light of the menu,...
Definition
HLTSequence.h:97
TrigConf::HLTSequence::print
void print(const std::string &indent="", unsigned int detail=1) const
print method
Definition
HLTSequence.cxx:110
TrigConf::HLTSequence::outputTE
HLTTriggerElement * outputTE()
accessor to the list of output trigger elements (just 1)
Definition
HLTSequence.h:49
TrigConf::HLTSequence::writeXML
void writeXML(std::ofstream &xmlfile)
Definition
HLTSequence.cxx:52
TrigConf::HLTTriggerElement
HLT trigger element configuration information.
Definition
HLTTriggerElement.h:26
TrigConf::TrigConfData::indent
std::ostream & indent(std::ostream &o, int lvl, int size) const
Definition
TrigConfData.cxx:23
TrigConf::TrigConfData::setName
void setName(const std::string &name)
Definition
TrigConfData.h:30
TrigConf::TrigConfData::name
const std::string & name() const
Definition
TrigConfData.h:22
TrigConf::TrigConfData::printNameIdV
void printNameIdV(const std::string &indent="") const
Definition
TrigConfData.cxx:31
algorithm
std::string algorithm
Definition
hcg.cxx:87
xmlfile
static std::vector< std::string > xmlfile
Definition
iLumiCalc.h:29
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition
Config.h:22
TrigConf::operator<<
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)
Definition
L1ThresholdBase.cxx:339
detail
Definition
extract_histogram_tag.cxx:14
std
STL namespace.
str
Definition
BTagTrackIpAccessor.cxx:11
Generated on
for ATLAS Offline Software by
1.17.0