ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
Global
GlobalSimulation
src
Utilities
ICutter.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 "
./ICutter.h
"
6
#include <sstream>
7
8
namespace
GlobalSim
{
9
10
class
lt
:
public
ICutter
{
11
public
:
12
lt
(
const
ulong& c):
m_cut
(c) {}
13
virtual
bool
cut
(
const
ulong& v)
const override
{
14
return
v <
m_cut
;
15
};
16
17
virtual
std::string
to_string
()
const override
{
18
std::stringstream
ss
;
19
ss
<<
"cut: "
<<
m_cut
<<
" op: < "
;
20
return
ss
.str();
21
}
22
23
private
:
24
ulong
m_cut
;
25
};
26
27
class
leq
:
public
ICutter
{
28
public
:
29
leq
(
const
ulong& c):
m_cut
(c) {}
30
virtual
bool
cut
(
const
ulong& v)
const override
{
31
return
v <=
m_cut
;
32
};
33
34
virtual
std::string
to_string
()
const override
{
35
std::stringstream
ss
;
36
ss
<<
"cut: "
<<
m_cut
<<
" op: <= "
;
37
return
ss
.str();
38
}
39
40
private
:
41
ulong
m_cut
;
42
};
43
44
class
gt
:
public
ICutter
{
45
public
:
46
gt
(
const
ulong& c):
m_cut
(c) {}
47
virtual
bool
cut
(
const
ulong& v)
const override
{
48
return
v >
m_cut
;
49
};
50
51
virtual
std::string
to_string
()
const override
{
52
std::stringstream
ss
;
53
ss
<<
"cut: "
<<
m_cut
<<
" op: > "
;
54
return
ss
.str();
55
}
56
57
private
:
58
ulong
m_cut
;
59
};
60
61
62
class
geq
:
public
ICutter
{
63
public
:
64
geq
(
const
ulong& c):
m_cut
(c) {}
65
virtual
bool
cut
(
const
ulong& v)
const override
{
66
return
v >=
m_cut
;
67
};
68
69
virtual
std::string
to_string
()
const override
{
70
std::stringstream
ss
;
71
ss
<<
"cut: "
<<
m_cut
<<
" op: >= "
;
72
return
ss
.str();
73
}
74
75
private
:
76
ulong
m_cut
;
77
};
78
79
std::unique_ptr<ICutter>
make_cutter
(
const
ulong& cut,
80
const
std::string& op) {
81
82
auto
cutter = std::unique_ptr<ICutter>(
nullptr
);
83
84
if
(op ==
">"
){
85
cutter.reset(
new
gt
(cut));
86
}
else
if
(op ==
">="
){
87
cutter.reset(
new
geq
(cut));
88
}
else
if
(op ==
"<"
){
89
cutter.reset(
new
lt
(cut));
90
}
else
if
(op ==
"<="
){
91
cutter.reset(
new
leq
(cut));
92
}
else
{
93
throw
std::invalid_argument(
"unown operator "
+ op);
94
}
95
96
return
cutter;
97
}
98
99
}
ICutter.h
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
GlobalSim::ICutter
Implementaton of ICutter, for converting text to cut logic in selectors.
Definition
ICutter.h:16
GlobalSim::geq
Definition
ICutter.cxx:62
GlobalSim::geq::cut
virtual bool cut(const ulong &v) const override
Definition
ICutter.cxx:65
GlobalSim::geq::to_string
virtual std::string to_string() const override
Definition
ICutter.cxx:69
GlobalSim::geq::geq
geq(const ulong &c)
Definition
ICutter.cxx:64
GlobalSim::geq::m_cut
ulong m_cut
Definition
ICutter.cxx:76
GlobalSim::gt
Definition
ICutter.cxx:44
GlobalSim::gt::to_string
virtual std::string to_string() const override
Definition
ICutter.cxx:51
GlobalSim::gt::gt
gt(const ulong &c)
Definition
ICutter.cxx:46
GlobalSim::gt::cut
virtual bool cut(const ulong &v) const override
Definition
ICutter.cxx:47
GlobalSim::gt::m_cut
ulong m_cut
Definition
ICutter.cxx:58
GlobalSim::leq
Definition
ICutter.cxx:27
GlobalSim::leq::m_cut
ulong m_cut
Definition
ICutter.cxx:41
GlobalSim::leq::cut
virtual bool cut(const ulong &v) const override
Definition
ICutter.cxx:30
GlobalSim::leq::to_string
virtual std::string to_string() const override
Definition
ICutter.cxx:34
GlobalSim::leq::leq
leq(const ulong &c)
Definition
ICutter.cxx:29
GlobalSim::lt
Definition
ICutter.cxx:10
GlobalSim::lt::m_cut
ulong m_cut
Definition
ICutter.cxx:24
GlobalSim::lt::lt
lt(const ulong &c)
Definition
ICutter.cxx:12
GlobalSim::lt::cut
virtual bool cut(const ulong &v) const override
Definition
ICutter.cxx:13
GlobalSim::lt::to_string
virtual std::string to_string() const override
Definition
ICutter.cxx:17
GlobalSim
AlgTool to read in LArStripNeighborhoods, and run the BDT Algorithm.
Definition
Trigger/TrigT1/Global/GlobalSimulation/src/Egamma1BDT/Egamma1BDT/BDT.h:11
GlobalSim::make_cutter
std::unique_ptr< ICutter > make_cutter(const ulong &cut, const std::string &op)
Definition
ICutter.cxx:79
Generated on
for ATLAS Offline Software by
1.17.0