ATLAS Offline Software
Loading...
Searching...
No Matches
PdgConditional.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef DerivationFramework_PdgConditional_H
5#define DerivationFramework_PdgConditional_H
6
7#include <variant>
8#include <functional>
9
10
15namespace DerivationFramework {
17public:
18 //Default c'tor just for testing, *may change*
20 //Constructor taking integer pdg code for comparison with a value in operator ==
21 PdgConditional(int pdgIntCode);
22 //Constructor taking unsigned int for comparison with abs(value) in operator ==
23 PdgConditional(unsigned equalInt);
24 //Constructor taking a fully custom binary predicate for use in operator ==
25 PdgConditional(std::function<bool(int)> b);
26 //Uses either v, abs(v) or f(v) for comparison with a held value
27 bool operator==(int v) const;
28 private:
29 //variant member determines behaviour: raw compare, abs compare or use the provided function
30 const std::variant<int, unsigned, std::function<bool(int)>> m_condition;
31 };
32
33}
34#endif
const std::variant< int, unsigned, std::function< bool(int)> > m_condition
THE reconstruction tool.