LArMvaHelper class. More...
#include <LArMvaHelper.h>
Public Types | |
typedef MvaTypes::MvaFeature | MvaFeature |
typedef MvaTypes::MvaFeatureVector | MvaFeatureVector |
typedef std::map< std::string, double > | DoubleMap |
typedef MvaTypes::MvaFeatureMap | MvaFeatureMap |
typedef std::map< std::string, pandora::AlgorithmTool * > | AlgorithmToolMap |
Static Public Member Functions | |
template<typename TCONTAINER > | |
static pandora::StatusCode | ProduceTrainingExample (const std::string &trainingOutputFile, const bool result, TCONTAINER &&featureContainer) |
Produce a training example with the given features and result. More... | |
template<typename TCONTAINER > | |
static pandora::StatusCode | ProduceTrainingExample (const std::string &trainingOutputFile, const bool result, const pandora::StringVector &featureOrder, TCONTAINER &&featureContainer) |
Produce a training example with the given features and result - using a map. More... | |
template<typename TCONTAINER > | |
static bool | Classify (const MvaInterface &classifier, TCONTAINER &&featureContainer) |
Use the trained classifier to predict the boolean class of an example. More... | |
template<typename TCONTAINER > | |
static bool | Classify (const MvaInterface &classifier, const pandora::StringVector &featureOrder, TCONTAINER &&featureContainer) |
Use the trained classifier to predict the boolean class of an example – using a map. More... | |
template<typename TCONTAINER > | |
static double | CalculateClassificationScore (const MvaInterface &classifier, TCONTAINER &&featureContainer) |
Use the trained classifer to calculate the classification score of an example (>0 means boolean class true) More... | |
template<typename TCONTAINER > | |
static double | CalculateProbability (const MvaInterface &classifier, TCONTAINER &&featureContainer) |
Use the trained mva to calculate a classification probability for an example. More... | |
template<typename TCONTAINER > | |
static double | CalculateProbability (const MvaInterface &classifier, const pandora::StringVector &featureOrder, TCONTAINER &&featureContainer) |
Use the trained mva to calculate a classification probability for an example – using a map. More... | |
template<typename... Ts, typename... TARGS> | |
static MvaFeatureVector | CalculateFeatures (const MvaFeatureToolVector< Ts...> &featureToolVector, TARGS &&...args) |
Calculate the features in a given feature tool vector. More... | |
template<typename... Ts, typename... TARGS> | |
static MvaFeatureMap | CalculateFeatures (const pandora::StringVector &featureToolOrder, const MvaFeatureToolMap< Ts...> &featureToolMap, pandora::StringVector &featureOrder, TARGS &&...args) |
Calculate the features in a given feature tool map, and fill an MvaFeatureMap and vector with feature order. More... | |
template<typename T , typename... Ts, typename... TARGS> | |
static MvaFeatureVector | CalculateFeaturesOfType (const MvaFeatureToolVector< Ts...> &featureToolVector, TARGS &&...args) |
Calculate the features of a given derived feature tool type in a feature tool vector. More... | |
template<typename... Ts> | |
static pandora::StatusCode | AddFeatureToolToVector (pandora::AlgorithmTool *const pFeatureTool, MvaFeatureToolVector< Ts...> &featureToolVector) |
Add a feature tool to a vector of feature tools. More... | |
template<typename... Ts> | |
static pandora::StatusCode | AddFeatureToolToMap (pandora::AlgorithmTool *const pFeatureTool, std::string pFeatureToolName, MvaFeatureToolMap< Ts...> &featureToolMap) |
Add a feature tool to a map of feature tools. More... | |
static pandora::StatusCode | ProcessAlgorithmToolListToMap (const pandora::Algorithm &algorithm, const pandora::TiXmlHandle &xmlHandle, const std::string &listName, pandora::StringVector &algorithToolNameVector, AlgorithmToolMap &algorithmToolMap) |
Process a list of algorithms tools in an xml file, using a map. Idea is for this to go to XmlHelper in PandoraSDK eventually as an overload to ProcessAlgorithmToolList. More... | |
template<typename TLIST , typename... TLISTS> | |
static MvaFeatureVector | ConcatenateFeatureLists (TLIST &&featureList, TLISTS &&...featureLists) |
Recursively concatenate vectors of features. More... | |
static MvaFeatureVector | ConcatenateFeatureLists () |
Recursively concatenate vectors of features (terminating method) More... | |
Static Private Member Functions | |
static std::string | GetTimestampString () |
Get a timestamp string for this point in time. More... | |
template<typename TCONTAINER > | |
static pandora::StatusCode | WriteFeaturesToFile (std::ofstream &outfile, const std::string &delimiter, TCONTAINER &&featureContainer) |
Write the features of the given lists to file. More... | |
template<typename TCONTAINER > | |
static pandora::StatusCode | WriteFeaturesToFileImpl (std::ofstream &outfile, const std::string &delimiter, TCONTAINER &&featureContainer) |
Write the features of the given list to file (implementation method) More... | |
LArMvaHelper class.
Definition at line 68 of file LArMvaHelper.h.
typedef std::map<std::string, pandora::AlgorithmTool *> lar_content::LArMvaHelper::AlgorithmToolMap |
Definition at line 76 of file LArMvaHelper.h.
typedef std::map<std::string, double> lar_content::LArMvaHelper::DoubleMap |
Definition at line 73 of file LArMvaHelper.h.
Definition at line 71 of file LArMvaHelper.h.
Definition at line 75 of file LArMvaHelper.h.
Definition at line 72 of file LArMvaHelper.h.
|
static |
Add a feature tool to a map of feature tools.
pFeatureTool | the feature tool |
pFeatureToolName | the name of the feature tool |
featureToolMap | the map to append |
Definition at line 462 of file LArMvaHelper.h.
|
static |
Add a feature tool to a vector of feature tools.
pFeatureTool | the feature tool |
featureToolVector | the vector to append |
Definition at line 448 of file LArMvaHelper.h.
|
static |
Use the trained classifer to calculate the classification score of an example (>0 means boolean class true)
classifier | the classifier |
featureContainer | the container of features |
Definition at line 358 of file LArMvaHelper.h.
|
static |
Calculate the features in a given feature tool vector.
featureToolVector | the feature tool vector |
args | arguments to pass to the tool |
Definition at line 396 of file LArMvaHelper.h.
|
static |
Calculate the features in a given feature tool map, and fill an MvaFeatureMap and vector with feature order.
featureToolOrder | vector of strings of the ordered keys |
featureToolMap | the feature tool map |
featureOrder | a vector that is to be filled with the order of features in the function |
args | arguments to pass to the tool |
Definition at line 409 of file LArMvaHelper.h.
|
static |
Calculate the features of a given derived feature tool type in a feature tool vector.
featureToolVector | the feature tool vector |
args | arguments to pass to the tool |
Definition at line 431 of file LArMvaHelper.h.
|
static |
Use the trained mva to calculate a classification probability for an example.
classifier | the classifier |
featureContainer | the container of features |
Definition at line 366 of file LArMvaHelper.h.
|
static |
Use the trained mva to calculate a classification probability for an example – using a map.
classifier | the classifier |
featureOrder | the vector of strings corresponding to ordered list of keys |
featureContainer | the container of features |
Definition at line 374 of file LArMvaHelper.h.
|
static |
Use the trained classifier to predict the boolean class of an example.
classifier | the classifier |
featureContainer | the container of features |
Definition at line 328 of file LArMvaHelper.h.
|
static |
Use the trained classifier to predict the boolean class of an example – using a map.
classifier | the classifier |
featureOrder | the vector of strings corresponding to ordered list of keys |
featureContainer | the container of features |
Definition at line 336 of file LArMvaHelper.h.
|
static |
Recursively concatenate vectors of features.
featureList | a list of features |
featureLists | optional further lists of features |
Definition at line 520 of file LArMvaHelper.h.
|
inlinestatic |
Recursively concatenate vectors of features (terminating method)
Definition at line 538 of file LArMvaHelper.h.
|
inlinestaticprivate |
Get a timestamp string for this point in time.
Definition at line 476 of file LArMvaHelper.h.
|
static |
Process a list of algorithms tools in an xml file, using a map. Idea is for this to go to XmlHelper in PandoraSDK eventually as an overload to ProcessAlgorithmToolList.
algorithm | the parent algorithm calling this function |
xmlHandle | the relevant xml handle |
listName | the name of the algorithm tool list |
algorithmToolMap | to receive the vector of addresses of the algorithm tool instances, but also keep the name |
Definition at line 16 of file LArMvaHelper.cc.
|
static |
Produce a training example with the given features and result.
trainingOutputFile | the file to which to append the example |
featureContainer | the container of features |
Definition at line 282 of file LArMvaHelper.h.
|
static |
Produce a training example with the given features and result - using a map.
trainingOutputFile | the file to which to append the example |
featureOrder | the vector of strings corresponding to ordered list of keys |
featureContainer | the container of features |
Definition at line 305 of file LArMvaHelper.h.
|
inlinestaticprivate |
Write the features of the given lists to file.
outfile | the std::ofstream object to use |
delimiter | the delimiter string |
featureContainer | a container of features to write |
Definition at line 497 of file LArMvaHelper.h.
|
staticprivate |
Write the features of the given list to file (implementation method)
outfile | the std::ofstream object to use |
delimiter | the delimiter string |
featureContainer | a container of features to write |
Definition at line 509 of file LArMvaHelper.h.