8 #ifndef LAR_THREE_D_HIT_CREATION_ALGORITHM_H
9 #define LAR_THREE_D_HIT_CREATION_ALGORITHM_H 1
11 #include "Pandora/Algorithm.h"
12 #include "Pandora/AlgorithmTool.h"
19 class HitCreationBaseTool;
20 class ThreeDSlidingFitResult;
39 TrajectorySample(
const pandora::CartesianVector &position,
const pandora::HitType hitType,
const double sigma);
46 const pandora::CartesianVector &
GetPosition()
const;
81 ProtoHit(
const pandora::CaloHit *
const pParentCaloHit2D);
146 void SetPosition3D(
const pandora::CartesianVector &position3D,
const double chi2);
178 const pandora::CaloHitVector &inputCaloHitVector,
const pandora::HitType hitType, pandora::CaloHitVector &outputCaloHitVector)
const;
181 pandora::StatusCode
Run();
191 pandora::CaloHitVector &remainingHitVector)
const;
267 void AddThreeDHitsToPfo(
const pandora::ParticleFlowObject *
const pPfo,
const pandora::CaloHitList &caloHitList)
const;
269 pandora::StatusCode
ReadSettings(
const pandora::TiXmlHandle xmlHandle);
289 const pandora::CartesianVector &position,
const pandora::HitType hitType,
const double sigma) :
290 m_position(position),
321 m_pParentCaloHit2D(pParentCaloHit2D),
322 m_isPositionSet(
false),
323 m_position3D(0.f, 0.f, 0.f),
324 m_chi2(
std::numeric_limits<double>::max())
332 return m_pParentCaloHit2D;
339 return m_isPositionSet;
346 return m_trajectorySampleVector.size();
353 m_position3D = position3D;
355 m_isPositionSet =
true;
362 m_trajectorySampleVector.push_back(trajectorySample);
367 #endif // #ifndef LAR_THREE_D_HIT_CREATION_ALGORITHM_H
void IterativeTreatment(ProtoHitVector &protoHitVector) const
Improve initial 3D hits by fitting proto hits and iteratively creating consisted 3D hit trajectory...
const pandora::CaloHit * m_pParentCaloHit2D
The address of the parent 2D calo hit.
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Proto hits are temporary constructs to be used during iterative 3D hit procedure. ...
ProtoHit(const pandora::CaloHit *const pParentCaloHit2D)
Constructor.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
double m_chi2
The output chi squared value.
std::string m_inputPfoListName
The name of the input pfo list.
unsigned int m_slidingFitHalfWindow
The sliding linear fit half window.
bool CheckThreeDHit(const ProtoHit &protoHit) const
Check that a new three dimensional position is not unphysical.
std::vector< TrajectorySample > TrajectorySampleVector
pandora::HitType m_hitType
The sampling hit type.
unsigned int GetNTrajectorySamples() const
Get the number of trajectory samples.
const pandora::CaloHit * GetParentCaloHit2D() const
Get the address of the parent 2D calo hit.
std::string m_outputCaloHitListName
The name of the output calo hit list.
void SeparateTwoDHits(const pandora::ParticleFlowObject *const pPfo, const ProtoHitVector &protoHitVector, pandora::CaloHitVector &remainingHitVector) const
Get the list of 2D calo hits in a pfo for which 3D hits have and have not been created.
void RefineHitPositions(const ThreeDSlidingFitResult &slidingFitResult, ProtoHitVector &protoHitVector) const
Refine the 3D hit positions (and chi2) for a list of proto hits, in accordance with a provided 3D sli...
bool IsPositionSet() const
Whether the proto hit position is set.
ThreeDHitCreationAlgorithm()
Default constructor.
void CreateThreeDHit(const ProtoHit &protoHit, const pandora::CaloHit *&pCaloHit3D) const
Create a new three dimensional hit from a two dimensional hit.
double GetHitMovementChi2(const ProtoHitVector &protoHitVector) const
Receive a chi2 value indicating consistency of a list of proto hits with the original, input hit positions.
void AddTrajectorySample(const TrajectorySample &trajectorySample)
Add a trajectory sample.
unsigned int m_nHitRefinementIterations
The maximum number of hit refinement iterations.
const pandora::CartesianVector & GetPosition3D() const
Get the output 3D position.
pandora::CartesianVector m_position
The sampling position.
std::string m_outputClusterListName
The name of the output cluster list.
pandora::StatusCode Run()
double GetChi2WrtFit(const ThreeDSlidingFitResult &slidingFitResult, const ProtoHitVector &protoHitVector) const
Receive a chi2 value indicating consistency of a list of proto hits with a provided 3D sliding fit tr...
bool m_isPositionSet
Whether the output 3D position has been set.
double GetChi2() const
Get the chi squared value.
bool m_iterateTrackHits
Whether to enable iterative improvement of 3D hits for track trajectories.
std::vector< ProtoHit > ProtoHitVector
TrajectorySampleVector m_trajectorySampleVector
The trajectory sample vector.
pandora::CartesianVector m_position3D
The output 3D position.
bool m_iterateShowerHits
Whether to enable iterative improvement of 3D hits for showers.
const TrajectorySample & GetFirstTrajectorySample() const
Get the first trajectory sample.
TrajectorySample(const pandora::CartesianVector &position, const pandora::HitType hitType, const double sigma)
Constructor.
void CreateThreeDHits(const ProtoHitVector &protoHitVector, pandora::CaloHitList &newThreeDHits) const
Create new three dimensional hits from two dimensional hits.
pandora::HitType GetHitType() const
Get the sampling hit type.
const pandora::CartesianVector & GetPosition() const
Get the sampling position.
double GetSigma() const
Get the sampling sigma.
ThreeDSlidingFitResult class.
void ExtractResults(const ProtoHitVector &protoHitVector, double &chi2, pandora::CartesianPointVector &pointVector) const
Extract key results from a provided proto hit vector.
Trajectory samples record the results of sampling a particles in a particular view.
ThreeDHitCreationAlgorithm::Algorithm class.
HitCreationToolVector m_algorithmToolVector
The algorithm tool vector.
void SetPosition3D(const pandora::CartesianVector &position3D, const double chi2)
Set position 3D.
std::vector< HitCreationBaseTool * > HitCreationToolVector
double m_sigma3DFitMultiplier
Multiplicative factor: sigmaUVW (same as sigmaHit and sigma2DFit) to sigma3DFit.
double m_iterationMaxChi2Ratio
Max ratio between current and previous chi2 values to cease iterations.
double m_sigma
The sampling sigma.
void AddThreeDHitsToPfo(const pandora::ParticleFlowObject *const pPfo, const pandora::CaloHitList &caloHitList) const
Add a specified list of three dimensional hits to a cluster in a pfo, creating the new cluster if req...
const TrajectorySample & GetLastTrajectorySample() const
Get the last trajectory sample.
void FilterCaloHitsByType(const pandora::CaloHitVector &inputCaloHitVector, const pandora::HitType hitType, pandora::CaloHitVector &outputCaloHitVector) const
Get the subset of a provided calo hit vector corresponding to a specified hit type.