1#include "duneanaobj/StandardRecord/Navigate.h"
2#include "duneanaobj/StandardRecord/SREnums.h"
8 template <
typename TruthBranchType,
typename TrueParticleIDType>
9 const typename std::conditional<std::is_same_v<TruthBranchType, SRTruthBranch>, SRTrueParticle, SRTrueParticleProxy>::type *
10 FindParticle(
const TruthBranchType & truth,
const TrueParticleIDType &
id)
12 if (
id.type == TrueParticleID::kUnknown ||
id.ixn < 0 ||
id.part < 0)
15 if (
id.type == TrueParticleID::PartType::kPrimary)
16 return &truth.nu[
id.ixn].prim[
id.part];
17 else if (
id.type == TrueParticleID::PartType::kPrimaryBeforeFSI)
18 return &truth.nu[
id.ixn].prefsi[
id.part];
19 else if (
id.type == TrueParticleID::PartType::kSecondary)
20 return &truth.nu[
id.ixn].sec[
id.part];
22 throw std::domain_error(
"Unknown PartType: " + std::to_string(
id.type));
25 template <
typename TruthBranchType>
26 const typename std::conditional<std::is_same_v<TruthBranchType, SRTruthBranch>, SRTrueInteraction, SRTrueInteractionProxy>::type *
27 FindInteraction(
const TruthBranchType & truth,
long int id){
Common Analysis Files.
Definition Navigate.cxx:8