LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TrackShowerIdFeatureTool.h
Go to the documentation of this file.
1 
8 #ifndef LAR_TRACK_SHOWER_ID_FEATURE_TOOLS_H
9 #define LAR_TRACK_SHOWER_ID_FEATURE_TOOLS_H 1
10 
12 
13 #include "Pandora/PandoraInternal.h"
14 
15 namespace lar_content
16 {
17 
20 
21 //------------------------------------------------------------------------------------------------------------------------------------------
22 
26 class TwoDShowerFitFeatureTool : public ClusterCharacterisationFeatureTool
27 {
28 public:
33 
34  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster);
35  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
36  const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster);
37 
38 private:
39  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
40 
49  float CalculateShowerFitWidth(const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster) const;
50 
51  unsigned int m_slidingShowerFitWindow;
52  unsigned int m_slidingLinearFitWindow;
53 };
54 
55 //------------------------------------------------------------------------------------------------------------------------------------------
56 
60 class TwoDLinearFitFeatureTool : public ClusterCharacterisationFeatureTool
61 {
62 public:
67 
68  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster);
69  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
70  const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster);
71 
72 private:
73  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
74 
86  void CalculateVariablesSlidingLinearFit(const pandora::Cluster *const pCluster, float &straightLineLengthLarge, float &diffWithStraigthLineMean,
87  float &diffWithStraightLineSigma, float &dTdLWidth, float &maxFitGapLength, float &rmsSlidingLinearFit) const;
88 
89  unsigned int m_slidingLinearFitWindow;
91 };
92 
93 //------------------------------------------------------------------------------------------------------------------------------------------
94 
98 class TwoDVertexDistanceFeatureTool : public ClusterCharacterisationFeatureTool
99 {
100 public:
105 
106  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster);
107  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
108  const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster);
109 
110 private:
111  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
112 
120  float CalculateVertexDistance(const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster) const;
121 
123 };
124 
125 //------------------------------------------------------------------------------------------------------------------------------------------
126 
130 class PfoHierarchyFeatureTool : public PfoCharacterisationFeatureTool
131 {
132 public:
137 
138  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
139  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
140  const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
141 
142 private:
143  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
144 };
145 
146 //------------------------------------------------------------------------------------------------------------------------------------------
147 
151 class ThreeDLinearFitFeatureTool : public PfoCharacterisationFeatureTool
152 {
153 public:
158 
159  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
160  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
161  const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
162 
163 private:
164  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
165 
177  void CalculateVariablesSlidingLinearFit(const pandora::Cluster *const pCluster, float &straightLineLengthLarge,
178  float &diffWithStraigthLineMean, float &maxFitGapLength, float &rmsSlidingLinearFit) const;
179 
182 };
183 
184 //------------------------------------------------------------------------------------------------------------------------------------------
185 
189 class ThreeDVertexDistanceFeatureTool : public PfoCharacterisationFeatureTool
190 {
191 public:
196 
197  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
198  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
199  const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
200 
201 private:
202  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
203 };
204 
205 //------------------------------------------------------------------------------------------------------------------------------------------
206 
210 class ConeChargeFeatureTool : public PfoCharacterisationFeatureTool
211 {
212 public:
217 
218  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
219  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
220  const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
221 
222 private:
223  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
224 
234  unsigned int m_conMinHits;
235  float m_minCharge;
239 
250  void CalculateChargeDistribution(const pandora::CaloHitList &caloHitList, const pandora::CartesianVector &pfoStart,
251  const pandora::CartesianVector &pfoDir, float &chargeCore, float &chargeHalo, float &chargeCon);
252 
262  float CalculateConicalness(const pandora::CaloHitList &caloHitList, const pandora::CartesianVector &pfoStart,
263  const pandora::CartesianVector &pfoDir, const float pfoLength);
264 };
265 
266 //------------------------------------------------------------------------------------------------------------------------------------------
267 
271 class ThreeDOpeningAngleFeatureTool : public PfoCharacterisationFeatureTool
272 {
273 public:
278 
279  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
280  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
281  const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
282 
283 private:
284  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
285 
293  void Divide3DCaloHitList(const pandora::Algorithm *const pAlgorithm, const pandora::CaloHitList &threeDCaloHitList,
294  pandora::CartesianPointVector &pointVectorStart, pandora::CartesianPointVector &pointVectorEnd);
295 
305  float OpeningAngle(const pandora::CartesianVector &principal, const pandora::CartesianVector &secondary,
306  const pandora::CartesianVector &eigenValues) const;
307 
310 };
311 
312 //------------------------------------------------------------------------------------------------------------------------------------------
313 
317 class ThreeDPCAFeatureTool : public PfoCharacterisationFeatureTool
318 {
319 public:
324 
325  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
326  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
327  const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
328 
329 private:
330  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
331 };
332 
333 //------------------------------------------------------------------------------------------------------------------------------------------
334 
338 class ThreeDChargeFeatureTool : public PfoCharacterisationFeatureTool
339 {
340 public:
345 
350  {
351  public:
355  VertexComparator(const pandora::CartesianVector vertexPosition2D);
356 
364  bool operator()(const pandora::CaloHit *const left, const pandora::CaloHit *const right) const;
365 
366  pandora::CartesianVector m_neutrinoVertex; //The neutrino vertex used to sort
367  };
368 
369  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
370  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
371  const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo);
372 
373 private:
385  void CalculateChargeVariables(const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster, float &totalCharge,
386  float &chargeSigma, float &chargeMean, float &endCharge);
387 
396  void OrderCaloHitsByDistanceToVertex(
397  const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster, pandora::CaloHitList &caloHitList);
398 
399  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
400 
402 };
403 
404 } // namespace lar_content
405 
406 #endif // #ifndef LAR_TRACK_SHOWER_ID_FEATURE_TOOLS_H
ConeChargeFeatureTool class for the calculation of charge distribution and conicalness.
ThreeDLinearFitFeatureTool class for the calculation of variables related to 3d sliding linear fit...
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102
MvaTypes::MvaFeatureVector MvaFeatureVector
Definition: LArMvaHelper.h:75
float m_hitFraction
Fraction of hits in start and end of pfo.
MvaFeatureTool< const pandora::Algorithm *const, const pandora::ParticleFlowObject *const > PfoCharacterisationFeatureTool
ThreeDVertexDistanceFeatureTool class for the calculation of 3d distance to neutrino vertex...
PfoHierarchyFeatureTool for calculation of features relating to reconstructed particle hierarchy...
unsigned int m_slidingShowerFitWindow
The sliding shower fit window.
MvaTypes::MvaFeatureMap MvaFeatureMap
Definition: LArMvaHelper.h:78
unsigned int m_conMinHits
Configurable parameters to calculate cone charge variables.
void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster)
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
MvaFeatureTool< const pandora::Algorithm *const, const pandora::Cluster *const > ClusterCharacterisationFeatureTool
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
TwoDVertexDistanceFeatureTool class for the calculation of 2d distance to neutrino vertex...
float CalculateShowerFitWidth(const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster) const
Calculation of the shower fit width variable.
unsigned int m_slidingLinearFitWindowLarge
The sliding linear fit window - should be large, providing a simple linear fit.
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
ThreeDChargeFeatureTool class for the calculation of charge-related features.
VertexComparator class for comparison of two points wrt neutrino vertex position. ...
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:94
unsigned int m_slidingLinearFitWindowLarge
The sliding linear fit window - should be large, providing a simple linear fit.
float m_defaultValue
Default value to return, in case calculation not feasible.
ThreeDPCAFeatureTool class for the calculation of PCA-related variables.
TwoDShowerFitFeatureTool to calculate variables related to sliding shower fit.
float m_endChargeFraction
Fraction of hits that will be considered to calculate end charge (default 10%)
TwoDLinearFitFeatureTool class for the calculation of variables related to 2d sliding linear fit...
MvaFeatureTool class template.
Definition: LArMvaHelper.h:33
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
ThreeDOpeningAngleFeatureTool class for the calculation of distance to neutrino vertex.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)