LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ConnectionPathwayFeatureTool.h
Go to the documentation of this file.
1 
8 #ifndef LAR_CONNECTION_PATHWAY_FEATURE_TOOLS_H
9 #define LAR_CONNECTION_PATHWAY_FEATURE_TOOLS_H 1
10 
11 #include "Pandora/PandoraInternal.h"
12 
14 
16 
18 
19 namespace lar_content
20 {
21 
23 
24 //------------------------------------------------------------------------------------------------------------------------------------------
25 
29 class InitialRegionFeatureTool : public ConnectionPathwayFeatureTool
30 {
31 public:
36 
37  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm,
38  const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D,
39  const ProtoShowerMatch &protoShowerMatch, const pandora::CartesianPointVector &showerStarts3D);
40 
41  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
42  const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D,
43  const ProtoShowerMatch &protoShowerMatch, const pandora::CartesianPointVector &showerStarts3D);
44 
45 private:
46  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
47 
58  void GetViewInitialRegionVariables(const pandora::Algorithm *const pAlgorithm, const pandora::CartesianVector &nuVertex3D,
59  const ProtoShowerMatch &protoShowerMatch, const pandora::HitType hitType, float &initialGapSize, float &largestGapSize) const;
60 
62  unsigned int m_nHitsToConsider;
65 };
66 
67 //------------------------------------------------------------------------------------------------------------------------------------------
68 
72 class ConnectionRegionFeatureTool : public ConnectionPathwayFeatureTool
73 {
74 public:
79 
80  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm,
81  const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D,
82  const ProtoShowerMatch &protoShowerMatch, const pandora::CartesianPointVector &showerStarts3D);
83 
84  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
85  const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D,
86  const ProtoShowerMatch &protoShowerMatch, const pandora::CartesianPointVector &showerStarts3D);
87 
88 private:
89  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
90 
100  float Get2DKink(const pandora::Algorithm *const pAlgorithm, const ProtoShowerMatch &protoShowerMatch,
101  const pandora::CartesianVector &showerStart3D) const;
102 
113  float GetLargest2DKinkFromView(const pandora::Algorithm *const pAlgorithm, const TwoDSlidingFitResult &spineFit,
114  const pandora::HitType hitType, const pandora::CartesianVector &showerStart3D) const;
115 
117  unsigned int m_spineFitWindow;
121 };
122 
123 //------------------------------------------------------------------------------------------------------------------------------------------
124 
128 class ShowerRegionFeatureTool : public ConnectionPathwayFeatureTool
129 {
130 public:
135 
136  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm,
137  const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D,
138  const ProtoShowerMatch &protoShowerMatch, const pandora::CartesianPointVector &showerStarts3D);
139 
140  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
141  const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D,
142  const ProtoShowerMatch &protoShowerMatch, const pandora::CartesianPointVector &showerStarts3D);
143 
144 private:
145  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
146 
165  void GetViewShowerRegionVariables(const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pShowerPfo,
166  const pandora::CartesianVector &nuVertex3D, const ProtoShowerMatch &protoShowerMatch, const pandora::HitType hitType,
167  const pandora::CartesianVector &showerStart3D, float &nHits, float &foundHitRatio, float &scatterAngle, float &openingAngle,
168  float &nuVertexEnergyAsymmetry, float &nuVertexEnergyWeightedMeanRadialDistance, float &showerStartEnergyAsymmetry,
169  float &showerStartMoliereRadius);
170 
182  void BuildViewShower(const pandora::ParticleFlowObject *const pShowerPfo, const TwoDSlidingFitResult &spineFit,
183  const pandora::HitType hitType, const pandora::CartesianVector &showerStart2D, const pandora::CartesianVector &nuVertex2D,
184  pandora::CaloHitList &postShowerHitList, pandora::CartesianPointVector &postShowerPositions);
185 
196  void GetShowerHitVariables(const pandora::CaloHitList &spineHitList, const pandora::CaloHitList &postShowerHitList,
197  const pandora::ParticleFlowObject *const pShowerPfo, const pandora::HitType hitType, float &nHits, float &foundHitRatio);
198 
208  void CalculateViewScatterAngle(const pandora::CartesianVector &nuVertex2D, const TwoDSlidingFitResult &spineFitResult,
209  const pandora::CartesianVector &showerStart2D, const TwoDSlidingFitResult &showerFitResult, float &scatterAngle);
210 
219  void CalculateViewOpeningAngle(const TwoDSlidingFitResult &showerFitResult, const pandora::CaloHitList &postShowerHitList,
220  const pandora::CartesianVector &showerStart2D, float &openingAngle);
221 
232  void CalculateViewNuVertexConsistencyVariables(const TwoDSlidingFitResult &spineFitResult,
233  const pandora::CaloHitList &postShowerHitList, const bool isDownstream, const pandora::CartesianVector &nuVertex2D,
234  float &nuVertexEnergyAsymmetry, float &nuVertexEnergyWeightedMeanRadialDistance);
235 
245  void CalculateViewShowerStartConsistencyVariables(const TwoDSlidingFitResult &showerFitResult, const pandora::CaloHitList &postShowerHitList,
246  const bool isShowerDownstream, float &showerStartEnergyAsymmetry, float &showerStartMoliereRadius);
247 
250  unsigned int m_spineFitWindow;
252  unsigned int m_showerFitWindow;
253  float m_edgeStep;
261 };
262 
263 //------------------------------------------------------------------------------------------------------------------------------------------
264 
268 class AmbiguousRegionFeatureTool : public ConnectionPathwayFeatureTool
269 {
270 public:
275 
276  void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm,
277  const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D,
278  const ProtoShowerMatch &protoShowerMatch, const pandora::CartesianPointVector &showerStarts3D);
279 
280  void Run(LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName,
281  const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D,
282  const ProtoShowerMatch &protoShowerMatch, const pandora::CartesianPointVector &showerStarts3D);
283 
284 private:
285  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
286 
293  void CalculateNAmbiguousViews(const ProtoShowerMatch &protoShowerMatch, float &nAmbiguousViews);
294 
306  bool GetViewAmbiguousHitVariables(const pandora::Algorithm *const pAlgorithm, const ProtoShowerMatch &protoShowerMatch,
307  const pandora::HitType hitType, const pandora::CartesianVector &nuVertex3D, float &unaccountedHitEnergy);
308 
319  void BuildAmbiguousSpines(const pandora::Algorithm *const pAlgorithm, const pandora::HitType hitType, const ProtoShower &protoShower,
320  const pandora::CartesianVector &nuVertex2D, std::map<int, pandora::CaloHitList> &ambiguousHitSpines,
321  pandora::CaloHitList &hitsToExcludeInEnergyCalcs);
322 
332  pandora::StatusCode GetHitListOfType(
333  const pandora::Algorithm *const pAlgorithm, const pandora::HitType hitType, const pandora::CaloHitList *&pCaloHitList) const;
334 
344  pandora::CaloHitList FindAmbiguousContinuousSpine(
345  const pandora::CaloHitList &caloHitList, const pandora::CaloHitList &ambiguousHitList, const pandora::CartesianVector &nuVertex2D);
346 
348  std::string m_caloHitListNameU;
349  std::string m_caloHitListNameV;
350  std::string m_caloHitListNameW;
352  unsigned int m_maxSampleHits;
355 };
356 
357 } // namespace lar_content
358 
359 #endif // #ifndef LAR_CONNECTION_PATHWAY_FEATURE_TOOLS_H
float m_maxTransverseDistance
The max. proximity of a hits, included in a trajectory energy calcs.
float m_edgeStep
The binning of the shower boundaries.
std::string m_caloHitListNameW
The event W view hit list.
float m_maxFoundHitRatioLimit
maxFoundHitRatio max. limit
Header file for the ProtoShower class.
float m_maxInitialGapSizeLimit
maxInitialGapSizeLimit max. limit
MvaTypes::MvaFeatureVector MvaFeatureVector
Definition: LArMvaHelper.h:75
ConnectionRegionFeatureTool to calculate variables related to the connection pathway region...
AmbiguousRegionFeatureTool to calculate variables related to the shower region.
float m_maxNuVertexEnergyWeightedMeanRadialDistanceLimit
maxNuVertexEnergyWeightedMeanRadialDistance max. limit
float m_maxOpeningAngleLimit
maxOpeningAngle max. limit
unsigned int m_spineFitWindow
The spine fit window.
float m_maxScatterAngleLimit
maxScatterAngle max. limit
unsigned int m_showerFitWindow
The shower fit window.
MvaTypes::MvaFeatureMap MvaFeatureMap
Definition: LArMvaHelper.h:78
unsigned int m_spineFitWindow
The spine fit window.
ProtoShowerMatch class.
std::string m_caloHitListNameU
The event U view hit list.
float m_defaultRatio
Default float value for ratios.
float m_minLargestGapSizeLimit
minLargestGapSizeLimit max. limit
float m_showerRadius
The max. separation distance between a shower region hit and the shower core.
InitialRegionFeatureTool to calculate variables related to the initial shower region.
unsigned int m_nHitsToConsider
The number of hits which defines the initial region.
float m_pathwayScatteringAngle2DLimit
pathwayScatteringAngle2DLimit max. limit
void GetViewInitialRegionVariables(const pandora::Algorithm *const pAlgorithm, const pandora::CartesianVector &nuVertex3D, const ProtoShowerMatch &protoShowerMatch, const pandora::HitType hitType, float &initialGapSize, float &largestGapSize) const
Calculate the initial region variables for the input view.
float m_moliereFraction
The energy fraction which corresponds to minShowerStartMoliereRadius.
Header file for the lar two dimensional sliding fit result class.
void Run(LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D, const ProtoShowerMatch &protoShowerMatch, const pandora::CartesianPointVector &showerStarts3D)
unsigned int m_maxSampleHits
The max. number of hits considered in the spine energy calcs.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
ShowerRegionFeatureTool to calculate variables related to the shower region.
ProtoShower class.
float m_pathwayLengthLimit
pathwayLengthLimit max. limit
HitType
Definition: HitType.h:12
float m_maxHitSeparation
The max. separation of connected hits.
std::string m_caloHitListNameV
The event V view hit list.
MvaFeatureTool class template.
Definition: LArMvaHelper.h:33
float m_maxTrackFraction
The fraction of found hits which are considered in the energy calcs.
int m_nLayersHalfWindow
The half window of each segment.
MvaFeatureTool< const pandora::Algorithm *const, const pandora::ParticleFlowObject *const, const pandora::CartesianVector &, const ProtoShowerMatch &, const pandora::CartesianPointVector & > ConnectionPathwayFeatureTool
float m_minShowerStartMoliereRadiusLimit
minShowerStartMoliereRadius max. limit