![]() |
LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
SvmVertexSelectionAlgorithm class. More...
#include "SvmVertexSelectionAlgorithm.h"
Classes | |
| class | EventFeatureInfo |
| Event feature info class. More... | |
| class | VertexFeatureInfo |
| Vertex feature info class. More... | |
Public Types | |
| typedef std::map< const pandora::Vertex *const, VertexFeatureInfo > | VertexFeatureInfoMap |
| typedef std::vector< VertexScore > | VertexScoreList |
| typedef std::vector< SlidingFitData > | SlidingFitDataList |
| typedef std::vector< ShowerCluster > | ShowerClusterList |
| typedef std::map< pandora::HitType, const pandora::ClusterList & > | ClusterListMap |
| Map array of cluster lists for passing to tools. More... | |
| typedef std::map< pandora::HitType, const SlidingFitDataList > | SlidingFitDataListMap |
| Map of sliding fit data lists for passing to tools. More... | |
| typedef std::map< pandora::HitType, const ShowerClusterList > | ShowerClusterListMap |
| Map of shower cluster lists for passing to tools. More... | |
| typedef std::map< pandora::HitType, const std::reference_wrapper< HitKDTree2D > > | KDTreeMap |
| Map array of hit kd trees for passing to tools. More... | |
| typedef MvaFeatureTool< const VertexSelectionBaseAlgorithm *const, const pandora::Vertex *const, const SlidingFitDataListMap &, const ClusterListMap &, const KDTreeMap &, const ShowerClusterListMap &, const float, float & > | VertexFeatureTool |
| The base type for the vertex feature tools. More... | |
Public Member Functions | |
| SvmVertexSelectionAlgorithm () | |
| Default constructor. More... | |
Protected Member Functions | |
| pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
| virtual void | FilterVertexList (const pandora::VertexList *const pInputVertexList, HitKDTree2D &kdTreeU, HitKDTree2D &kdTreeV, HitKDTree2D &kdTreeW, pandora::VertexVector &filteredVertices) const |
| Filter the input list of vertices to obtain a reduced number of vertex candidates. More... | |
| virtual void | GetBeamConstants (const pandora::VertexVector &vertexVector, BeamConstants &beamConstants) const |
| Get the beam score constants for a provided list of candidate vertices. More... | |
| void | GetClusterLists (const pandora::StringVector &inputClusterListNames, pandora::ClusterList &clusterListU, pandora::ClusterList &clusterListV, pandora::ClusterList &clusterListW) const |
| Get the cluster lists. More... | |
| void | CalculateClusterSlidingFits (const pandora::ClusterList &inputClusterList, const unsigned int minClusterCaloHits, const unsigned int slidingFitWindow, SlidingFitDataList &slidingFitDataList) const |
| Calculate the cluster sliding fits. More... | |
| float | GetBeamDeweightingScore (const BeamConstants &beamConstants, const pandora::Vertex *const pVertex) const |
| Get the beam deweighting score for a vertex. More... | |
| bool | IsBeamModeOn () const |
| Whether algorithm is running in beam mode, assuming neutrinos travel in positive z-direction. More... | |
Private Types | |
| typedef std::pair< pandora::CartesianVector, pandora::CartesianVector > | ClusterEndPoints |
| typedef std::map< const pandora::Cluster *const, ClusterEndPoints > | ClusterEndPointsMap |
| typedef std::vector< LArMvaHelper::MvaFeatureVector > | FeatureListVector |
| typedef std::vector< pandora::VertexVector > | VectorOfVertexVectors |
| typedef KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > | HitKDTree2D |
| typedef KDTreeNodeInfoT< const pandora::CaloHit *, 2 > | HitKDNode2D |
| typedef std::vector< HitKDNode2D > | HitKDNode2DList |
| typedef std::unordered_map< const pandora::CaloHit *, const pandora::Cluster * > | HitToClusterMap |
Private Member Functions | |
| void | GetVertexScoreList (const pandora::VertexVector &vertexVector, const BeamConstants &beamConstants, HitKDTree2D &kdTreeU, HitKDTree2D &kdTreeV, HitKDTree2D &kdTreeW, VertexScoreList &vertexScoreList) const |
| Get the vertex score list. More... | |
| void | CalculateShowerClusterList (const pandora::ClusterList &inputClusterList, ShowerClusterList &showerClusterList) const |
| Calculate the shower cluster map for a cluster list. More... | |
| void | GetShowerLikeClusterEndPoints (const pandora::ClusterList &clusterList, pandora::ClusterList &showerLikeClusters, ClusterEndPointsMap &clusterEndPointsMap) const |
| Add the endpoints of any shower-like clusters to the map. More... | |
| void | PopulateKdTree (const pandora::ClusterList &clusterList, HitKDTree2D &kdTree, HitToClusterMap &hitToClusterMap) const |
| Populate kd tree with information about hits in a provided list of clusters. More... | |
| bool | AddClusterToShower (const ClusterEndPointsMap &clusterEndPointsMap, pandora::ClusterList &availableShowerLikeClusters, const pandora::Cluster *const pCluster, pandora::ClusterList &showerCluster) const |
| Try to add an available cluster to a given shower cluster, using shower clustering approximation. More... | |
| bool | AddClusterToShower (HitKDTree2D &kdTree, const HitToClusterMap &hitToClusterMap, pandora::ClusterList &availableShowerLikeClusters, const pandora::Cluster *const pCluster, pandora::ClusterList &showerCluster) const |
| Try to add an available cluster to a given shower cluster, using cluster hit positions cached in kd tree. More... | |
| EventFeatureInfo | CalculateEventFeatures (const pandora::ClusterList &clusterListU, const pandora::ClusterList &clusterListV, const pandora::ClusterList &clusterListW, const pandora::VertexVector &vertexVector) const |
| Calculate the event parameters. More... | |
| void | IncrementShoweryParameters (const pandora::ClusterList &clusterList, unsigned int &nShoweryHits, unsigned int &nHits, float &eventEnergy) const |
| Increment the showery hit parameters for a cluster list. More... | |
| bool | IsClusterShowerLike (const pandora::Cluster *const pCluster) const |
| Find whether a cluster is shower-like. More... | |
| void | GetEventShapeFeatures (const pandora::ClusterList &clusterList, float &eventVolume, float &longitudinality) const |
| Get the event shape features. More... | |
| void | UpdateSpanCoordinate (const float minPositionCoord, const float maxPositionCoord, pandora::InputFloat &minCoord, pandora::InputFloat &maxCoord) const |
| Update the min/max coordinate spans. More... | |
| float | GetCoordinateSpan (const pandora::InputFloat &minCoord, const pandora::InputFloat &maxCoord) const |
| Get the coordinate span. More... | |
| void | AddEventFeaturesToVector (const EventFeatureInfo &eventFeatureInfo, LArMvaHelper::MvaFeatureVector &featureVector) const |
| Add the event features to a vector in the correct order. More... | |
| void | PopulateVertexFeatureInfoMap (const BeamConstants &beamConstants, const ClusterListMap &clusterListMap, const SlidingFitDataListMap &slidingFitDataListMap, const ShowerClusterListMap &showerClusterListMap, const KDTreeMap &kdTreeMap, const pandora::Vertex *const pVertex, VertexFeatureInfoMap &vertexFeatureInfoMap) const |
| Populate the vertex feature info map for a given vertex. More... | |
| void | PopulateInitialScoreList (VertexFeatureInfoMap &vertexFeatureInfoMap, const pandora::Vertex *const pVertex, VertexScoreList &initialScoreList) const |
| Populate the initial vertex score list for a given vertex. More... | |
| void | GetBestRegionVertices (VertexScoreList &initialScoreList, pandora::VertexVector &bestRegionVertices) const |
| Get the list of top-N separated vertices. More... | |
| void | ProduceTrainingSets (const pandora::VertexVector &vertexVector, const pandora::VertexVector &bestRegionVertices, VertexFeatureInfoMap &vertexFeatureInfoMap, const LArMvaHelper::MvaFeatureVector &eventFeatureList, const KDTreeMap &kdTreeMap) const |
| Produce the region and vertex training sets. More... | |
| void | CalculateRPhiScores (pandora::VertexVector &vertexVector, VertexFeatureInfoMap &vertexFeatureInfoMap, const KDTreeMap &kdTreeMap) const |
| Calculate the r/phi scores for the vertices in a vector, possibly erasing those that fail the fast score test. More... | |
| std::string | GetInteractionType () const |
| Get the interaction type string. More... | |
| const pandora::Vertex * | ProduceTrainingExamples (const pandora::VertexVector &vertexVector, const VertexFeatureInfoMap &vertexFeatureInfoMap, std::bernoulli_distribution &coinFlip, std::mt19937 &generator, const std::string &interactionType, const std::string &trainingOutputFile, const LArMvaHelper::MvaFeatureVector &eventFeatureList, const float maxRadius, const bool useRPhi) const |
| Produce a set of training examples for a binary classifier. More... | |
| void | GetBestVertex (const pandora::VertexVector &vertexVector, const pandora::Vertex *&pBestVertex, float &bestVertexDr) const |
| Use the MC information to get the best vertex from a list. More... | |
| void | AddVertexFeaturesToVector (const VertexFeatureInfo &vertexFeatureInfo, LArMvaHelper::MvaFeatureVector &featureVector, const bool useRPhi) const |
| Add the vertex features to a vector in the correct order. More... | |
| const pandora::Vertex * | CompareVertices (const pandora::VertexVector &vertexVector, const VertexFeatureInfoMap &vertexFeatureInfoMap, const LArMvaHelper::MvaFeatureVector &eventFeatureList, const SupportVectorMachine &supportVectorMachine, const bool useRPhi) const |
| Used a binary classifier to compare a set of vertices and pick the best one. More... | |
| void | PopulateFinalVertexScoreList (const VertexFeatureInfoMap &vertexFeatureInfoMap, const pandora::Vertex *const pFavouriteVertex, const pandora::VertexVector &vertexVector, VertexScoreList &finalVertexScoreList) const |
| Populate the final vertex score list using the r/phi score to find the best vertex in the vicinity. More... | |
Private Attributes | |
| VertexFeatureTool::FeatureToolVector | m_featureToolVector |
| The feature tool vector. More... | |
| std::string | m_filePathEnvironmentVariable |
| The environment variable providing a list of paths to svm files. More... | |
| std::string | m_svmFileName |
| The Svm file name. More... | |
| std::string | m_regionSvmName |
| The name of the region Svm to find. More... | |
| std::string | m_vertexSvmName |
| The name of the vertex Svm to find. More... | |
| SupportVectorMachine | m_svMachineRegion |
| The region support vector machine. More... | |
| SupportVectorMachine | m_svMachineVertex |
| The vertex support vector machine. More... | |
| bool | m_trainingSetMode |
| Whether to train. More... | |
| bool | m_allowClassifyDuringTraining |
| Whether classification is allowed during training. More... | |
| float | m_mcVertexXCorrection |
| The correction to the x-coordinate of the MC vertex position. More... | |
| std::string | m_trainingOutputFileRegion |
| The training output file for the region Svm. More... | |
| std::string | m_trainingOutputFileVertex |
| The training output file for the vertex Svm. More... | |
| std::string | m_mcParticleListName |
| The MC particle list for creating training examples. More... | |
| std::string | m_caloHitListName |
| The 2D CaloHit list name. More... | |
| pandora::StringVector | m_inputClusterListNames |
| The list of cluster list names. More... | |
| unsigned int | m_minClusterCaloHits |
| The min number of hits parameter in the energy score. More... | |
| unsigned int | m_slidingFitWindow |
| The layer window for the sliding linear fits. More... | |
| float | m_minShowerSpineLength |
| The minimum length at which all are considered to be tracks. More... | |
| float | m_beamDeweightingConstant |
| The beam deweighting constant for the initial region score list. More... | |
| float | m_localAsymmetryConstant |
| The local asymmetry constant for the initial region score list. More... | |
| float | m_globalAsymmetryConstant |
| The global asymmetry constant for the initial region score list. More... | |
| float | m_showerAsymmetryConstant |
| The shower asymmetry constant for the initial region score list. More... | |
| float | m_energyKickConstant |
| The energy kick constant for the initial region score list. More... | |
| float | m_showerClusteringDistance |
| The shower clustering distance. More... | |
| unsigned int | m_minShowerClusterHits |
| The minimum number of shower cluster hits. More... | |
| bool | m_useShowerClusteringApproximation |
| Whether to use the shower clustering distance approximation. More... | |
| float | m_regionRadius |
| The radius for a vertex region. More... | |
| float | m_rPhiFineTuningRadius |
| The maximum distance the r/phi tune can move a vertex. More... | |
| float | m_maxTrueVertexRadius |
| The maximum distance at which a vertex candidate can be considered the 'true' vertex. More... | |
| bool | m_useRPhiFeatureForRegion |
| Whether to use the r/phi feature for the region vertex. More... | |
| bool | m_dropFailedRPhiFastScoreCandidates |
| Whether to drop candidates that fail the r/phi fast score test. More... | |
SvmVertexSelectionAlgorithm class.
Definition at line 33 of file SvmVertexSelectionAlgorithm.h.
|
private |
Definition at line 107 of file SvmVertexSelectionAlgorithm.h.
|
private |
Definition at line 108 of file SvmVertexSelectionAlgorithm.h.
|
inherited |
Map array of cluster lists for passing to tools.
Definition at line 224 of file VertexSelectionBaseAlgorithm.h.
|
private |
Definition at line 109 of file SvmVertexSelectionAlgorithm.h.
|
private |
Definition at line 144 of file SvmVertexSelectionAlgorithm.h.
|
private |
Definition at line 145 of file SvmVertexSelectionAlgorithm.h.
|
private |
Definition at line 143 of file SvmVertexSelectionAlgorithm.h.
|
private |
Definition at line 147 of file SvmVertexSelectionAlgorithm.h.
|
inherited |
Map array of hit kd trees for passing to tools.
Definition at line 227 of file VertexSelectionBaseAlgorithm.h.
|
inherited |
Definition at line 218 of file VertexSelectionBaseAlgorithm.h.
|
inherited |
Map of shower cluster lists for passing to tools.
Definition at line 226 of file VertexSelectionBaseAlgorithm.h.
|
inherited |
Definition at line 172 of file VertexSelectionBaseAlgorithm.h.
|
inherited |
Map of sliding fit data lists for passing to tools.
Definition at line 225 of file VertexSelectionBaseAlgorithm.h.
|
private |
Definition at line 110 of file SvmVertexSelectionAlgorithm.h.
| typedef std::map<const pandora::Vertex *const, VertexFeatureInfo> lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfoMap |
Definition at line 63 of file SvmVertexSelectionAlgorithm.h.
|
inherited |
The base type for the vertex feature tools.
Definition at line 230 of file VertexSelectionBaseAlgorithm.h.
|
inherited |
Definition at line 79 of file VertexSelectionBaseAlgorithm.h.
| lar_content::SvmVertexSelectionAlgorithm::SvmVertexSelectionAlgorithm | ( | ) |
Default constructor.
Definition at line 34 of file SvmVertexSelectionAlgorithm.cc.
|
private |
Try to add an available cluster to a given shower cluster, using shower clustering approximation.
| clusterEndPointsMap | the map of shower-like cluster endpoints |
| availableShowerLikeClusters | the list of shower-like clusters still available |
| pCluster | the cluster in the shower cluster from which to consider distances |
| showerCluster | the shower cluster |
Referenced by CalculateShowerClusterList(), and PopulateKdTree().
|
private |
Try to add an available cluster to a given shower cluster, using cluster hit positions cached in kd tree.
| kdTree | the kd tree, used purely for efficiency in events with large hit multiplicity |
| hitToClusterMap | the hit to cluster map, used to interpret kd tree findings |
| availableShowerLikeClusters | the list of shower-like clusters still available |
| pCluster | the cluster in the shower cluster from which to consider distances |
| showerCluster | the shower cluster |
|
private |
Add the event features to a vector in the correct order.
| eventFeatureInfo | the event feature info |
| featureVector | the vector of doubles to append |
Definition at line 432 of file SvmVertexSelectionAlgorithm.cc.
References lar_content::SvmVertexSelectionAlgorithm::EventFeatureInfo::m_eventEnergy, lar_content::SvmVertexSelectionAlgorithm::EventFeatureInfo::m_eventShoweryness, lar_content::SvmVertexSelectionAlgorithm::EventFeatureInfo::m_eventVolume, lar_content::SvmVertexSelectionAlgorithm::EventFeatureInfo::m_longitudinality, lar_content::SvmVertexSelectionAlgorithm::EventFeatureInfo::m_nCandidates, lar_content::SvmVertexSelectionAlgorithm::EventFeatureInfo::m_nClusters, and lar_content::SvmVertexSelectionAlgorithm::EventFeatureInfo::m_nHits.
Referenced by GetVertexScoreList().
|
private |
Add the vertex features to a vector in the correct order.
| vertexFeatureInfo | the vertex feature info |
| featureVector | the vector of floats to append |
| useRPhi | whether to include the r/phi feature |
Definition at line 687 of file SvmVertexSelectionAlgorithm.cc.
References lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_beamDeweighting, lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_energyKick, lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_globalAsymmetry, lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_localAsymmetry, lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_rPhiFeature, and lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_showerAsymmetry.
Referenced by CompareVertices(), and ProduceTrainingExamples().
|
protectedinherited |
Calculate the cluster sliding fits.
| inputClusterList | the input cluster list |
| minClusterCaloHits | the minimum number of cluster calo hits |
| slidingFitWindow | the sliding fit window |
| slidingFitDataList | the list of sliding fits to fill |
Definition at line 119 of file VertexSelectionBaseAlgorithm.cc.
References lar_content::LArGeometryHelper::GetWireZPitch(), min, and lar_content::LArClusterHelper::SortByNHits().
Referenced by lar_content::EnergyKickVertexSelectionAlgorithm::GetVertexScoreList(), and GetVertexScoreList().
|
private |
Calculate the event parameters.
| clusterListU | the U-view cluster list |
| clusterListV | the V-view cluster list |
| clusterListW | the W-view cluster list |
| vertexVector | the vector of vertex candidates |
Definition at line 323 of file SvmVertexSelectionAlgorithm.cc.
References f, GetEventShapeFeatures(), and IncrementShoweryParameters().
Referenced by GetVertexScoreList().
|
private |
Calculate the r/phi scores for the vertices in a vector, possibly erasing those that fail the fast score test.
| vertexVector | the vector of vertices |
| vertexFeatureInfoMap | the vertex feature info map |
| kdTreeMap | the kd tree map |
Definition at line 564 of file SvmVertexSelectionAlgorithm.cc.
References lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_beamDeweighting, m_dropFailedRPhiFastScoreCandidates, m_featureToolVector, lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_rPhiFeature, and max.
Referenced by GetVertexScoreList(), and ProduceTrainingSets().
|
private |
Calculate the shower cluster map for a cluster list.
| inputClusterList | the input cluster list |
| showerClusterList | the shower cluster list to populate |
Definition at line 148 of file SvmVertexSelectionAlgorithm.cc.
References AddClusterToShower(), GetShowerLikeClusterEndPoints(), lar_content::LArGeometryHelper::GetWireZPitch(), m_minClusterCaloHits, m_slidingFitWindow, m_useShowerClusteringApproximation, and PopulateKdTree().
Referenced by GetVertexScoreList().
|
private |
Used a binary classifier to compare a set of vertices and pick the best one.
| vertexVector | the vector of vertices |
| vertexFeatureInfoMap | the vertex feature info map |
| eventFeatureList | the event feature list |
| supportVectorMachine | the support vector machine classifier |
| useRPhi | whether to include the r/phi feature |
Definition at line 702 of file SvmVertexSelectionAlgorithm.cc.
References AddVertexFeaturesToVector(), and lar_content::LArMvaHelper::Classify().
Referenced by GetVertexScoreList().
|
protectedvirtualinherited |
Filter the input list of vertices to obtain a reduced number of vertex candidates.
| pInputVertexList | the address of the input vertex list |
| kdTreeU | the kd tree for u hits |
| kdTreeV | the kd tree for v hits |
| kdTreeW | the kd tree for w hits |
| filteredVertices | to receive the filtered vertex list |
Definition at line 40 of file VertexSelectionBaseAlgorithm.cc.
References lar_content::KDTreeLinkerAlgo< DATA, DIM >::empty(), lar_content::VertexSelectionBaseAlgorithm::IsVertexInGap(), lar_content::VertexSelectionBaseAlgorithm::IsVertexOnHit(), lar_content::VertexSelectionBaseAlgorithm::m_isEmptyViewAcceptable, lar_content::VertexSelectionBaseAlgorithm::m_minVertexAcceptableViews, and lar_content::VertexSelectionBaseAlgorithm::SortByVertexZPosition().
Referenced by lar_content::VertexSelectionBaseAlgorithm::Run().
|
protectedvirtualinherited |
Get the beam score constants for a provided list of candidate vertices.
| vertexVector | the vertex vector |
| beamConstants | to receive the beam constants |
Definition at line 65 of file VertexSelectionBaseAlgorithm.cc.
References f, lar_content::VertexSelectionBaseAlgorithm::m_beamMode, lar_content::VertexSelectionBaseAlgorithm::m_nDecayLengthsInZSpan, max, and lar_content::VertexSelectionBaseAlgorithm::BeamConstants::SetConstants().
Referenced by lar_content::VertexSelectionBaseAlgorithm::Run().
|
inlineprotectedinherited |
Get the beam deweighting score for a vertex.
| beamConstants | the beam constants |
| pVertex | address of the vertex |
Definition at line 394 of file VertexSelectionBaseAlgorithm.h.
References lar_content::VertexSelectionBaseAlgorithm::BeamConstants::GetDecayConstant(), lar_content::VertexSelectionBaseAlgorithm::BeamConstants::GetMinZCoordinate(), and max.
Referenced by lar_content::EnergyKickVertexSelectionAlgorithm::GetVertexScoreList(), and PopulateVertexFeatureInfoMap().
|
private |
Get the list of top-N separated vertices.
| initialScoreList | the initial score list |
| bestRegionVertices | the list of best region vertices populate |
Definition at line 491 of file SvmVertexSelectionAlgorithm.cc.
References m_regionRadius.
Referenced by GetVertexScoreList().
|
private |
Use the MC information to get the best vertex from a list.
| vertexVector | the vector of vertices |
| pBestVertex | address of the best vertex |
| bestVertexDr | dR of the best vertex |
Definition at line 654 of file SvmVertexSelectionAlgorithm.cc.
References lar_content::LArMCParticleHelper::GetTrueNeutrinos(), m_mcParticleListName, m_mcVertexXCorrection, and max.
Referenced by ProduceTrainingExamples().
|
protectedinherited |
Get the cluster lists.
| inputClusterListNames | the input cluster list names |
| clusterListU | the U-view cluster list to populate |
| clusterListV | the V-view cluster list to populate |
| clusterListW | the W-view cluster list to populate |
Definition at line 91 of file VertexSelectionBaseAlgorithm.cc.
References lar_content::LArClusterHelper::GetClusterHitType().
Referenced by lar_content::EnergyKickVertexSelectionAlgorithm::GetVertexScoreList(), and GetVertexScoreList().
|
inlineprivate |
Get the coordinate span.
| minCoord | the min coordinate |
| maxCoord | the max coordinate |
Definition at line 422 of file SvmVertexSelectionAlgorithm.cc.
Referenced by GetEventShapeFeatures().
|
private |
Get the event shape features.
| clusterList | the cluster list |
| eventVolume | the event volume |
| longitudinality | the event longitudinality |
Definition at line 370 of file SvmVertexSelectionAlgorithm.cc.
References f, lar_content::LArClusterHelper::GetClusterBoundingBox(), GetCoordinateSpan(), and UpdateSpanCoordinate().
Referenced by CalculateEventFeatures().
|
private |
Get the interaction type string.
Definition at line 586 of file SvmVertexSelectionAlgorithm.cc.
References lar_content::LArInteractionTypeHelper::GetInteractionType(), lar_content::LArMCParticleHelper::IsBeamNeutrinoFinalState(), m_caloHitListName, m_mcParticleListName, lar_content::LArMCParticleHelper::SelectReconstructableMCParticles(), lar_content::LArMCParticleHelper::SortByMomentum(), and lar_content::LArInteractionTypeHelper::ToString().
Referenced by ProduceTrainingSets().
|
private |
Add the endpoints of any shower-like clusters to the map.
| clusterList | the list of clusters |
| showerLikeClusters | the list of shower-like clusters to populate |
| clusterEndPointsMap | the map of shower-like cluster endpoints to populate |
Definition at line 202 of file SvmVertexSelectionAlgorithm.cc.
References IsClusterShowerLike(), m_minShowerClusterHits, and lar_content::LArClusterHelper::SortHitsByPosition().
Referenced by CalculateShowerClusterList().
|
privatevirtual |
Get the vertex score list.
| vertexVector | the vector of vertices |
| beamConstants | the beam constants |
| kdTreeU | the hit kd tree for the U view |
| kdTreeV | the hit kd tree for the V view |
| kdTreeW | the hit kd tree for the W view |
| vertexScoreList | the vertex score list to fill |
Implements lar_content::VertexSelectionBaseAlgorithm.
Definition at line 61 of file SvmVertexSelectionAlgorithm.cc.
References AddEventFeaturesToVector(), lar_content::VertexSelectionBaseAlgorithm::CalculateClusterSlidingFits(), CalculateEventFeatures(), CalculateRPhiScores(), CalculateShowerClusterList(), CompareVertices(), GetBestRegionVertices(), lar_content::VertexSelectionBaseAlgorithm::GetClusterLists(), m_allowClassifyDuringTraining, m_inputClusterListNames, m_minClusterCaloHits, m_regionRadius, m_slidingFitWindow, m_svMachineRegion, m_svMachineVertex, m_trainingSetMode, m_useRPhiFeatureForRegion, PopulateFinalVertexScoreList(), PopulateInitialScoreList(), PopulateVertexFeatureInfoMap(), and ProduceTrainingSets().
|
private |
Increment the showery hit parameters for a cluster list.
| clusterList | the cluster list |
| nShoweryHits | the number of showery hits |
| nHits | the number of hits |
| eventEnergy | the event energy |
Definition at line 348 of file SvmVertexSelectionAlgorithm.cc.
References IsClusterShowerLike().
Referenced by CalculateEventFeatures().
|
inlineprotectedinherited |
Whether algorithm is running in beam mode, assuming neutrinos travel in positive z-direction.
Definition at line 402 of file VertexSelectionBaseAlgorithm.h.
References lar_content::VertexSelectionBaseAlgorithm::m_beamMode.
Referenced by lar_content::EnergyKickVertexSelectionAlgorithm::GetVertexScoreList().
|
inlineprivate |
Find whether a cluster is shower-like.
| pCluster | the cluster |
Definition at line 363 of file SvmVertexSelectionAlgorithm.cc.
References lar_content::LArClusterHelper::GetLength(), and m_minShowerSpineLength.
Referenced by GetShowerLikeClusterEndPoints(), and IncrementShoweryParameters().
|
private |
Populate the final vertex score list using the r/phi score to find the best vertex in the vicinity.
| vertexFeatureInfoMap | the vertex feature info map |
| pFavouriteVertex | address of the favourite vertex |
| vertexVector | the vector of all vertex candidates |
| finalVertexScoreList | the final vertex score list to populate |
Definition at line 732 of file SvmVertexSelectionAlgorithm.cc.
References m_rPhiFineTuningRadius.
Referenced by GetVertexScoreList().
|
private |
Populate the initial vertex score list for a given vertex.
| vertexFeatureInfoMap | the vertex feature info map |
| pVertex | the vertex |
| initialScoreList | the score list to populate |
Definition at line 475 of file SvmVertexSelectionAlgorithm.cc.
References lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_beamDeweighting, m_beamDeweightingConstant, lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_energyKick, m_energyKickConstant, lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_globalAsymmetry, m_globalAsymmetryConstant, lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_localAsymmetry, m_localAsymmetryConstant, lar_content::SvmVertexSelectionAlgorithm::VertexFeatureInfo::m_showerAsymmetry, and m_showerAsymmetryConstant.
Referenced by GetVertexScoreList().
|
private |
Populate kd tree with information about hits in a provided list of clusters.
| clusterList | the list of clusters |
| kdTree | to receive the populated kd tree |
| hitToClusterMap | to receive the populated hit to cluster map |
Definition at line 229 of file SvmVertexSelectionAlgorithm.cc.
References AddClusterToShower(), lar_content::KDTreeLinkerAlgo< DATA, DIM >::build(), lar_content::build_2d_kd_search_region(), lar_content::fill_and_bound_2d_kd_tree(), m_showerClusteringDistance, min, and lar_content::KDTreeLinkerAlgo< DATA, DIM >::search().
Referenced by CalculateShowerClusterList().
|
private |
Populate the vertex feature info map for a given vertex.
| beamConstants | the beam constants |
| clusterListMap | the cluster list map |
| slidingFitDataListMap | the sliding fit data list map |
| showerClusterListMap | the shower cluster list map |
| kdTreeMap | the kd tree map |
| pVertex | the vertex |
| vertexFeatureInfoMap | the map to populate |
Definition at line 446 of file SvmVertexSelectionAlgorithm.cc.
References f, Get, lar_content::VertexSelectionBaseAlgorithm::GetBeamDeweightingScore(), m_featureToolVector, and max.
Referenced by GetVertexScoreList().
|
private |
Produce a set of training examples for a binary classifier.
| vertexVector | the vector of vertices to use |
| vertexFeatureInfoMap | the vertex feature info map |
| coinFlip | a distribution for producing coin flips |
| generator | the random number generator |
| interactionType | the interaction type string |
| trainingOutputFile | the training set output file |
| eventFeatureList | the event feature list |
| maxRadius | the maximum allowed radius for the 'best' vertex |
| useRPhi | whether to include the r/phi feature |
Definition at line 610 of file SvmVertexSelectionAlgorithm.cc.
References AddVertexFeaturesToVector(), GetBestVertex(), max, and lar_content::LArMvaHelper::ProduceTrainingExample().
Referenced by ProduceTrainingSets().
|
private |
Produce the region and vertex training sets.
| vertexVector | the vector of all vertices |
| bestRegionVertices | the best region vertices |
| vertexFeatureInfoMap | the vertex feature info map |
| eventFeatureList | the list of event features |
| kdTreeMap |
Definition at line 524 of file SvmVertexSelectionAlgorithm.cc.
References CalculateRPhiScores(), GetInteractionType(), m_maxTrueVertexRadius, m_regionRadius, m_trainingOutputFileRegion, m_trainingOutputFileVertex, m_useRPhiFeatureForRegion, and ProduceTrainingExamples().
Referenced by GetVertexScoreList().
|
protected |
Definition at line 753 of file SvmVertexSelectionAlgorithm.cc.
References lar_content::LArMvaHelper::AddFeatureToolToVector(), lar_content::LArFileHelper::FindFileInPath(), lar_content::SupportVectorMachine::Initialize(), m_allowClassifyDuringTraining, m_beamDeweightingConstant, m_caloHitListName, m_dropFailedRPhiFastScoreCandidates, m_energyKickConstant, m_featureToolVector, m_filePathEnvironmentVariable, m_globalAsymmetryConstant, m_inputClusterListNames, m_localAsymmetryConstant, m_maxTrueVertexRadius, m_mcParticleListName, m_mcVertexXCorrection, m_minClusterCaloHits, m_minShowerClusterHits, m_minShowerSpineLength, m_regionRadius, m_regionSvmName, m_rPhiFineTuningRadius, m_showerAsymmetryConstant, m_showerClusteringDistance, m_slidingFitWindow, m_svMachineRegion, m_svMachineVertex, m_svmFileName, m_trainingOutputFileRegion, m_trainingOutputFileVertex, m_trainingSetMode, m_useRPhiFeatureForRegion, m_useShowerClusteringApproximation, m_vertexSvmName, and lar_content::VertexSelectionBaseAlgorithm::ReadSettings().
|
inlineprivate |
Update the min/max coordinate spans.
| minPositionCoord | the min position coordinate |
| maxPositionCoord | the max position coordinate |
| minCoord | the current min coordinate |
| maxCoord | the current max coordinate |
Definition at line 410 of file SvmVertexSelectionAlgorithm.cc.
Referenced by GetEventShapeFeatures().
|
private |
Whether classification is allowed during training.
Definition at line 388 of file SvmVertexSelectionAlgorithm.h.
Referenced by GetVertexScoreList(), and ReadSettings().
|
private |
The beam deweighting constant for the initial region score list.
Definition at line 400 of file SvmVertexSelectionAlgorithm.h.
Referenced by PopulateInitialScoreList(), and ReadSettings().
|
private |
The 2D CaloHit list name.
Definition at line 393 of file SvmVertexSelectionAlgorithm.h.
Referenced by GetInteractionType(), and ReadSettings().
|
private |
Whether to drop candidates that fail the r/phi fast score test.
Definition at line 413 of file SvmVertexSelectionAlgorithm.h.
Referenced by CalculateRPhiScores(), and ReadSettings().
|
private |
The energy kick constant for the initial region score list.
Definition at line 404 of file SvmVertexSelectionAlgorithm.h.
Referenced by PopulateInitialScoreList(), and ReadSettings().
|
private |
The feature tool vector.
Definition at line 379 of file SvmVertexSelectionAlgorithm.h.
Referenced by CalculateRPhiScores(), PopulateVertexFeatureInfoMap(), and ReadSettings().
|
private |
The environment variable providing a list of paths to svm files.
Definition at line 380 of file SvmVertexSelectionAlgorithm.h.
Referenced by ReadSettings().
|
private |
The global asymmetry constant for the initial region score list.
Definition at line 402 of file SvmVertexSelectionAlgorithm.h.
Referenced by PopulateInitialScoreList(), and ReadSettings().
|
private |
The list of cluster list names.
Definition at line 395 of file SvmVertexSelectionAlgorithm.h.
Referenced by GetVertexScoreList(), and ReadSettings().
|
private |
The local asymmetry constant for the initial region score list.
Definition at line 401 of file SvmVertexSelectionAlgorithm.h.
Referenced by PopulateInitialScoreList(), and ReadSettings().
|
private |
The maximum distance at which a vertex candidate can be considered the 'true' vertex.
Definition at line 411 of file SvmVertexSelectionAlgorithm.h.
Referenced by ProduceTrainingSets(), and ReadSettings().
|
private |
The MC particle list for creating training examples.
Definition at line 392 of file SvmVertexSelectionAlgorithm.h.
Referenced by GetBestVertex(), GetInteractionType(), and ReadSettings().
|
private |
The correction to the x-coordinate of the MC vertex position.
Definition at line 389 of file SvmVertexSelectionAlgorithm.h.
Referenced by GetBestVertex(), and ReadSettings().
|
private |
The min number of hits parameter in the energy score.
Definition at line 396 of file SvmVertexSelectionAlgorithm.h.
Referenced by CalculateShowerClusterList(), GetVertexScoreList(), and ReadSettings().
|
private |
The minimum number of shower cluster hits.
Definition at line 407 of file SvmVertexSelectionAlgorithm.h.
Referenced by GetShowerLikeClusterEndPoints(), and ReadSettings().
|
private |
The minimum length at which all are considered to be tracks.
Definition at line 398 of file SvmVertexSelectionAlgorithm.h.
Referenced by IsClusterShowerLike(), and ReadSettings().
|
private |
The radius for a vertex region.
Definition at line 409 of file SvmVertexSelectionAlgorithm.h.
Referenced by GetBestRegionVertices(), GetVertexScoreList(), ProduceTrainingSets(), and ReadSettings().
|
private |
The name of the region Svm to find.
Definition at line 382 of file SvmVertexSelectionAlgorithm.h.
Referenced by ReadSettings().
|
private |
The maximum distance the r/phi tune can move a vertex.
Definition at line 410 of file SvmVertexSelectionAlgorithm.h.
Referenced by PopulateFinalVertexScoreList(), and ReadSettings().
|
private |
The shower asymmetry constant for the initial region score list.
Definition at line 403 of file SvmVertexSelectionAlgorithm.h.
Referenced by PopulateInitialScoreList(), and ReadSettings().
|
private |
The shower clustering distance.
Definition at line 406 of file SvmVertexSelectionAlgorithm.h.
Referenced by PopulateKdTree(), and ReadSettings().
|
private |
The layer window for the sliding linear fits.
Definition at line 397 of file SvmVertexSelectionAlgorithm.h.
Referenced by CalculateShowerClusterList(), GetVertexScoreList(), and ReadSettings().
|
private |
The region support vector machine.
Definition at line 384 of file SvmVertexSelectionAlgorithm.h.
Referenced by GetVertexScoreList(), and ReadSettings().
|
private |
The vertex support vector machine.
Definition at line 385 of file SvmVertexSelectionAlgorithm.h.
Referenced by GetVertexScoreList(), and ReadSettings().
|
private |
The Svm file name.
Definition at line 381 of file SvmVertexSelectionAlgorithm.h.
Referenced by ReadSettings().
|
private |
The training output file for the region Svm.
Definition at line 390 of file SvmVertexSelectionAlgorithm.h.
Referenced by ProduceTrainingSets(), and ReadSettings().
|
private |
The training output file for the vertex Svm.
Definition at line 391 of file SvmVertexSelectionAlgorithm.h.
Referenced by ProduceTrainingSets(), and ReadSettings().
|
private |
Whether to train.
Definition at line 387 of file SvmVertexSelectionAlgorithm.h.
Referenced by GetVertexScoreList(), and ReadSettings().
|
private |
Whether to use the r/phi feature for the region vertex.
Definition at line 412 of file SvmVertexSelectionAlgorithm.h.
Referenced by GetVertexScoreList(), ProduceTrainingSets(), and ReadSettings().
|
private |
Whether to use the shower clustering distance approximation.
Definition at line 408 of file SvmVertexSelectionAlgorithm.h.
Referenced by CalculateShowerClusterList(), and ReadSettings().
|
private |
The name of the vertex Svm to find.
Definition at line 383 of file SvmVertexSelectionAlgorithm.h.
Referenced by ReadSettings().