27 std::cout <<
"----> Running Algorithm Tool: " << this->
GetInstanceName() <<
", " << this->
GetType() << std::endl;
39 if (parentHitList3D.empty())
42 CaloHitVector parentHitVector3D(parentHitList3D.begin(), parentHitList3D.end());
57 for (
const CaloHit *
const pCaloHit2D : inputTwoDHits)
61 const HitType hitType(pCaloHit2D->GetHitType());
65 bool foundClosestPosition(
false);
66 float closestDistanceSquared(std::numeric_limits<float>::max());
69 for (
const CaloHit *
const pCaloHit3D : parentHits3D)
73 const float thisDistanceSquared((pCaloHit2D->GetPositionVector() - thisPosition2D).GetMagnitudeSquared());
75 if (thisDistanceSquared < closestDistanceSquared)
77 foundClosestPosition =
true;
78 closestDistanceSquared = thisDistanceSquared;
79 closestPosition3D = thisPosition3D;
83 if (!foundClosestPosition)
93 protoHitVector.push_back(protoHit);
Header file for the cluster helper class.
Header file for the geometry helper class.
Header file for the pfo helper class.
Header file for the three dimensional hit creation algorithm class.
static const pandora::PandoraSettings * GetSettings(const pandora::Algorithm &algorithm)
Get the pandora settings instance.
void CreateDeltaRayShowerHits3D(const pandora::CaloHitVector &inputTwoDHits, const pandora::CaloHitVector &parentHits3D, ProtoHitVector &protoHitVector) const
Create three dimensional hits, using a list of input two dimensional hits and the 3D hits from the pa...
virtual void Run(ThreeDHitCreationAlgorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pPfo, const pandora::CaloHitVector &inputTwoDHits, ProtoHitVector &protoHitVector)
Run the algorithm tool.
ThreeDHitCreationAlgorithm::ProtoHitVector ProtoHitVector
virtual void GetBestPosition3D(const pandora::HitType hitType1, const pandora::HitType hitType2, const pandora::CartesianPointVector &fitPositionList1, const pandora::CartesianPointVector &fitPositionList2, ProtoHit &protoHit) const
Get the three dimensional position using a provided two dimensional calo hit and candidate fit positi...
static bool SortHitsByPosition(const pandora::CaloHit *const pLhs, const pandora::CaloHit *const pRhs)
Sort calo hits by their position (use Z, followed by X, followed by Y)
static pandora::CartesianVector ProjectPosition(const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
Project 3D position into a given 2D view.
static bool IsShower(const pandora::ParticleFlowObject *const pPfo)
Return shower flag based on Pfo Particle ID.
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.
Proto hits are temporary constructs to be used during iterative 3D hit procedure.
bool IsPositionSet() const
Whether the proto hit position is set.
ThreeDHitCreationAlgorithm::Algorithm class.
bool ShouldDisplayAlgorithmInfo() const
Whether to display algorithm information during processing.
ParticleFlowObject class.
const PfoList & GetParentPfoList() const
Get the parent pfo list.
const std::string & GetType() const
Get the type.
const Pandora & GetPandora() const
Get the associated pandora instance.
const std::string & GetInstanceName() const
Get the instance name.
StatusCodeException class.
HitType
Calorimeter hit type enum.
std::vector< const CaloHit * > CaloHitVector
MANAGED_CONTAINER< const CaloHit * > CaloHitList