ATLAS Offline Software
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 
15 namespace DerivationFramework {
17 public:
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
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
DerivationFramework::PdgConditional::operator==
bool operator==(int v) const
Definition: PdgConditional.cxx:25
xAOD::unsigned
unsigned
Definition: RingSetConf_v1.cxx:662
DerivationFramework::PdgConditional
Definition: PdgConditional.h:16
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
python.PyAthena.v
v
Definition: PyAthena.py:154
DerivationFramework::PdgConditional::m_condition
const std::variant< int, unsigned, std::function< bool(int)> > m_condition
Definition: PdgConditional.h:30
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
DerivationFramework::PdgConditional::PdgConditional
PdgConditional()
Definition: PdgConditional.cxx:10