Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
lar_content::BdtBeamParticleIdTool Class Reference

BdtBeamParticleIdTool class. More...

#include "BdtBeamParticleIdTool.h"

Inheritance diagram for lar_content::BdtBeamParticleIdTool:
Collaboration diagram for lar_content::BdtBeamParticleIdTool:

Classes

class  Plane
 Plane class. More...
 
class  SliceFeatureParameters
 SliceFeatureParameters class. More...
 
class  SliceFeatures
 Slice features class. More...
 

Public Member Functions

 BdtBeamParticleIdTool ()
 Constructor.
 
 BdtBeamParticleIdTool (const BdtBeamParticleIdTool &)=default
 Copy constructor.
 
BdtBeamParticleIdTooloperator= (const BdtBeamParticleIdTool &)=default
 Assignment operator.
 
 ~BdtBeamParticleIdTool ()=default
 Destructor.
 
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.
 
const std::string & GetType () const
 Get the type.
 
const std::string & GetInstanceName () const
 Get the instance name.
 
const PandoraGetPandora () const
 Get the associated pandora instance.
 

Protected Member Functions

virtual StatusCode Reset ()
 Perform any operations when pandora is reset, typically at the end of each event.
 
StatusCode RegisterDetails (const Pandora *const pPandora, const std::string &type, const std::string &instanceName)
 Register i) the pandora instance that will run the process and ii) the process type.
 

Protected Attributes

const Pandoram_pPandora
 The pandora object that will run the process.
 
std::string m_type
 The process type.
 
std::string m_instanceName
 The process instance name.
 

Private Types

typedef std::vector< PlanePlaneVector
 
typedef std::vector< SliceFeaturesSliceFeaturesVector
 
typedef std::pair< unsigned int, float > UintFloatPair
 
typedef std::unordered_map< const pandora::MCParticle *, int > MCParticleToIntMap
 

Private Member Functions

pandora::StatusCode Initialize ()
 Perform any operations that must occur after reading settings, but before running the process.
 
void GetSliceFeatures (const SliceHypotheses &nuSliceHypotheses, const SliceHypotheses &crSliceHypotheses, SliceFeaturesVector &sliceFeaturesVector) const
 Get the features of each slice.
 
void SelectAllPfos (const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &hypotheses, pandora::PfoList &selectedPfos) const
 Select all pfos under the same hypothesis.
 
void SelectPfos (const pandora::PfoList &pfos, pandora::PfoList &selectedPfos) const
 Add the given pfos to the selected Pfo list.
 
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.
 
void PopulateMCParticleToHitsMap (MCParticleToIntMap &mcParticleToIntMap, const pandora::CaloHitList &caloHitList) const
 Fill mc particle to nHits map from calo hit list.
 
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.
 
bool PassesQualityCuts (const float purity, const float completeness) const
 Determine if the event passes the selection cuts for training.
 
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.
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 Read the algorithm settings.
 

Private Attributes

bool m_useTrainingMode
 Should use training mode. If true, training examples will be written to the output file.
 
std::string m_trainingOutputFile
 Output file name for training examples.
 
std::string m_caloHitListName
 Name of input calo hit list.
 
std::string m_mcParticleListName
 Name of input MC particle list.
 
float m_minPurity
 Minimum purity of the best slice to use event for training.
 
float m_minCompleteness
 Minimum completeness of the best slice to use event for training.
 
AdaBoostDecisionTree m_adaBoostDecisionTree
 The adaptive boost decision tree.
 
std::string m_filePathEnvironmentVariable
 The environment variable providing a list of paths to bdt files.
 
unsigned int m_maxNeutrinos
 The maximum number of neutrinos to select in any one event.
 
float m_minAdaBDTScore
 Minimum score required to classify a slice as a beam particle.
 
SliceFeatureParameters m_sliceFeatureParameters
 Geometry information block.
 

Detailed Description

BdtBeamParticleIdTool class.

Definition at line 23 of file BdtBeamParticleIdTool.h.

Member Typedef Documentation

◆ MCParticleToIntMap

typedef std::unordered_map<const pandora::MCParticle *, int> lar_content::BdtBeamParticleIdTool::MCParticleToIntMap
private

Definition at line 304 of file BdtBeamParticleIdTool.h.

◆ PlaneVector

Definition at line 82 of file BdtBeamParticleIdTool.h.

◆ SliceFeaturesVector

◆ UintFloatPair

typedef std::pair<unsigned int, float> lar_content::BdtBeamParticleIdTool::UintFloatPair
private

Definition at line 303 of file BdtBeamParticleIdTool.h.

Constructor & Destructor Documentation

◆ BdtBeamParticleIdTool() [1/2]

lar_content::BdtBeamParticleIdTool::BdtBeamParticleIdTool ( )

Constructor.

Definition at line 23 of file BdtBeamParticleIdTool.cc.

◆ BdtBeamParticleIdTool() [2/2]

lar_content::BdtBeamParticleIdTool::BdtBeamParticleIdTool ( const BdtBeamParticleIdTool )
default

Copy constructor.

Parameters
BdtBeamParticleIdToolto copy

◆ ~BdtBeamParticleIdTool()

lar_content::BdtBeamParticleIdTool::~BdtBeamParticleIdTool ( )
default

Destructor.

Member Function Documentation

◆ Collect2DHits()

void lar_content::BdtBeamParticleIdTool::Collect2DHits ( const pandora::PfoList pfos,
pandora::CaloHitList caloHitList,
const pandora::CaloHitSet reconstructableCaloHitSet 
) const
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.

Parameters
pfosinput list of pfos
caloHitListoutput list of all 2d hits in the input pfos
reconstructableCaloHitSetto check if part of before adding

Definition at line 266 of file BdtBeamParticleIdTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBestMCSliceIndices()

void lar_content::BdtBeamParticleIdTool::GetBestMCSliceIndices ( const pandora::Algorithm *const  pAlgorithm,
const SliceHypotheses nuSliceHypotheses,
const SliceHypotheses crSliceHypotheses,
pandora::IntVector bestSliceIndices 
) const
private

Get the slice with the most neutrino induced hits using Monte-Carlo information.

Parameters
pAlgorithmaddress of the master algorithm
nuSliceHypothesesthe input neutrino slice hypotheses
crSliceHypothesesthe input cosmic slice hypotheses
bestSliceIndicesvector of slice indices passing quality cuts

Definition at line 163 of file BdtBeamParticleIdTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInstanceName()

const std::string & pandora::Process::GetInstanceName ( ) const
inlineinherited

Get the instance name.

Returns
The instance name

Definition at line 109 of file Process.h.

◆ GetPandora()

const Pandora & pandora::Process::GetPandora ( ) const
inlineinherited

Get the associated pandora instance.

Returns
the associated pandora instance

Definition at line 116 of file Process.h.

◆ GetSliceFeatures()

void lar_content::BdtBeamParticleIdTool::GetSliceFeatures ( const SliceHypotheses nuSliceHypotheses,
const SliceHypotheses crSliceHypotheses,
SliceFeaturesVector sliceFeaturesVector 
) const
private

Get the features of each slice.

Parameters
nuSliceHypothesesthe input neutrino slice hypotheses
crSliceHypothesesthe input cosmic slice hypotheses
sliceFeaturesVectorvector to hold the slice features

Definition at line 130 of file BdtBeamParticleIdTool.cc.

Here is the caller graph for this function:

◆ GetType()

const std::string & pandora::Process::GetType ( ) const
inlineinherited

Get the type.

Returns
The type

Definition at line 102 of file Process.h.

◆ Initialize()

StatusCode lar_content::BdtBeamParticleIdTool::Initialize ( )
privatevirtual

Perform any operations that must occur after reading settings, but before running the process.

Reimplemented from pandora::Process.

Definition at line 38 of file BdtBeamParticleIdTool.cc.

Here is the call graph for this function:

◆ operator=()

BdtBeamParticleIdTool & lar_content::BdtBeamParticleIdTool::operator= ( const BdtBeamParticleIdTool )
default

Assignment operator.

Parameters
TheBdtBeamParticleIdTool to assign

◆ PassesQualityCuts()

bool lar_content::BdtBeamParticleIdTool::PassesQualityCuts ( const float  purity,
const float  completeness 
) const
private

Determine if the event passes the selection cuts for training.

Parameters
puritypurity of best slice
completenesscompleteness of best slice
Returns
does the evenr pass the quality cuts on purity and completeness

Definition at line 289 of file BdtBeamParticleIdTool.cc.

Here is the caller graph for this function:

◆ PopulateMCParticleToHitsMap()

void lar_content::BdtBeamParticleIdTool::PopulateMCParticleToHitsMap ( MCParticleToIntMap mcParticleToIntMap,
const pandora::CaloHitList caloHitList 
) const
private

Fill mc particle to nHits map from calo hit list.

Parameters
mcParticleToIntMapmap to fill
caloHitListthe input calo hits

Definition at line 238 of file BdtBeamParticleIdTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadSettings()

StatusCode lar_content::BdtBeamParticleIdTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
privatevirtual

Read the algorithm settings.

Parameters
xmlHandlethe relevant xml handle

Implements pandora::Process.

Definition at line 692 of file BdtBeamParticleIdTool.cc.

Here is the call graph for this function:

◆ RegisterDetails()

StatusCode pandora::Process::RegisterDetails ( const Pandora *const  pPandora,
const std::string &  type,
const std::string &  instanceName 
)
inlineprotectedinherited

Register i) the pandora instance that will run the process and ii) the process type.

Parameters
pPandoraaddress of the pandora object that will run the process
typethe process type
instanceNamethe process instance name

Definition at line 146 of file Process.h.

Here is the caller graph for this function:

◆ Reset()

StatusCode pandora::Process::Reset ( )
inlineprotectedvirtualinherited

Perform any operations when pandora is reset, typically at the end of each event.

Reimplemented in lar_content::MasterAlgorithm, lar_content::PostProcessingAlgorithm, and lar_content::PreProcessingAlgorithm.

Definition at line 133 of file Process.h.

Here is the caller graph for this function:

◆ SelectAllPfos()

void lar_content::BdtBeamParticleIdTool::SelectAllPfos ( const pandora::Algorithm *const  pAlgorithm,
const SliceHypotheses hypotheses,
pandora::PfoList selectedPfos 
) const
private

Select all pfos under the same hypothesis.

Parameters
pAlgorithmaddress of the master algorithm
hypothesesthe lists of slices under a certain hypothesis
selectedPfosthe list of pfos to populate

Definition at line 139 of file BdtBeamParticleIdTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SelectOutputPfos()

void lar_content::BdtBeamParticleIdTool::SelectOutputPfos ( const pandora::Algorithm *const  pAlgorithm,
const SliceHypotheses nuSliceHypotheses,
const SliceHypotheses crSliceHypotheses,
pandora::PfoList selectedPfos 
)
virtual

Select which reconstruction hypotheses to use; neutrino outcomes or cosmic-ray muon outcomes for each slice.

Parameters
pAlgorithmthe address of the master instance, used to access MCParticles when in training mode
nuSliceHypothesesthe parent pfos representing the neutrino outcome for each slice
crSliceHypothesesthe parent pfos representing the cosmic-ray muon outcome for each slice
sliceNuPfosto receive the list of selected pfos

Implements lar_content::SliceIdBaseTool.

Definition at line 76 of file BdtBeamParticleIdTool.cc.

Here is the call graph for this function:

◆ SelectPfos()

void lar_content::BdtBeamParticleIdTool::SelectPfos ( const pandora::PfoList pfos,
pandora::PfoList selectedPfos 
) const
private

Add the given pfos to the selected Pfo list.

Parameters
pfosthe pfos to select
selectedPfosthe list of pfos to populate

Definition at line 156 of file BdtBeamParticleIdTool.cc.

Here is the caller graph for this function:

◆ SelectPfosByAdaBDTScore()

void lar_content::BdtBeamParticleIdTool::SelectPfosByAdaBDTScore ( const pandora::Algorithm *const  pAlgorithm,
const SliceHypotheses nuSliceHypotheses,
const SliceHypotheses crSliceHypotheses,
const SliceFeaturesVector sliceFeaturesVector,
pandora::PfoList selectedPfos 
) const
private

Select pfos based on the AdaBDT score that the slice contains a beam particle interaction.

Parameters
pAlgorithmaddress of the master algorithm
nuSliceHypothesesthe input neutrino slice hypotheses
crSliceHypothesesthe input cosmic slice hypotheses
sliceFeaturesVectorvector holding the slice features
selectedPfosthe list of pfos to populate

Definition at line 299 of file BdtBeamParticleIdTool.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_adaBoostDecisionTree

AdaBoostDecisionTree lar_content::BdtBeamParticleIdTool::m_adaBoostDecisionTree
private

The adaptive boost decision tree.

Definition at line 396 of file BdtBeamParticleIdTool.h.

◆ m_caloHitListName

std::string lar_content::BdtBeamParticleIdTool::m_caloHitListName
private

Name of input calo hit list.

Definition at line 390 of file BdtBeamParticleIdTool.h.

◆ m_filePathEnvironmentVariable

std::string lar_content::BdtBeamParticleIdTool::m_filePathEnvironmentVariable
private

The environment variable providing a list of paths to bdt files.

Definition at line 397 of file BdtBeamParticleIdTool.h.

◆ m_instanceName

std::string pandora::Process::m_instanceName
protectedinherited

The process instance name.

Definition at line 89 of file Process.h.

◆ m_maxNeutrinos

unsigned int lar_content::BdtBeamParticleIdTool::m_maxNeutrinos
private

The maximum number of neutrinos to select in any one event.

Definition at line 398 of file BdtBeamParticleIdTool.h.

◆ m_mcParticleListName

std::string lar_content::BdtBeamParticleIdTool::m_mcParticleListName
private

Name of input MC particle list.

Definition at line 391 of file BdtBeamParticleIdTool.h.

◆ m_minAdaBDTScore

float lar_content::BdtBeamParticleIdTool::m_minAdaBDTScore
private

Minimum score required to classify a slice as a beam particle.

Definition at line 399 of file BdtBeamParticleIdTool.h.

◆ m_minCompleteness

float lar_content::BdtBeamParticleIdTool::m_minCompleteness
private

Minimum completeness of the best slice to use event for training.

Definition at line 393 of file BdtBeamParticleIdTool.h.

◆ m_minPurity

float lar_content::BdtBeamParticleIdTool::m_minPurity
private

Minimum purity of the best slice to use event for training.

Definition at line 392 of file BdtBeamParticleIdTool.h.

◆ m_pPandora

const Pandora* pandora::Process::m_pPandora
protectedinherited

The pandora object that will run the process.

Definition at line 87 of file Process.h.

◆ m_sliceFeatureParameters

SliceFeatureParameters lar_content::BdtBeamParticleIdTool::m_sliceFeatureParameters
private

Geometry information block.

Definition at line 400 of file BdtBeamParticleIdTool.h.

◆ m_trainingOutputFile

std::string lar_content::BdtBeamParticleIdTool::m_trainingOutputFile
private

Output file name for training examples.

Definition at line 389 of file BdtBeamParticleIdTool.h.

◆ m_type

std::string pandora::Process::m_type
protectedinherited

The process type.

Definition at line 88 of file Process.h.

◆ m_useTrainingMode

bool lar_content::BdtBeamParticleIdTool::m_useTrainingMode
private

Should use training mode. If true, training examples will be written to the output file.

Definition at line 388 of file BdtBeamParticleIdTool.h.


The documentation for this class was generated from the following files: