LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::SvmPfoCharacterisationAlgorithm Class Reference

SvmPfoCharacterisationAlgorithm class. More...

#include "SvmPfoCharacterisationAlgorithm.h"

Inheritance diagram for lar_content::SvmPfoCharacterisationAlgorithm:
lar_content::PfoCharacterisationBaseAlgorithm

Public Member Functions

 SvmPfoCharacterisationAlgorithm ()
 Default constructor. More...
 

Protected Member Functions

virtual bool IsClearTrack (const pandora::ParticleFlowObject *const pPfo) const
 Whether pfo is identified as a clear track. More...
 
virtual bool IsClearTrack (const pandora::Cluster *const pCluster) const
 Whether cluster is identified as a clear track. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
pandora::StatusCode Run ()
 
virtual bool IsClearTrack3x2D (const pandora::ParticleFlowObject *const pPfo) const
 Whether pfo is identified as a clear track using its three clusters. More...
 

Protected Attributes

ClusterCharacterisationFeatureTool::FeatureToolVector m_featureToolVector
 The feature tool map. More...
 
PfoCharacterisationFeatureTool::FeatureToolVector m_featureToolVectorThreeD
 The feature tool map for 3D info. More...
 
PfoCharacterisationFeatureTool::FeatureToolVector m_featureToolVectorNoChargeInfo
 The feature tool map for missing W view. More...
 
SupportVectorMachine m_supportVectorMachine
 The support vector machine. More...
 
SupportVectorMachine m_supportVectorMachineNoChargeInfo
 The support vector machine for missing W view. More...
 
bool m_trainingSetMode
 Whether to train. More...
 
bool m_enableProbability
 Whether to use probabilities instead of binary classification. More...
 
bool m_useThreeDInformation
 Whether to use 3D information. More...
 
float m_minProbabilityCut
 The minimum probability to label a cluster as track-like. More...
 
unsigned int m_minCaloHitsCut
 The minimum number of calo hits to qualify as a track. More...
 
std::string m_trainingOutputFile
 The training output file. More...
 
std::string m_filePathEnvironmentVariable
 The environment variable providing a list of paths to svm files. More...
 
std::string m_svmFileName
 The svm input file. More...
 
std::string m_svmName
 The name of the svm to find. More...
 
std::string m_svmFileNameNoChargeInfo
 The svm input file for PFOs missing the W view, and thus charge info. More...
 
std::string m_svmNameNoChargeInfo
 The name of the svm to find for PFOs missing the W view, and thus charge info. More...
 
std::string m_trackPfoListName
 The track pfo list name. More...
 
std::string m_showerPfoListName
 The shower pfo list name. More...
 
pandora::StringVector m_inputPfoListNames
 The names of the input pfo lists. More...
 
bool m_updateClusterIds
 Whether to update daughter cluster particle id labels to match pfo id. More...
 
bool m_postBranchAddition
 Whether to use configuration for shower clusters post branch addition. More...
 
unsigned int m_minTrackLikeViews
 The minimum number of track-like views to declare a pfo as track-like. More...
 

Detailed Description

Constructor & Destructor Documentation

lar_content::SvmPfoCharacterisationAlgorithm::SvmPfoCharacterisationAlgorithm ( )

Default constructor.

Definition at line 22 of file SvmPfoCharacterisationAlgorithm.cc.

References lar_content::LArMvaHelper::CalculateFeatures(), lar_content::LArMvaHelper::CalculateProbability(), lar_content::LArMvaHelper::Classify(), IsClearTrack(), m_enableProbability, m_featureToolVector, m_minCaloHitsCut, m_minProbabilityCut, m_supportVectorMachine, m_trainingOutputFile, m_trainingSetMode, and lar_content::LArMvaHelper::ProduceTrainingExample().

22  :
23  m_trainingSetMode(false),
24  m_enableProbability(true),
28  m_filePathEnvironmentVariable("FW_SEARCH_PATH")
29 {
30 }
bool m_useThreeDInformation
Whether to use 3D information.
std::string m_filePathEnvironmentVariable
The environment variable providing a list of paths to svm files.
TFile f
Definition: plotHisto.C:6
unsigned int m_minCaloHitsCut
The minimum number of calo hits to qualify as a track.
bool m_enableProbability
Whether to use probabilities instead of binary classification.
float m_minProbabilityCut
The minimum probability to label a cluster as track-like.

Member Function Documentation

bool lar_content::SvmPfoCharacterisationAlgorithm::IsClearTrack ( const pandora::ParticleFlowObject *const  pPfo) const
protectedvirtual

Whether pfo is identified as a clear track.

Parameters
pPfoaddress of the relevant pfo
Returns
boolean

Implements lar_content::PfoCharacterisationBaseAlgorithm.

Definition at line 68 of file SvmPfoCharacterisationAlgorithm.cc.

References lar_content::LArMvaHelper::CalculateFeatures(), lar_content::LArMvaHelper::CalculateProbability(), lar_content::LArMvaHelper::Classify(), evd::details::end(), lar_content::LArPfoHelper::GetClusters(), lar_content::LArMCParticleHelper::GetMainMCParticle(), lar_content::LArPfoHelper::IsThreeD(), m_enableProbability, m_featureToolVectorNoChargeInfo, m_featureToolVectorThreeD, m_minProbabilityCut, m_supportVectorMachine, m_supportVectorMachineNoChargeInfo, m_trainingOutputFile, m_trainingSetMode, and lar_content::LArMvaHelper::ProduceTrainingExample().

Referenced by SvmPfoCharacterisationAlgorithm().

69 {
70 
71  if (!LArPfoHelper::IsThreeD(pPfo))
72  {
74  {
75  object_creation::ParticleFlowObject::Metadata metadata;
76  metadata.m_propertiesToAdd["TrackScore"] = -1.f;
77  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*this, pPfo, metadata));
78  }
79  return (pPfo->GetParticleId() == MU_MINUS);
80  }
81  //charge related features are only calculated using hits in W view
82  ClusterList wClusterList;
83  LArPfoHelper::GetClusters(pPfo, TPC_VIEW_W, wClusterList);
85 
87  {
88  bool isTrueTrack(false);
89  bool isMainMCParticleSet(false);
90 
91  try
92  {
93  const MCParticle *const pMCParticle(LArMCParticleHelper::GetMainMCParticle(pPfo));
94  isTrueTrack = ((PHOTON != pMCParticle->GetParticleId()) && (E_MINUS != std::abs(pMCParticle->GetParticleId())));
95  isMainMCParticleSet = (pMCParticle->GetParticleId() != 0);
96  }
97  catch (const StatusCodeException &) {}
98 
99  if (isMainMCParticleSet)
100  {
101  std::string outputFile;
102  outputFile.append(m_trainingOutputFile);
103  const std::string end=((wClusterList.empty()) ? "noChargeInfo.txt" : ".txt");
104  outputFile.append(end);
105  LArMvaHelper::ProduceTrainingExample(outputFile, isTrueTrack, featureVector);
106  }
107  return isTrueTrack;
108  }// training mode
109 
110  //check for failures in the calculation of features, i.e. not initialized features
111  for (const LArMvaHelper::MvaFeature &featureValue : featureVector)
112  {
113  if (!featureValue.IsInitialized())
114  {
116  {
117  object_creation::ParticleFlowObject::Metadata metadata;
118  metadata.m_propertiesToAdd["TrackScore"] = -1.f;
119  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*this, pPfo, metadata));
120  }
121  return (pPfo->GetParticleId() == MU_MINUS);
122  }
123  }
124 
125  //if no failures, proceed with svm classification
126  if (!m_enableProbability)
127  {
128  return LArMvaHelper::Classify((wClusterList.empty() ? m_supportVectorMachineNoChargeInfo : m_supportVectorMachine), featureVector);
129  }
130  else
131  {
132  const double score(LArMvaHelper::CalculateProbability((wClusterList.empty() ? m_supportVectorMachineNoChargeInfo : m_supportVectorMachine), featureVector));
133  object_creation::ParticleFlowObject::Metadata metadata;
134  metadata.m_propertiesToAdd["TrackScore"] = score;
135  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*this, pPfo, metadata));
136  return (m_minProbabilityCut <= score);
137  }
138 }
static double CalculateProbability(const MvaInterface &classifier, TLISTS &&...featureLists)
Use the trained mva to calculate a classification probability for an example.
Definition: LArMvaHelper.h:236
static bool IsThreeD(const pandora::ParticleFlowObject *const pPfo)
Does Pfo contain 3D clusters.
MvaTypes::MvaFeatureVector MvaFeatureVector
Definition: LArMvaHelper.h:58
static void GetClusters(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::ClusterList &clusterList)
Get a list of clusters of a particular hit type from a list of pfos.
std::string m_trainingOutputFile
The training output file.
static bool Classify(const MvaInterface &classifier, TLISTS &&...featureLists)
Use the trained classifier to predict the boolean class of an example.
Definition: LArMvaHelper.h:220
PfoCharacterisationFeatureTool::FeatureToolVector m_featureToolVectorNoChargeInfo
The feature tool map for missing W view.
SupportVectorMachine m_supportVectorMachineNoChargeInfo
The support vector machine for missing W view.
static const pandora::MCParticle * GetMainMCParticle(const pandora::ParticleFlowObject *const pPfo)
Find the mc particle making the largest contribution to 2D clusters in a specified pfo...
MvaTypes::MvaFeature MvaFeature
Definition: LArMvaHelper.h:57
PfoCharacterisationFeatureTool::FeatureToolVector m_featureToolVectorThreeD
The feature tool map for 3D info.
SupportVectorMachine m_supportVectorMachine
The support vector machine.
static pandora::StatusCode ProduceTrainingExample(const std::string &trainingOutputFile, const bool result, TLISTS &&...featureLists)
Produce a training example with the given features and result.
Definition: LArMvaHelper.h:197
bool m_enableProbability
Whether to use probabilities instead of binary classification.
static MvaFeatureVector CalculateFeatures(const MvaFeatureToolVector< Ts... > &featureToolVector, TARGS &&...args)
Calculate the features in a given feature tool vector.
Definition: LArMvaHelper.h:244
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
float m_minProbabilityCut
The minimum probability to label a cluster as track-like.
virtual bool lar_content::SvmPfoCharacterisationAlgorithm::IsClearTrack ( const pandora::Cluster *const  pCluster) const
protectedvirtual

Whether cluster is identified as a clear track.

Parameters
pClusteraddress of the relevant cluster
Returns
boolean

Implements lar_content::PfoCharacterisationBaseAlgorithm.

bool lar_content::PfoCharacterisationBaseAlgorithm::IsClearTrack3x2D ( const pandora::ParticleFlowObject *const  pPfo) const
protectedvirtualinherited

Whether pfo is identified as a clear track using its three clusters.

Parameters
pPfoaddress of the relevant pfo
Returns
boolean

Definition at line 108 of file PfoCharacterisationBaseAlgorithm.cc.

References lar_content::LArClusterHelper::GetClusterHitType(), lar_content::LArPfoHelper::GetTwoDClusterList(), lar_content::PfoCharacterisationBaseAlgorithm::IsClearTrack(), and lar_content::PfoCharacterisationBaseAlgorithm::m_minTrackLikeViews.

Referenced by lar_content::PfoCharacterisationBaseAlgorithm::Run().

109 {
110  ClusterList twoDClusterList;
111  LArPfoHelper::GetTwoDClusterList(pPfo, twoDClusterList);
112 
113  typedef std::set<pandora::HitType> HitTypeSet;
114  HitTypeSet hitTypeSet;
115 
116  unsigned int nTrackLikeViews(0);
117  for (const Cluster *const pCluster : twoDClusterList)
118  {
119  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
120  if (!hitTypeSet.insert(hitType).second)
121  continue;
122 
123  if (this->IsClearTrack(pCluster))
124  ++nTrackLikeViews;
125 
126  if (nTrackLikeViews >= m_minTrackLikeViews)
127  return true;
128  }
129 
130  return false;
131 }
static void GetTwoDClusterList(const pandora::ParticleFlowObject *const pPfo, pandora::ClusterList &clusterList)
Get the list of 2D clusters from an input pfo.
Definition: LArPfoHelper.cc:97
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
virtual bool IsClearTrack(const pandora::ParticleFlowObject *const pPfo) const =0
Whether pfo is identified as a clear track.
unsigned int m_minTrackLikeViews
The minimum number of track-like views to declare a pfo as track-like.
StatusCode lar_content::SvmPfoCharacterisationAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
protected

Definition at line 142 of file SvmPfoCharacterisationAlgorithm.cc.

References lar_content::LArMvaHelper::AddFeatureToolToVector(), lar_content::LArFileHelper::FindFileInPath(), lar_content::SupportVectorMachine::Initialize(), m_enableProbability, m_featureToolVector, m_featureToolVectorNoChargeInfo, m_featureToolVectorThreeD, m_filePathEnvironmentVariable, m_minCaloHitsCut, m_minProbabilityCut, m_supportVectorMachine, m_supportVectorMachineNoChargeInfo, m_svmFileName, m_svmFileNameNoChargeInfo, m_svmName, m_svmNameNoChargeInfo, m_trainingOutputFile, m_trainingSetMode, m_useThreeDInformation, and lar_content::PfoCharacterisationBaseAlgorithm::ReadSettings().

143 {
144  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
145  "TrainingSetMode", m_trainingSetMode));
146 
147  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
148  "MinCaloHitsCut", m_minCaloHitsCut));
149 
150  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
151  "UseThreeDInformation", m_useThreeDInformation));
152 
153  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
154  "FilePathEnvironmentVariable", m_filePathEnvironmentVariable));
155 
156  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
157  "SvmFileName", m_svmFileName));
158 
159  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
160  "SvmName", m_svmName));
161 
163  {
164  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
165  "SvmFileNameNoChargeInfo", m_svmFileNameNoChargeInfo));
166 
167  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
168  "SvmNameNoChargeInfo", m_svmNameNoChargeInfo));
169  }
170 
171  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
172  "EnableProbability", m_enableProbability));
173 
174  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
175  "MinProbabilityCut", m_minProbabilityCut));
176 
177  if (m_trainingSetMode)
178  {
179  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "TrainingOutputFileName", m_trainingOutputFile));
180  }
181  else
182  {
183  if (m_svmFileName.empty() || m_svmName.empty())
184  {
185  std::cout << "SvmPfoCharacterisationAlgorithm: SvmFileName and SvmName must be set if in classification mode " << std::endl;
186  return STATUS_CODE_INVALID_PARAMETER;
187  }
188 
190  m_supportVectorMachine.Initialize(fullSvmFileName, m_svmName);
191 
193  {
194  if (m_svmFileNameNoChargeInfo.empty() || m_svmNameNoChargeInfo.empty())
195  {
196  std::cout << "SvmPfoCharacterisationAlgorithm: SvmFileName and SvmName must be set if in classification mode for no charge info in 3D mode " << std::endl;
197  return STATUS_CODE_INVALID_PARAMETER;
198  }
199  const std::string fullSvmFileNameNoChargeInfo(LArFileHelper::FindFileInPath(m_svmFileNameNoChargeInfo, m_filePathEnvironmentVariable));
201  }
202  }
203 
204  AlgorithmToolVector algorithmToolVector;
205  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithmToolList(*this, xmlHandle, "FeatureTools", algorithmToolVector));
206 
208  {
209  AlgorithmToolVector algorithmToolVectorNoChargeInfo;
210  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithmToolList(*this, xmlHandle, "FeatureToolsNoChargeInfo", algorithmToolVectorNoChargeInfo));
211  for (AlgorithmTool *const pAlgorithmTool : algorithmToolVector)
212  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, LArMvaHelper::AddFeatureToolToVector(pAlgorithmTool, m_featureToolVectorThreeD));
213  for (AlgorithmTool *const pAlgorithmTool : algorithmToolVectorNoChargeInfo)
214  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, LArMvaHelper::AddFeatureToolToVector(pAlgorithmTool, m_featureToolVectorNoChargeInfo));
215  }
216  else
217  {
218  for (AlgorithmTool *const pAlgorithmTool : algorithmToolVector)
219  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, LArMvaHelper::AddFeatureToolToVector(pAlgorithmTool, m_featureToolVector));
220  }
221 
223 }
std::string m_svmFileNameNoChargeInfo
The svm input file for PFOs missing the W view, and thus charge info.
bool m_useThreeDInformation
Whether to use 3D information.
std::string m_trainingOutputFile
The training output file.
PfoCharacterisationFeatureTool::FeatureToolVector m_featureToolVectorNoChargeInfo
The feature tool map for missing W view.
std::string m_filePathEnvironmentVariable
The environment variable providing a list of paths to svm files.
SupportVectorMachine m_supportVectorMachineNoChargeInfo
The support vector machine for missing W view.
std::string m_svmNameNoChargeInfo
The name of the svm to find for PFOs missing the W view, and thus charge info.
PfoCharacterisationFeatureTool::FeatureToolVector m_featureToolVectorThreeD
The feature tool map for 3D info.
SupportVectorMachine m_supportVectorMachine
The support vector machine.
std::string m_svmName
The name of the svm to find.
unsigned int m_minCaloHitsCut
The minimum number of calo hits to qualify as a track.
static pandora::StatusCode AddFeatureToolToVector(pandora::AlgorithmTool *const pFeatureTool, MvaFeatureToolVector< Ts... > &featureToolVector)
Add a feature tool to a vector of feature tools.
Definition: LArMvaHelper.h:274
static std::string FindFileInPath(const std::string &unqualifiedFileName, const std::string &environmentVariable, const std::string &delimiter=":")
Find the fully-qualified file name by searching through a list of delimiter-separated paths in a name...
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
pandora::StatusCode Initialize(const std::string &parameterLocation, const std::string &svmName)
Initialize the svm using a serialized model.
bool m_enableProbability
Whether to use probabilities instead of binary classification.
float m_minProbabilityCut
The minimum probability to label a cluster as track-like.
ClusterCharacterisationFeatureTool::FeatureToolVector m_featureToolVector
The feature tool map.
StatusCode lar_content::PfoCharacterisationBaseAlgorithm::Run ( )
protectedinherited

Definition at line 39 of file PfoCharacterisationBaseAlgorithm.cc.

References lar_content::LArPfoHelper::GetTwoDClusterList(), lar_content::PfoCharacterisationBaseAlgorithm::IsClearTrack(), lar_content::PfoCharacterisationBaseAlgorithm::IsClearTrack3x2D(), lar_content::PfoCharacterisationBaseAlgorithm::m_inputPfoListNames, lar_content::PfoCharacterisationBaseAlgorithm::m_showerPfoListName, lar_content::PfoCharacterisationBaseAlgorithm::m_trackPfoListName, lar_content::PfoCharacterisationBaseAlgorithm::m_updateClusterIds, and lar_content::PfoCharacterisationBaseAlgorithm::m_useThreeDInformation.

40 {
41  PfoList tracksToShowers, showersToTracks;
42 
43  for (const std::string &pfoListName : m_inputPfoListNames)
44  {
45  const PfoList *pPfoList(nullptr);
46  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, pfoListName, pPfoList));
47 
48  if (!pPfoList || pPfoList->empty())
49  {
50  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
51  std::cout << "PfoCharacterisationBaseAlgorithm: unable to find pfo list " << pfoListName << std::endl;
52 
53  continue;
54  }
55 
56  for (const ParticleFlowObject *const pPfo : *pPfoList)
57  {
58  PandoraContentApi::ParticleFlowObject::Metadata pfoMetadata;
59  const bool isTrackLike(m_useThreeDInformation ? this->IsClearTrack(pPfo) : this->IsClearTrack3x2D(pPfo));
60 
61  if (isTrackLike)
62  {
63  pfoMetadata.m_particleId = MU_MINUS;
64 
65  if (m_showerPfoListName == pfoListName)
66  showersToTracks.push_back(pPfo);
67  }
68  else
69  {
70  pfoMetadata.m_particleId = E_MINUS;
71 
72  if (m_trackPfoListName == pfoListName)
73  tracksToShowers.push_back(pPfo);
74  }
75 
76  if (pPfo->GetParticleId() != pfoMetadata.m_particleId.Get())
77  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*this, pPfo, pfoMetadata));
78 
79  if (!m_updateClusterIds)
80  continue;
81 
82  ClusterList twoDClusterList;
83  LArPfoHelper::GetTwoDClusterList(pPfo, twoDClusterList);
84 
85  for (const Cluster *const pCluster : twoDClusterList)
86  {
87  if (pCluster->GetParticleId() == pfoMetadata.m_particleId.Get())
88  continue;
89 
90  PandoraContentApi::Cluster::Metadata clusterMetadata;
91  clusterMetadata.m_particleId = pfoMetadata.m_particleId.Get();
92  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Cluster::AlterMetadata(*this, pCluster, clusterMetadata));
93  }
94  }
95  }
96 
97  if (!tracksToShowers.empty())
98  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList(*this, m_trackPfoListName, m_showerPfoListName, tracksToShowers));
99 
100  if (!showersToTracks.empty())
101  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList(*this, m_showerPfoListName, m_trackPfoListName, showersToTracks));
102 
103  return STATUS_CODE_SUCCESS;
104 }
virtual bool IsClearTrack3x2D(const pandora::ParticleFlowObject *const pPfo) const
Whether pfo is identified as a clear track using its three clusters.
pandora::StringVector m_inputPfoListNames
The names of the input pfo lists.
static void GetTwoDClusterList(const pandora::ParticleFlowObject *const pPfo, pandora::ClusterList &clusterList)
Get the list of 2D clusters from an input pfo.
Definition: LArPfoHelper.cc:97
virtual bool IsClearTrack(const pandora::ParticleFlowObject *const pPfo) const =0
Whether pfo is identified as a clear track.
bool m_updateClusterIds
Whether to update daughter cluster particle id labels to match pfo id.
bool m_useThreeDInformation
Whether to use PFO and 3D information or clusters for characterisation.
std::string m_showerPfoListName
The shower pfo list name.

Member Data Documentation

bool lar_content::SvmPfoCharacterisationAlgorithm::m_enableProbability
protected

Whether to use probabilities instead of binary classification.

Definition at line 41 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by IsClearTrack(), ReadSettings(), and SvmPfoCharacterisationAlgorithm().

ClusterCharacterisationFeatureTool::FeatureToolVector lar_content::SvmPfoCharacterisationAlgorithm::m_featureToolVector
protected

The feature tool map.

Definition at line 33 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by ReadSettings(), and SvmPfoCharacterisationAlgorithm().

PfoCharacterisationFeatureTool::FeatureToolVector lar_content::SvmPfoCharacterisationAlgorithm::m_featureToolVectorNoChargeInfo
protected

The feature tool map for missing W view.

Definition at line 35 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by IsClearTrack(), and ReadSettings().

PfoCharacterisationFeatureTool::FeatureToolVector lar_content::SvmPfoCharacterisationAlgorithm::m_featureToolVectorThreeD
protected

The feature tool map for 3D info.

Definition at line 34 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by IsClearTrack(), and ReadSettings().

std::string lar_content::SvmPfoCharacterisationAlgorithm::m_filePathEnvironmentVariable
protected

The environment variable providing a list of paths to svm files.

Definition at line 47 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by ReadSettings().

pandora::StringVector lar_content::PfoCharacterisationBaseAlgorithm::m_inputPfoListNames
protectedinherited
unsigned int lar_content::SvmPfoCharacterisationAlgorithm::m_minCaloHitsCut
protected

The minimum number of calo hits to qualify as a track.

Definition at line 44 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by ReadSettings(), and SvmPfoCharacterisationAlgorithm().

float lar_content::SvmPfoCharacterisationAlgorithm::m_minProbabilityCut
protected

The minimum probability to label a cluster as track-like.

Definition at line 43 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by IsClearTrack(), ReadSettings(), and SvmPfoCharacterisationAlgorithm().

unsigned int lar_content::PfoCharacterisationBaseAlgorithm::m_minTrackLikeViews
protectedinherited

The minimum number of track-like views to declare a pfo as track-like.

Definition at line 71 of file PfoCharacterisationBaseAlgorithm.h.

Referenced by lar_content::PfoCharacterisationBaseAlgorithm::IsClearTrack3x2D(), and lar_content::PfoCharacterisationBaseAlgorithm::ReadSettings().

bool lar_content::PfoCharacterisationBaseAlgorithm::m_postBranchAddition
protectedinherited

Whether to use configuration for shower clusters post branch addition.

Definition at line 69 of file PfoCharacterisationBaseAlgorithm.h.

std::string lar_content::PfoCharacterisationBaseAlgorithm::m_showerPfoListName
protectedinherited
SupportVectorMachine lar_content::SvmPfoCharacterisationAlgorithm::m_supportVectorMachine
protected

The support vector machine.

Definition at line 37 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by IsClearTrack(), ReadSettings(), and SvmPfoCharacterisationAlgorithm().

SupportVectorMachine lar_content::SvmPfoCharacterisationAlgorithm::m_supportVectorMachineNoChargeInfo
protected

The support vector machine for missing W view.

Definition at line 38 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by IsClearTrack(), and ReadSettings().

std::string lar_content::SvmPfoCharacterisationAlgorithm::m_svmFileName
protected

The svm input file.

Definition at line 48 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by ReadSettings().

std::string lar_content::SvmPfoCharacterisationAlgorithm::m_svmFileNameNoChargeInfo
protected

The svm input file for PFOs missing the W view, and thus charge info.

Definition at line 50 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by ReadSettings().

std::string lar_content::SvmPfoCharacterisationAlgorithm::m_svmName
protected

The name of the svm to find.

Definition at line 49 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by ReadSettings().

std::string lar_content::SvmPfoCharacterisationAlgorithm::m_svmNameNoChargeInfo
protected

The name of the svm to find for PFOs missing the W view, and thus charge info.

Definition at line 51 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by ReadSettings().

std::string lar_content::PfoCharacterisationBaseAlgorithm::m_trackPfoListName
protectedinherited
std::string lar_content::SvmPfoCharacterisationAlgorithm::m_trainingOutputFile
protected

The training output file.

Definition at line 46 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by IsClearTrack(), ReadSettings(), and SvmPfoCharacterisationAlgorithm().

bool lar_content::SvmPfoCharacterisationAlgorithm::m_trainingSetMode
protected

Whether to train.

Definition at line 40 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by IsClearTrack(), ReadSettings(), and SvmPfoCharacterisationAlgorithm().

bool lar_content::PfoCharacterisationBaseAlgorithm::m_updateClusterIds
protectedinherited

Whether to update daughter cluster particle id labels to match pfo id.

Definition at line 68 of file PfoCharacterisationBaseAlgorithm.h.

Referenced by lar_content::PfoCharacterisationBaseAlgorithm::ReadSettings(), and lar_content::PfoCharacterisationBaseAlgorithm::Run().

bool lar_content::SvmPfoCharacterisationAlgorithm::m_useThreeDInformation
protected

Whether to use 3D information.

Definition at line 42 of file SvmPfoCharacterisationAlgorithm.h.

Referenced by ReadSettings().


The documentation for this class was generated from the following files: