28 m_minNeutrinoVertexDistance(5.f),
29 m_trackBranchAdditionFraction(0.4f),
30 m_maxParentClusterDistance(3.5f)
39 std::cout <<
"----> Running Algorithm Tool: " << this->
GetInstanceName() <<
", " << this->
GetType() << std::endl;
41 bool associationsMade(
true);
43 while (associationsMade)
45 associationsMade =
false;
47 pAlgorithm->
SeparatePfos(pfoInfoMap, assignedPfos, unassignedPfos);
49 if (unassignedPfos.empty())
57 PfoInfo *
const pParentPfoInfo(pfoInfoMap.at(pParentPfo));
69 if (recentlyAssigned.count(pPfo))
72 PfoInfo *
const pPfoInfo(pfoInfoMap.at(pPfo));
81 const float dParentVertex(std::min((pointingCluster.
GetInnerVertex().
GetPosition() - parentVertexPosition).GetMagnitude(),
92 associationsMade =
true;
96 recentlyAssigned.insert(pPfoInfo->
GetThisPfo());
116 return STATUS_CODE_SUCCESS;
Header file for the cluster helper class.
Header file for the pfo helper class.
Header file for the lar pointing cluster class.
Header file for the lar three dimensional sliding fit result class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
static const pandora::PandoraSettings * GetSettings(const pandora::Algorithm &algorithm)
Get the pandora settings instance.
void Run(const NeutrinoHierarchyAlgorithm *const pAlgorithm, const pandora::Vertex *const pNeutrinoVertex, NeutrinoHierarchyAlgorithm::PfoInfoMap &pfoInfoMap)
Run the algorithm tool.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
float m_trackBranchAdditionFraction
Branch association: min fraction of length along parent track before association allowed.
BranchAssociatedPfosTool()
Default constructor.
float m_maxParentClusterDistance
Branch association: max distance from branch vertex to a hit in parent 3D cluster.
float m_minNeutrinoVertexDistance
Branch association: min distance from branch vertex to neutrino vertex.
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.
static bool IsTrack(const pandora::ParticleFlowObject *const pPfo)
Return track flag based on Pfo Particle ID.
const pandora::CartesianVector & GetPosition() const
Get the vertex position.
LArPointingCluster class.
const Vertex & GetInnerVertex() const
Get the inner vertex.
const Vertex & GetOuterVertex() const
Get the outer vertex.
const pandora::ParticleFlowObject * GetThisPfo() const
Get the address of the pfo.
bool IsInnerLayerAssociated() const
If associated, whether association to parent (vtx or pfo) is at sliding fit inner layer.
const pandora::Cluster * GetCluster3D() const
Get the address of the three dimensional cluster.
void AddDaughterPfo(const pandora::ParticleFlowObject *const pDaughterPfo)
Add a daughter pfo.
void SetParentPfo(const pandora::ParticleFlowObject *const pParentPfo)
Set the parent pfo.
void SetInnerLayerAssociation(const bool isInnerLayerAssociated)
Set the inner layer association flag.
const ThreeDSlidingFitResult * GetSlidingFitResult3D() const
Get the address of the three dimensional sliding fit result.
NeutrinoHierarchyAlgorithm class.
void SeparatePfos(const NeutrinoHierarchyAlgorithm::PfoInfoMap &pfoInfoMap, pandora::PfoVector &assignedPfos, pandora::PfoVector &unassignedPfos) const
Query the pfo info map and separate/extract pfos currently either acting as parents or associated wit...
std::unordered_map< const pandora::ParticleFlowObject *, PfoInfo * > PfoInfoMap
ThreeDSlidingFitResult class.
const pandora::CartesianVector & GetGlobalMaxLayerPosition() const
Get global position corresponding to the fit result in maximum fit layer.
const pandora::CartesianVector & GetGlobalMinLayerPosition() const
Get global position corresponding to the fit result in minimum fit layer.
bool ShouldDisplayAlgorithmInfo() const
Whether to display algorithm information during processing.
ParticleFlowObject class.
const std::string & GetType() const
Get the type.
const std::string & GetInstanceName() const
Get the instance name.
const CartesianVector & GetPosition() const
Get the vertex position.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
NeutrinoHierarchyAlgorithm::PfoInfo PfoInfo
NeutrinoHierarchyAlgorithm::PfoInfoMap PfoInfoMap
std::unordered_set< const ParticleFlowObject * > PfoSet
std::vector< const ParticleFlowObject * > PfoVector
StatusCode
The StatusCode enum.