CheatingSliceSelectionTool.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArCheating/CheatingSliceSelectionTool.h
3  *
4  * @brief Header file for the cheating slice selection tool class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_CHEATING_SLICE_SELECTION_TOOL_H
9 #define LAR_CHEATING_SLICE_SELECTION_TOOL_H 1
10 
12 
13 namespace lar_content
14 {
15 
16 /**
17  * @brief CheatingSliceSelectionTool class
18  */
20 {
21 public:
22  /**
23  * @brief Default constructor
24  */
26 
27  /**
28  * @brief Select which slice(s) to use
29  *
30  * @param pAlgorithm the address of the master instance, used to access MCParticles when in training mode
31  * @param inputSliceVector the initial slice vector
32  * @param outputSliceVector the output slice vector
33  */
34  void SelectSlices(const pandora::Algorithm *const pAlgorithm, const SliceVector &inputSliceVector, SliceVector &outputSliceVector);
35 
36  typedef std::map<float, int, std::greater<float>> MetricSliceIndexMap;
37 
38 protected:
39  /**
40  * @brief Template method to determine if an MC particle matches the target criteria for slice selection. Return true if match.
41  *
42  * @param mcParticle the MC particle to check
43  */
44  virtual bool IsTarget(const pandora::MCParticle *const mcParticle) const = 0;
45 
46  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
47 
48 protected:
49  int m_maxSlices; ///< The maximum number of slices to retain (0 to retain all) - default 0
50  float m_threshold; ///< The minimum cut threshold to retain a slice (< 0 for no threshold) - default -1
51  std::string m_cutVariable; ///< The variable to cut on ("purity" or "completeness") - default "completeness"
52 };
53 
54 } // namespace lar_content
55 
56 #endif // #ifndef LAR_CHEATING_SLICE_SELECTION_TOOL_H
void SelectSlices(const pandora::Algorithm *const pAlgorithm, const SliceVector &inputSliceVector, SliceVector &outputSliceVector)
Select which slice(s) to use.
std::string m_cutVariable
The variable to cut on ("purity" or "completeness") - default "completeness".
std::vector< pandora::CaloHitList > SliceVector
int m_maxSlices
The maximum number of slices to retain (0 to retain all) - default 0.
std::string string
Definition: nybbler.cc:12
std::map< float, int, std::greater< float > > MetricSliceIndexMap
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Header file for the master algorithm class.
float m_threshold
The minimum cut threshold to retain a slice (< 0 for no threshold) - default -1.
SliceSelectionBaseTool class.
virtual bool IsTarget(const pandora::MCParticle *const mcParticle) const =0
Template method to determine if an MC particle matches the target criteria for slice selection...