Public Member Functions | Private Member Functions | Private Attributes | List of all members
lar_content::ClearTracksTool Class Reference

ClearTracksTool class. More...

#include <ClearTracksTool.h>

Inheritance diagram for lar_content::ClearTracksTool:
lar_content::TransverseTensorTool

Public Member Functions

 ClearTracksTool ()
 Default constructor. More...
 
bool Run (ThreeViewTransverseTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor)
 Run the algorithm tool. More...
 

Private Member Functions

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

Private Attributes

float m_minMatchedFraction
 The min matched sampling point fraction for particle creation. More...
 
float m_minXOverlapFraction
 The min x overlap fraction (in each view) for particle creation. More...
 

Additional Inherited Members

- Public Types inherited from lar_content::TransverseTensorTool
typedef ThreeViewTransverseTracksAlgorithm::MatchingType::TensorType TensorType
 
typedef std::vector< TensorType::ElementList::const_iteratorIteratorList
 

Detailed Description

ClearTracksTool class.

Definition at line 19 of file ClearTracksTool.h.

Constructor & Destructor Documentation

lar_content::ClearTracksTool::ClearTracksTool ( )

Default constructor.

Definition at line 17 of file ClearTracksTool.cc.

18 {
19 }
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
float m_minXOverlapFraction
The min x overlap fraction (in each view) for particle creation.

Member Function Documentation

void lar_content::ClearTracksTool::CreateThreeDParticles ( ThreeViewTransverseTracksAlgorithm *const  pAlgorithm,
const TensorType::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 39 of file ClearTracksTool.cc.

41 {
42  ProtoParticleVector protoParticleVector;
43 
44  for (TensorType::ElementList::const_iterator iter = elementList.begin(), iterEnd = elementList.end(); iter != iterEnd; ++iter)
45  {
46  if (iter->GetOverlapResult().GetMatchedFraction() < m_minMatchedFraction)
47  continue;
48 
49  const XOverlap &xOverlap(iter->GetOverlapResult().GetXOverlap());
50 
51  if ((xOverlap.GetXSpanU() < std::numeric_limits<float>::epsilon()) || (xOverlap.GetXOverlapSpan() / xOverlap.GetXSpanU() < m_minXOverlapFraction))
52  continue;
53 
54  if ((xOverlap.GetXSpanV() < std::numeric_limits<float>::epsilon()) || (xOverlap.GetXOverlapSpan() / xOverlap.GetXSpanV() < m_minXOverlapFraction))
55  continue;
56 
57  if ((xOverlap.GetXSpanW() < std::numeric_limits<float>::epsilon()) || (xOverlap.GetXOverlapSpan() / xOverlap.GetXSpanW() < m_minXOverlapFraction))
58  continue;
59 
60  ProtoParticle protoParticle;
61  protoParticle.m_clusterList.push_back(iter->GetClusterU());
62  protoParticle.m_clusterList.push_back(iter->GetClusterV());
63  protoParticle.m_clusterList.push_back(iter->GetClusterW());
64  protoParticleVector.push_back(protoParticle);
65  }
66 
67  particlesMade |= pAlgorithm->CreateThreeDParticles(protoParticleVector);
68 }
std::vector< ProtoParticle > ProtoParticleVector
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
intermediate_table::const_iterator const_iterator
float m_minXOverlapFraction
The min x overlap fraction (in each view) for particle creation.
StatusCode lar_content::ClearTracksTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 72 of file ClearTracksTool.cc.

73 {
74  PANDORA_RETURN_RESULT_IF_AND_IF(
75  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinMatchedFraction", m_minMatchedFraction));
76 
77  PANDORA_RETURN_RESULT_IF_AND_IF(
78  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinXOverlapFraction", m_minXOverlapFraction));
79 
80  return STATUS_CODE_SUCCESS;
81 }
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
float m_minXOverlapFraction
The min x overlap fraction (in each view) for particle creation.
bool lar_content::ClearTracksTool::Run ( ThreeViewTransverseTracksAlgorithm *const  pAlgorithm,
TensorType overlapTensor 
)
virtual

Run the algorithm tool.

Parameters
pAlgorithmaddress of the calling algorithm
overlapTensorthe overlap tensor
Returns
whether changes have been made by the tool

Implements lar_content::TransverseTensorTool.

Definition at line 23 of file ClearTracksTool.cc.

24 {
25  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
26  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
27 
28  bool particlesMade(false);
29 
30  TensorType::ElementList elementList;
31  overlapTensor.GetUnambiguousElements(true, elementList);
32  this->CreateThreeDParticles(pAlgorithm, elementList, particlesMade);
33 
34  return particlesMade;
35 }
void CreateThreeDParticles(ThreeViewTransverseTracksAlgorithm *const pAlgorithm, const TensorType::ElementList &elementList, bool &particlesMade) const
Create three dimensional particles for a given tensor element list.
QTextStream & endl(QTextStream &s)

Member Data Documentation

float lar_content::ClearTracksTool::m_minMatchedFraction
private

The min matched sampling point fraction for particle creation.

Definition at line 41 of file ClearTracksTool.h.

float lar_content::ClearTracksTool::m_minXOverlapFraction
private

The min x overlap fraction (in each view) for particle creation.

Definition at line 42 of file ClearTracksTool.h.


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