|
| 1 | +#ifndef DUNEANAOBJ_NAVIGATE_H |
| 2 | +#define DUNEANAOBJ_NAVIGATE_H |
| 3 | + |
| 4 | +#include <type_traits> |
| 5 | + |
| 6 | +#include "duneanaobj/StandardRecord/SRTruthBranch.h" |
| 7 | + |
| 8 | +namespace caf |
| 9 | +{ |
| 10 | + // a bit horrible to forward-declare Proxy types... |
| 11 | + // (we would #include Proxy/FwdDeclare.h, but |
| 12 | + // gen_srproxy has not yet created it |
| 13 | + // by the time Navigate.h is first seen) |
| 14 | + template <class T> class Proxy; |
| 15 | + class SRTrueParticle; |
| 16 | + using SRTrueParticleProxy = caf::Proxy<caf::SRTrueParticle>; |
| 17 | + |
| 18 | + /// Convenience method to find a particle stored by its ID easily. |
| 19 | + /// Intended to be used with 'regular' StandardRecord objects as well as their SRProxy equivalents. |
| 20 | + /// (The horrible return type construction is so that the return type can be deduced automatically |
| 21 | + /// and thus avoids having to have the user specify a template parameter for it.) |
| 22 | + template <typename TruthBranchType, typename TrueParticleIDType> |
| 23 | + const typename std::conditional<std::is_same_v<TruthBranchType, SRTruthBranch>, |
| 24 | + SRTrueParticle, SRTrueParticleProxy>::type * |
| 25 | + FindParticle(const TruthBranchType & truth, const TrueParticleIDType &id); |
| 26 | + |
| 27 | + class SRTrueInteraction; |
| 28 | + using SRTrueInteractionProxy = caf::Proxy<caf::SRTrueInteraction>; |
| 29 | + template <typename TruthBranchType> |
| 30 | + const typename std::conditional<std::is_same_v<TruthBranchType, SRTruthBranch>, |
| 31 | + SRTrueInteraction, SRTrueInteractionProxy>::type * |
| 32 | + FindInteraction(const TruthBranchType & truth, long int id); |
| 33 | +} |
| 34 | +#endif //DUNEANAOBJ_NAVIGATE_H |
0 commit comments