9 #include "Pandora/AlgorithmHeaders.h" 22 CheatingCosmicRayTaggingTool::CheatingCosmicRayTaggingTool() :
23 m_maxCosmicRayFraction(0.25
f)
31 if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
32 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
34 PfoList ambiguousParentPfos;
36 for (
const Pfo *
const pParentCosmicRayPfo : parentCosmicRayPfos)
38 PfoList downstreamPfos;
41 float thisCosmicRayWeight(0.
f), thisTotalWeight(0.
f);
45 ambiguousParentPfos.push_back(pParentCosmicRayPfo);
55 PANDORA_RETURN_RESULT_IF_AND_IF(
56 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MaxCosmicRayFraction",
m_maxCosmicRayFraction));
58 return STATUS_CODE_SUCCESS;
Header file for the pfo helper class.
static bool IsCosmicRay(const pandora::MCParticle *const pMCParticle)
Return true if passed a primary cosmic ray MCParticle.
Header file for the lar monte carlo particle helper helper class.
void FindAmbiguousPfos(const pandora::PfoList &parentCosmicRayPfos, pandora::PfoList &ambiguousPfos, const MasterAlgorithm *const pAlgorithm)
Find the list of ambiguous pfos (could represent cosmic-ray muons or neutrinos)
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
static void GetTargetParticleWeight(const pandora::PfoList *const pPfoList, float &targetParticleWeight, float &totalWeight, std::function< bool(const pandora::MCParticle *const)> fCriteria)
Get the target particle weight in a list of pfos.
float m_maxCosmicRayFraction
The maximum cosmic ray fraction for a pfo to be declared an ambiguous cosmic ray. ...
static void GetAllDownstreamPfos(const pandora::PfoList &inputPfoList, pandora::PfoList &outputPfoList)
Get a flat list of all pfos, recursively, of all daughters associated with those pfos in an input lis...
static void GetAllConnectedPfos(const pandora::PfoList &inputPfoList, pandora::PfoList &outputPfoList)
Get a flat list of all pfos, recursively including all daughters and parents associated with those pf...