LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
ElectronInitialRegionRefinementAlgorithm class. More...
#include "ElectronInitialRegionRefinementAlgorithm.h"
Public Member Functions | |
ElectronInitialRegionRefinementAlgorithm () | |
Default constructor. More... | |
Private Types | |
typedef std::map< const pandora::MCParticle *, pandora::CaloHitList > | HitOwnershipMap |
Private Member Functions | |
pandora::StatusCode | Run () |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
void | FillShowerPfoVector (pandora::PfoVector &showerPfoVector) const |
Obtain a sorted vector of the reconstructed shower pfos. More... | |
void | RefineShower (const pandora::ParticleFlowObject *const pShowerPfo) const |
Find and evaluate shower connection pathway, removing if necessary. More... | |
pandora::StatusCode | GetNeutrinoVertex (pandora::CartesianVector &nuVertex3D) const |
Obtain the reconstructed neutrino vertex. More... | |
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. More... | |
pandora::StatusCode | GetHitListOfType (const pandora::HitType hitType, const pandora::CaloHitList *&pCaloHitList) const |
Obtain the event hit list of a given view. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
void | SetMetadata (const pandora::ParticleFlowObject *const pShowerPfo, const LArMvaHelper::MvaFeatureMap &featureMap) const |
Add the shower characterisation information to the pfo metadata. More... | |
void | FillElectronHitMap (HitOwnershipMap &electronHitMap) const |
Determine the one-to-one mapping of leading MCParticle electrons and the hits which contain their energy depositions. More... | |
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. More... | |
Private Attributes | |
PeakDirectionFinderTool * | m_pShowerPeakDirectionFinderTool |
The shower initial pathway direction finder tool. More... | |
PeakDirectionFinderTool * | m_pEventPeakDirectionFinderTool |
The other (not incl. shower) initial pathway direction finder tool. More... | |
ShowerSpineFinderTool * | m_pShowerSpineFinderTool |
The shower spine finder tool for the shower. More... | |
ShowerSpineFinderTool * | m_pEventPathwayFinderTool |
The shower spine finder tool for all other event particles. More... | |
ShowerStartFinderTool * | m_pShowerStartFinderTool |
The shower start finder tool. More... | |
ProtoShowerMatchingTool * | m_pProtoShowerMatchingTool |
The 2D -> 3D ProtoShower matching tool. More... | |
std::string | m_showerPfoListName |
The shower pfo list name. More... | |
std::string | m_neutrinoVertexListName |
The neutrino vertex list name. More... | |
std::string | m_caloHitListNameU |
The U calo hit list name. More... | |
std::string | m_caloHitListNameV |
The V calo hit list name. More... | |
std::string | m_caloHitListNameW |
The W calo hit list name. More... | |
unsigned int | m_minShowerHits3D |
The min. number of hits of a significant shower. More... | |
unsigned int | m_showerSlidingFitWindow |
The sliding fit window for shower fits. More... | |
float | m_maxCoincidenceTransverseSeparation |
The max. transverse distance from the pathway direction of a coincident shower vertex. More... | |
float | m_minSpinePurity |
The min. purity of a coincident shower spine downstream of the shower vertex. More... | |
bool | m_trainingMode |
Whether to run the algorithm to train the BDT. More... | |
std::string | m_trainingFileName |
The name of the output training file name. More... | |
float | m_unambiguousThreshold |
The min. transverse distance of an unambiguous shower hit from another pathway direction. More... | |
float | m_maxConnectionDistance |
The max. distance between connected hits. More... | |
unsigned int | m_minNConnectedHits |
The number of connected hits needed for a conntected pathway. More... | |
float | m_minElectronCompleteness |
The min. completeness of an electron-like pfo. More... | |
float | m_minElectronPurity |
The min. purity of an electron-like pfo. More... | |
float | m_maxSeparationFromHit |
The max. separation between the projected 3D shower start and the closest 2D shower hit. More... | |
float | m_maxProjectionSeparation |
The max. separation between the projected 3D shower start and the shower start of that view. More... | |
float | m_maxXSeparation |
The max. drift-coordinate separation between a 3D shower start and a matched 2D shower hit. More... | |
ConnectionPathwayFeatureTool::FeatureToolMap | m_featureToolMap |
The feature tool map. More... | |
pandora::StringVector | m_algorithmToolNames |
The algorithm tool names. More... | |
ElectronInitialRegionRefinementAlgorithm class.
Definition at line 26 of file ElectronInitialRegionRefinementAlgorithm.h.
|
private |
Definition at line 35 of file ElectronInitialRegionRefinementAlgorithm.h.
lar_content::ElectronInitialRegionRefinementAlgorithm::ElectronInitialRegionRefinementAlgorithm | ( | ) |
Default constructor.
Definition at line 32 of file ElectronInitialRegionRefinementAlgorithm.cc.
|
private |
Build the connection pathways of all other particles in the event.
pShowerPfo | the input shower pfo |
protectedHits | the list of protected hits which will not be considered |
nuVertex3D | the 3D neutrino vertex |
hitType | the 2D view |
viewPathways | the output vector of found connection pathways |
Definition at line 404 of file ElectronInitialRegionRefinementAlgorithm.cc.
References lar_content::LArPfoHelper::GetCaloHits(), GetHitListOfType(), m_pEventPathwayFinderTool, m_pEventPeakDirectionFinderTool, lar_content::LArGeometryHelper::ProjectPosition(), lar_content::ShowerSpineFinderTool::Run(), and lar_content::PeakDirectionFinderTool::Run().
Referenced by RefineShower().
|
private |
Build the 2D ProtoShower objects for a given view.
pShowerPfo | the input shower pfo |
nuVertex3D | the 3D neutrino vertex |
hitType | the 2D view |
protoShowerVector | the output vector of ProtoShower objects |
Definition at line 191 of file ElectronInitialRegionRefinementAlgorithm.cc.
References lar_content::ProtoShower::AddHitToAdd(), f, lar_content::LArPfoHelper::GetCaloHits(), GetHitListOfType(), GetShowerVertex(), IsSpineCoincident(), m_pShowerPeakDirectionFinderTool, m_pShowerSpineFinderTool, m_pShowerStartFinderTool, lar_content::LArGeometryHelper::ProjectPosition(), RefineShowerVertex(), lar_content::ShowerSpineFinderTool::Run(), lar_content::PeakDirectionFinderTool::Run(), and lar_content::ShowerStartFinderTool::Run().
Referenced by RefineShower().
|
private |
Determine the one-to-one mapping of leading MCParticle electrons and the hits which contain their energy depositions.
electronHitMap | the output [MCParticle -> CaloHitList] map |
Definition at line 591 of file ElectronInitialRegionRefinementAlgorithm.cc.
References util::abs(), f, GetHitListOfType(), lar_content::LArMCParticleHelper::GetPrimaryMCParticle(), and weight.
Referenced by RefineShower().
|
private |
Obtain a sorted vector of the reconstructed shower pfos.
showerPfoVector | the sorted shower vector to be filled |
Definition at line 77 of file ElectronInitialRegionRefinementAlgorithm.cc.
References m_showerPfoListName, and lar_content::LArPfoHelper::SortByNHits().
Referenced by Run().
|
private |
Find the continuous path of hits that lies closest to a given point.
refinedHitList | the input hit list |
nuVertex2D | the given point (the 2D neutrino vertex) |
continuousHitList | the input hit list to be filled |
Definition at line 483 of file ElectronInitialRegionRefinementAlgorithm.cc.
References lar_content::LArClusterHelper::GetClosestDistance(), m_maxConnectionDistance, and m_minNConnectedHits.
Referenced by RefineHitsToAdd().
|
private |
Obtain the event hit list of a given view.
hitType | the 2D view |
pCaloHitList | the output 2D hit list |
Definition at line 268 of file ElectronInitialRegionRefinementAlgorithm.cc.
References m_caloHitListNameU, m_caloHitListNameV, and m_caloHitListNameW.
Referenced by BuildViewPathways(), BuildViewProtoShowers(), and FillElectronHitMap().
|
private |
Obtain the reconstructed neutrino vertex.
nuVertex3D | the output neutrino vertex |
Definition at line 167 of file ElectronInitialRegionRefinementAlgorithm.cc.
References m_neutrinoVertexListName.
Referenced by RefineShower().
|
private |
Fit the shower to obtain a 2D shower vertex.
pShowerPfo | the input shower pfo |
hitType | the 2D view |
nuVertex3D | the 3D neutrino vertex |
Definition at line 289 of file ElectronInitialRegionRefinementAlgorithm.cc.
References lar_content::LArPfoHelper::GetClusters(), lar_content::LArGeometryHelper::GetWirePitch(), m_showerSlidingFitWindow, and lar_content::LArGeometryHelper::ProjectPosition().
Referenced by BuildViewProtoShowers().
|
private |
To determine whether a pfo is a true leading electron via its completeness and purity.
pShowerPfo | the input shower pfo |
electronHitMap | the mapping of [MCParticle leading electrons -> their associated hits] |
Definition at line 640 of file ElectronInitialRegionRefinementAlgorithm.cc.
References lar_content::LArPfoHelper::GetCaloHits(), lar_content::LArMCParticleHelper::GetSharedHits(), m_minElectronCompleteness, and m_minElectronPurity.
Referenced by RefineShower().
|
private |
To determine whether the shower vertex lies on the connection pathway.
showerVertexPosition | the input 2D shower vertex position |
nuVertex2D | the 2D neutrino vertex |
peakDirection | the initial direction of the connection pathway |
Definition at line 349 of file ElectronInitialRegionRefinementAlgorithm.cc.
References f, and m_maxCoincidenceTransverseSeparation.
Referenced by RefineShowerVertex().
|
private |
To determine if the hits downstream of the shower vertex lie within the shower.
pShowerPfo | the input shower pfo |
nuVertex3D | the 3D neutrino vertex |
hitType | the 2D view |
showerVertex | the 2D shower vertex |
showerSpineHitList | the hits of the found shower spine |
Definition at line 369 of file ElectronInitialRegionRefinementAlgorithm.cc.
References lar_content::LArPfoHelper::GetCaloHits(), lar_content::LArMCParticleHelper::GetSharedHits(), m_minSpinePurity, and lar_content::LArGeometryHelper::ProjectPosition().
Referenced by BuildViewProtoShowers().
|
private |
Definition at line 674 of file ElectronInitialRegionRefinementAlgorithm.cc.
References lar_content::LArMvaHelper::AddFeatureToolToMap(), m_algorithmToolNames, m_caloHitListNameU, m_caloHitListNameV, m_caloHitListNameW, m_featureToolMap, m_maxCoincidenceTransverseSeparation, m_maxConnectionDistance, m_maxProjectionSeparation, m_maxSeparationFromHit, m_maxXSeparation, m_minElectronCompleteness, m_minElectronPurity, m_minNConnectedHits, m_minShowerHits3D, m_minSpinePurity, m_neutrinoVertexListName, m_pEventPathwayFinderTool, m_pEventPeakDirectionFinderTool, m_pProtoShowerMatchingTool, m_pShowerPeakDirectionFinderTool, m_pShowerSpineFinderTool, m_pShowerStartFinderTool, m_showerPfoListName, m_showerSlidingFitWindow, m_trainingFileName, m_trainingMode, m_unambiguousThreshold, and lar_content::LArMvaHelper::ProcessAlgorithmToolListToMap().
|
private |
Determine the continuous and unambiguous hits to add to an electron-like shower pfo.
nuVertex3D | the 3D neutrino vertex |
hitType | the 2D view |
viewPathways | the vector of other event connection pathways |
protoShower | the ProtoShower object associated with the input shower |
Definition at line 435 of file ElectronInitialRegionRefinementAlgorithm.cc.
References lar_content::ProtoShower::AddAmbiguousDirection(), lar_content::ProtoShower::AddAmbiguousHit(), FindContinuousPath(), lar_content::ProtoShower::GetAmbiguousDirectionVector(), lar_content::ProtoShower::GetConnectionPathway(), lar_content::ProtoShower::GetHitsToAddList(), lar_content::ConnectionPathway::GetStartDirection(), m_unambiguousThreshold, lar_content::LArGeometryHelper::ProjectPosition(), and lar_content::ProtoShower::SetHitsToAddList().
Referenced by RefineShower().
|
private |
Find and evaluate shower connection pathway, removing if necessary.
pShowerPfo | the input shower pfo |
Definition at line 97 of file ElectronInitialRegionRefinementAlgorithm.cc.
References BuildViewPathways(), BuildViewProtoShowers(), lar_content::LArMvaHelper::CalculateFeatures(), f, FillElectronHitMap(), lar_content::LArConnectionPathwayHelper::FindShowerStarts3D(), GetNeutrinoVertex(), IsElectron(), m_algorithmToolNames, m_featureToolMap, m_maxProjectionSeparation, m_maxSeparationFromHit, m_maxXSeparation, m_pProtoShowerMatchingTool, m_trainingFileName, m_trainingMode, lar_content::LArMvaHelper::ProduceTrainingExample(), RefineHitsToAdd(), lar_content::ProtoShowerMatchingTool::Run(), and SetMetadata().
Referenced by Run().
|
private |
Move the shower vertex closer to the connection pathway.
pShowerPfo | the input shower pfo |
hitType | the 2D view |
nuVertex3D | the 3D neutrino vertex |
peakDirection | the initial direction of the connection pathway |
showerVertexPosition | the (perhaps) refined 2D shower vertex position |
Definition at line 316 of file ElectronInitialRegionRefinementAlgorithm.cc.
References f, lar_content::LArPfoHelper::GetCaloHits(), IsShowerConnected(), m_maxCoincidenceTransverseSeparation, and lar_content::LArGeometryHelper::ProjectPosition().
Referenced by BuildViewProtoShowers().
|
private |
Definition at line 52 of file ElectronInitialRegionRefinementAlgorithm.cc.
References FillShowerPfoVector(), lar_content::LArPfoHelper::GetCaloHits(), m_minShowerHits3D, and RefineShower().
|
private |
Add the shower characterisation information to the pfo metadata.
pShowerPfo | the input shower pfo |
featureMap | the map of [characterisation variable -> value] |
Definition at line 533 of file ElectronInitialRegionRefinementAlgorithm.cc.
Referenced by RefineShower().
|
private |
The algorithm tool names.
Definition at line 216 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by ReadSettings(), and RefineShower().
|
private |
The U calo hit list name.
Definition at line 198 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by GetHitListOfType(), and ReadSettings().
|
private |
The V calo hit list name.
Definition at line 199 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by GetHitListOfType(), and ReadSettings().
|
private |
The W calo hit list name.
Definition at line 200 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by GetHitListOfType(), and ReadSettings().
|
private |
The feature tool map.
Definition at line 215 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by ReadSettings(), and RefineShower().
|
private |
The max. transverse distance from the pathway direction of a coincident shower vertex.
Definition at line 203 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by IsShowerConnected(), ReadSettings(), and RefineShowerVertex().
|
private |
The max. distance between connected hits.
Definition at line 208 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by FindContinuousPath(), and ReadSettings().
|
private |
The max. separation between the projected 3D shower start and the shower start of that view.
Definition at line 213 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by ReadSettings(), and RefineShower().
|
private |
The max. separation between the projected 3D shower start and the closest 2D shower hit.
Definition at line 212 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by ReadSettings(), and RefineShower().
|
private |
The max. drift-coordinate separation between a 3D shower start and a matched 2D shower hit.
Definition at line 214 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by ReadSettings(), and RefineShower().
|
private |
The min. completeness of an electron-like pfo.
Definition at line 210 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by IsElectron(), and ReadSettings().
|
private |
The min. purity of an electron-like pfo.
Definition at line 211 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by IsElectron(), and ReadSettings().
|
private |
The number of connected hits needed for a conntected pathway.
Definition at line 209 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by FindContinuousPath(), and ReadSettings().
|
private |
The min. number of hits of a significant shower.
Definition at line 201 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by ReadSettings(), and Run().
|
private |
The min. purity of a coincident shower spine downstream of the shower vertex.
Definition at line 204 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by IsSpineCoincident(), and ReadSettings().
|
private |
The neutrino vertex list name.
Definition at line 197 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by GetNeutrinoVertex(), and ReadSettings().
|
private |
The shower spine finder tool for all other event particles.
Definition at line 193 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by BuildViewPathways(), and ReadSettings().
|
private |
The other (not incl. shower) initial pathway direction finder tool.
Definition at line 191 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by BuildViewPathways(), and ReadSettings().
|
private |
The 2D -> 3D ProtoShower matching tool.
Definition at line 195 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by ReadSettings(), and RefineShower().
|
private |
The shower initial pathway direction finder tool.
Definition at line 190 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by BuildViewProtoShowers(), and ReadSettings().
|
private |
The shower spine finder tool for the shower.
Definition at line 192 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by BuildViewProtoShowers(), and ReadSettings().
|
private |
The shower start finder tool.
Definition at line 194 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by BuildViewProtoShowers(), and ReadSettings().
|
private |
The shower pfo list name.
Definition at line 196 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by FillShowerPfoVector(), and ReadSettings().
|
private |
The sliding fit window for shower fits.
Definition at line 202 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by GetShowerVertex(), and ReadSettings().
|
private |
The name of the output training file name.
Definition at line 206 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by ReadSettings(), and RefineShower().
|
private |
Whether to run the algorithm to train the BDT.
Definition at line 205 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by ReadSettings(), and RefineShower().
|
private |
The min. transverse distance of an unambiguous shower hit from another pathway direction.
Definition at line 207 of file ElectronInitialRegionRefinementAlgorithm.h.
Referenced by ReadSettings(), and RefineHitsToAdd().