EnergyKickFeatureTool class.
More...
#include <EnergyKickFeatureTool.h>
|
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
|
float | GetEnergyKickForView (const pandora::CartesianVector &vertexPosition2D, const VertexSelectionBaseAlgorithm::SlidingFitDataList &slidingFitDataList) const |
| Get the energy kick feature for a given view. More...
|
|
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. More...
|
|
lar_content::EnergyKickFeatureTool::EnergyKickFeatureTool |
( |
| ) |
|
Default constructor.
Definition at line 20 of file EnergyKickFeatureTool.cc.
float m_xOffset
The x offset parameter in the energy score.
float m_rOffset
The r offset parameter in the energy score.
Get the energy kick feature for a given view.
- Parameters
-
vertexPosition2D | the projection of the vertex position in this view |
slidingFitDataList | the list of sliding fit data objects in this view |
- Returns
- the energy kick feature
Definition at line 50 of file EnergyKickFeatureTool.cc.
53 unsigned int totHits(0);
55 float totEnergy(0.
f), totEnergyKick(0.
f), totHitKick(0.
f);
57 for (
const VertexSelectionBaseAlgorithm::SlidingFitData &slidingFitData : slidingFitDataList)
59 const Cluster *
const pCluster(slidingFitData.GetCluster());
61 if (pCluster->GetElectromagneticEnergy() < std::numeric_limits<float>::epsilon())
64 const CartesianVector vertexToMinLayer(slidingFitData.GetMinLayerPosition() - vertexPosition2D);
65 const CartesianVector vertexToMaxLayer(slidingFitData.GetMaxLayerPosition() - vertexPosition2D);
67 const bool minLayerClosest(vertexToMinLayer.GetMagnitudeSquared() < vertexToMaxLayer.GetMagnitudeSquared());
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);
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.
void lar_content::EnergyKickFeatureTool::IncrementEnergyKickParameters |
( |
const pandora::Cluster *const |
pCluster, |
|
|
const pandora::CartesianVector & |
clusterDisplacement, |
|
|
const pandora::CartesianVector & |
clusterDirection, |
|
|
float & |
totEnergyKick, |
|
|
float & |
totEnergy, |
|
|
float & |
totHitKick, |
|
|
unsigned int & |
totHits |
|
) |
| const |
|
private |
Increment the energy kick parameters for a given cluster.
- Parameters
-
pCluster | address of the cluster |
clusterDisplacement | the cluster displacement |
clusterDirection | the cluster direction |
totEnergyKick | the total energy kick |
totEnergy | the total energy |
totHitKick | the total hit kick |
totHits | the total number of hits |
Definition at line 86 of file EnergyKickFeatureTool.cc.
89 const float impactParameter(clusterDisplacement.GetCrossProduct(clusterDirection).GetMagnitude());
90 const float displacement(clusterDisplacement.GetMagnitude());
92 totEnergyKick += pCluster->GetElectromagneticEnergy() * (impactParameter +
m_xOffset) / (displacement +
m_rOffset);
93 totEnergy += pCluster->GetElectromagneticEnergy();
95 totHitKick +=
static_cast<float>(pCluster->GetNCaloHits()) * (impactParameter +
m_xOffset) / (displacement +
m_rOffset);
96 totHits += pCluster->GetNCaloHits();
float m_xOffset
The x offset parameter in the energy score.
float m_rOffset
The r offset parameter in the energy score.
StatusCode lar_content::EnergyKickFeatureTool::ReadSettings |
( |
const pandora::TiXmlHandle |
xmlHandle | ) |
|
|
private |
Definition at line 101 of file EnergyKickFeatureTool.cc.
103 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"ROffset",
m_rOffset));
105 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"XOffset",
m_xOffset));
107 return STATUS_CODE_SUCCESS;
float m_xOffset
The x offset parameter in the energy score.
float m_rOffset
The r offset parameter in the energy score.
Run the tool.
- Parameters
-
pAlgorithm | address of the calling algorithm |
pVertex | address of the vertex |
slidingFitDataListMap | map of the sliding fit data lists |
- Returns
- the energy kick feature
Definition at line 26 of file EnergyKickFeatureTool.cc.
31 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
32 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() <<
std::endl;
34 float energyKick(0.
f);
45 featureVector.push_back(energyKick);
static pandora::CartesianVector ProjectPosition(const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
Project 3D position into a given 2D view.
float GetEnergyKickForView(const pandora::CartesianVector &vertexPosition2D, const VertexSelectionBaseAlgorithm::SlidingFitDataList &slidingFitDataList) const
Get the energy kick feature for a given view.
QTextStream & endl(QTextStream &s)
float lar_content::EnergyKickFeatureTool::m_rOffset |
|
private |
float lar_content::EnergyKickFeatureTool::m_xOffset |
|
private |
The documentation for this class was generated from the following files: