9 #include "Pandora/AlgorithmHeaders.h" 13 #include "Helpers/MCParticleHelper.h" 30 m_useTrainingMode(false),
31 m_selectNuanceCode(false),
32 m_nuance(-
std::numeric_limits<int>::max()),
34 m_minCompleteness(0.9
f),
35 m_minProbability(0.0
f),
36 m_defaultProbability(0.0
f),
38 m_persistFeatures(false),
39 m_filePathEnvironmentVariable(
"FW_SEARCH_PATH")
49 if (nuSliceHypotheses.size() != crSliceHypotheses.size())
50 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
52 const unsigned int nSlices(nuSliceHypotheses.size());
57 this->
GetSliceFeatures(
this, nuSliceHypotheses, crSliceHypotheses, sliceFeaturesVector);
62 this->
SelectAllPfos(pAlgorithm, crSliceHypotheses, selectedPfos);
64 unsigned int bestSliceIndex(std::numeric_limits<unsigned int>::max());
65 if (!this->
GetBestMCSliceIndex(pAlgorithm, nuSliceHypotheses, crSliceHypotheses, bestSliceIndex))
68 for (
unsigned int sliceIndex = 0; sliceIndex < nSlices; ++sliceIndex)
70 const SliceFeatures &features(sliceFeaturesVector.at(sliceIndex));
71 if (!features.IsFeatureVectorAvailable())
82 this->
SelectPfosByProbability(pAlgorithm, nuSliceHypotheses, crSliceHypotheses, sliceFeaturesVector, selectedPfos);
91 for (
unsigned int sliceIndex = 0, nSlices = nuSliceHypotheses.size(); sliceIndex < nSlices; ++sliceIndex)
92 sliceFeaturesVector.push_back(
SliceFeatures(nuSliceHypotheses.at(sliceIndex), crSliceHypotheses.at(sliceIndex), pTool));
99 const SliceHypotheses &crSliceHypotheses,
unsigned int &bestSliceIndex)
const 101 unsigned int nHitsInBestSlice(0), nNuHitsInBestSlice(0);
104 const CaloHitList *pAllReconstructedCaloHitList(
nullptr);
105 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*pAlgorithm, pAllReconstructedCaloHitList));
107 const MCParticleList *pMCParticleList(
nullptr);
108 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*pAlgorithm, pMCParticleList));
115 CaloHitList reconstructableCaloHitList;
121 const CaloHitSet reconstructableCaloHitSet(reconstructableCaloHitList.begin(), reconstructableCaloHitList.end());
123 for (
unsigned int sliceIndex = 0, nSlices = nuSliceHypotheses.size(); sliceIndex < nSlices; ++sliceIndex)
125 CaloHitList reconstructedCaloHitList;
126 this->
Collect2DHits(crSliceHypotheses.at(sliceIndex), reconstructedCaloHitList, reconstructableCaloHitSet);
128 for (
const ParticleFlowObject *
const pNeutrino : nuSliceHypotheses.at(sliceIndex))
130 const PfoList &nuFinalStates(pNeutrino->GetDaughterPfoList());
131 this->
Collect2DHits(nuFinalStates, reconstructedCaloHitList, reconstructableCaloHitSet);
136 if (nNuHits > nNuHitsInBestSlice)
138 nNuHitsInBestSlice = nNuHits;
139 nHitsInBestSlice = reconstructedCaloHitList.size();
140 bestSliceIndex = sliceIndex;
145 const float purity(nHitsInBestSlice > 0 ? static_cast<float>(nNuHitsInBestSlice) / static_cast<float>(nHitsInBestSlice) : 0.
f);
146 const float completeness(nuNHitsTotal > 0 ? static_cast<float>(nNuHitsInBestSlice) / static_cast<float>(nuNHitsTotal) : 0.f);
152 template <
typename T>
165 template <
typename T>
168 CaloHitList collectedHits;
173 for (
const CaloHit *
const pCaloHit : collectedHits)
175 const CaloHit *
const pParentHit =
static_cast<const CaloHit *
>(pCaloHit->GetParentAddress());
176 if (!reconstructableCaloHitSet.count(pParentHit))
180 if (std::find(reconstructedCaloHitList.begin(), reconstructedCaloHitList.end(), pParentHit) == reconstructedCaloHitList.end())
181 reconstructedCaloHitList.push_back(pParentHit);
187 template <
typename T>
190 unsigned int nNuHits(0);
191 for (
const CaloHit *
const pCaloHit : caloHitList)
198 catch (
const StatusCodeException &)
208 template <
typename T>
211 const MCParticleList *pMCParticleList =
nullptr;
212 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*pAlgorithm, pMCParticleList));
217 if (trueNeutrinos.size() != 1)
219 std::cout <<
"NeutrinoIdTool::GetNuanceCode - Error: number of true neutrinos in event must be exactly one" << std::endl;
220 throw StatusCodeException(STATUS_CODE_OUT_OF_RANGE);
228 template <
typename T>
231 for (
const PfoList &pfos : hypotheses)
233 for (
const ParticleFlowObject *
const pPfo : pfos)
235 object_creation::ParticleFlowObject::Metadata metadata;
236 metadata.m_propertiesToAdd[
"NuScore"] = -1.f;
237 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*pAlgorithm, pPfo, metadata));
246 template <
typename T>
251 std::vector<UintFloatPair> sliceIndexProbabilityPairs;
252 for (
unsigned int sliceIndex = 0, nSlices = nuSliceHypotheses.size(); sliceIndex < nSlices; ++sliceIndex)
256 for (
const ParticleFlowObject *
const pPfo : crSliceHypotheses.at(sliceIndex))
258 object_creation::ParticleFlowObject::Metadata metadata;
259 metadata.m_propertiesToAdd[
"NuScore"] = nuProbability;
261 if (
m_persistFeatures && sliceFeaturesVector.at(sliceIndex).IsFeatureVectorAvailable())
264 sliceFeaturesVector.at(sliceIndex).GetFeatureMap(featureMap);
266 for (
auto const &[name,
value] : featureMap)
267 metadata.m_propertiesToAdd[name] =
value;
270 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*pAlgorithm, pPfo, metadata));
273 for (
const ParticleFlowObject *
const pPfo : nuSliceHypotheses.at(sliceIndex))
275 object_creation::ParticleFlowObject::Metadata metadata;
276 metadata.m_propertiesToAdd[
"NuScore"] = nuProbability;
278 if (
m_persistFeatures && sliceFeaturesVector.at(sliceIndex).IsFeatureVectorAvailable())
281 sliceFeaturesVector.at(sliceIndex).GetFeatureMap(featureMap);
283 for (
auto const &[name,
value] : featureMap)
284 metadata.m_propertiesToAdd[name] =
value;
287 PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*pAlgorithm, pPfo, metadata));
292 this->
SelectPfos(crSliceHypotheses.at(sliceIndex), selectedPfos);
296 sliceIndexProbabilityPairs.push_back(
UintFloatPair(sliceIndex, nuProbability));
300 std::sort(sliceIndexProbabilityPairs.begin(), sliceIndexProbabilityPairs.end(),
304 unsigned int nNuSlices(0);
305 for (
const UintFloatPair &slice : sliceIndexProbabilityPairs)
309 this->
SelectPfos(nuSliceHypotheses.at(slice.first), selectedPfos);
314 this->
SelectPfos(crSliceHypotheses.at(slice.first), selectedPfos);
320 template <
typename T>
323 selectedPfos.insert(selectedPfos.end(), pfos.begin(), pfos.end());
330 template <
typename T>
332 m_isAvailable(false),
337 const ParticleFlowObject *
const pNeutrino(this->
GetNeutrino(nuPfos));
339 const PfoList &nuFinalStates(pNeutrino->GetDaughterPfoList());
342 CartesianVector nuWeightedDirTotal(0.
f, 0.
f, 0.
f);
343 unsigned int nuNHitsUsedTotal(0);
344 unsigned int nuNHitsTotal(0);
345 CartesianPointVector nuAllSpacePoints;
346 for (
const ParticleFlowObject *
const pPfo : nuFinalStates)
348 CartesianPointVector spacePoints;
351 nuAllSpacePoints.insert(nuAllSpacePoints.end(), spacePoints.begin(), spacePoints.end());
352 nuNHitsTotal += spacePoints.size();
354 if (spacePoints.size() < 5)
358 nuWeightedDirTotal += dir *
static_cast<float>(spacePoints.size());
359 nuNHitsUsedTotal += spacePoints.size();
362 if (nuNHitsUsedTotal == 0)
364 const CartesianVector nuWeightedDir(nuWeightedDirTotal * (1.
f / static_cast<float>(nuNHitsUsedTotal)));
366 CartesianPointVector pointsInSphere;
369 CartesianVector centroid(std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
370 LArPcaHelper::EigenValues eigenValues(std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
374 const float nuNFinalStatePfos(static_cast<float>(nuFinalStates.size()));
375 const float nuVertexY(nuVertex.GetY());
376 const float nuWeightedDirZ(nuWeightedDir.GetZ());
377 const float nuNSpacePointsInSphere(static_cast<float>(pointsInSphere.size()));
379 if (eigenValues.GetX() <= std::numeric_limits<float>::epsilon())
381 const float nuEigenRatioInSphere(eigenValues.GetY() / eigenValues.GetX());
384 unsigned int nCRHitsMax(0);
385 unsigned int nCRHitsTotal(0);
386 float crLongestTrackDirY(std::numeric_limits<float>::max());
387 float crLongestTrackDeflection(-std::numeric_limits<float>::max());
389 for (
const ParticleFlowObject *
const pPfo : crPfos)
391 CartesianPointVector spacePoints;
394 nCRHitsTotal += spacePoints.size();
396 if (spacePoints.size() < 5)
399 if (spacePoints.size() > nCRHitsMax)
401 nCRHitsMax = spacePoints.size();
405 crLongestTrackDirY = upperDir.GetY();
406 crLongestTrackDeflection = 1.f - upperDir.GetDotProduct(lowerDir * (-1.
f));
412 if (nCRHitsTotal == 0)
415 const float crFracHitsInLongestTrack =
static_cast<float>(nCRHitsMax) / static_cast<float>(nCRHitsTotal);
433 m_featureMap[
"NuNSpacePointsInSphere"] = nuNSpacePointsInSphere;
434 m_featureMap[
"NuEigenRatioInSphere"] = nuEigenRatioInSphere;
435 m_featureMap[
"CRLongestTrackDirY"] = crLongestTrackDirY;
436 m_featureMap[
"CRLongestTrackDeflection"] = crLongestTrackDeflection;
437 m_featureMap[
"CRFracHitsInLongestTrack"] = crFracHitsInLongestTrack;
442 catch (StatusCodeException &)
450 template <
typename T>
458 template <
typename T>
462 throw StatusCodeException(STATUS_CODE_NOT_FOUND);
469 template <
typename T>
473 throw StatusCodeException(STATUS_CODE_NOT_FOUND);
480 template <
typename T>
485 return defaultProbability;
494 template <
typename T>
498 if (nuPfos.size() != 1)
499 throw StatusCodeException(STATUS_CODE_OUT_OF_RANGE);
501 return nuPfos.front();
506 template <
typename T>
509 ClusterList clusters3D;
512 if (clusters3D.size() > 1)
513 throw StatusCodeException(STATUS_CODE_OUT_OF_RANGE);
515 if (clusters3D.empty())
518 CaloHitList caloHits;
519 clusters3D.front()->GetOrderedCaloHitList().FillCaloHitList(caloHits);
521 for (
const CaloHit *
const pCaloHit : caloHits)
522 spacePoints.push_back(pCaloHit->GetPositionVector());
527 template <
typename T>
531 [&](
const CartesianVector &pointA,
const CartesianVector &pointB)
532 {
return ((pointA - vertex).GetMagnitude() < (pointB - vertex).GetMagnitude()); });
537 template <
typename T>
541 spacePoints, [&](
const CartesianVector &pointA,
const CartesianVector &pointB) {
return (pointA.GetY() > pointB.GetY()); });
546 template <
typename T>
550 spacePoints, [&](
const CartesianVector &pointA,
const CartesianVector &pointB) {
return (pointA.GetY() < pointB.GetY()); });
555 template <
typename T>
557 std::function<
bool(
const CartesianVector &pointA,
const CartesianVector &pointB)> fShouldChooseA)
const 560 const LArTPC *
const pFirstLArTPC(
m_pTool->GetPandora().GetGeometry()->GetLArTPCMap().begin()->second);
561 const float layerPitch(pFirstLArTPC->GetWirePitchW());
564 const CartesianVector endMin(fit.GetGlobalMinLayerPosition());
565 const CartesianVector endMax(fit.GetGlobalMaxLayerPosition());
566 const CartesianVector dirMin(fit.GetGlobalMinLayerDirection());
567 const CartesianVector dirMax(fit.GetGlobalMaxLayerDirection());
569 const bool isMinStart(fShouldChooseA(endMin, endMax));
570 const CartesianVector startPoint(isMinStart ? endMin : endMax);
571 const CartesianVector endPoint(isMinStart ? endMax : endMin);
572 const CartesianVector startDir(isMinStart ? dirMin : dirMax);
574 const bool shouldFlip((endPoint - startPoint).GetUnitVector().GetDotProduct(startDir) < 0.
f);
575 return (shouldFlip ? startDir * (-1.
f) : startDir);
580 template <
typename T>
582 const float radius, CartesianPointVector &spacePointsInSphere)
const 584 for (
const CartesianVector &point : spacePoints)
586 if ((point - vertex).GetMagnitudeSquared() <= radius * radius)
587 spacePointsInSphere.push_back(point);
593 template <
typename T>
596 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"UseTrainingMode",
m_useTrainingMode));
600 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"TrainingOutputFileName",
m_trainingOutputFile));
603 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MinimumPurity",
m_minPurity));
605 PANDORA_RETURN_RESULT_IF_AND_IF(
606 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MinimumCompleteness",
m_minCompleteness));
608 PANDORA_RETURN_RESULT_IF_AND_IF(
609 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"SelectNuanceCode",
m_selectNuanceCode));
613 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"NuanceCode",
m_nuance));
616 PANDORA_RETURN_RESULT_IF_AND_IF(
617 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MinimumNeutrinoProbability",
m_minProbability));
619 PANDORA_RETURN_RESULT_IF_AND_IF(
620 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"DefaultProbability",
m_defaultProbability));
622 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MaximumNeutrinos",
m_maxNeutrinos));
624 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"PersistFeatures",
m_persistFeatures));
626 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
632 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"MvaName", mvaName));
634 std::string mvaFileName;
635 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"MvaFileName", mvaFileName));
638 m_mva.Initialize(fullMvaFileName, mvaName);
641 return STATUS_CODE_SUCCESS;
float m_defaultProbability
Default probability set if score could not be calculated.
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...
std::vector< pandora::PfoList > SliceHypotheses
Header file for the pfo helper class.
bool m_selectInputHits
whether to select input hits
MvaTypes::MvaFeatureVector MvaFeatureVector
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.
SliceFeatures(const pandora::PfoList &nuPfos, const pandora::PfoList &crPfos, const NeutrinoIdTool *const pTool)
Constructor.
static pandora::StatusCode ProduceTrainingExample(const std::string &trainingOutputFile, const bool result, TCONTAINER &&featureContainer)
Produce a training example with the given features and result.
void GetFeatureMap(LArMvaHelper::DoubleMap &featureMap) const
Get the feature map for the MVA.
bool IsFeatureVectorAvailable() const
Check if all features were calculable.
float m_minProbability
Minimum probability required to classify a slice as the neutrino.
int GetNuanceCode(const pandora::Algorithm *const pAlgorithm) const
Use the current MCParticle list to get the nuance code of the neutrino in the event.
pandora::CartesianVector EigenValues
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
const NeutrinoIdTool *const m_pTool
The tool that owns this.
static const pandora::Vertex * GetVertex(const pandora::ParticleFlowObject *const pPfo)
Get the pfo vertex.
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...
void SelectAllPfos(const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &hypotheses, pandora::PfoList &selectedPfos) const
Select all pfos under the same hypothesis.
LArMvaHelper::DoubleMap m_featureMap
A map between MVA features and their names.
Header file for the principal curve analysis helper class.
static void GetMCPrimaryMap(const pandora::MCParticleList *const pMCParticleList, MCRelationMap &mcPrimaryMap)
Get mapping from individual mc particles (in a provided list) and their primary parent mc particles...
static unsigned int GetNuanceCode(const pandora::MCParticle *const pMCParticle)
Get the nuance code of an MCParticle.
float m_minCompleteness
Minimum completeness of the best slice to use event for training.
float m_maxPhotonPropagation
the maximum photon propagation length
std::string m_filePathEnvironmentVariable
The environment variable providing a list of paths to mva files.
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...
bool m_selectNuanceCode
Should select training events by nuance code.
unsigned int m_maxNeutrinos
The maximum number of neutrinos to select in any one event.
unsigned int CountNeutrinoInducedHits(const pandora::CaloHitList &caloHitList) const
Count the number of neutrino induced hits in a given list using MC information.
std::pair< unsigned int, float > UintFloatPair
void GetFeatureVector(LArMvaHelper::MvaFeatureVector &featureVector) const
Get the feature vector for the MVA.
pandora::CartesianVector GetLowerDirection(const pandora::CartesianPointVector &spacePoints) const
Use a sliding fit to get the lower direction of a collection of spacepoints.
void GetSliceFeatures(const NeutrinoIdTool *const pTool, const SliceHypotheses &nuSliceHypotheses, const SliceHypotheses &crSliceHypotheses, SliceFeaturesVector &sliceFeaturesVector) const
Get the features of each slice.
std::map< std::string, double > DoubleMap
Header file for the lar monte carlo particle helper helper class.
int m_nuance
Nuance code to select for training.
bool m_isAvailable
Is the feature vector available.
void SelectPfos(const pandora::PfoList &pfos, pandora::PfoList &selectedPfos) const
Add the given pfos to the selected Pfo list.
bool m_useTrainingMode
Should use training mode. If true, training examples will be written to the output file...
float m_minPurity
Minimum purity of the best slice to use event for training.
LArMvaHelper::MvaFeatureVector m_featureVector
The MVA feature vector.
const pandora::ParticleFlowObject * GetNeutrino(const pandora::PfoList &nuPfos) const
Get the recontructed neutrino the input list of neutrino Pfos.
std::vector< art::Ptr< simb::MCParticle > > MCParticleVector
static const pandora::MCParticle * GetParentMCParticle(const pandora::MCParticle *const pMCParticle)
Get the parent mc particle.
float GetNeutrinoProbability(const T &t, const float defaultProbability) const
Get the probability that this slice contains a neutrino interaction.
static std::string FindFileInPath(const std::string &unqualifiedFileName, const std::string &environmentVariable, const std::string &delimiter=":")
Find the fully-qualified file name by searching through a list of delimiter-separated paths in a name...
Header file for the file helper class.
static void GetThreeDClusterList(const pandora::ParticleFlowObject *const pPfo, pandora::ClusterList &clusterList)
Get the list of 3D clusters from an input pfo.
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.
std::vector< SliceFeatures > SliceFeaturesVector
Header file for the lar three dimensional sliding fit result class.
bool m_persistFeatures
If true, the mva features will be persisted in the metadata.
pandora::CartesianVector GetDirectionFromVertex(const pandora::CartesianPointVector &spacePoints, const pandora::CartesianVector &vertex) const
Use a sliding fit to get the direction of a collection of spacepoint near a vertex position...
pandora::CartesianVector GetUpperDirection(const pandora::CartesianPointVector &spacePoints) const
Use a sliding fit to get the upper direction of a collection of spacepoints.
pandora::CartesianVector GetDirection(const pandora::CartesianPointVector &spacePoints, std::function< bool(const pandora::CartesianVector &pointA, const pandora::CartesianVector &pointB)> fShouldChooseA) const
Use a sliding fit to get the direction of a collection of spacepoints.
static void RunPca(const T &t, pandora::CartesianVector ¢roid, EigenValues &outputEigenValues, EigenVectors &outputEigenVectors)
Run principal component analysis using input calo hits (TPC_VIEW_U,V,W or TPC_3D; all treated as 3D p...
static void GetTrueNeutrinos(const pandora::MCParticleList *const pMCParticleList, pandora::MCParticleVector &trueNeutrinos)
Get neutrino MC particles from an input MC particle list.
std::vector< pandora::CartesianVector > EigenVectors
ThreeDSlidingFitResult class.
void GetPointsInSphere(const pandora::CartesianPointVector &spacePoints, const pandora::CartesianVector &vertex, const float radius, pandora::CartesianPointVector &spacePointsInSphere) const
Get a vector of spacepoints within a given radius of a vertex point.
void GetSpacePoints(const pandora::ParticleFlowObject *const pPfo, pandora::CartesianPointVector &spacePoints) const
Get the 3D space points in a given pfo.
std::string m_trainingOutputFile
Output file name for training examples.
static double CalculateProbability(const MvaInterface &classifier, TCONTAINER &&featureContainer)
Use the trained mva to calculate a classification probability for an example.
static void GetCaloHits(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::CaloHitList &caloHitList)
Get a list of calo hits of a particular hit type from a list of pfos.
std::unordered_map< const pandora::MCParticle *, const pandora::MCParticle * > MCRelationMap
static bool IsNeutrino(const pandora::MCParticle *const pMCParticle)
Whether a mc particle is a neutrino or antineutrino.
static void SelectCaloHits(const pandora::CaloHitList *const pCaloHitList, const MCRelationMap &mcToTargetMCMap, pandora::CaloHitList &selectedCaloHitList, const bool selectInputHits, const float maxPhotonPropagation)
Select a subset of calo hits representing those that represent "reconstructable" regions of the event...