LArSoft  v10_06_00
Liquid Argon Software toolkit - https://larsoft.org/
LArHierarchyPfo.h
Go to the documentation of this file.
1 
8 #ifndef LAR_HIERARCHY_PFO_H
9 #define LAR_HIERARCHY_PFO_H 1
10 
11 #include "Pandora/PandoraInternal.h"
12 
15 
16 using namespace lar_content;
17 
18 namespace lar_dl_content
19 {
20 
25 {
26 public:
30  ExtremalPoint();
31 
35  ExtremalPoint(const ExtremalPoint &extremalPoint);
36 
42  const pandora::CartesianVector &GetPosition() const;
43 
49  const pandora::CartesianVector &GetDirection() const;
50 
57  void Set(const pandora::CartesianVector &position, const pandora::CartesianVector &direction);
58 
64  bool IsSet() const;
65 
69  ExtremalPoint &operator=(const ExtremalPoint &rhs);
70 
71 private:
72  bool m_isSet;
73  pandora::CartesianVector m_position;
74  pandora::CartesianVector m_direction;
75 };
76 
77 //------------------------------------------------------------------------------------------------------------------------------------------
78 
83 {
84 public:
88  HierarchyPfo();
89 
98  HierarchyPfo(const pandora::ParticleFlowObject *pPfo, const ThreeDSlidingFitResult &threeDSlidingFitResult,
99  const ExtremalPoint &upstreamPoint, const ExtremalPoint &downstreamPoint);
100 
106  const pandora::ParticleFlowObject *GetPfo() const;
107 
113  void SetPfo(const pandora::ParticleFlowObject *pPfo);
114 
120  const ThreeDSlidingFitResult &GetSlidingFitResult() const;
121 
127  const pandora::ParticleFlowObject *GetPredictedParentPfo() const;
128 
134  void SetPredictedParentPfo(const pandora::ParticleFlowObject *pPredictedParentPfo);
135 
141  const pandora::ParticleFlowObject *GetParentPfo() const;
142 
148  void SetParentPfo(const pandora::ParticleFlowObject *pParentPfo);
149 
155  const pandora::PfoVector &GetChildPfoVector() const;
156 
162  void AddChildPfo(const pandora::ParticleFlowObject *const pChildPfo);
163 
169  const ExtremalPoint &GetUpstreamPoint() const;
170 
176  void SetUpstreamPoint(const ExtremalPoint &upstreamPoint);
177 
183  const ExtremalPoint &GetDownstreamPoint() const;
184 
190  void SetDownstreamPoint(const ExtremalPoint &downstreamPoint);
191 
197  float GetPrimaryScore() const;
198 
204  void SetPrimaryScore(const float primaryScore);
205 
211  float GetLaterTierScore() const;
212 
218  void SetLaterTierScore(const float laterTierScore);
219 
225  bool GetIsInHierarchy() const;
226 
232  void SetIsInHierarchy(const bool isInHierarchy);
233 
239  bool operator==(const HierarchyPfo &rhs) const;
240 
246  bool operator==(const pandora::ParticleFlowObject *const rhs) const;
247 
248 private:
249  const pandora::ParticleFlowObject *m_pPfo;
251  const pandora::ParticleFlowObject *m_pPredictedParentPfo;
252  const pandora::ParticleFlowObject *m_pParentPfo;
253  pandora::PfoVector m_childPfoVector;
259 };
260 
261 typedef std::vector<HierarchyPfo> HierarchyPfoVector;
262 
263 //------------------------------------------------------------------------------------------------------------------------------------------
264 
265 inline ExtremalPoint::ExtremalPoint() :
266  m_isSet(false),
267  m_position(-999.f, -999.f, -999.f),
268  m_direction(-999.f, -999.f, -999.f)
269 {
270 }
271 
272 //------------------------------------------------------------------------------------------------------------------------------------------
273 
274 inline ExtremalPoint::ExtremalPoint(const ExtremalPoint &extremalPoint) :
275  m_isSet(extremalPoint.m_isSet),
276  m_position(extremalPoint.m_position),
277  m_direction(extremalPoint.m_direction)
278 {
279 }
280 
281 //------------------------------------------------------------------------------------------------------------------------------------------
282 
283 inline const pandora::CartesianVector &ExtremalPoint::GetPosition() const
284 {
285  return m_position;
286 }
287 
288 //------------------------------------------------------------------------------------------------------------------------------------------
289 
290 inline const pandora::CartesianVector &ExtremalPoint::GetDirection() const
291 {
292  return m_direction;
293 }
294 
295 //------------------------------------------------------------------------------------------------------------------------------------------
296 
297 inline void ExtremalPoint::Set(const pandora::CartesianVector &position, const pandora::CartesianVector &direction)
298 {
299  m_isSet = true;
300  m_position = position;
301  m_direction = direction;
302 }
303 
304 //------------------------------------------------------------------------------------------------------------------------------------------
305 
306 inline bool ExtremalPoint::IsSet() const
307 {
308  return m_isSet;
309 }
310 
311 //------------------------------------------------------------------------------------------------------------------------------------------
312 
314 {
315  this->m_isSet = rhs.m_isSet;
316  this->m_position = rhs.m_position;
317  this->m_direction = rhs.m_direction;
318 
319  return *this;
320 }
321 
322 //------------------------------------------------------------------------------------------------------------------------------------------
323 
324 inline HierarchyPfo::HierarchyPfo(const pandora::ParticleFlowObject *pPfo, const ThreeDSlidingFitResult &slidingFitResult,
325  const ExtremalPoint &upstreamPoint, const ExtremalPoint &downstreamPoint) :
326  m_pPfo(pPfo),
327  m_slidingFitResult(slidingFitResult),
328  m_pPredictedParentPfo(nullptr),
329  m_pParentPfo(nullptr),
330  m_childPfoVector(pandora::PfoVector()),
331  m_upstreamPoint(upstreamPoint),
332  m_downstreamPoint(downstreamPoint),
333  m_primaryScore(-std::numeric_limits<float>::max()),
334  m_laterTierScore(-std::numeric_limits<float>::max()),
335  m_isInHierarchy(false)
336 {
337 }
338 
339 //------------------------------------------------------------------------------------------------------------------------------------------
340 
341 inline const pandora::ParticleFlowObject *HierarchyPfo::GetPfo() const
342 {
343  return m_pPfo;
344 }
345 
346 //------------------------------------------------------------------------------------------------------------------------------------------
347 
348 inline void HierarchyPfo::SetPfo(const pandora::ParticleFlowObject *pPfo)
349 {
350  m_pPfo = pPfo;
351 }
352 
353 //------------------------------------------------------------------------------------------------------------------------------------------
354 
356 {
357  return m_slidingFitResult;
358 }
359 
360 //------------------------------------------------------------------------------------------------------------------------------------------
361 
362 inline const pandora::ParticleFlowObject *HierarchyPfo::GetPredictedParentPfo() const
363 {
364  return m_pPredictedParentPfo;
365 }
366 
367 //------------------------------------------------------------------------------------------------------------------------------------------
368 
369 inline void HierarchyPfo::SetPredictedParentPfo(const pandora::ParticleFlowObject *pPredictedParentPfo)
370 {
371  m_pPredictedParentPfo = pPredictedParentPfo;
372 }
373 
374 //------------------------------------------------------------------------------------------------------------------------------------------
375 
376 inline const pandora::ParticleFlowObject *HierarchyPfo::GetParentPfo() const
377 {
378  return m_pParentPfo;
379 }
380 
381 //------------------------------------------------------------------------------------------------------------------------------------------
382 
383 inline void HierarchyPfo::SetParentPfo(const pandora::ParticleFlowObject *pParentPfo)
384 {
385  m_pParentPfo = pParentPfo;
386 }
387 
388 //------------------------------------------------------------------------------------------------------------------------------------------
389 
390 inline const pandora::PfoVector &HierarchyPfo::GetChildPfoVector() const
391 {
392  return m_childPfoVector;
393 }
394 
395 //------------------------------------------------------------------------------------------------------------------------------------------
396 
397 inline void HierarchyPfo::AddChildPfo(const pandora::ParticleFlowObject *const pChildPfo)
398 {
399  m_childPfoVector.emplace_back(pChildPfo);
400 }
401 
402 //------------------------------------------------------------------------------------------------------------------------------------------
403 
405 {
406  return m_upstreamPoint;
407 }
408 
409 //------------------------------------------------------------------------------------------------------------------------------------------
410 
411 inline void HierarchyPfo::SetUpstreamPoint(const ExtremalPoint &upstreamPoint)
412 {
413  m_upstreamPoint = upstreamPoint;
414 }
415 
416 //------------------------------------------------------------------------------------------------------------------------------------------
417 
419 {
420  return m_downstreamPoint;
421 }
422 
423 //------------------------------------------------------------------------------------------------------------------------------------------
424 
425 inline void HierarchyPfo::SetDownstreamPoint(const ExtremalPoint &downstreamPoint)
426 {
427  m_downstreamPoint = downstreamPoint;
428 }
429 
430 //------------------------------------------------------------------------------------------------------------------------------------------
431 
432 inline float HierarchyPfo::GetPrimaryScore() const
433 {
434  return m_primaryScore;
435 }
436 
437 //------------------------------------------------------------------------------------------------------------------------------------------
438 
439 inline void HierarchyPfo::SetPrimaryScore(const float primaryScore)
440 {
441  m_primaryScore = primaryScore;
442 }
443 
444 //------------------------------------------------------------------------------------------------------------------------------------------
445 
447 {
448  return m_laterTierScore;
449 }
450 
451 //------------------------------------------------------------------------------------------------------------------------------------------
452 
453 inline void HierarchyPfo::SetLaterTierScore(const float laterTierScore)
454 {
455  m_laterTierScore = laterTierScore;
456 }
457 
458 //------------------------------------------------------------------------------------------------------------------------------------------
459 
461 {
462  return m_isInHierarchy;
463 }
464 
465 //------------------------------------------------------------------------------------------------------------------------------------------
466 
467 inline void HierarchyPfo::SetIsInHierarchy(const bool isInHierarchy)
468 {
469  m_isInHierarchy = isInHierarchy;
470 }
471 
472 //------------------------------------------------------------------------------------------------------------------------------------------
473 
474 inline bool HierarchyPfo::operator==(const HierarchyPfo &rhs) const
475 {
476  return this->GetPfo() == rhs.GetPfo();
477 }
478 
479 //------------------------------------------------------------------------------------------------------------------------------------------
480 
481 inline bool HierarchyPfo::operator==(const pandora::ParticleFlowObject *const rhs) const
482 {
483  return this->GetPfo() == rhs;
484 }
485 
486 //------------------------------------------------------------------------------------------------------------------------------------------
487 
488 } // namespace lar_dl_content
489 
490 #endif // #ifndef LAR_HIERARCHY_PFO_H
HierarchyPfo()
Default constructor.
void Set(const pandora::CartesianVector &position, const pandora::CartesianVector &direction)
Set the the extremal point&#39;s position and direction.
void SetIsInHierarchy(const bool isInHierarchy)
Set whether the pfo has been assigned to a particle hierarchy.
pandora::PfoVector m_childPfoVector
the vector of pointers to the assigned child pfos
HierarchyPfo class.
Header file for the pfo helper class.
ExtremalPoint m_downstreamPoint
The extremal point that lies furthest from the neutrino vertex.
void AddChildPfo(const pandora::ParticleFlowObject *const pChildPfo)
Add a child pfo to the child pfo vector.
const pandora::ParticleFlowObject * GetPfo() const
Get the pfo.
void SetDownstreamPoint(const ExtremalPoint &downstreamPoint)
Set the downstream extremal point.
pandora::CartesianVector m_position
the extremal point position
ThreeDSlidingFitResult m_slidingFitResult
the 3D sliding fit result of the pfo
float m_laterTierScore
the later tier network score
void SetUpstreamPoint(const ExtremalPoint &upstreamPoint)
Set the upstream extremal point.
pandora::CartesianVector m_direction
the extremal point direction (pointing into the particle)
STL namespace.
float m_primaryScore
the primary network score
std::vector< HierarchyPfo > HierarchyPfoVector
const pandora::ParticleFlowObject * m_pPredictedParentPfo
a pointer to the best matched parent pfo
TFile f
Definition: plotHisto.C:6
bool IsSet() const
Whether extremal point object has been set.
ExtremalPoint m_upstreamPoint
The extremal point that lies closest to the neutrino vertex.
const pandora::ParticleFlowObject * GetParentPfo() const
Get the parent pfo.
const ExtremalPoint & GetUpstreamPoint() const
Get the upstream extremal point.
ExtremalPoint class.
const ExtremalPoint & GetDownstreamPoint() const
Get the downstream extremal point.
constexpr BitMask< Storage > Set(Flag_t< Storage > flag)
Returns a bit mask which sets the specified flag.
const pandora::ParticleFlowObject * GetPredictedParentPfo() const
Get the best matched parent pfo.
ExtremalPoint()
Default constructor.
const pandora::CartesianVector & GetPosition() const
Get the position.
void SetPredictedParentPfo(const pandora::ParticleFlowObject *pPredictedParentPfo)
Set the best matched parent pfo.
bool m_isSet
whether the extremal point object has been set
Header file for the lar three dimensional sliding fit result class.
const ThreeDSlidingFitResult & GetSlidingFitResult() const
Get the pfo&#39;s 3D sliding fit result.
void SetPfo(const pandora::ParticleFlowObject *pPfo)
Set the pfo.
float GetLaterTierScore() const
Get the later tier network score.
float GetPrimaryScore() const
Get the primary network score.
void SetParentPfo(const pandora::ParticleFlowObject *pParentPfo)
Set the parent pfo.
const pandora::CartesianVector & GetDirection() const
Get the direction at the extremal point.
void SetLaterTierScore(const float laterTierScore)
Set the later tier network score.
bool operator==(const HierarchyPfo &rhs) const
HierarchyPfo == operator.
const pandora::ParticleFlowObject * m_pPfo
a pointer to the corresponding pfo
bool GetIsInHierarchy() const
Get whether the pfo has been assigned to a particle hierarchy.
ExtremalPoint & operator=(const ExtremalPoint &rhs)
Assignment operator.
void SetPrimaryScore(const float primaryScore)
Set the primary network score.
bool operator==(infinite_endcount_iterator< T > const &, count_iterator< T > const &)
Definition: counter.h:277
bool m_isInHierarchy
whether the pfo has been assigned to a particle hierarchy
const pandora::ParticleFlowObject * m_pParentPfo
a pointer to the assigned parent pfo
const pandora::PfoVector & GetChildPfoVector() const
Get the vector of child pfos.