ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfHLTData
Root
HLTSequenceList.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigConfHLTData/HLTSequenceList.h
"
6
#include "
TrigConfHLTData/HLTSequence.h
"
7
#include "
TrigConfHLTData/HLTTriggerElement.h
"
8
#include "
TrigConfL1Data/DiffStruct.h
"
9
10
#include <iostream>
11
#include <stdexcept>
12
13
using namespace
std
;
14
15
TrigConf::HLTSequenceList::HLTSequenceList
(){}
16
17
TrigConf::HLTSequenceList::HLTSequenceList
( vector<HLTSequence*>& sequenceList ) {
18
copy( sequenceList.begin(), sequenceList.end(), std::inserter(*
this
, begin()));
19
}
20
21
TrigConf::HLTSequenceList::~HLTSequenceList
(
void
) {
22
clear
();
23
}
24
25
void
TrigConf::HLTSequenceList::clear
() {
26
for
(
HLTSequence
* seq : *
this
)
delete
seq;
27
HLTSequenceContainer::clear();
28
}
29
30
void
TrigConf::HLTSequenceList::addHLTSequence
(
HLTSequence
* sequence) {
31
if
(sequence==0)
return
;
32
pair<iterator, bool> ins = insert(sequence);
33
if
(!ins.second) {
34
throw
runtime_error(
"Can't insert sequence '"
+ sequence->
name
() +
"', because a uniqueness constraint is violated"
);
35
}
36
}
37
38
39
bool
TrigConf::HLTSequenceList::hasTE
(
const
std::string&
name
) {
40
return
getSequence
(
name
)!=0;
41
}
42
43
44
TrigConf::HLTSequence
*
45
TrigConf::HLTSequenceList::getSequence
(
unsigned
int
id
)
const
{
46
const
index<seq_hash_id>::type
& byid =
get<seq_hash_id>
();
47
index<seq_hash_id>::type::const_iterator
seq = byid.find(
id
);
48
if
(seq == byid.end())
return
0;
49
return
*seq;
50
}
51
52
TrigConf::HLTSequence
*
53
TrigConf::HLTSequenceList::getSequence
(
const
std::string&
name
)
const
{
54
const
index<seq_name_hash>::type
& byname =
get<seq_name_hash>
();
55
index<seq_name_hash>::type::const_iterator
seq = byname.find(
name
);
56
if
(seq == byname.end())
return
0;
57
return
*seq;
58
}
59
60
61
bool
62
TrigConf::HLTSequenceList::getLabel
(
unsigned
int
id
, std::string &
label
) {
63
const
index<seq_hash_id>::type
& byid =
get<seq_hash_id>
();
64
index<seq_hash_id>::type::const_iterator
seq = byid.find(
id
);
65
if
(seq != byid.end()) {
66
label
= (*seq)->name();
67
return
true
;
68
}
else
{
69
label
=
""
;
70
return
false
;
71
}
72
}
73
74
75
bool
76
TrigConf::HLTSequenceList::getHashIdFromLabel
(
const
char
*
label
,
unsigned
int
&
id
) {
77
const
index<seq_name_hash>::type
& byname =
get<seq_name_hash>
();
78
index<seq_name_hash>::type::const_iterator
seq = byname.find(
label
);
79
if
(seq != byname.end()) {
80
id
= (*seq)->hashId();
81
return
true
;
82
}
else
{
83
id
= 0;
84
return
false
;
85
}
86
}
87
88
TrigConf::DiffStruct
*
89
TrigConf::HLTSequenceList::compareTo
(
const
HLTSequenceList
* o)
const
{
90
DiffStruct
* ds =
new
DiffStruct
(
"SEQUENCE_LIST"
);
91
for
(
HLTSequence
* seq : *
this
) {
92
const
HLTSequence
*o_seq = o->
getSequence
(seq->
name
());
93
if
(o_seq) {
94
ds->addSub( seq->
compareTo
(o_seq) );
95
}
else
{
96
ds->addLeftOnlySub(
"SEQUENCE"
, seq->
name
() );
97
}
98
}
99
for
(
HLTSequence
* o_seq : *o) {
100
const
HLTSequence
*seq =
getSequence
(o_seq->name());
101
if
(!seq)
102
ds->addRightOnlySub(
"SEQUENCE"
, o_seq->name() );
103
}
104
if
(ds->empty()) {
105
delete
ds; ds=0;
106
}
107
return
ds;
108
}
109
110
111
void
112
TrigConf::HLTSequenceList::print
(
const
std::string& indent,
unsigned
int
detail
)
const
{
113
if
(
detail
>=1) {
114
cout << indent <<
"HLTSequenceList has "
<<
size
() <<
" sequences"
<< endl;
115
if
(
detail
>=4) {
116
cout << indent <<
"--------------------------------------------------------------------------------"
<< endl;
117
for
(
HLTSequence
* seq : *
this
)
118
seq->
print
(indent +
" "
,
detail
);
119
cout << indent <<
"================================================================================"
<< endl;
120
}
121
}
122
}
123
124
std::ostream &
125
TrigConf::operator<<
(std::ostream & o,
const
TrigConf::HLTSequenceList
& sl) {
126
o <<
"- -- HLTSequenceList printout ------------------------------ "
<< std::endl;
127
for
(
TrigConf::HLTSequence
* seq : sl) o << *seq;
128
o <<
"- ---------------------------------------------------------- "
<< std::endl;
129
return
o;
130
}
131
DiffStruct.h
HLTSequenceList.h
HLTSequence.h
HLTTriggerElement.h
size
size_t size() const
Number of registered mappings.
clear
void clear()
Empty the pool.
TrigConf::DiffStruct
Definition
DiffStruct.h:14
TrigConf::HLTSequenceList
list of HLT sequences
Definition
HLTSequenceList.h:40
TrigConf::HLTSequenceList::compareTo
DiffStruct * compareTo(const HLTSequenceList *o) const
Definition
HLTSequenceList.cxx:89
TrigConf::HLTSequenceList::hasTE
bool hasTE(const std::string &name)
Definition
HLTSequenceList.cxx:39
TrigConf::HLTSequenceList::getSequence
HLTSequence * getSequence(unsigned int id) const
counts the number of sequences in the menu
Definition
HLTSequenceList.cxx:45
TrigConf::HLTSequenceList::HLTSequenceList
HLTSequenceList()
default constructor
Definition
HLTSequenceList.cxx:15
TrigConf::HLTSequenceList::~HLTSequenceList
~HLTSequenceList()
destructor
Definition
HLTSequenceList.cxx:21
TrigConf::HLTSequenceList::addHLTSequence
void addHLTSequence(HLTSequence *sequence)
adds an HLTSequence to the menu
Definition
HLTSequenceList.cxx:30
TrigConf::HLTSequenceList::print
void print(const std::string &indent="", unsigned int detail=1) const
print the sequence list
Definition
HLTSequenceList.cxx:112
TrigConf::HLTSequenceList::clear
void clear()
Definition
HLTSequenceList.cxx:25
TrigConf::HLTSequenceList::getLabel
bool getLabel(unsigned int hashId, std::string &label)
find name from ID in the map m_IdToLabel
Definition
HLTSequenceList.cxx:62
TrigConf::HLTSequenceList::getHashIdFromLabel
bool getHashIdFromLabel(const char *label, unsigned int &hashId)
find ID from name in the map m_IdToLabel
Definition
HLTSequenceList.cxx:76
TrigConf::HLTSequence
HLT sequence configuration information.
Definition
HLTSequence.h:28
TrigConf::HLTSequence::compareTo
DiffStruct * compareTo(const HLTSequence *o) const
Definition
HLTSequence.cxx:94
TrigConf::HLTSequence::print
void print(const std::string &indent="", unsigned int detail=1) const
print method
Definition
HLTSequence.cxx:110
TrigConf::TrigConfData::name
const std::string & name() const
Definition
TrigConfData.h:22
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition
hcg.cxx:132
label
std::string label(const std::string &format, int i)
Definition
label.h:19
TrigConf::operator<<
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)
Definition
L1ThresholdBase.cxx:339
detail
Definition
extract_histogram_tag.cxx:14
index
Definition
index.py:1
std
STL namespace.
TrigConf::name
Definition
HLTChainList.h:35
Generated on
for ATLAS Offline Software by
1.17.0