32 std::cout <<
"----> Running Algorithm Tool: " << this->
GetInstanceName() <<
", " << this->
GetType() << std::endl;
34 float energyKick(0.f);
45 featureVector.push_back(energyKick);
53 unsigned int totHits(0);
55 float totEnergy(0.f), totEnergyKick(0.f), totHitKick(0.f);
59 const Cluster *
const pCluster(slidingFitData.GetCluster());
64 const CartesianVector vertexToMinLayer(slidingFitData.GetMinLayerPosition() - vertexPosition2D);
65 const CartesianVector vertexToMaxLayer(slidingFitData.GetMaxLayerPosition() - vertexPosition2D);
68 const CartesianVector &clusterDisplacement((minLayerClosest) ? vertexToMinLayer : vertexToMaxLayer);
69 const CartesianVector &clusterDirection((minLayerClosest) ? slidingFitData.GetMinLayerDirection() : slidingFitData.GetMaxLayerDirection());
74 float energyKick(0.f);
75 if (useEnergy && totEnergy > std::numeric_limits<float>::epsilon())
76 energyKick = totEnergyKick / totEnergy;
78 else if (!useEnergy && totHits > 0)
79 energyKick = totHitKick /
static_cast<float>(totHits);
87 const CartesianVector &clusterDirection,
float &totEnergyKick,
float &totEnergy,
float &totHitKick,
unsigned int &totHits)
const
90 const float displacement(clusterDisplacement.
GetMagnitude());
107 return STATUS_CODE_SUCCESS;
Header file for the geometry helper 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.
float m_xOffset
The x offset parameter in the energy score.
float GetEnergyKickForView(const pandora::CartesianVector &vertexPosition2D, const VertexSelectionBaseAlgorithm::SlidingFitDataList &slidingFitDataList) const
Get the energy kick feature for a given view.
void Run(LArMvaHelper::MvaFeatureVector &featureVector, const VertexSelectionBaseAlgorithm *const pAlgorithm, const pandora::Vertex *const pVertex, const VertexSelectionBaseAlgorithm::SlidingFitDataListMap &slidingFitDataListMap, const VertexSelectionBaseAlgorithm::ClusterListMap &, const VertexSelectionBaseAlgorithm::KDTreeMap &, const VertexSelectionBaseAlgorithm::ShowerClusterListMap &, const float, float &)
Run the tool.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
void IncrementEnergyKickParameters(const pandora::Cluster *const pCluster, const pandora::CartesianVector &clusterDisplacement, const pandora::CartesianVector &clusterDirection, float &totEnergyKick, float &totEnergy, float &totHitKick, unsigned int &totHits) const
Increment the energy kick parameters for a given cluster.
EnergyKickFeatureTool()
Default constructor.
float m_rOffset
The r offset parameter in the energy score.
static pandora::CartesianVector ProjectPosition(const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
Project 3D position into a given 2D view.
MvaTypes::MvaFeatureVector MvaFeatureVector
VertexSelectionBaseAlgorithm class.
std::map< pandora::HitType, const SlidingFitDataList > SlidingFitDataListMap
Map of sliding fit data lists for passing to tools.
std::map< pandora::HitType, const pandora::ClusterList & > ClusterListMap
Map array of cluster lists for passing to tools.
std::map< pandora::HitType, const std::reference_wrapper< HitKDTree2D > > KDTreeMap
Map array of hit kd trees for passing to tools.
std::map< pandora::HitType, const ShowerClusterList > ShowerClusterListMap
Map of shower cluster lists for passing to tools.
std::vector< SlidingFitData > SlidingFitDataList
float GetMagnitudeSquared() const
Get the magnitude squared.
float GetMagnitude() const
Get the magnitude.
CartesianVector GetCrossProduct(const CartesianVector &rhs) const
Get the cross product of the cartesian vector with a second cartesian vector.
unsigned int GetNCaloHits() const
Get the number of calo hits in the cluster.
float GetElectromagneticEnergy() const
Get the sum of electromagnetic energy measures of all constituent calo hits, units GeV.
bool ShouldDisplayAlgorithmInfo() const
Whether to display algorithm information during processing.
const std::string & GetType() const
Get the type.
const Pandora & GetPandora() const
Get the associated pandora instance.
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.
StatusCode
The StatusCode enum.