Slice.h
Go to the documentation of this file.
1 /**
2  * @file larpandora/LArPandoraEventBuilding/Slice.h
3  *
4  * @brief header for the lar pandora slice class
5  */
6 
7 #ifndef LAR_PANDORA_SLICE_H
8 #define LAR_PANDORA_SLICE_H 1
9 
11 
12 namespace lar_pandora
13 {
14 
15 /**
16  * @brief Slice class
17  */
18 class Slice
19 {
20 public:
21  /**
22  * @brief Default constructor
23  *
24  * @param topologicalScore the topological score from Pandora
25  * @param targetHypothesis the slice as reconstructed under the target hypothesis
26  * @param crHypothesis the slice as reconstructed under the cosmic-ray hypothesis
27  * @param isTarget if the slice has been identified as a target
28  */
29  Slice(const float topologicalScore, const PFParticleVector &targetHypothesis, const PFParticleVector &crHypothesis, const bool isTarget = false);
30 
31  /**
32  * @brief Get the topological score for the slice - closer to 1 means more likely to be the target slice
33  */
34  float GetTopologicalScore() const;
35 
36  /**
37  * @brief Get the slice as reconstructed under the target hypothesis
38  */
40 
41  /**
42  * @brief Get the slice as reconstructed under the cosmic-ray hypothesis
43  */
45 
46  /**
47  * @brief Check if the slice has been identified as a target
48  */
49  bool IsTaggedAsTarget() const;
50 
51  /**
52  * @brief Tag the slice as a neutrino / test beam particle
53  */
54  void TagAsTarget();
55 
56  /**
57  * @brief Tag the slice as a cosmic
58  */
59  void TagAsCosmic();
60 
61 private:
62  float m_topologicalScore; ///< The topological neutrino / beam particle score from Pandora
63  PFParticleVector m_targetHypothesis; ///< The slice as reconstructed under the neutrino / beam particle hypothesis
64  PFParticleVector m_crHypothesis; ///< The slice as reconstructed under the cosmic-ray hypothesis
65  bool m_isTarget; ///< If the slice has been identified as a neutrino / beam particle
66 };
67 
68 typedef std::vector<Slice> SliceVector;
69 
70 //------------------------------------------------------------------------------------------------------------------------------------------
71 
72 inline Slice::Slice(const float topologicalScore, const PFParticleVector &targetHypothesis, const PFParticleVector &crHypothesis, const bool isTarget) :
73  m_topologicalScore(topologicalScore),
74  m_targetHypothesis(targetHypothesis),
75  m_crHypothesis(crHypothesis),
76  m_isTarget(isTarget)
77 {
78 }
79 
80 //------------------------------------------------------------------------------------------------------------------------------------------
81 
82 inline float Slice::GetTopologicalScore() const
83 {
84  return m_topologicalScore;
85 }
86 
87 //------------------------------------------------------------------------------------------------------------------------------------------
88 
90 {
91  return m_targetHypothesis;
92 }
93 
94 //------------------------------------------------------------------------------------------------------------------------------------------
95 
97 {
98  return m_crHypothesis;
99 }
100 
101 //------------------------------------------------------------------------------------------------------------------------------------------
102 
103 inline bool Slice::IsTaggedAsTarget() const
104 {
105  return m_isTarget;
106 }
107 
108 //------------------------------------------------------------------------------------------------------------------------------------------
109 
110 inline void Slice::TagAsTarget()
111 {
112  m_isTarget = true;
113 }
114 
115 //------------------------------------------------------------------------------------------------------------------------------------------
116 
117 inline void Slice::TagAsCosmic()
118 {
119  m_isTarget = false;
120 }
121 
122 
123 } // namespace lar_pandora
124 
125 #endif // #ifndef LAR_PANDORA_SLICE_H
Slice class.
Definition: Slice.h:18
const PFParticleVector & GetCosmicRayHypothesis() const
Get the slice as reconstructed under the cosmic-ray hypothesis.
Definition: Slice.h:96
Slice(const float topologicalScore, const PFParticleVector &targetHypothesis, const PFParticleVector &crHypothesis, const bool isTarget=false)
Default constructor.
Definition: Slice.h:72
float m_topologicalScore
The topological neutrino / beam particle score from Pandora.
Definition: Slice.h:62
const PFParticleVector & GetTargetHypothesis() const
Get the slice as reconstructed under the target hypothesis.
Definition: Slice.h:89
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
bool IsTaggedAsTarget() const
Check if the slice has been identified as a target.
Definition: Slice.h:103
PFParticleVector m_crHypothesis
The slice as reconstructed under the cosmic-ray hypothesis.
Definition: Slice.h:64
PFParticleVector m_targetHypothesis
The slice as reconstructed under the neutrino / beam particle hypothesis.
Definition: Slice.h:63
std::vector< Slice > SliceVector
Definition: Slice.h:68
bool m_isTarget
If the slice has been identified as a neutrino / beam particle.
Definition: Slice.h:65
void TagAsCosmic()
Tag the slice as a cosmic.
Definition: Slice.h:117
float GetTopologicalScore() const
Get the topological score for the slice - closer to 1 means more likely to be the target slice...
Definition: Slice.h:82
helper function for LArPandoraInterface producer module
void TagAsTarget()
Tag the slice as a neutrino / test beam particle.
Definition: Slice.h:110