ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SelectorHelpers.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file SelectorHelpers.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2018-2020 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#pragma once
10
11
#include <functional>
12
#include <limits>
13
14
#include "
ActsFatras/EventData/Particle.hpp
"
15
#include "
ActsFatras/Selectors/detail/combine_selectors.hpp
"
16
17
namespace
ActsFatras {
18
20
template
<
typename
cast_t>
21
struct
Min
{
22
double
valMin
= 0.;
23
24
template
<
typename
T>
25
bool
operator()
(
const
T
&thing)
const
{
26
return
(
valMin
<= cast_t()(thing));
27
}
28
};
29
31
template
<
typename
cast_t>
32
struct
Max
{
33
double
valMax
=
std::numeric_limits<double>::max
();
34
35
template
<
typename
T>
36
bool
operator()
(
const
T
&thing)
const
{
37
return
(cast_t()(thing) <
valMax
);
38
}
39
};
40
44
template
<
typename
cast_t>
45
struct
Range
{
46
double
valMin
= std::numeric_limits<double>::lowest();
47
double
valMax
=
std::numeric_limits<double>::max
();
48
49
template
<
typename
T>
50
bool
operator()
(
const
T
&thing)
const
{
51
const
auto
val = cast_t()(thing);
52
return
((
valMin
<= val) and (val <
valMax
));
53
}
54
};
55
57
template
<
typename
... selectors_t>
58
using
CombineAnd
=
59
detail::CombineSelectors<true, std::logical_and<bool>
, selectors_t...>;
60
62
template
<
typename
... selectors_t>
63
using
CombineOr
=
64
detail::CombineSelectors<false, std::logical_or<bool>
, selectors_t...>;
65
66
}
// namespace ActsFatras
acts
blob
master
Fatras
include
ActsFatras
Selectors
SelectorHelpers.hpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:25
using
1.8.2 with
ECCE GitHub integration