LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
BdtBeamParticleIdTool class. More...
#include "BdtBeamParticleIdTool.h"
Classes | |
class | Plane |
Plane class. More... | |
class | SliceFeatureParameters |
SliceFeatureParameters class. More... | |
class | SliceFeatures |
Slice features class. More... | |
Public Member Functions | |
BdtBeamParticleIdTool () | |
Constructor. More... | |
BdtBeamParticleIdTool (const BdtBeamParticleIdTool &)=default | |
Copy constructor. More... | |
BdtBeamParticleIdTool & | operator= (const BdtBeamParticleIdTool &)=default |
Assignment operator. More... | |
~BdtBeamParticleIdTool ()=default | |
Destructor. More... | |
void | SelectOutputPfos (const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &beamSliceHypotheses, const SliceHypotheses &crSliceHypotheses, pandora::PfoList &selectedPfos) |
Select which reconstruction hypotheses to use; neutrino outcomes or cosmic-ray muon outcomes for each slice. More... | |
Private Types | |
typedef std::vector< Plane > | PlaneVector |
typedef std::vector< SliceFeatures > | SliceFeaturesVector |
typedef std::pair< unsigned int, float > | UintFloatPair |
typedef std::unordered_map< const pandora::MCParticle *, int > | MCParticleToIntMap |
Private Member Functions | |
pandora::StatusCode | Initialize () |
void | GetSliceFeatures (const SliceHypotheses &nuSliceHypotheses, const SliceHypotheses &crSliceHypotheses, SliceFeaturesVector &sliceFeaturesVector) const |
Get the features of each slice. More... | |
void | SelectAllPfos (const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &hypotheses, pandora::PfoList &selectedPfos) const |
Select all pfos under the same hypothesis. More... | |
void | SelectPfos (const pandora::PfoList &pfos, pandora::PfoList &selectedPfos) const |
Add the given pfos to the selected Pfo list. More... | |
void | GetBestMCSliceIndices (const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &nuSliceHypotheses, const SliceHypotheses &crSliceHypotheses, pandora::IntVector &bestSliceIndices) const |
Get the slice with the most neutrino induced hits using Monte-Carlo information. More... | |
void | PopulateMCParticleToHitsMap (MCParticleToIntMap &mcParticleToIntMap, const pandora::CaloHitList &caloHitList) const |
Fill mc particle to nHits map from calo hit list. More... | |
void | Collect2DHits (const pandora::PfoList &pfos, pandora::CaloHitList &caloHitList, const pandora::CaloHitSet &reconstructableCaloHitSet) const |
Collect all 2D hits in a supplied list of Pfos and push them on to an existing hit list, check so not to double count. More... | |
bool | PassesQualityCuts (const float purity, const float completeness) const |
Determine if the event passes the selection cuts for training. More... | |
void | SelectPfosByAdaBDTScore (const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &nuSliceHypotheses, const SliceHypotheses &crSliceHypotheses, const SliceFeaturesVector &sliceFeaturesVector, pandora::PfoList &selectedPfos) const |
Select pfos based on the AdaBDT score that the slice contains a beam particle interaction. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
Private Attributes | |
bool | m_useTrainingMode |
Should use training mode. If true, training examples will be written to the output file. More... | |
std::string | m_trainingOutputFile |
Output file name for training examples. More... | |
std::string | m_caloHitListName |
Name of input calo hit list. More... | |
std::string | m_mcParticleListName |
Name of input MC particle list. More... | |
float | m_minPurity |
Minimum purity of the best slice to use event for training. More... | |
float | m_minCompleteness |
Minimum completeness of the best slice to use event for training. More... | |
AdaBoostDecisionTree | m_adaBoostDecisionTree |
The adaptive boost decision tree. More... | |
std::string | m_filePathEnvironmentVariable |
The environment variable providing a list of paths to bdt files. More... | |
unsigned int | m_maxNeutrinos |
The maximum number of neutrinos to select in any one event. More... | |
float | m_minAdaBDTScore |
Minimum score required to classify a slice as a beam particle. More... | |
SliceFeatureParameters | m_sliceFeatureParameters |
Geometry information block. More... | |
BdtBeamParticleIdTool class.
Definition at line 24 of file BdtBeamParticleIdTool.h.
|
private |
Definition at line 305 of file BdtBeamParticleIdTool.h.
|
private |
Definition at line 83 of file BdtBeamParticleIdTool.h.
|
private |
Definition at line 303 of file BdtBeamParticleIdTool.h.
|
private |
Definition at line 304 of file BdtBeamParticleIdTool.h.
lar_content::BdtBeamParticleIdTool::BdtBeamParticleIdTool | ( | ) |
Constructor.
Definition at line 23 of file BdtBeamParticleIdTool.cc.
|
default |
Copy constructor.
BdtBeamParticleIdTool | to copy |
|
default |
Destructor.
|
private |
Collect all 2D hits in a supplied list of Pfos and push them on to an existing hit list, check so not to double count.
pfos | input list of pfos |
caloHitList | output list of all 2d hits in the input pfos |
reconstructableCaloHitSet | to check if part of before adding |
Definition at line 266 of file BdtBeamParticleIdTool.cc.
References lar_content::LArPfoHelper::GetCaloHits().
Referenced by GetBestMCSliceIndices().
|
private |
Get the slice with the most neutrino induced hits using Monte-Carlo information.
pAlgorithm | address of the master algorithm |
nuSliceHypotheses | the input neutrino slice hypotheses |
crSliceHypotheses | the input cosmic slice hypotheses |
bestSliceIndices | vector of slice indices passing quality cuts |
Definition at line 163 of file BdtBeamParticleIdTool.cc.
References Collect2DHits(), f, lar_content::LArMCParticleHelper::GetMCPrimaryMap(), lar_content::LArMCParticleHelper::GetNuanceCode(), m_caloHitListName, lar_content::LArMCParticleHelper::PrimaryParameters::m_maxPhotonPropagation, m_mcParticleListName, lar_content::LArMCParticleHelper::PrimaryParameters::m_selectInputHits, PassesQualityCuts(), PopulateMCParticleToHitsMap(), and lar_content::LArMCParticleHelper::SelectCaloHits().
Referenced by SelectOutputPfos().
|
private |
Get the features of each slice.
nuSliceHypotheses | the input neutrino slice hypotheses |
crSliceHypotheses | the input cosmic slice hypotheses |
sliceFeaturesVector | vector to hold the slice features |
Definition at line 130 of file BdtBeamParticleIdTool.cc.
References m_sliceFeatureParameters.
Referenced by SelectOutputPfos().
|
private |
Definition at line 38 of file BdtBeamParticleIdTool.cc.
References lar_content::BdtBeamParticleIdTool::SliceFeatureParameters::Initialize(), and m_sliceFeatureParameters.
|
default |
Assignment operator.
The | BdtBeamParticleIdTool to assign |
|
private |
Determine if the event passes the selection cuts for training.
purity | purity of best slice |
completeness | completeness of best slice |
Definition at line 289 of file BdtBeamParticleIdTool.cc.
References m_minCompleteness, and m_minPurity.
Referenced by GetBestMCSliceIndices().
|
private |
Fill mc particle to nHits map from calo hit list.
mcParticleToIntMap | map to fill |
caloHitList | the input calo hits |
Definition at line 238 of file BdtBeamParticleIdTool.cc.
References lar_content::LArMCParticleHelper::GetParentMCParticle().
Referenced by GetBestMCSliceIndices().
|
private |
Definition at line 691 of file BdtBeamParticleIdTool.cc.
References f, lar_content::LArFileHelper::FindFileInPath(), lar_content::AdaBoostDecisionTree::Initialize(), m_adaBoostDecisionTree, m_caloHitListName, m_filePathEnvironmentVariable, m_maxNeutrinos, m_mcParticleListName, m_minAdaBDTScore, m_minCompleteness, m_minPurity, m_sliceFeatureParameters, m_trainingOutputFile, m_useTrainingMode, lar_content::BdtBeamParticleIdTool::SliceFeatureParameters::SetBeamDirection(), lar_content::BdtBeamParticleIdTool::SliceFeatureParameters::SetBeamLArTPCIntersection(), lar_content::BdtBeamParticleIdTool::SliceFeatureParameters::SetContainmentLimit(), lar_content::BdtBeamParticleIdTool::SliceFeatureParameters::SetNSelectedHits(), and lar_content::BdtBeamParticleIdTool::SliceFeatureParameters::SetSelectedFraction().
|
private |
Select all pfos under the same hypothesis.
pAlgorithm | address of the master algorithm |
hypotheses | the lists of slices under a certain hypothesis |
selectedPfos | the list of pfos to populate |
Definition at line 139 of file BdtBeamParticleIdTool.cc.
References SelectPfos().
Referenced by SelectOutputPfos().
|
virtual |
Select which reconstruction hypotheses to use; neutrino outcomes or cosmic-ray muon outcomes for each slice.
pAlgorithm | the address of the master instance, used to access MCParticles when in training mode |
nuSliceHypotheses | the parent pfos representing the neutrino outcome for each slice |
crSliceHypotheses | the parent pfos representing the cosmic-ray muon outcome for each slice |
sliceNuPfos | to receive the list of selected pfos |
Implements lar_content::SliceIdBaseTool.
Definition at line 76 of file BdtBeamParticleIdTool.cc.
References lar_content::BdtBeamParticleIdTool::SliceFeatures::FillFeatureVector(), GetBestMCSliceIndices(), GetSliceFeatures(), m_trainingOutputFile, m_useTrainingMode, lar_content::LArMvaHelper::ProduceTrainingExample(), SelectAllPfos(), and SelectPfosByAdaBDTScore().
|
private |
Add the given pfos to the selected Pfo list.
pfos | the pfos to select |
selectedPfos | the list of pfos to populate |
Definition at line 156 of file BdtBeamParticleIdTool.cc.
Referenced by SelectAllPfos(), and SelectPfosByAdaBDTScore().
|
private |
Select pfos based on the AdaBDT score that the slice contains a beam particle interaction.
pAlgorithm | address of the master algorithm |
nuSliceHypotheses | the input neutrino slice hypotheses |
crSliceHypotheses | the input cosmic slice hypotheses |
sliceFeaturesVector | vector holding the slice features |
selectedPfos | the list of pfos to populate |
Definition at line 299 of file BdtBeamParticleIdTool.cc.
References m_adaBoostDecisionTree, m_maxNeutrinos, m_minAdaBDTScore, and SelectPfos().
Referenced by SelectOutputPfos().
|
private |
The adaptive boost decision tree.
Definition at line 397 of file BdtBeamParticleIdTool.h.
Referenced by ReadSettings(), and SelectPfosByAdaBDTScore().
|
private |
Name of input calo hit list.
Definition at line 391 of file BdtBeamParticleIdTool.h.
Referenced by GetBestMCSliceIndices(), and ReadSettings().
|
private |
The environment variable providing a list of paths to bdt files.
Definition at line 398 of file BdtBeamParticleIdTool.h.
Referenced by ReadSettings().
|
private |
The maximum number of neutrinos to select in any one event.
Definition at line 399 of file BdtBeamParticleIdTool.h.
Referenced by ReadSettings(), and SelectPfosByAdaBDTScore().
|
private |
Name of input MC particle list.
Definition at line 392 of file BdtBeamParticleIdTool.h.
Referenced by GetBestMCSliceIndices(), and ReadSettings().
|
private |
Minimum score required to classify a slice as a beam particle.
Definition at line 400 of file BdtBeamParticleIdTool.h.
Referenced by ReadSettings(), and SelectPfosByAdaBDTScore().
|
private |
Minimum completeness of the best slice to use event for training.
Definition at line 394 of file BdtBeamParticleIdTool.h.
Referenced by PassesQualityCuts(), and ReadSettings().
|
private |
Minimum purity of the best slice to use event for training.
Definition at line 393 of file BdtBeamParticleIdTool.h.
Referenced by PassesQualityCuts(), and ReadSettings().
|
private |
Geometry information block.
Definition at line 401 of file BdtBeamParticleIdTool.h.
Referenced by lar_content::BdtBeamParticleIdTool::SliceFeatures::GetLArTPCIntercepts(), lar_content::BdtBeamParticleIdTool::SliceFeatures::GetLeadingCaloHits(), GetSliceFeatures(), lar_content::BdtBeamParticleIdTool::SliceFeatureParameters::Initialize(), Initialize(), lar_content::BdtBeamParticleIdTool::SliceFeatures::IsContained(), and ReadSettings().
|
private |
Output file name for training examples.
Definition at line 390 of file BdtBeamParticleIdTool.h.
Referenced by ReadSettings(), and SelectOutputPfos().
|
private |
Should use training mode. If true, training examples will be written to the output file.
Definition at line 389 of file BdtBeamParticleIdTool.h.
Referenced by ReadSettings(), and SelectOutputPfos().