9 #include "Pandora/AlgorithmHeaders.h" 18 SimpleShowersTool::SimpleShowersTool() :
19 m_minMatchedFraction(0.2
f),
20 m_minMatchedSamplingPoints(40),
21 m_minXOverlapFraction(0.5
f)
29 if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
30 std::cout <<
"----> Running Algorithm Tool: " << this->GetInstanceName() <<
", " << this->GetType() << std::endl;
46 for (
const Cluster *
const pKeyCluster : sortedKeyClusters)
48 if (!pKeyCluster->IsAvailable())
51 unsigned int nU(0), nV(0), nW(0);
55 if (elementList.empty())
58 TensorType::Element bestElement(elementList.back());
60 if (!bestElement.GetOverlapResult().IsInitialized())
63 if ((NULL == bestElement.GetClusterU()) || (NULL == bestElement.GetClusterV()) || (NULL == bestElement.GetClusterW()))
70 protoParticleVector.push_back(protoParticle);
86 const XOverlap &xOverlap(eIter->GetOverlapResult().GetXOverlap());
88 if ((xOverlap.GetXSpanU() > std::numeric_limits<float>::epsilon()) && (xOverlap.GetXOverlapSpan() / xOverlap.GetXSpanU() >
m_minXOverlapFraction) &&
89 (xOverlap.GetXSpanV() > std::numeric_limits<float>::epsilon()) && (xOverlap.GetXOverlapSpan() / xOverlap.GetXSpanV() >
m_minXOverlapFraction) &&
90 (xOverlap.GetXSpanW() > std::numeric_limits<float>::epsilon()) && (xOverlap.GetXOverlapSpan() / xOverlap.GetXSpanW() >
m_minXOverlapFraction))
102 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
105 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
108 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
111 return STATUS_CODE_SUCCESS;
std::vector< ProtoParticle > ProtoParticleVector
void FindBestShower(const TensorType &overlapTensor, ProtoParticleVector &protoParticleVector) const
Find best shower match as a simple way to (try to) resolve ambiguities in the tensor.
virtual bool CreateThreeDParticles(const ProtoParticleVector &protoParticleVector)
Create particles using findings from recent algorithm processing.
void GetConnectedElements(const pandora::Cluster *const pCluster, const bool ignoreUnavailable, ElementList &elementList) const
Get a list of elements connected to a specified cluster.
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
ThreeDShowersAlgorithm class.
pandora::ClusterList m_clusterListW
List of 2D W clusters in a 3D proto particle.
std::vector< Element > ElementList
bool Run(ThreeDShowersAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
pandora::ClusterList m_clusterListV
List of 2D V clusters in a 3D proto particle.
pandora::ClusterList m_clusterListU
List of 2D U clusters in a 3D proto particle.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
void GetSortedKeyClusters(pandora::ClusterVector &sortedKeyClusters) const
Get a sorted vector of key clusters (U clusters with current implementation)
std::vector< art::Ptr< recob::Cluster > > ClusterVector
unsigned int m_minMatchedSamplingPoints
The min number of matched sampling points for particle creation.
float m_minXOverlapFraction
The min x overlap fraction (in each view) for particle creation.
bool PassesElementCuts(TensorType::ElementList::const_iterator eIter) const
Whether a provided (iterator to a) tensor element passes the selection cuts for particle creation...
TheTensor::const_iterator const_iterator