30 const PfoList *pPfoList(
nullptr);
37 std::cout <<
"CheatingCosmicRayIdentificationAlg: pfo list " <<
m_inputPfoListName <<
" unavailable." << std::endl;
39 return STATUS_CODE_SUCCESS;
42 PfoList outputPfoList, outputDaughterPfoList;
46 if (!pPfo->GetParentPfoList().empty())
52 float thisNeutrinoWeight(0.f), thisTotalWeight(0.f);
55 if ((thisTotalWeight < std::numeric_limits<float>::epsilon()) || ((thisNeutrinoWeight / thisTotalWeight) <
m_maxNeutrinoFraction))
56 outputPfoList.push_back(pPfo);
59 if (!outputPfoList.empty())
63 if (!outputDaughterPfoList.empty())
68 return STATUS_CODE_SUCCESS;
90 return STATUS_CODE_SUCCESS;
Header file for the cosmic ray identification cheater class.
Header file for the lar monte carlo particle helper helper class.
Header file for the pfo helper class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
static pandora::StatusCode SaveList(const pandora::Algorithm &algorithm, const T &t, const std::string &newListName)
Save a provided input object list under a new name.
static pandora::StatusCode GetList(const pandora::Algorithm &algorithm, const std::string &listName, const T *&pT)
Get a named list.
static const pandora::PandoraSettings * GetSettings(const pandora::Algorithm &algorithm)
Get the pandora settings instance.
std::string m_inputPfoListName
The input pfo list name.
pandora::StatusCode Run()
Run the algorithm.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
std::string m_inputDaughterPfoListName
The input daughter pfo list name (if not specified, will assume same as main input list)
std::string m_outputDaughterPfoListName
The output daughter pfo list name (if not specified, will assume same as main output list)
CheatingCosmicRayIdentificationAlg()
Default constructor.
std::string m_outputPfoListName
The output pfo list name.
float m_maxNeutrinoFraction
The maximum true neutrino fraction in a particle to be labelled as a cosmic ray.
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.
static bool IsNeutrino(const pandora::MCParticle *const pMCParticle)
Whether a mc particle is a neutrino or antineutrino.
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...
bool ShouldDisplayAlgorithmInfo() const
Whether to display algorithm information during processing.
ParticleFlowObject class.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
StatusCode
The StatusCode enum.
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList