ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAnalysis
TrigDecisionTool
Root
TDTUtilities.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
#include "
TrigConfHLTData/HLTTriggerElement.h
"
6
7
#include "
TrigDecisionTool/TDTUtilities.h
"
8
#include "
TrigNavStructure/TriggerElement.h
"
9
10
#include <string>
11
#include <vector>
12
#include <algorithm>
13
14
#include "TTree.h"
15
#include "TROOT.h"
16
17
#include <iostream>
18
19
20
21
namespace
TDTUtilities_impl
{
22
23
// splitting a string at the ','
24
std::vector<std::string>
25
split
(
const
std::string& line) {
26
std::vector<std::string>
res
;
27
std::string::size_type old_pos = 0, pos = line.find(
','
,0);
28
while
( pos != std::string::npos ) {
29
res
.push_back(line.substr(old_pos,pos-old_pos));
30
old_pos = pos + 1;
31
pos = line.find(
','
, old_pos);
32
}
33
// last entry
34
if
(old_pos < line.size())
35
res
.push_back(line.substr(old_pos,line.size()-old_pos));
36
return
res
;
37
}
38
}
39
40
41
std::vector< std::string >
42
Trig::convertStringToVector
(std::string_view triggerNames) {
43
std::string temp(triggerNames);
44
std::string::size_type pos;
45
// new erase all spaces
46
while
((pos = temp.find_first_of(
' '
)) != std::string::npos)
47
temp.erase(pos,1);
48
return
TDTUtilities_impl::split
(temp);
49
}
50
51
52
std::vector< std::string >
53
Trig::keyWrap
(
const
std::vector< std::string >& triggerNames) {
54
std::vector< std::string > v;
55
v.assign(triggerNames.begin(),triggerNames.end());
56
std::sort
(v.begin(),v.end());
57
v.erase(
std::unique
(v.begin(),v.end()),v.end());
58
return
v;
59
}
60
61
62
std::string
Trig::getTEName
(
const
HLT::TriggerElement
& te)
63
{
64
std::string s;
65
//coverity[copy_constructor_call]
66
return
(
TrigConf::HLTTriggerElement::getLabel
(te.
getId
(), s) ? s :
""
);
67
}
HLTTriggerElement.h
res
std::pair< std::vector< unsigned int >, bool > res
Definition
JetGroupProductTest.cxx:11
TDTUtilities.h
TriggerElement.h
HLT::TriggerElement
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
Definition
TrigNavStructure/TrigNavStructure/TriggerElement.h:27
HLT::TriggerElement::getId
te_id_type getId() const
reset internals.
Definition
TrigNavStructure/TrigNavStructure/TriggerElement.h:43
TrigConf::HLTTriggerElement::getLabel
static bool getLabel(unsigned int id, std::string &label)
find name from ID in the map m_IdToLabel
Definition
HLTTriggerElement.cxx:63
TDTUtilities_impl
Definition
TDTUtilities.cxx:21
TDTUtilities_impl::split
std::vector< std::string > split(const std::string &line)
Definition
TDTUtilities.cxx:25
Trig::convertStringToVector
std::vector< std::string > convertStringToVector(std::string_view triggerNames)
makes a split of list of chains into the vector of chains
Definition
TDTUtilities.cxx:42
Trig::getTEName
std::string getTEName(const HLT::TriggerElement &te)
converts TEid to TE name (this may not always work, it depends on the availability of config)
Definition
TDTUtilities.cxx:62
Trig::keyWrap
std::vector< std::string > keyWrap(const std::vector< std::string > &triggerNames)
normalizes the list of triggers (patterns) by sorting and uniquing them
Definition
TDTUtilities.cxx:53
std::unique
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
Definition
DVL_algorithms.h:135
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition
DVL_algorithms.h:554
Generated on
for ATLAS Offline Software by
1.17.0