LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::DeltaRayIdentificationAlgorithm Class Reference

DeltaRayIdentificationAlgorithm class. More...

#include "DeltaRayIdentificationAlgorithm.h"

Inheritance diagram for lar_content::DeltaRayIdentificationAlgorithm:

Public Member Functions

 DeltaRayIdentificationAlgorithm ()
 Default constructor. More...
 

Private Types

typedef std::unordered_map< const pandora::ParticleFlowObject *, const pandora::ParticleFlowObject * > PfoAssociationMap
 

Private Member Functions

pandora::StatusCode Run ()
 
void GetPfos (const std::string &inputPfoListName, pandora::PfoVector &outputPfoVector) const
 Get the vector of Pfos, given the input list name. More...
 
void BuildAssociationMap (const pandora::PfoVector &inputPfos, const pandora::PfoVector &outputPfos, PfoAssociationMap &pfoAssociationMap) const
 Build parent/daughter associations between PFOs. More...
 
bool IsAssociated (const pandora::ParticleFlowObject *const pDaughterPfo, const pandora::ParticleFlowObject *const pParentPfo, float &displacement) const
 Determine if a given pair of Pfos have a parent/daughter association. More...
 
float GetTwoDSeparation (const pandora::ParticleFlowObject *const pDaughterPfo, const pandora::ParticleFlowObject *const pParentPfo) const
 Calculate 2D separation between two Pfos. More...
 
void GetTwoDVertices (const pandora::ParticleFlowObject *const pPfo, const pandora::HitType &hitType, pandora::CartesianPointVector &vertexVector) const
 Calculate 2D separation between two Pfos. More...
 
float GetClosestDistance (const pandora::CartesianPointVector &vertexVector, const pandora::ClusterList &clusterList) const
 Calculate closest 2D separation between a set of vertices and a set of clusters. More...
 
void BuildParentDaughterLinks (const PfoAssociationMap &pfoAssociationMap, pandora::PfoList &outputPfoList) const
 Build the parent/daughter links from the map of parent/daughter associations. More...
 
const pandora::ParticleFlowObject * GetParent (const PfoAssociationMap &pfoAssociationMap, const pandora::ParticleFlowObject *const pPfo) const
 For a given daughter, follow the parent/daughter links to find the overall parent. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

std::string m_parentPfoListName
 The parent pfo list name. More...
 
std::string m_daughterPfoListName
 The daughter pfo list name. More...
 
float m_distanceForMatching
 Maximum allowed distance of delta ray from parent cosmic ray. More...
 
float m_minParentLengthSquared
 Minimum allowed length of parent cosmic ray. More...
 
float m_maxDaughterLengthSquared
 Maximum allowed length of daughter delta ray. More...
 

Detailed Description

Member Typedef Documentation

typedef std::unordered_map<const pandora::ParticleFlowObject*, const pandora::ParticleFlowObject*> lar_content::DeltaRayIdentificationAlgorithm::PfoAssociationMap
private

Definition at line 32 of file DeltaRayIdentificationAlgorithm.h.

Constructor & Destructor Documentation

lar_content::DeltaRayIdentificationAlgorithm::DeltaRayIdentificationAlgorithm ( )

Default constructor.

Definition at line 21 of file DeltaRayIdentificationAlgorithm.cc.

21  :
23  m_minParentLengthSquared(10.f * 10.f),
24  m_maxDaughterLengthSquared(175.f * 175.f)
25 {
26 }
float m_distanceForMatching
Maximum allowed distance of delta ray from parent cosmic ray.
float m_maxDaughterLengthSquared
Maximum allowed length of daughter delta ray.
TFile f
Definition: plotHisto.C:6
float m_minParentLengthSquared
Minimum allowed length of parent cosmic ray.

Member Function Documentation

void lar_content::DeltaRayIdentificationAlgorithm::BuildAssociationMap ( const pandora::PfoVector &  inputPfos,
const pandora::PfoVector &  outputPfos,
PfoAssociationMap pfoAssociationMap 
) const
private

Build parent/daughter associations between PFOs.

Parameters
inputPfosthe input vector of current parent Pfos
outputPfosthe input vector of current daughter Pfos
pfoAssociationMapthe output map of parent/daughter associations

Definition at line 77 of file DeltaRayIdentificationAlgorithm.cc.

References IsAssociated(), and max.

Referenced by Run().

79 {
80  PfoSet parentPfoList, daughterPfoList;
81  parentPfoList.insert(parentPfos.begin(), parentPfos.end());
82  daughterPfoList.insert(daughterPfos.begin(), daughterPfos.end());
83 
84  PfoVector allPfos(parentPfos.begin(), parentPfos.end());
85  allPfos.insert(allPfos.end(), daughterPfos.begin(), daughterPfos.end());
86 
87  // Loop over possible daughter Pfos in primary list
88  for (PfoVector::const_iterator iter1 = parentPfos.begin(), iterEnd1 = parentPfos.end(); iter1 != iterEnd1; ++iter1)
89  {
90  const ParticleFlowObject *const pDaughterPfo = *iter1;
91 
92  // Find the best parent Pfo using combined list
93  const ParticleFlowObject *pBestParentPfo = NULL;
94  float bestDisplacement(std::numeric_limits<float>::max());
95 
96  for (PfoVector::const_iterator iter2 = allPfos.begin(), iterEnd2 = allPfos.end(); iter2 != iterEnd2; ++iter2)
97  {
98  const ParticleFlowObject *const pThisParentPfo = *iter2;
99  float thisDisplacement(std::numeric_limits<float>::max());
100 
101  if (pDaughterPfo == pThisParentPfo)
102  continue;
103 
104  if (!this->IsAssociated(pDaughterPfo, pThisParentPfo, thisDisplacement))
105  continue;
106 
107  if (thisDisplacement < bestDisplacement)
108  {
109  bestDisplacement = thisDisplacement;
110  pBestParentPfo = pThisParentPfo;
111  }
112  }
113 
114  if (!pBestParentPfo)
115  continue;
116 
117  // Case 1: candidate parent comes from primary list
118  if (pBestParentPfo->GetParentPfoList().empty())
119  {
120  // Check: parent shouldn't live in the secondary list
121  if (daughterPfoList.count(pBestParentPfo))
122  throw StatusCodeException(STATUS_CODE_FAILURE);
123 
124  pfoAssociationMap.insert(PfoAssociationMap::value_type(pDaughterPfo, pBestParentPfo));
125  }
126 
127  // Case 2: candidate parent comes from secondary list
128  else
129  {
130  // Check: parent shouldn't live in the primary list
131  if (parentPfoList.count(pBestParentPfo))
132  throw StatusCodeException(STATUS_CODE_FAILURE);
133 
134  // Check: there should only be one parent
135  if (pBestParentPfo->GetParentPfoList().size() != 1)
136  throw StatusCodeException(STATUS_CODE_FAILURE);
137 
138  // Check: get the new parent (and check there is no grand-parent)
139  PfoList::const_iterator pIter = pBestParentPfo->GetParentPfoList().begin();
140  const ParticleFlowObject *const pReplacementParentPfo = *pIter;
141  if (pReplacementParentPfo->GetParentPfoList().size() != 0)
142  throw StatusCodeException(STATUS_CODE_FAILURE);
143 
144  pfoAssociationMap.insert(PfoAssociationMap::value_type(pDaughterPfo, pReplacementParentPfo));
145  }
146  }
147 }
Int_t max
Definition: plot.C:27
intermediate_table::const_iterator const_iterator
bool IsAssociated(const pandora::ParticleFlowObject *const pDaughterPfo, const pandora::ParticleFlowObject *const pParentPfo, float &displacement) const
Determine if a given pair of Pfos have a parent/daughter association.
void lar_content::DeltaRayIdentificationAlgorithm::BuildParentDaughterLinks ( const PfoAssociationMap pfoAssociationMap,
pandora::PfoList &  outputPfoList 
) const
private

Build the parent/daughter links from the map of parent/daughter associations.

Parameters
pfoAssociationMapthe map of parent/daughter associations
outputPfoListthe output list of daughter Pfos

Definition at line 277 of file DeltaRayIdentificationAlgorithm.cc.

References GetParent(), lar_content::LArPfoHelper::IsTrack(), and lar_content::LArPfoHelper::SortByNHits().

Referenced by Run().

278 {
279  PfoList pfoList;
280  for (const auto &mapEntry : pfoAssociationMap) pfoList.push_back(mapEntry.first);
281  pfoList.sort(LArPfoHelper::SortByNHits);
282 
283  for (const ParticleFlowObject *const pDaughterPfo : pfoList)
284  {
285  const ParticleFlowObject *const pParentPfo(this->GetParent(pfoAssociationMap, pDaughterPfo));
286 
287  if (!pParentPfo)
288  throw StatusCodeException(STATUS_CODE_FAILURE);
289 
290  if (!LArPfoHelper::IsTrack(pParentPfo))
291  continue;
292 
293  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SetPfoParentDaughterRelationship(*this, pParentPfo, pDaughterPfo));
294 
295  PandoraContentApi::ParticleFlowObject::Metadata metadata;
296  metadata.m_particleId = E_MINUS;
297  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*this, pDaughterPfo, metadata));
298 
299  daughterPfoList.push_back(pDaughterPfo);
300  }
301 }
static bool SortByNHits(const pandora::ParticleFlowObject *const pLhs, const pandora::ParticleFlowObject *const pRhs)
Sort pfos by number of constituent hits.
const pandora::ParticleFlowObject * GetParent(const PfoAssociationMap &pfoAssociationMap, const pandora::ParticleFlowObject *const pPfo) const
For a given daughter, follow the parent/daughter links to find the overall parent.
static bool IsTrack(const pandora::ParticleFlowObject *const pPfo)
Return track flag based on Pfo Particle ID.
float lar_content::DeltaRayIdentificationAlgorithm::GetClosestDistance ( const pandora::CartesianPointVector &  vertexVector,
const pandora::ClusterList &  clusterList 
) const
private

Calculate closest 2D separation between a set of vertices and a set of clusters.

Parameters
vertexVectorthe vector of possible vertex positions
clusterListthe list of clusters

Definition at line 251 of file DeltaRayIdentificationAlgorithm.cc.

References lar_content::LArClusterHelper::GetClosestDistance(), and max.

Referenced by GetTwoDSeparation().

252 {
253  if (vertexVector.empty() || clusterList.empty())
254  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
255 
256  float bestDisplacement(std::numeric_limits<float>::max());
257 
258  for (CartesianPointVector::const_iterator iter1 = vertexVector.begin(), iterEnd1 = vertexVector.end(); iter1 != iterEnd1; ++iter1)
259  {
260  const CartesianVector &thisVertex = *iter1;
261 
262  for (ClusterList::const_iterator iter2 = clusterList.begin(), iterEnd2 = clusterList.end(); iter2 != iterEnd2; ++iter2)
263  {
264  const Cluster *const pCluster = *iter2;
265  const float thisDisplacement(LArClusterHelper::GetClosestDistance(thisVertex, pCluster));
266 
267  if (thisDisplacement < bestDisplacement)
268  bestDisplacement = thisDisplacement;
269  }
270  }
271 
272  return bestDisplacement;
273 }
Int_t max
Definition: plot.C:27
intermediate_table::const_iterator const_iterator
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.
const ParticleFlowObject * lar_content::DeltaRayIdentificationAlgorithm::GetParent ( const PfoAssociationMap pfoAssociationMap,
const pandora::ParticleFlowObject *const  pPfo 
) const
private

For a given daughter, follow the parent/daughter links to find the overall parent.

Parameters
pfoAssociationMapthe map of parent/daughter associations
pPfothe daughter Pfo
Returns
the parent Pfo

Definition at line 305 of file DeltaRayIdentificationAlgorithm.cc.

Referenced by BuildParentDaughterLinks().

307 {
308  const ParticleFlowObject *pParentPfo = nullptr;
309  const ParticleFlowObject *pDaughterPfo = pPfo;
310 
311  while(1)
312  {
313  PfoAssociationMap::const_iterator iter = pfoAssociationMap.find(pDaughterPfo);
314  if (pfoAssociationMap.end() == iter)
315  break;
316 
317  pParentPfo = iter->second;
318  pDaughterPfo = pParentPfo;
319  }
320 
321  return pParentPfo;
322 }
intermediate_table::const_iterator const_iterator
void lar_content::DeltaRayIdentificationAlgorithm::GetPfos ( const std::string &  inputPfoListName,
pandora::PfoVector &  outputPfoVector 
) const
private

Get the vector of Pfos, given the input list name.

Parameters
inputPfoListNamethe input Pfo list name
outputPfoVectorthe output vector of Pfos

Definition at line 62 of file DeltaRayIdentificationAlgorithm.cc.

References lar_content::LArPfoHelper::SortByNHits().

Referenced by Run().

63 {
64  const PfoList *pPfoList = NULL;
65  PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this,
66  inputPfoListName, pPfoList));
67 
68  if (NULL == pPfoList)
69  return;
70 
71  outputPfoVector.insert(outputPfoVector.end(), pPfoList->begin(), pPfoList->end());
72  std::sort(outputPfoVector.begin(), outputPfoVector.end(), LArPfoHelper::SortByNHits);
73 }
static bool SortByNHits(const pandora::ParticleFlowObject *const pLhs, const pandora::ParticleFlowObject *const pRhs)
Sort pfos by number of constituent hits.
float lar_content::DeltaRayIdentificationAlgorithm::GetTwoDSeparation ( const pandora::ParticleFlowObject *const  pDaughterPfo,
const pandora::ParticleFlowObject *const  pParentPfo 
) const
private

Calculate 2D separation between two Pfos.

Parameters
pDaughterPfothe input daughter Pfo
pParentPfothe input parent Pfo
Returns
average displacement between parent and daughter

Definition at line 188 of file DeltaRayIdentificationAlgorithm.cc.

References f, GetClosestDistance(), lar_content::LArPfoHelper::GetClusters(), and GetTwoDVertices().

Referenced by IsAssociated().

189 {
190  CartesianPointVector vertexVectorU, vertexVectorV, vertexVectorW;
191  this->GetTwoDVertices(pDaughterPfo, TPC_VIEW_U, vertexVectorU);
192  this->GetTwoDVertices(pDaughterPfo, TPC_VIEW_V, vertexVectorV);
193  this->GetTwoDVertices(pDaughterPfo, TPC_VIEW_W, vertexVectorW);
194 
195  ClusterList clusterListU, clusterListV, clusterListW;
196  LArPfoHelper::GetClusters(pParentPfo, TPC_VIEW_U, clusterListU);
197  LArPfoHelper::GetClusters(pParentPfo, TPC_VIEW_V, clusterListV);
198  LArPfoHelper::GetClusters(pParentPfo, TPC_VIEW_W, clusterListW);
199 
200  float sumViews(0.f);
201  float sumDisplacementSquared(0.f);
202 
203  if (!vertexVectorU.empty())
204  {
205  const float thisDisplacement(this->GetClosestDistance(vertexVectorU, clusterListU));
206  sumDisplacementSquared += thisDisplacement * thisDisplacement;
207  sumViews += 1.f;
208  }
209 
210  if (!vertexVectorV.empty())
211  {
212  const float thisDisplacement(this->GetClosestDistance(vertexVectorV, clusterListV));
213  sumDisplacementSquared += thisDisplacement * thisDisplacement;
214  sumViews += 1.f;
215  }
216 
217  if (!vertexVectorW.empty())
218  {
219  const float thisDisplacement(this->GetClosestDistance(vertexVectorW, clusterListW));
220  sumDisplacementSquared += thisDisplacement * thisDisplacement;
221  sumViews += 1.f;
222  }
223 
224  if (sumViews < std::numeric_limits<float>::epsilon())
225  throw StatusCodeException(STATUS_CODE_FAILURE);
226 
227  return std::sqrt(sumDisplacementSquared / sumViews);
228 }
static void GetClusters(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::ClusterList &clusterList)
Get a list of clusters of a particular hit type from a list of pfos.
TFile f
Definition: plotHisto.C:6
void GetTwoDVertices(const pandora::ParticleFlowObject *const pPfo, const pandora::HitType &hitType, pandora::CartesianPointVector &vertexVector) const
Calculate 2D separation between two Pfos.
float GetClosestDistance(const pandora::CartesianPointVector &vertexVector, const pandora::ClusterList &clusterList) const
Calculate closest 2D separation between a set of vertices and a set of clusters.
void lar_content::DeltaRayIdentificationAlgorithm::GetTwoDVertices ( const pandora::ParticleFlowObject *const  pPfo,
const pandora::HitType &  hitType,
pandora::CartesianPointVector &  vertexVector 
) const
private

Calculate 2D separation between two Pfos.

Parameters
pPfothe input daughter Pfo
hitTypethe hit type
vertexVectorthe vector of possible vertex positions

Definition at line 232 of file DeltaRayIdentificationAlgorithm.cc.

References f, lar_content::LArPfoHelper::GetClusters(), and lar_content::LArClusterHelper::GetExtremalCoordinates().

Referenced by GetTwoDSeparation().

233 {
234  ClusterList clusterList;
235  LArPfoHelper::GetClusters(pPfo, hitType, clusterList);
236 
237  for (ClusterList::const_iterator iter = clusterList.begin(), iterEnd = clusterList.end(); iter != iterEnd; ++iter)
238  {
239  const Cluster *const pCluster = *iter;
240 
241  CartesianVector firstCoordinate(0.f,0.f,0.f), secondCoordinate(0.f,0.f,0.f);
242  LArClusterHelper::GetExtremalCoordinates(pCluster, firstCoordinate, secondCoordinate);
243 
244  vertexVector.push_back(firstCoordinate);
245  vertexVector.push_back(secondCoordinate);
246  }
247 }
static void GetClusters(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::ClusterList &clusterList)
Get a list of clusters of a particular hit type from a list of pfos.
TFile f
Definition: plotHisto.C:6
intermediate_table::const_iterator const_iterator
static void GetExtremalCoordinates(const pandora::ClusterList &clusterList, pandora::CartesianVector &innerCoordinate, pandora::CartesianVector &outerCoordinate)
Get positions of the two most distant calo hits in a list of cluster (ordered by Z) ...
bool lar_content::DeltaRayIdentificationAlgorithm::IsAssociated ( const pandora::ParticleFlowObject *const  pDaughterPfo,
const pandora::ParticleFlowObject *const  pParentPfo,
float &  displacement 
) const
private

Determine if a given pair of Pfos have a parent/daughter association.

Parameters
pDaughterPfothe input daughter Pfo
pParentPfothe input parent Pfo
displacementthe average displacement between parent and daughter
Returns
boolean

Definition at line 151 of file DeltaRayIdentificationAlgorithm.cc.

References f, lar_content::LArPfoHelper::GetTwoDLengthSquared(), GetTwoDSeparation(), m_distanceForMatching, m_maxDaughterLengthSquared, m_minParentLengthSquared, and max.

Referenced by BuildAssociationMap().

153 {
154  displacement = std::numeric_limits<float>::max();
155 
156  if (pDaughterPfo == pParentPfo)
157  return false;
158 
159  const float daughterLengthSquared(LArPfoHelper::GetTwoDLengthSquared(pDaughterPfo));
160  const float parentLengthSquared(LArPfoHelper::GetTwoDLengthSquared(pParentPfo));
161 
162  if (daughterLengthSquared > m_maxDaughterLengthSquared || parentLengthSquared < m_minParentLengthSquared ||
163  daughterLengthSquared > 0.5 * parentLengthSquared)
164  return false;
165 
166  const float transitionLengthSquared(125.f);
167  const float displacementCut((daughterLengthSquared > transitionLengthSquared) ? m_distanceForMatching :
168  m_distanceForMatching * (2.f - daughterLengthSquared / transitionLengthSquared));
169 
170  try
171  {
172  displacement = this->GetTwoDSeparation(pDaughterPfo, pParentPfo);
173  }
174  catch(StatusCodeException &statusCodeException)
175  {
176  if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
177  throw statusCodeException;
178  }
179 
180  if (displacement > displacementCut)
181  return false;
182 
183  return true;
184 }
float m_distanceForMatching
Maximum allowed distance of delta ray from parent cosmic ray.
float GetTwoDSeparation(const pandora::ParticleFlowObject *const pDaughterPfo, const pandora::ParticleFlowObject *const pParentPfo) const
Calculate 2D separation between two Pfos.
static float GetTwoDLengthSquared(const pandora::ParticleFlowObject *const pPfo)
Calculate length of Pfo using 2D clusters.
float m_maxDaughterLengthSquared
Maximum allowed length of daughter delta ray.
TFile f
Definition: plotHisto.C:6
Int_t max
Definition: plot.C:27
float m_minParentLengthSquared
Minimum allowed length of parent cosmic ray.
StatusCode lar_content::DeltaRayIdentificationAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 326 of file DeltaRayIdentificationAlgorithm.cc.

References m_daughterPfoListName, m_distanceForMatching, m_maxDaughterLengthSquared, m_minParentLengthSquared, and m_parentPfoListName.

327 {
328  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "ParentPfoListName", m_parentPfoListName));
329  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "DaughterPfoListName", m_daughterPfoListName));
330 
331  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
332  "DistanceForMatching", m_distanceForMatching));
333 
334  float minParentLength = std::sqrt(m_minParentLengthSquared);
335  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
336  "MinParentLength", minParentLength));
337  m_minParentLengthSquared = minParentLength * minParentLength;
338 
339  float maxDaughterLength = std::sqrt(m_maxDaughterLengthSquared);
340  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
341  "MaxDaughterLength", maxDaughterLength));
342  m_maxDaughterLengthSquared = maxDaughterLength * maxDaughterLength;
343 
344  return STATUS_CODE_SUCCESS;
345 }
float m_distanceForMatching
Maximum allowed distance of delta ray from parent cosmic ray.
std::string m_parentPfoListName
The parent pfo list name.
float m_maxDaughterLengthSquared
Maximum allowed length of daughter delta ray.
std::string m_daughterPfoListName
The daughter pfo list name.
float m_minParentLengthSquared
Minimum allowed length of parent cosmic ray.
StatusCode lar_content::DeltaRayIdentificationAlgorithm::Run ( )
private

Definition at line 30 of file DeltaRayIdentificationAlgorithm.cc.

References BuildAssociationMap(), BuildParentDaughterLinks(), GetPfos(), m_daughterPfoListName, and m_parentPfoListName.

31 {
32  PfoVector parentPfos, daughterPfos;
33  this->GetPfos(m_parentPfoListName, parentPfos);
34  this->GetPfos(m_daughterPfoListName, daughterPfos);
35 
36  if (parentPfos.empty())
37  {
38  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
39  std::cout << "DeltaRayIdentificationAlgorithm: pfo list " << m_parentPfoListName << " unavailable." << std::endl;
40  return STATUS_CODE_SUCCESS;
41  }
42 
43  // Build parent/daughter associations (currently using length and proximity)
44  PfoAssociationMap pfoAssociationMap;
45  this->BuildAssociationMap(parentPfos, daughterPfos, pfoAssociationMap);
46 
47  // Create the parent/daughter links
48  PfoList newDaughterPfoList;
49  this->BuildParentDaughterLinks(pfoAssociationMap, newDaughterPfoList);
50 
51  if (!newDaughterPfoList.empty())
52  {
53  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList(*this, m_parentPfoListName, m_daughterPfoListName,
54  newDaughterPfoList));
55  }
56 
57  return STATUS_CODE_SUCCESS;
58 }
void GetPfos(const std::string &inputPfoListName, pandora::PfoVector &outputPfoVector) const
Get the vector of Pfos, given the input list name.
std::string m_parentPfoListName
The parent pfo list name.
std::string m_daughterPfoListName
The daughter pfo list name.
void BuildParentDaughterLinks(const PfoAssociationMap &pfoAssociationMap, pandora::PfoList &outputPfoList) const
Build the parent/daughter links from the map of parent/daughter associations.
void BuildAssociationMap(const pandora::PfoVector &inputPfos, const pandora::PfoVector &outputPfos, PfoAssociationMap &pfoAssociationMap) const
Build parent/daughter associations between PFOs.
std::unordered_map< const pandora::ParticleFlowObject *, const pandora::ParticleFlowObject * > PfoAssociationMap

Member Data Documentation

std::string lar_content::DeltaRayIdentificationAlgorithm::m_daughterPfoListName
private

The daughter pfo list name.

Definition at line 113 of file DeltaRayIdentificationAlgorithm.h.

Referenced by ReadSettings(), and Run().

float lar_content::DeltaRayIdentificationAlgorithm::m_distanceForMatching
private

Maximum allowed distance of delta ray from parent cosmic ray.

Definition at line 115 of file DeltaRayIdentificationAlgorithm.h.

Referenced by IsAssociated(), and ReadSettings().

float lar_content::DeltaRayIdentificationAlgorithm::m_maxDaughterLengthSquared
private

Maximum allowed length of daughter delta ray.

Definition at line 117 of file DeltaRayIdentificationAlgorithm.h.

Referenced by IsAssociated(), and ReadSettings().

float lar_content::DeltaRayIdentificationAlgorithm::m_minParentLengthSquared
private

Minimum allowed length of parent cosmic ray.

Definition at line 116 of file DeltaRayIdentificationAlgorithm.h.

Referenced by IsAssociated(), and ReadSettings().

std::string lar_content::DeltaRayIdentificationAlgorithm::m_parentPfoListName
private

The parent pfo list name.

Definition at line 112 of file DeltaRayIdentificationAlgorithm.h.

Referenced by ReadSettings(), and Run().


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