BeamParticleIdTool.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArControlFlow/BeamParticleIdTool.h
3  *
4  * @brief Header file for the beam particle id tool class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_BEAM_PARTICLE_ID_TOOL_H
9 #define LAR_BEAM_PARTICLE_ID_TOOL_H 1
10 
12 
13 namespace lar_content
14 {
15 
16 /**
17  * @brief BeamParticleIdTool class
18  */
20 {
21 public:
22  /**
23  * @brief Default constructor
24  */
26 
27  void SelectOutputPfos(const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &beamSliceHypotheses,
28  const SliceHypotheses &crSliceHypotheses, pandora::PfoList &selectedPfos);
29 
30 private:
31  /**
32  * @brief Plane class
33  */
34  class Plane
35  {
36  public:
37  /**
38  * @brief Constructor, using equation of plane: m_a*x + m_b*y + m_c*z + m_d = 0.
39  *
40  * @param normal a Cartesian vector that points in a direction that is normal to the plane
41  * @param point a Cartesian vector that corresponds to any point on the plane
42  */
43  Plane(const pandora::CartesianVector &normal, const pandora::CartesianVector &point);
44 
45  /**
46  * @brief Return the intersection between the plane and a line
47  *
48  * @param a0 point on the line
49  * @param a vector pointing along the line
50  */
51  pandora::CartesianVector GetLineIntersection(const pandora::CartesianVector &a0, const pandora::CartesianVector &a) const;
52 
53  private:
54  pandora::CartesianVector m_unitNormal; ///< Unit normal to plane
55  pandora::CartesianVector m_point; ///< A point on the plane
56  float m_d; ///< Parameter defining a plane
57  };
58 
59  pandora::StatusCode Initialize();
60 
61  /**
62  * @brief Select a given fraction of a slice's calo hits that are closest to the beam spot
63  *
64  * @param inputCaloHitList all calo hits in slice
65  * @param outputCaloHitList to receive the list of selected calo hits
66  * @param closestHitToFaceDistance to receive the distance of closest hit to beam spot
67  */
68  void GetSelectedCaloHits(const pandora::CaloHitList &inputCaloHitList, pandora::CaloHitList &outputCaloHitList, float &closestHitToFaceDistance) const;
69 
70  /**
71  * @brief Find the intercepts of a line with the protoDUNE detector
72  *
73  * @param a0 a point on the line in question
74  * @param majorAxis the direction of the line in question
75  * @param interceptOne to receive the first intersection between line and protoDUNE detector
76  * @param interceptTwo to receive the second intersection between line and protoDUNE detector
77  */
78  void GetTPCIntercepts(const pandora::CartesianVector &a0, const pandora::CartesianVector &majorAxis,
79  pandora::CartesianVector &interceptOne, pandora::CartesianVector &interceptTwo) const;
80 
81  /**
82  * @brief Check if a given 3D spacepoint is inside the global TPC volume
83  *
84  * @param spacePoint
85  */
86  bool IsContained(const pandora::CartesianVector &spacePoint) const;
87 
88  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
89 
90  typedef std::vector<Plane> PlaneVector;
91 
92  bool m_selectAllBeamParticles; ///< First approach: select all beam particles, as opposed to selecting all cosmics
93  bool m_selectOnlyFirstSliceBeamParticles; ///< First approach: select first slice beam particles, cosmics for all subsequent slices
94  float m_tpcMinX; ///< Global TPC volume minimum x extent
95  float m_tpcMaxX; ///< Global TPC volume maximum x extent
96  float m_tpcMinY; ///< Global TPC volume minimum y extent
97  float m_tpcMaxY; ///< Global TPC volume maximum y extent
98  float m_tpcMinZ; ///< Global TPC volume minimum z extent
99  float m_tpcMaxZ; ///< Global TPC volume maximum z extent
100  pandora::CartesianVector m_beamTPCIntersection; ///< Intersection of beam and global TPC volume
101  pandora::CartesianVector m_beamDirection; ///< Beam direction
102  PlaneVector m_tpcPlanes; ///< Vector of all planes making up global TPC volume
103 
104  float m_projectionIntersectionCut; ///< Projection intersection distance cut, used in beam event selection
105  float m_closestDistanceCut; ///< Closest distance (of hit to beam spot), used in beam event selection
106  float m_angleToBeamCut; ///< Angle between major axis and beam direction, used in beam event selection
107  float m_selectedFraction; ///< Fraction of hits to use in 3D cluster fits
108  unsigned int m_nSelectedHits; ///< Minimum number of hits to use in 3D cluster fits
109 };
110 
111 } // namespace lar_content
112 
113 #endif // #ifndef LAR_BEAM_PARTICLE_ID_TOOL_H
BeamParticleIdTool()
Default constructor.
pandora::CartesianVector m_beamTPCIntersection
Intersection of beam and global TPC volume.
bool IsContained(const pandora::CartesianVector &spacePoint) const
Check if a given 3D spacepoint is inside the global TPC volume.
bool m_selectAllBeamParticles
First approach: select all beam particles, as opposed to selecting all cosmics.
#define a0
pandora::CartesianVector m_point
A point on the plane.
void GetSelectedCaloHits(const pandora::CaloHitList &inputCaloHitList, pandora::CaloHitList &outputCaloHitList, float &closestHitToFaceDistance) const
Select a given fraction of a slice&#39;s calo hits that are closest to the beam spot. ...
float m_closestDistanceCut
Closest distance (of hit to beam spot), used in beam event selection.
pandora::CartesianVector GetLineIntersection(const pandora::CartesianVector &a0, const pandora::CartesianVector &a) const
Return the intersection between the plane and a line.
float m_tpcMaxX
Global TPC volume maximum x extent.
float m_tpcMinZ
Global TPC volume minimum z extent.
float m_tpcMaxZ
Global TPC volume maximum z extent.
float m_d
Parameter defining a plane.
Header file for the master algorithm class.
const double a
float m_angleToBeamCut
Angle between major axis and beam direction, used in beam event selection.
std::vector< pandora::PfoList > SliceHypotheses
bool m_selectOnlyFirstSliceBeamParticles
First approach: select first slice beam particles, cosmics for all subsequent slices.
pandora::CartesianVector m_unitNormal
Unit normal to plane.
void GetTPCIntercepts(const pandora::CartesianVector &a0, const pandora::CartesianVector &majorAxis, pandora::CartesianVector &interceptOne, pandora::CartesianVector &interceptTwo) const
Find the intercepts of a line with the protoDUNE detector.
Plane(const pandora::CartesianVector &normal, const pandora::CartesianVector &point)
Constructor, using equation of plane: m_a*x + m_b*y + m_c*z + m_d = 0.
SliceIdBaseTool class.
unsigned int m_nSelectedHits
Minimum number of hits to use in 3D cluster fits.
BeamParticleIdTool class.
float m_selectedFraction
Fraction of hits to use in 3D cluster fits.
float m_projectionIntersectionCut
Projection intersection distance cut, used in beam event selection.
float m_tpcMaxY
Global TPC volume maximum y extent.
pandora::CartesianVector m_beamDirection
Beam direction.
void SelectOutputPfos(const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &beamSliceHypotheses, const SliceHypotheses &crSliceHypotheses, pandora::PfoList &selectedPfos)
Select which reconstruction hypotheses to use; neutrino outcomes or cosmic-ray muon outcomes for each...
float m_tpcMinY
Global TPC volume minimum y extent.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
PlaneVector m_tpcPlanes
Vector of all planes making up global TPC volume.
float m_tpcMinX
Global TPC volume minimum x extent.