8 #ifndef LAR_BDT_BEAM_PARTICLE_ID_TOOL_H
9 #define LAR_BDT_BEAM_PARTICLE_ID_TOOL_H 1
51 const SliceHypotheses &crSliceHypotheses, pandora::PfoList &selectedPfos);
66 Plane(
const pandora::CartesianVector &normal,
const pandora::CartesianVector &point);
74 pandora::CartesianVector
GetLineIntersection(
const pandora::CartesianVector &point,
const pandora::CartesianVector &direction)
const;
105 void Initialize(
const float larTPCMinX,
const float larTPCMaxX,
const float larTPCMinY,
const float larTPCMaxY,
106 const float larTPCMinZ,
const float larTPCMaxZ);
277 const pandora::CaloHitList &inputCaloHitList, pandora::CaloHitList &outputCaloHitList,
double &closestHitToFaceDistance)
const;
287 void GetLArTPCIntercepts(
const pandora::CartesianVector &
a0,
const pandora::CartesianVector &majorAxis,
288 pandora::CartesianVector &interceptOne, pandora::CartesianVector &interceptTwo)
const;
295 bool IsContained(
const pandora::CartesianVector &spacePoint,
const float limit)
const;
325 void SelectAllPfos(
const pandora::Algorithm *
const pAlgorithm,
const SliceHypotheses &hypotheses, pandora::PfoList &selectedPfos)
const;
333 void SelectPfos(
const pandora::PfoList &pfos, pandora::PfoList &selectedPfos)
const;
361 void Collect2DHits(
const pandora::PfoList &pfos, pandora::CaloHitList &caloHitList,
const pandora::CaloHitSet &reconstructableCaloHitSet)
const;
385 pandora::StatusCode
ReadSettings(
const pandora::TiXmlHandle xmlHandle);
414 m_beamDirection = beamDirection;
421 m_selectedFraction = selectedFraction;
428 m_nSelectedHits = nSelectedHits;
435 m_containmentLimit = containmentLimit;
484 return m_larTPCPlanes;
491 return m_beamLArTPCIntersection;
498 return m_beamDirection;
505 return m_selectedFraction;
512 return m_nSelectedHits;
519 return m_containmentLimit;
526 return m_isAvailable;
531 #endif // #ifndef LAR_BDT_BEAM_PARTICLE_ID_TOOL_H
void SetBeamLArTPCIntersection(const pandora::CartesianVector &beamLArTPCIntersection)
Set m_beamLArTPCIntersection.
double m_d
Parameter defining a plane.
float GetLArTPCMinZ() const
Get m_larTPCMinZ.
const SliceFeatureParameters m_sliceFeatureParameters
Geometry information block.
MvaTypes::MvaFeatureVector MvaFeatureVector
pandora::StatusCode Initialize()
std::string m_filePathEnvironmentVariable
The environment variable providing a list of paths to bdt files.
std::string m_mcParticleListName
Name of input MC particle list.
float m_larTPCMinY
Global LArTPC volume minimum y extent.
Plane(const pandora::CartesianVector &normal, const pandora::CartesianVector &point)
Constructor, using equation of plane: m_a*x + m_b*y + m_c*z + m_d = 0.
float m_minAdaBDTScore
Minimum score required to classify a slice as a beam particle.
float m_larTPCMaxX
Global LArTPC volume maximum x extent.
float GetSelectedFraction() const
Get m_selectedFraction.
unsigned int GetNSelectedHits() const
Get m_nSelectedHits.
pandora::CartesianVector GetLineIntersection(const pandora::CartesianVector &point, const pandora::CartesianVector &direction) const
Return the intersection between the plane and a line.
float GetAdaBoostDecisionTreeScore(const AdaBoostDecisionTree &adaBoostDecisionTree) const
Get the probability that this slice contains a beam particle.
float GetLArTPCMaxZ() const
Get m_larTPCMaxZ.
PlaneVector m_larTPCPlanes
Vector of all planes making up global LArTPC volume.
unsigned int m_nSelectedHits
Minimum number of hits to use in 3D cluster fits.
bool m_useTrainingMode
Should use training mode. If true, training examples will be written to the output file...
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.
float m_selectedFraction
Fraction of hits to use in 3D cluster fits.
std::vector< SliceFeatures > SliceFeaturesVector
float GetLArTPCMaxY() const
Get m_larTPCMaxY.
void SelectAllPfos(const pandora::Algorithm *const pAlgorithm, const SliceHypotheses &hypotheses, pandora::PfoList &selectedPfos) const
Select all pfos under the same hypothesis.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::vector< int > IntVector
void FillFeatureVector(LArMvaHelper::MvaFeatureVector &featureVector) const
Get the feature vector for the SVM.
bool IsFeatureVectorAvailable() const
Check if all features were calculable.
float m_larTPCMaxY
Global LArTPC volume maximum y extent.
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.
AdaBoostDecisionTree class.
bool PassesQualityCuts(const float purity, const float completeness) const
Determine if the event passes the selection cuts for training.
float GetLArTPCMaxX() const
Get m_larTPCMaxX.
SliceFeatures(const pandora::PfoList &nuPfos, const pandora::PfoList &crPfos, const SliceFeatureParameters &sliceFeatureParameters)
Constructor.
void SetBeamDirection(const pandora::CartesianVector &beamDirection)
Set m_beamDirection.
void SetNSelectedHits(const unsigned int nSelectedHits)
Set m_nSelectedHits.
bool IsContained(const pandora::CartesianVector &spacePoint, const float limit) const
Check if a given 3D spacepoint is inside the global LArTPC volume.
const pandora::CartesianVector & GetBeamDirection() const
Get the beam direction.
Header file for the master algorithm class.
float GetContainmentLimit() const
Get m_containmentLimit.
Header file for the lar adaptive boosted decision tree class.
std::string m_trainingOutputFile
Output file name for training examples.
SliceFeatureParameters class.
void SetSelectedFraction(const float selectedFraction)
Set m_selectedFraction.
pandora::CartesianVector m_beamDirection
Beam direction.
BdtBeamParticleIdTool()
Constructor.
float m_minPurity
Minimum purity of the best slice to use event for training.
std::vector< pandora::PfoList > SliceHypotheses
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...
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.
LArMvaHelper::MvaFeatureVector m_featureVector
The MVA feature vector.
float m_minCompleteness
Minimum completeness of the best slice to use event for training.
void PopulateMCParticleToHitsMap(MCParticleToIntMap &mcParticleToIntMap, const pandora::CaloHitList &caloHitList) const
Fill mc particle to nHits map from calo hit list.
BdtBeamParticleIdTool & operator=(const BdtBeamParticleIdTool &)=default
Assignment operator.
const pandora::CartesianVector & GetBeamLArTPCIntersection() const
Get the beam LArTPC intersection.
pandora::CartesianVector m_unitNormal
Unit normal to plane.
void Initialize(const float larTPCMinX, const float larTPCMaxX, const float larTPCMinY, const float larTPCMaxY, const float larTPCMinZ, const float larTPCMaxZ)
Set LArTPC geometry information.
SliceFeatureParameters()
Constructor.
~BdtBeamParticleIdTool()=default
Destructor.
float m_containmentLimit
Limit applied in is contained definition.
void SetContainmentLimit(const float containmentLimit)
Set m_containmentLimit.
const PlaneVector & GetPlanes() const
Get vector of planes.
float GetLArTPCMinX() const
Get m_larTPCMinX.
void GetSliceFeatures(const SliceHypotheses &nuSliceHypotheses, const SliceHypotheses &crSliceHypotheses, SliceFeaturesVector &sliceFeaturesVector) const
Get the features of each slice.
float m_larTPCMinX
Global LArTPC volume minimum x extent.
float m_larTPCMaxZ
Global LArTPC volume maximum z extent.
std::vector< Plane > PlaneVector
void GetLeadingCaloHits(const pandora::CaloHitList &inputCaloHitList, pandora::CaloHitList &outputCaloHitList, double &closestHitToFaceDistance) const
Select a given fraction of a slice's calo hits that are closest to the beam spot. ...
pandora::CartesianVector m_point
A point on the plane.
std::unordered_map< const pandora::MCParticle *, int > MCParticleToIntMap
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...
BdtBeamParticleIdTool class.
unsigned int m_maxNeutrinos
The maximum number of neutrinos to select in any one event.
std::string m_caloHitListName
Name of input calo hit list.
void GetLArTPCIntercepts(const pandora::CartesianVector &a0, const pandora::CartesianVector &majorAxis, pandora::CartesianVector &interceptOne, pandora::CartesianVector &interceptTwo) const
Find the intercepts of a line with the protoDUNE detector.
std::pair< unsigned int, float > UintFloatPair
pandora::CartesianVector m_beamLArTPCIntersection
Intersection of beam and global LArTPC volume.
float m_larTPCMinZ
Global LArTPC volume minimum z extent.
~SliceFeatures()=default
Destructor.
AdaBoostDecisionTree m_adaBoostDecisionTree
The adaptive boost decision tree.
float GetLArTPCMinY() const
Get m_larTPCMinY.
SliceFeatureParameters m_sliceFeatureParameters
Geometry information block.