9 #include "Pandora/AlgorithmHeaders.h" 23 TrackHitsBaseTool::TrackHitsBaseTool() :
25 m_slidingFitWindow(20)
32 const CaloHitVector &inputTwoDHits,
ProtoHitVector &protoHitVector)
34 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
35 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
45 if (matchedSlidingFitMap.size() < 2)
48 this->
GetTrackHits3D(inputTwoDHits, matchedSlidingFitMap, protoHitVector);
50 catch (StatusCodeException &)
59 const ClusterList &pfoClusterList(pPfo->GetClusterList());
63 pfoClusterVector.insert(pfoClusterVector.end(), pfoClusterList.begin(), pfoClusterList.end());
66 for (
const Cluster *
const pCluster : pfoClusterVector)
70 if (TPC_3D == hitType)
73 if (matchedSlidingFitMap.end() != matchedSlidingFitMap.find(hitType))
80 if (!matchedSlidingFitMap.insert(MatchedSlidingFitMap::value_type(hitType, slidingFitResult)).second)
81 throw StatusCodeException(STATUS_CODE_FAILURE);
83 catch (StatusCodeException &statusCodeException)
85 if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
86 throw statusCodeException;
95 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
98 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
virtual void GetTrackHits3D(const pandora::CaloHitVector &inputTwoDHits, const MatchedSlidingFitMap &matchedSlidingFitMap, ProtoHitVector &protoHitVector) const =0
Calculate 3D hits from an input list of 2D hits.
static bool SortByNHits(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by number of hits, then layer span, then inner layer, then position, then pulse-height.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
virtual void BuildSlidingFitMap(const pandora::ParticleFlowObject *const pPfo, MatchedSlidingFitMap &matchedSlidingFitMap) const
Calculate sliding fit results for clusters from each view.
Header file for the pfo helper class.
std::map< pandora::HitType, TwoDSlidingFitResult > MatchedSlidingFitMap
ThreeDHitCreationAlgorithm::ProtoHitVector ProtoHitVector
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
static bool IsTrack(const pandora::ParticleFlowObject *const pPfo)
Return track flag based on Pfo Particle ID.
static float GetWireZPitch(const pandora::Pandora &pandora, const float maxWirePitchDiscrepancy=0.01)
Return the wire pitch.
Header file for the three dimensional hit creation algorithm class.
Header file for the geometry helper class.
Header file for the cluster helper class.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
unsigned int m_minViews
The minimum number of views required for building hits.
ThreeDHitCreationAlgorithm::Algorithm class.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
virtual void Run(ThreeDHitCreationAlgorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pPfo, const pandora::CaloHitVector &inputTwoDHits, ProtoHitVector &protoHitVector)
Run the algorithm tool.
TwoDSlidingFitResult class.