LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ElectronInitialRegionRefinementAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_ELECTRON_INITIAL_REGION_REFINEMENT_ALGORITHM_H
9 #define LAR_ELECTRON_INITIAL_REGION_REFINEMENT_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
19 
20 namespace lar_content
21 {
22 
26 class ElectronInitialRegionRefinementAlgorithm : public pandora::Algorithm
27 {
28 public:
33 
34 private:
35  typedef std::map<const pandora::MCParticle *, pandora::CaloHitList> HitOwnershipMap;
36 
37  pandora::StatusCode Run();
38  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
39 
45  void FillShowerPfoVector(pandora::PfoVector &showerPfoVector) const;
46 
52  void RefineShower(const pandora::ParticleFlowObject *const pShowerPfo) const;
53 
61  pandora::StatusCode GetNeutrinoVertex(pandora::CartesianVector &nuVertex3D) const;
62 
71  void BuildViewProtoShowers(const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D,
72  pandora::HitType hitType, ProtoShowerVector &protoShowerVector) const;
73 
82  pandora::StatusCode GetHitListOfType(const pandora::HitType hitType, const pandora::CaloHitList *&pCaloHitList) const;
83 
93  pandora::CartesianVector GetShowerVertex(const pandora::ParticleFlowObject *const pShowerPfo, const pandora::HitType hitType,
94  const pandora::CartesianVector &nuVertex3D) const;
95 
105  void RefineShowerVertex(const pandora::ParticleFlowObject *const pShowerPfo, const pandora::HitType hitType,
106  const pandora::CartesianVector &nuVertex3D, const pandora::CartesianVector &peakDirection, pandora::CartesianVector &showerVertexPosition) const;
107 
117  bool IsShowerConnected(const pandora::CartesianVector &showerVertexPosition, const pandora::CartesianVector &nuVertex2D,
118  const pandora::CartesianVector &peakDirection) const;
119 
131  bool IsSpineCoincident(const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D,
132  const pandora::HitType hitType, const pandora::CartesianVector &showerVertex, const pandora::CaloHitList &showerSpineHitList) const;
133 
143  void BuildViewPathways(const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CaloHitList &protectedHits,
144  const pandora::CartesianVector &nuVertex3D, pandora::HitType hitType, ConnectionPathwayVector &viewPathways) const;
145 
154  void RefineHitsToAdd(const pandora::CartesianVector &nuVertex3D, const pandora::HitType hitType,
155  const ConnectionPathwayVector &viewPathways, ProtoShower &protoShower) const;
156 
164  void FindContinuousPath(const pandora::CaloHitList &refinedHitList, const pandora::CartesianVector &nuVertex2D,
165  pandora::CaloHitList &continuousHitList) const;
166 
173  void SetMetadata(const pandora::ParticleFlowObject *const pShowerPfo, const LArMvaHelper::MvaFeatureMap &featureMap) const;
174 
180  void FillElectronHitMap(HitOwnershipMap &electronHitMap) const;
181 
188  bool IsElectron(const pandora::ParticleFlowObject *const pShowerPfo, const HitOwnershipMap &electronHitMap) const;
189 
196  std::string m_showerPfoListName;
198  std::string m_caloHitListNameU;
199  std::string m_caloHitListNameV;
200  std::string m_caloHitListNameW;
201  unsigned int m_minShowerHits3D;
206  std::string m_trainingFileName;
209  unsigned int m_minNConnectedHits;
216  pandora::StringVector m_algorithmToolNames;
217 };
218 
219 } // namespace lar_content
220 
221 #endif // #ifndef LAR_ELECTRON_INITIAL_REGION_REFINEMENT
Header file for the connection pathway feature tools.
float m_unambiguousThreshold
The min. transverse distance of an unambiguous shower hit from another pathway direction.
float m_maxSeparationFromHit
The max. separation between the projected 3D shower start and the closest 2D shower hit...
Header file for the ProtoShower class.
bool IsElectron(const pandora::ParticleFlowObject *const pShowerPfo, const HitOwnershipMap &electronHitMap) const
To determine whether a pfo is a true leading electron via its completeness and purity.
void SetMetadata(const pandora::ParticleFlowObject *const pShowerPfo, const LArMvaHelper::MvaFeatureMap &featureMap) const
Add the shower characterisation information to the pfo metadata.
pandora::StatusCode GetNeutrinoVertex(pandora::CartesianVector &nuVertex3D) const
Obtain the reconstructed neutrino vertex.
float m_minSpinePurity
The min. purity of a coincident shower spine downstream of the shower vertex.
ShowerSpineFinderTool * m_pShowerSpineFinderTool
The shower spine finder tool for the shower.
bool IsShowerConnected(const pandora::CartesianVector &showerVertexPosition, const pandora::CartesianVector &nuVertex2D, const pandora::CartesianVector &peakDirection) const
To determine whether the shower vertex lies on the connection pathway.
float m_maxConnectionDistance
The max. distance between connected hits.
PeakDirectionFinderTool * m_pShowerPeakDirectionFinderTool
The shower initial pathway direction finder tool.
Header file for the shower start finder tool class.
float m_maxXSeparation
The max. drift-coordinate separation between a 3D shower start and a matched 2D shower hit...
void FillShowerPfoVector(pandora::PfoVector &showerPfoVector) const
Obtain a sorted vector of the reconstructed shower pfos.
void BuildViewProtoShowers(const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D, pandora::HitType hitType, ProtoShowerVector &protoShowerVector) const
Build the 2D ProtoShower objects for a given view.
MvaTypes::MvaFeatureMap MvaFeatureMap
Definition: LArMvaHelper.h:78
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::string m_trainingFileName
The name of the output training file name.
unsigned int m_minNConnectedHits
The number of connected hits needed for a conntected pathway.
float m_maxCoincidenceTransverseSeparation
The max. transverse distance from the pathway direction of a coincident shower vertex.
float m_minElectronCompleteness
The min. completeness of an electron-like pfo.
ShowerStartFinderTool * m_pShowerStartFinderTool
The shower start finder tool.
bool m_trainingMode
Whether to run the algorithm to train the BDT.
std::map< std::string, MvaFeatureTool< Ts... > * > FeatureToolMap
Definition: LArMvaHelper.h:37
void RefineShower(const pandora::ParticleFlowObject *const pShowerPfo) const
Find and evaluate shower connection pathway, removing if necessary.
void FillElectronHitMap(HitOwnershipMap &electronHitMap) const
Determine the one-to-one mapping of leading MCParticle electrons and the hits which contain their ene...
PeakDirectionFinderTool * m_pEventPeakDirectionFinderTool
The other (not incl. shower) initial pathway direction finder tool.
std::vector< ConnectionPathway > ConnectionPathwayVector
pandora::CartesianVector GetShowerVertex(const pandora::ParticleFlowObject *const pShowerPfo, const pandora::HitType hitType, const pandora::CartesianVector &nuVertex3D) const
Fit the shower to obtain a 2D shower vertex.
bool IsSpineCoincident(const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CartesianVector &nuVertex3D, const pandora::HitType hitType, const pandora::CartesianVector &showerVertex, const pandora::CaloHitList &showerSpineHitList) const
To determine if the hits downstream of the shower vertex lie within the shower.
void FindContinuousPath(const pandora::CaloHitList &refinedHitList, const pandora::CartesianVector &nuVertex2D, pandora::CaloHitList &continuousHitList) const
Find the continuous path of hits that lies closest to a given point.
unsigned int m_minShowerHits3D
The min. number of hits of a significant shower.
void BuildViewPathways(const pandora::ParticleFlowObject *const pShowerPfo, const pandora::CaloHitList &protectedHits, const pandora::CartesianVector &nuVertex3D, pandora::HitType hitType, ConnectionPathwayVector &viewPathways) const
Build the connection pathways of all other particles in the event.
ProtoShowerMatchingTool * m_pProtoShowerMatchingTool
The 2D -> 3D ProtoShower matching tool.
ProtoShower class.
void RefineHitsToAdd(const pandora::CartesianVector &nuVertex3D, const pandora::HitType hitType, const ConnectionPathwayVector &viewPathways, ProtoShower &protoShower) const
Determine the continuous and unambiguous hits to add to an electron-like shower pfo.
Header file for the ProtoShower matching tool class.
float m_maxProjectionSeparation
The max. separation between the projected 3D shower start and the shower start of that view...
ConnectionPathwayFeatureTool::FeatureToolMap m_featureToolMap
The feature tool map.
Header file for the peak direction finder tool class.
HitType
Definition: HitType.h:12
std::vector< ProtoShower > ProtoShowerVector
pandora::StatusCode GetHitListOfType(const pandora::HitType hitType, const pandora::CaloHitList *&pCaloHitList) const
Obtain the event hit list of a given view.
ShowerSpineFinderTool * m_pEventPathwayFinderTool
The shower spine finder tool for all other event particles.
Header file for the peak direction finder tool class.
std::map< const pandora::MCParticle *, pandora::CaloHitList > HitOwnershipMap
unsigned int m_showerSlidingFitWindow
The sliding fit window for shower fits.
void RefineShowerVertex(const pandora::ParticleFlowObject *const pShowerPfo, const pandora::HitType hitType, const pandora::CartesianVector &nuVertex3D, const pandora::CartesianVector &peakDirection, pandora::CartesianVector &showerVertexPosition) const
Move the shower vertex closer to the connection pathway.