LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::ClearTracksTool Class Reference

ClearTracksTool class. More...

#include "ClearTracksTool.h"

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

Public Types

typedef ThreeDTransverseTracksAlgorithm::TensorType TensorType
 
typedef std::vector< TensorType::ElementList::const_iteratorIteratorList
 

Public Member Functions

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

Private Member Functions

pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
void CreateThreeDParticles (ThreeDTransverseTracksAlgorithm *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...
 

Detailed Description

ClearTracksTool class.

Definition at line 19 of file ClearTracksTool.h.

Member Typedef Documentation

Constructor & Destructor Documentation

lar_content::ClearTracksTool::ClearTracksTool ( )

Default constructor.

Definition at line 17 of file ClearTracksTool.cc.

17  :
20 {
21 }
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
TFile f
Definition: plotHisto.C:6
float m_minXOverlapFraction
The min x overlap fraction (in each view) for particle creation.

Member Function Documentation

void lar_content::ClearTracksTool::CreateThreeDParticles ( ThreeDTransverseTracksAlgorithm *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 41 of file ClearTracksTool.cc.

References lar_content::ThreeDBaseAlgorithm< T >::CreateThreeDParticles(), lar_content::ProtoParticle::m_clusterListU, lar_content::ProtoParticle::m_clusterListV, lar_content::ProtoParticle::m_clusterListW, m_minMatchedFraction, and m_minXOverlapFraction.

Referenced by Run().

43 {
44  ProtoParticleVector protoParticleVector;
45 
46  for (TensorType::ElementList::const_iterator iter = elementList.begin(), iterEnd = elementList.end(); iter != iterEnd; ++iter)
47  {
48  if (iter->GetOverlapResult().GetMatchedFraction() < m_minMatchedFraction)
49  continue;
50 
51  const XOverlap &xOverlap(iter->GetOverlapResult().GetXOverlap());
52 
53  if ((xOverlap.GetXSpanU() < std::numeric_limits<float>::epsilon()) || (xOverlap.GetXOverlapSpan() / xOverlap.GetXSpanU() < m_minXOverlapFraction))
54  continue;
55 
56  if ((xOverlap.GetXSpanV() < std::numeric_limits<float>::epsilon()) || (xOverlap.GetXOverlapSpan() / xOverlap.GetXSpanV() < m_minXOverlapFraction))
57  continue;
58 
59  if ((xOverlap.GetXSpanW() < std::numeric_limits<float>::epsilon()) || (xOverlap.GetXOverlapSpan() / xOverlap.GetXSpanW() < m_minXOverlapFraction))
60  continue;
61 
62  ProtoParticle protoParticle;
63  protoParticle.m_clusterListU.push_back(iter->GetClusterU());
64  protoParticle.m_clusterListV.push_back(iter->GetClusterV());
65  protoParticle.m_clusterListW.push_back(iter->GetClusterW());
66  protoParticleVector.push_back(protoParticle);
67  }
68 
69  particlesMade |= pAlgorithm->CreateThreeDParticles(protoParticleVector);
70 }
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 74 of file ClearTracksTool.cc.

References m_minMatchedFraction, and m_minXOverlapFraction.

75 {
76  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
77  "MinMatchedFraction", m_minMatchedFraction));
78 
79  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
80  "MinXOverlapFraction", m_minXOverlapFraction));
81 
82  return STATUS_CODE_SUCCESS;
83 }
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 ( ThreeDTransverseTracksAlgorithm *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 25 of file ClearTracksTool.cc.

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

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

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.

Referenced by CreateThreeDParticles(), and ReadSettings().

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.

Referenced by CreateThreeDParticles(), and ReadSettings().


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