LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::TwoViewClearTracksTool Class Reference

TwoViewClearTracksTool class. More...

#include "TwoViewClearTracksTool.h"

Inheritance diagram for lar_content::TwoViewClearTracksTool:
lar_content::TransverseMatrixTool

Public Types

typedef TwoViewTransverseTracksAlgorithm::MatchingType::MatrixType MatrixType
 
typedef std::vector< MatrixType::ElementList::const_iteratorIteratorList
 

Public Member Functions

 TwoViewClearTracksTool ()
 Default constructor. More...
 
bool Run (TwoViewTransverseTracksAlgorithm *const pAlgorithm, MatrixType &overlapMatrix)
 Run the algorithm tool. More...
 

Private Member Functions

pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
void CreateThreeDParticles (TwoViewTransverseTracksAlgorithm *const pAlgorithm, const MatrixType::ElementList &elementList, bool &particlesMade) const
 Create three dimensional particles for a given tensor element list. More...
 

Private Attributes

float m_minXOverlapFraction
 The min x overlap fraction value for particle creation. More...
 
float m_minMatchingScore
 The min global matching score for particle creation. More...
 
float m_minLocallyMatchedFraction
 The min locally matched fraction for particle creation. More...
 

Detailed Description

TwoViewClearTracksTool class.

Definition at line 19 of file TwoViewClearTracksTool.h.

Member Typedef Documentation

Constructor & Destructor Documentation

lar_content::TwoViewClearTracksTool::TwoViewClearTracksTool ( )

Default constructor.

Definition at line 20 of file TwoViewClearTracksTool.cc.

20  :
22  m_minMatchingScore(0.95f),
24 {
25 }
float m_minMatchingScore
The min global matching score for particle creation.
TFile f
Definition: plotHisto.C:6
float m_minXOverlapFraction
The min x overlap fraction value for particle creation.
float m_minLocallyMatchedFraction
The min locally matched fraction for particle creation.

Member Function Documentation

void lar_content::TwoViewClearTracksTool::CreateThreeDParticles ( TwoViewTransverseTracksAlgorithm *const  pAlgorithm,
const MatrixType::ElementList elementList,
bool &  particlesMade 
) const
private

Create three dimensional particles for a given tensor element list.

Parameters
pAlgorithmaddress of the calling algorithm (ultimately responsible for the particles)
elementListthe tensor element list
particlesMadereceive boolean indicating whether particles have been made

Definition at line 45 of file TwoViewClearTracksTool.cc.

References lar_content::MatchingBaseAlgorithm::CreateThreeDParticles(), lar_content::ProtoParticle::m_clusterList, and m_minXOverlapFraction.

Referenced by Run().

47 {
48  ProtoParticleVector protoParticleVector;
49 
50  for (MatrixType::ElementList::const_iterator iter = elementList.begin(), iterEnd = elementList.end(); iter != iterEnd; ++iter)
51  {
52  if (iter->GetOverlapResult().GetTwoViewXOverlap().GetXOverlapFraction0() - m_minXOverlapFraction < -1.f * std::numeric_limits<float>::epsilon())
53  continue;
54  if (iter->GetOverlapResult().GetTwoViewXOverlap().GetXOverlapFraction1() - m_minXOverlapFraction < -1.f * std::numeric_limits<float>::epsilon())
55  continue;
56 
57  if (iter->GetOverlapResult().GetMatchingScore() - m_minMatchingScore < std::numeric_limits<float>::epsilon())
58  continue;
59 
60  if (iter->GetOverlapResult().GetLocallyMatchedFraction() - m_minLocallyMatchedFraction < std::numeric_limits<float>::epsilon())
61  continue;
62 
63  ProtoParticle protoParticle;
64  protoParticle.m_clusterList.push_back(iter->GetCluster1());
65  protoParticle.m_clusterList.push_back(iter->GetCluster2());
66  protoParticleVector.push_back(protoParticle);
67  }
68 
69  particlesMade |= pAlgorithm->CreateThreeDParticles(protoParticleVector);
70 }
std::vector< ProtoParticle > ProtoParticleVector
intermediate_table::const_iterator const_iterator
float m_minXOverlapFraction
The min x overlap fraction value for particle creation.
StatusCode lar_content::TwoViewClearTracksTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 74 of file TwoViewClearTracksTool.cc.

References m_minLocallyMatchedFraction, m_minMatchingScore, and m_minXOverlapFraction.

75 {
76  PANDORA_RETURN_RESULT_IF_AND_IF(
77  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinMatchingScore", m_minMatchingScore));
78 
79  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
80  XmlHelper::ReadValue(xmlHandle, "MinLocallyMatchedFraction", m_minLocallyMatchedFraction));
81 
82  PANDORA_RETURN_RESULT_IF_AND_IF(
83  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinXOverlapFraction", m_minXOverlapFraction));
84 
85  return STATUS_CODE_SUCCESS;
86 }
float m_minMatchingScore
The min global matching score for particle creation.
float m_minXOverlapFraction
The min x overlap fraction value for particle creation.
float m_minLocallyMatchedFraction
The min locally matched fraction for particle creation.
bool lar_content::TwoViewClearTracksTool::Run ( TwoViewTransverseTracksAlgorithm *const  pAlgorithm,
MatrixType overlapMatrix 
)
virtual

Run the algorithm tool.

Parameters
pAlgorithmaddress of the calling algorithm
overlapMatrixthe overlap matrix
Returns
whether changes have been made by the tool

Implements lar_content::TransverseMatrixTool.

Definition at line 29 of file TwoViewClearTracksTool.cc.

References CreateThreeDParticles(), and lar_content::OverlapMatrix< T >::GetUnambiguousElements().

30 {
31  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
32  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
33 
34  bool particlesMade(false);
35 
36  MatrixType::ElementList elementList;
37  overlapMatrix.GetUnambiguousElements(true, elementList);
38  this->CreateThreeDParticles(pAlgorithm, elementList, particlesMade);
39 
40  return particlesMade;
41 }
void CreateThreeDParticles(TwoViewTransverseTracksAlgorithm *const pAlgorithm, const MatrixType::ElementList &elementList, bool &particlesMade) const
Create three dimensional particles for a given tensor element list.

Member Data Documentation

float lar_content::TwoViewClearTracksTool::m_minLocallyMatchedFraction
private

The min locally matched fraction for particle creation.

Definition at line 43 of file TwoViewClearTracksTool.h.

Referenced by ReadSettings().

float lar_content::TwoViewClearTracksTool::m_minMatchingScore
private

The min global matching score for particle creation.

Definition at line 42 of file TwoViewClearTracksTool.h.

Referenced by ReadSettings().

float lar_content::TwoViewClearTracksTool::m_minXOverlapFraction
private

The min x overlap fraction value for particle creation.

Definition at line 41 of file TwoViewClearTracksTool.h.

Referenced by CreateThreeDParticles(), and ReadSettings().


The documentation for this class was generated from the following files: