8 #include "Pandora/AlgorithmHeaders.h" 22 EnergyKickVertexSelectionAlgorithm::EnergyKickVertexSelectionAlgorithm() :
23 m_minClusterCaloHits(12),
24 m_slidingFitWindow(100),
26 m_asymmetryConstant(3.
f)
35 ClusterList clustersU, clustersV, clustersW;
45 {TPC_VIEW_U, slidingFitDataListU}, {TPC_VIEW_V, slidingFitDataListV}, {TPC_VIEW_W, slidingFitDataListW}};
47 float bestFastScore(0.
f);
48 for (
const Vertex *
const pVertex : vertexVector)
52 const float energyKick(LArMvaHelper::CalculateFeaturesOfType<EnergyKickFeatureTool>(
m_featureToolVector,
this, pVertex,
57 const float energyAsymmetry(LArMvaHelper::CalculateFeaturesOfType<LocalAsymmetryFeatureTool>(
m_featureToolVector,
this, pVertex,
62 const float energyKickScore(-energyKick /
m_epsilon);
65 vertexScoreList.push_back(
VertexScore(pVertex, beamDeweightingScore + energyKickScore + energyAsymmetryScore));
74 AlgorithmToolVector algorithmToolVector;
75 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithmToolList(*
this, xmlHandle,
"FeatureTools", algorithmToolVector));
77 for (AlgorithmTool *
const pAlgorithmTool : algorithmToolVector)
80 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
"InputClusterListNames",
m_inputClusterListNames));
82 PANDORA_RETURN_RESULT_IF_AND_IF(
83 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MinClusterCaloHits",
m_minClusterCaloHits));
85 PANDORA_RETURN_RESULT_IF_AND_IF(
86 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"SlidingFitWindow",
m_slidingFitWindow));
88 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"Epsilon",
m_epsilon));
90 PANDORA_RETURN_RESULT_IF_AND_IF(
91 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"AsymmetryConstant",
m_asymmetryConstant));
95 std::cout <<
"EnergyKickVertexSelection: Invalid parameter(s), Epsilon " <<
m_epsilon <<
", AsymmetryConstant " 97 return STATUS_CODE_INVALID_PARAMETER;
pandora::StringVector m_inputClusterListNames
The list of cluster list names.
void GetClusterLists(const pandora::StringVector &inputClusterListNames, pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW) const
Get the cluster lists.
void CalculateClusterSlidingFits(const pandora::ClusterList &inputClusterList, const unsigned int minClusterCaloHits, const unsigned int slidingFitWindow, SlidingFitDataList &slidingFitDataList) const
Calculate the cluster sliding fits.
unsigned int m_minClusterCaloHits
The min number of hits parameter in the energy score.
bool IsBeamModeOn() const
Whether algorithm is running in beam mode, assuming neutrinos travel in positive z-direction.
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
std::vector< SlidingFitData > SlidingFitDataList
std::map< pandora::HitType, const ShowerClusterList > ShowerClusterListMap
Map of shower cluster lists for passing to tools.
Header file for the energy kick vertex selection algorithm class.
float m_epsilon
The epsilon parameter in the energy score.
VertexFeatureTool::FeatureToolVector m_featureToolVector
The feature tool map.
std::map< pandora::HitType, const pandora::ClusterList & > ClusterListMap
Map array of cluster lists for passing to tools.
static pandora::StatusCode AddFeatureToolToVector(pandora::AlgorithmTool *const pFeatureTool, MvaFeatureToolVector< Ts... > &featureToolVector)
Add a feature tool to a vector of feature tools.
float m_asymmetryConstant
The asymmetry constant parameter in the energy score.
std::vector< VertexScore > VertexScoreList
std::map< pandora::HitType, const SlidingFitDataList > SlidingFitDataListMap
Map of sliding fit data lists for passing to tools.
std::vector< art::Ptr< recob::Vertex > > VertexVector
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
std::map< pandora::HitType, const std::reference_wrapper< HitKDTree2D > > KDTreeMap
Map array of hit kd trees for passing to tools.
float GetBeamDeweightingScore(const BeamConstants &beamConstants, const pandora::Vertex *const pVertex) const
Get the beam deweighting score for a vertex.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
QTextStream & endl(QTextStream &s)
void GetVertexScoreList(const pandora::VertexVector &vertexVector, const BeamConstants &beamConstants, HitKDTree2D &kdTreeU, HitKDTree2D &kdTreeV, HitKDTree2D &kdTreeW, VertexScoreList &vertexScoreList) const
Get the vertex score list for a provided list of candidate vertices.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)