Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
lar_content::NeutrinoIdTool< T > Class Template Reference

NeutrinoIdTool class. More...

#include "NeutrinoIdTool.h"

Inheritance diagram for lar_content::NeutrinoIdTool< T >:
Collaboration diagram for lar_content::NeutrinoIdTool< T >:

Classes

class  SliceFeatures
 Slice features class. More...
 

Public Member Functions

 NeutrinoIdTool ()
 Default constructor.
 
void SelectOutputPfos (const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &nuSliceHypotheses, 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 Initialize ()
 Perform any operations that must occur after reading settings, but before running the process.
 
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::pair< unsigned int, float > UintFloatPair
 
typedef std::vector< SliceFeaturesSliceFeaturesVector
 

Private Member Functions

void GetSliceFeatures (const NeutrinoIdTool *const pTool, const SliceHypotheses &nuSliceHypotheses, const SliceHypotheses &crSliceHypotheses, SliceFeaturesVector &sliceFeaturesVector) const
 Get the features of each slice.
 
bool GetBestMCSliceIndex (const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &nuSliceHypotheses, const SliceHypotheses &crSliceHypotheses, unsigned int &bestSliceIndex) const
 Get the slice with the most neutrino induced hits using Monte-Carlo information.
 
bool PassesQualityCuts (const pandora::Algorithm *const pAlgorithm, const float purity, const float completeness) const
 Determine if the event passes the selection cuts for training and has the required NUANCE code.
 
void Collect2DHits (const pandora::PfoList &pfos, pandora::CaloHitList &reconstructedCaloHitList, 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.
 
unsigned int CountNeutrinoInducedHits (const pandora::CaloHitList &caloHitList) const
 Count the number of neutrino induced hits in a given list using MC information.
 
int GetNuanceCode (const pandora::Algorithm *const pAlgorithm) const
 Use the current MCParticle list to get the nuance code of the neutrino in the event.
 
void SelectAllPfos (const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &hypotheses, pandora::PfoList &selectedPfos) const
 Select all pfos under the same hypothesis.
 
void SelectPfosByProbability (const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &nuSliceHypotheses, const SliceHypotheses &crSliceHypotheses, const SliceFeaturesVector &sliceFeaturesVector, pandora::PfoList &selectedPfos) const
 Select pfos based on the probability that their slice contains a neutrino interaction.
 
void SelectPfos (const pandora::PfoList &pfos, pandora::PfoList &selectedPfos) const
 Add the given pfos to the selected Pfo list.
 
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.
 
bool m_selectNuanceCode
 Should select training events by nuance code.
 
int m_nuance
 Nuance code to select for training.
 
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.
 
float m_minProbability
 Minimum probability required to classify a slice as the neutrino.
 
float m_defaultProbability
 Default probability set if score could not be calculated.
 
unsigned int m_maxNeutrinos
 The maximum number of neutrinos to select in any one event.
 
bool m_persistFeatures
 If true, the mva features will be persisted in the metadata.
 
m_mva
 The mva.
 
std::string m_filePathEnvironmentVariable
 The environment variable providing a list of paths to mva files.
 

Detailed Description

template<typename T>
class lar_content::NeutrinoIdTool< T >

NeutrinoIdTool class.

    Compares the neutrino and cosmic hypotheses of all of the slices in the event. Uses an MVA to calculate the probability of each slice
    containing a neutrino interaction. The N slices with the highest probabilities are identified as a neutrino (if sufficiently probable)
    all other slices are deemed cosmogenic.

    If training mode is switched on, then the tool will write MVA training exmples to the specified output file. The events selected for
    training must pass (user configurable) slicing quality cuts. Users may also select events based on their interaction type (nuance code).

Definition at line 32 of file NeutrinoIdTool.h.

Member Typedef Documentation

◆ SliceFeaturesVector

template<typename T >
typedef std::vector<SliceFeatures> lar_content::NeutrinoIdTool< T >::SliceFeaturesVector
private

Definition at line 162 of file NeutrinoIdTool.h.

◆ UintFloatPair

template<typename T >
typedef std::pair<unsigned int, float> lar_content::NeutrinoIdTool< T >::UintFloatPair
private

Definition at line 161 of file NeutrinoIdTool.h.

Constructor & Destructor Documentation

◆ NeutrinoIdTool()

template<typename T >
lar_content::NeutrinoIdTool< T >::NeutrinoIdTool ( )

Default constructor.

Definition at line 29 of file NeutrinoIdTool.cc.

Member Function Documentation

◆ Collect2DHits()

template<typename T >
void lar_content::NeutrinoIdTool< T >::Collect2DHits ( const pandora::PfoList pfos,
pandora::CaloHitList reconstructedCaloHitList,
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
reconstructedCaloHitListoutput list of all 2d hits in the input pfos
reconstructableCaloHitSetset of reconstructable calo hits

Definition at line 166 of file NeutrinoIdTool.cc.

Here is the call graph for this function:

◆ CountNeutrinoInducedHits()

template<typename T >
unsigned int lar_content::NeutrinoIdTool< T >::CountNeutrinoInducedHits ( const pandora::CaloHitList caloHitList) const
private

Count the number of neutrino induced hits in a given list using MC information.

Parameters
caloHitSetinput list of calo hits
Returns
the number of neutrino induced hits in the input list

Definition at line 188 of file NeutrinoIdTool.cc.

Here is the call graph for this function:

◆ GetBestMCSliceIndex()

template<typename T >
bool lar_content::NeutrinoIdTool< T >::GetBestMCSliceIndex ( const pandora::Algorithm *const  pAlgorithm,
const SliceHypotheses nuSliceHypotheses,
const SliceHypotheses crSliceHypotheses,
unsigned int &  bestSliceIndex 
) 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
bestSliceIndexthe index of the slice with the most neutrino hits
Returns
does the best slice pass the quality cuts for training?

Definition at line 98 of file NeutrinoIdTool.cc.

Here is the call 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.

◆ GetNuanceCode()

template<typename T >
int lar_content::NeutrinoIdTool< T >::GetNuanceCode ( const pandora::Algorithm *const  pAlgorithm) const
private

Use the current MCParticle list to get the nuance code of the neutrino in the event.

Parameters
pAlgorithmaddress of the master algorithm
Returns
the nuance code of the event

Definition at line 209 of file NeutrinoIdTool.cc.

Here is the call graph for this function:

◆ 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()

template<typename T >
void lar_content::NeutrinoIdTool< T >::GetSliceFeatures ( const NeutrinoIdTool< T > *const  pTool,
const SliceHypotheses nuSliceHypotheses,
const SliceHypotheses crSliceHypotheses,
SliceFeaturesVector sliceFeaturesVector 
) const
private

Get the features of each slice.

Parameters
pToolthe address of the this NeutrinoId tool
nuSliceHypothesesthe input neutrino slice hypotheses
crSliceHypothesesthe input cosmic slice hypotheses
sliceFeaturesVectorvector to hold the slice features

Definition at line 88 of file NeutrinoIdTool.cc.

◆ 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 pandora::Process::Initialize ( )
inlineprotectedvirtualinherited

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

Reimplemented in lar_content::BdtBeamParticleIdTool, lar_content::BeamParticleIdTool, lar_content::CosmicRayTaggingTool, lar_content::EventReadingAlgorithm, lar_content::EventWritingAlgorithm, lar_content::LArPseudoLayerPlugin, lar_content::LArRotationalTransformationPlugin, EventReadingAlgorithm, and EventWritingAlgorithm.

Definition at line 126 of file Process.h.

Here is the caller graph for this function:

◆ PassesQualityCuts()

template<typename T >
bool lar_content::NeutrinoIdTool< T >::PassesQualityCuts ( const pandora::Algorithm *const  pAlgorithm,
const float  purity,
const float  completeness 
) const
private

Determine if the event passes the selection cuts for training and has the required NUANCE code.

Parameters
pAlgorithmaddress of the master algorithm
puritypurity of best slice
completenesscompleteness of best slice
Returns
does the evenr pass the quality cuts on purity and completeness and has the required NUANCE code

Definition at line 153 of file NeutrinoIdTool.cc.

◆ ReadSettings()

template<typename T >
StatusCode lar_content::NeutrinoIdTool< T >::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
privatevirtual

Read the algorithm settings.

Parameters
xmlHandlethe relevant xml handle

Implements pandora::Process.

Definition at line 594 of file NeutrinoIdTool.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()

template<typename T >
void lar_content::NeutrinoIdTool< T >::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 229 of file NeutrinoIdTool.cc.

Here is the call graph for this function:

◆ SelectOutputPfos()

template<typename T >
void lar_content::NeutrinoIdTool< T >::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 46 of file NeutrinoIdTool.cc.

Here is the call graph for this function:

◆ SelectPfos()

template<typename T >
void lar_content::NeutrinoIdTool< T >::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 321 of file NeutrinoIdTool.cc.

◆ SelectPfosByProbability()

template<typename T >
void lar_content::NeutrinoIdTool< T >::SelectPfosByProbability ( const pandora::Algorithm *const  pAlgorithm,
const SliceHypotheses nuSliceHypotheses,
const SliceHypotheses crSliceHypotheses,
const SliceFeaturesVector sliceFeaturesVector,
pandora::PfoList selectedPfos 
) const
private

Select pfos based on the probability that their slice contains a neutrino 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 247 of file NeutrinoIdTool.cc.

Here is the call graph for this function:

Member Data Documentation

◆ m_defaultProbability

template<typename T >
float lar_content::NeutrinoIdTool< T >::m_defaultProbability
private

Default probability set if score could not be calculated.

Definition at line 268 of file NeutrinoIdTool.h.

◆ m_filePathEnvironmentVariable

template<typename T >
std::string lar_content::NeutrinoIdTool< T >::m_filePathEnvironmentVariable
private

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

Definition at line 274 of file NeutrinoIdTool.h.

◆ m_instanceName

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

The process instance name.

Definition at line 89 of file Process.h.

◆ m_maxNeutrinos

template<typename T >
unsigned int lar_content::NeutrinoIdTool< T >::m_maxNeutrinos
private

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

Definition at line 269 of file NeutrinoIdTool.h.

◆ m_minCompleteness

template<typename T >
float lar_content::NeutrinoIdTool< T >::m_minCompleteness
private

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

Definition at line 264 of file NeutrinoIdTool.h.

◆ m_minProbability

template<typename T >
float lar_content::NeutrinoIdTool< T >::m_minProbability
private

Minimum probability required to classify a slice as the neutrino.

Definition at line 267 of file NeutrinoIdTool.h.

◆ m_minPurity

template<typename T >
float lar_content::NeutrinoIdTool< T >::m_minPurity
private

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

Definition at line 263 of file NeutrinoIdTool.h.

◆ m_mva

template<typename T >
T lar_content::NeutrinoIdTool< T >::m_mva
private

The mva.

Definition at line 273 of file NeutrinoIdTool.h.

◆ m_nuance

template<typename T >
int lar_content::NeutrinoIdTool< T >::m_nuance
private

Nuance code to select for training.

Definition at line 262 of file NeutrinoIdTool.h.

◆ m_persistFeatures

template<typename T >
bool lar_content::NeutrinoIdTool< T >::m_persistFeatures
private

If true, the mva features will be persisted in the metadata.

Definition at line 271 of file NeutrinoIdTool.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_selectNuanceCode

template<typename T >
bool lar_content::NeutrinoIdTool< T >::m_selectNuanceCode
private

Should select training events by nuance code.

Definition at line 261 of file NeutrinoIdTool.h.

◆ m_trainingOutputFile

template<typename T >
std::string lar_content::NeutrinoIdTool< T >::m_trainingOutputFile
private

Output file name for training examples.

Definition at line 260 of file NeutrinoIdTool.h.

◆ m_type

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

The process type.

Definition at line 88 of file Process.h.

◆ m_useTrainingMode

template<typename T >
bool lar_content::NeutrinoIdTool< T >::m_useTrainingMode
private

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

Definition at line 259 of file NeutrinoIdTool.h.


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