PrincipalComponentsAlg.h
Go to the documentation of this file.
1 /**
2  * @file PrincipalComponentsAlg.h
3  *
4  * @brief This header file defines the interface to a principal components analysis designed to
5  * be used within the 3D clustering
6  *
7  */
8 #ifndef PrincipalComponentsAlg_h
9 #define PrincipalComponentsAlg_h
10 
11 // Framework Includes
12 #include "fhiclcpp/ParameterSet.h"
13 
14 // LArSoft includes
17 #include "lardata/RecoObjects/Cluster3D.h"
18 
19 // Root
20 #include "TVector3.h"
21 
22 // std includes
23 #include <string>
24 #include <functional>
25 #include <iostream>
26 #include <memory>
27 
28 
29 //------------------------------------------------------------------------------------------------------------------------------------------
30 
31 namespace lar_cluster3d
32 {
33 
34 /**
35  * @brief Cluster3D class
36  */
38 {
39 public:
40  /**
41  * @brief Constructor
42  *
43  * @param pset
44  */
46 
47  /**
48  * @brief Destructor
49  */
50  virtual ~PrincipalComponentsAlg();
51 
52  /**
53  * @brief a handler for the case where the algorithm control parameters are to be reset
54  */
55  void reconfigure(fhicl::ParameterSet const &pset);
56 
57  /**
58  * @brief Run the Principal Components Analysis
59  */
60  void PCAAnalysis(const reco::HitPairListPtr& hitPairVector, reco::PrincipalComponents& pca, double doca3DScl = 3.) const;
61 
62  void PCAAnalysis_3D(const reco::HitPairListPtr& hitPairList, reco::PrincipalComponents& pca, bool skeletonOnly = false) const;
63 
64  void PCAAnalysis_2D(const reco::HitPairListPtr& hitPairVector, reco::PrincipalComponents& pca, bool updateAvePos = false) const;
65 
66  void PCAAnalysis_calc3DDocas(const reco::HitPairListPtr& hitPairVector, const reco::PrincipalComponents& pca) const;
67 
68  void PCAAnalysis_calc2DDocas(const reco::Hit2DListPtr& hit2DVector, const reco::PrincipalComponents& pca) const;
69 
70  int PCAAnalysis_reject2DOutliers(const reco::HitPairListPtr& hitPairVector, reco::PrincipalComponents& pca, double aveHitDoca) const;
71 
72  int PCAAnalysis_reject3DOutliers(const reco::HitPairListPtr& hitPairVector, const reco::PrincipalComponents& pca, double aveHitDoca) const;
73 
74 
75 
76 private:
77  /**
78  * @brief This is used to get the poca, doca and arclen along cluster axis to 2D hit
79  */
80  void getHit2DPocaToAxis(const TVector3& axisPos,
81  const TVector3& axisDir,
82  const reco::ClusterHit2D* hit2D,
83  TVector3& poca,
84  double& arcLenAxis,
85  double& arcLenWire,
86  double& doca);
87 
88  double m_parallel; ///< means lines are parallel
89 
90  geo::Geometry* m_geometry; // pointer to the Geometry service
91  const detinfo::DetectorProperties* m_detector; // Pointer to the detector properties
92 };
93 
94 } // namespace lar_cluster3d
95 #endif
void PCAAnalysis_2D(const reco::HitPairListPtr &hitPairVector, reco::PrincipalComponents &pca, bool updateAvePos=false) const
std::list< const reco::ClusterHit2D * > Hit2DListPtr
export some data structure definitions
Definition: Cluster3D.h:334
void PCAAnalysis_calc3DDocas(const reco::HitPairListPtr &hitPairVector, const reco::PrincipalComponents &pca) const
void PCAAnalysis_3D(const reco::HitPairListPtr &hitPairList, reco::PrincipalComponents &pca, bool skeletonOnly=false) const
PrincipalComponentsAlg(fhicl::ParameterSet const &pset)
Constructor.
void reconfigure(fhicl::ParameterSet const &pset)
a handler for the case where the algorithm control parameters are to be reset
int PCAAnalysis_reject2DOutliers(const reco::HitPairListPtr &hitPairVector, reco::PrincipalComponents &pca, double aveHitDoca) const
art framework interface to geometry description
void PCAAnalysis(const reco::HitPairListPtr &hitPairVector, reco::PrincipalComponents &pca, double doca3DScl=3.) const
Run the Principal Components Analysis.
double m_parallel
means lines are parallel
int PCAAnalysis_reject3DOutliers(const reco::HitPairListPtr &hitPairVector, const reco::PrincipalComponents &pca, double aveHitDoca) const
std::list< const reco::ClusterHit3D * > HitPairListPtr
Definition: Cluster3D.h:335
The geometry of one entire detector, as served by art.
Definition: Geometry.h:196
void getHit2DPocaToAxis(const TVector3 &axisPos, const TVector3 &axisDir, const reco::ClusterHit2D *hit2D, TVector3 &poca, double &arcLenAxis, double &arcLenWire, double &doca)
This is used to get the poca, doca and arclen along cluster axis to 2D hit.
void PCAAnalysis_calc2DDocas(const reco::Hit2DListPtr &hit2DVector, const reco::PrincipalComponents &pca) const
const detinfo::DetectorProperties * m_detector