LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
NeutrinoIdTool class. More...
#include "NeutrinoIdTool.h"
Classes | |
class | SliceFeatures |
Slice features class. More... | |
Public Member Functions | |
NeutrinoIdTool () | |
Default constructor. More... | |
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. More... | |
Private Types | |
typedef std::pair< unsigned int, float > | UintFloatPair |
typedef std::vector< SliceFeatures > | SliceFeaturesVector |
Private Member Functions | |
void | GetSliceFeatures (const NeutrinoIdTool *const pTool, const SliceHypotheses &nuSliceHypotheses, const SliceHypotheses &crSliceHypotheses, SliceFeaturesVector &sliceFeaturesVector) const |
Get the features of each slice. More... | |
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. More... | |
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. More... | |
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. More... | |
unsigned int | CountNeutrinoInducedHits (const pandora::CaloHitList &caloHitList) const |
Count the number of neutrino induced hits in a given list using MC information. More... | |
int | GetNuanceCode (const pandora::Algorithm *const pAlgorithm) const |
Use the current MCParticle list to get the nuance code of the neutrino in the event. More... | |
void | SelectAllPfos (const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &hypotheses, pandora::PfoList &selectedPfos) const |
Select all pfos under the same hypothesis. More... | |
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. More... | |
void | SelectPfos (const pandora::PfoList &pfos, pandora::PfoList &selectedPfos) const |
Add the given pfos to the selected Pfo list. 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... | |
bool | m_selectNuanceCode |
Should select training events by nuance code. More... | |
int | m_nuance |
Nuance code to select for training. 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... | |
float | m_minProbability |
Minimum probability required to classify a slice as the neutrino. More... | |
unsigned int | m_maxNeutrinos |
The maximum number of neutrinos to select in any one event. More... | |
SupportVectorMachine | m_supportVectorMachine |
The support vector machine. More... | |
std::string | m_filePathEnvironmentVariable |
The environment variable providing a list of paths to svm files. More... | |
NeutrinoIdTool class.
Compares the neutrino and cosmic hypotheses of all of the slices in the event. Uses an SVM 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 SVM 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 30 of file NeutrinoIdTool.h.
|
private |
Definition at line 149 of file NeutrinoIdTool.h.
|
private |
Definition at line 148 of file NeutrinoIdTool.h.
lar_content::NeutrinoIdTool::NeutrinoIdTool | ( | ) |
Default constructor.
Definition at line 28 of file NeutrinoIdTool.cc.
|
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 |
reconstructedCaloHitList | output list of all 2d hits in the input pfos |
reconstructableCaloHitSet | set of reconstructable calo hits |
Definition at line 150 of file NeutrinoIdTool.cc.
References lar_content::LArPfoHelper::GetCaloHits().
Referenced by GetBestMCSliceIndex().
|
private |
Count the number of neutrino induced hits in a given list using MC information.
caloHitSet | input list of calo hits |
Definition at line 170 of file NeutrinoIdTool.cc.
References lar_content::LArMCParticleHelper::GetParentMCParticle(), and lar_content::LArMCParticleHelper::IsNeutrino().
Referenced by GetBestMCSliceIndex().
|
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 |
bestSliceIndex | the index of the slice with the most neutrino hits |
Definition at line 87 of file NeutrinoIdTool.cc.
References Collect2DHits(), CountNeutrinoInducedHits(), f, lar_content::LArMCParticleHelper::GetMCPrimaryMap(), lar_content::LArMCParticleHelper::PrimaryParameters::m_maxPhotonPropagation, lar_content::LArMCParticleHelper::PrimaryParameters::m_selectInputHits, PassesQualityCuts(), and lar_content::LArMCParticleHelper::SelectCaloHits().
Referenced by SelectOutputPfos().
|
private |
Use the current MCParticle list to get the nuance code of the neutrino in the event.
pAlgorithm | address of the master algorithm |
Definition at line 190 of file NeutrinoIdTool.cc.
References lar_content::LArMCParticleHelper::GetNuanceCode(), and lar_content::LArMCParticleHelper::GetTrueNeutrinos().
Referenced by PassesQualityCuts().
|
private |
Get the features of each slice.
pTool | the address of the this NeutrinoId tool |
nuSliceHypotheses | the input neutrino slice hypotheses |
crSliceHypotheses | the input cosmic slice hypotheses |
sliceFeaturesVector | vector to hold the slice features |
Definition at line 79 of file NeutrinoIdTool.cc.
Referenced by SelectOutputPfos().
|
private |
Determine if the event passes the selection cuts for training and has the required NUANCE code.
pAlgorithm | address of the master algorithm |
purity | purity of best slice |
completeness | completeness of best slice |
Definition at line 140 of file NeutrinoIdTool.cc.
References GetNuanceCode(), m_minCompleteness, m_minPurity, m_nuance, and m_selectNuanceCode.
Referenced by GetBestMCSliceIndex().
|
private |
Definition at line 515 of file NeutrinoIdTool.cc.
References lar_content::LArFileHelper::FindFileInPath(), lar_content::SupportVectorMachine::Initialize(), m_filePathEnvironmentVariable, m_maxNeutrinos, m_minCompleteness, m_minProbability, m_minPurity, m_nuance, m_selectNuanceCode, m_supportVectorMachine, m_trainingOutputFile, and m_useTrainingMode.
|
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 209 of file NeutrinoIdTool.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 42 of file NeutrinoIdTool.cc.
References GetBestMCSliceIndex(), lar_content::NeutrinoIdTool::SliceFeatures::GetFeatureVector(), GetSliceFeatures(), m_trainingOutputFile, m_useTrainingMode, max, lar_content::LArMvaHelper::ProduceTrainingExample(), SelectAllPfos(), and SelectPfosByProbability().
|
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 280 of file NeutrinoIdTool.cc.
Referenced by SelectAllPfos(), and SelectPfosByProbability().
|
private |
Select pfos based on the probability that their slice contains a neutrino 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 226 of file NeutrinoIdTool.cc.
References m_maxNeutrinos, m_minProbability, m_supportVectorMachine, and SelectPfos().
Referenced by SelectOutputPfos().
|
private |
The environment variable providing a list of paths to svm files.
Definition at line 254 of file NeutrinoIdTool.h.
Referenced by ReadSettings().
|
private |
The maximum number of neutrinos to select in any one event.
Definition at line 251 of file NeutrinoIdTool.h.
Referenced by ReadSettings(), and SelectPfosByProbability().
|
private |
Minimum completeness of the best slice to use event for training.
Definition at line 247 of file NeutrinoIdTool.h.
Referenced by PassesQualityCuts(), and ReadSettings().
|
private |
Minimum probability required to classify a slice as the neutrino.
Definition at line 250 of file NeutrinoIdTool.h.
Referenced by ReadSettings(), and SelectPfosByProbability().
|
private |
Minimum purity of the best slice to use event for training.
Definition at line 246 of file NeutrinoIdTool.h.
Referenced by PassesQualityCuts(), and ReadSettings().
|
private |
Nuance code to select for training.
Definition at line 245 of file NeutrinoIdTool.h.
Referenced by PassesQualityCuts(), and ReadSettings().
|
private |
Should select training events by nuance code.
Definition at line 244 of file NeutrinoIdTool.h.
Referenced by PassesQualityCuts(), and ReadSettings().
|
private |
The support vector machine.
Definition at line 253 of file NeutrinoIdTool.h.
Referenced by ReadSettings(), and SelectPfosByProbability().
|
private |
Output file name for training examples.
Definition at line 243 of file NeutrinoIdTool.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 242 of file NeutrinoIdTool.h.
Referenced by ReadSettings(), and SelectOutputPfos().