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

Proto hits are temporary constructs to be used during iterative 3D hit procedure. More...

#include "ThreeDHitCreationAlgorithm.h"

Public Member Functions

 ProtoHit (const pandora::CaloHit *const pParentCaloHit2D)
 Constructor. More...
 
const pandora::CaloHit * GetParentCaloHit2D () const
 Get the address of the parent 2D calo hit. More...
 
bool IsPositionSet () const
 Whether the proto hit position is set. More...
 
const pandora::CartesianVector & GetPosition3D () const
 Get the output 3D position. More...
 
double GetChi2 () const
 Get the chi squared value. More...
 
unsigned int GetNTrajectorySamples () const
 Get the number of trajectory samples. More...
 
const TrajectorySampleGetFirstTrajectorySample () const
 Get the first trajectory sample. More...
 
const TrajectorySampleGetLastTrajectorySample () const
 Get the last trajectory sample. More...
 
void SetPosition3D (const pandora::CartesianVector &position3D, const double chi2)
 Set position 3D. More...
 
void AddTrajectorySample (const TrajectorySample &trajectorySample)
 Add a trajectory sample. More...
 

Private Attributes

const pandora::CaloHit * m_pParentCaloHit2D
 The address of the parent 2D calo hit. More...
 
bool m_isPositionSet
 Whether the output 3D position has been set. More...
 
pandora::CartesianVector m_position3D
 The output 3D position. More...
 
double m_chi2
 The output chi squared value. More...
 
TrajectorySampleVector m_trajectorySampleVector
 The trajectory sample vector. More...
 

Detailed Description

Proto hits are temporary constructs to be used during iterative 3D hit procedure.

Definition at line 73 of file ThreeDHitCreationAlgorithm.h.

Constructor & Destructor Documentation

lar_content::ThreeDHitCreationAlgorithm::ProtoHit::ProtoHit ( const pandora::CaloHit *const  pParentCaloHit2D)
inline

Constructor.

Parameters
pParentCaloHit2Dthe address of the parent 2D calo hit

Definition at line 320 of file ThreeDHitCreationAlgorithm.h.

320  :
321  m_pParentCaloHit2D(pParentCaloHit2D),
322  m_isPositionSet(false),
323  m_position3D(0.f, 0.f, 0.f),
324  m_chi2(std::numeric_limits<double>::max())
325 {
326 }
const pandora::CaloHit * m_pParentCaloHit2D
The address of the parent 2D calo hit.
TFile f
Definition: plotHisto.C:6
bool m_isPositionSet
Whether the output 3D position has been set.
pandora::CartesianVector m_position3D
The output 3D position.

Member Function Documentation

void lar_content::ThreeDHitCreationAlgorithm::ProtoHit::AddTrajectorySample ( const TrajectorySample trajectorySample)
inline

Add a trajectory sample.

Parameters
thetrajectory sample

Definition at line 360 of file ThreeDHitCreationAlgorithm.h.

References m_trajectorySampleVector.

Referenced by lar_content::HitCreationBaseTool::~HitCreationBaseTool().

361 {
362  m_trajectorySampleVector.push_back(trajectorySample);
363 }
TrajectorySampleVector m_trajectorySampleVector
The trajectory sample vector.
double lar_content::ThreeDHitCreationAlgorithm::ProtoHit::GetChi2 ( ) const

Get the chi squared value.

Returns
the chi squared value, if set
Exceptions
StatusCodeException

Definition at line 432 of file ThreeDHitCreationAlgorithm.cc.

Referenced by lar_content::TransverseTrackHitsBaseTool::AddTransverseChi2(), lar_content::ThreeViewShowerHitsTool::GetShowerHit3D(), lar_content::TransverseTrackHitsBaseTool::GetTrackHits3D(), lar_content::LongitudinalTrackHitsBaseTool::GetTrackHits3D(), and lar_content::HitCreationBaseTool::~HitCreationBaseTool().

433 {
434  if (!m_isPositionSet)
435  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
436 
437  return m_chi2;
438 }
bool m_isPositionSet
Whether the output 3D position has been set.
const ThreeDHitCreationAlgorithm::TrajectorySample & lar_content::ThreeDHitCreationAlgorithm::ProtoHit::GetFirstTrajectorySample ( ) const

Get the first trajectory sample.

Returns
the first trajectory sample, if at least one sample is present
Exceptions
StatusCodeException

Definition at line 442 of file ThreeDHitCreationAlgorithm.cc.

443 {
444  if (m_trajectorySampleVector.empty())
445  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
446 
447  return m_trajectorySampleVector.front();
448 }
TrajectorySampleVector m_trajectorySampleVector
The trajectory sample vector.
const ThreeDHitCreationAlgorithm::TrajectorySample & lar_content::ThreeDHitCreationAlgorithm::ProtoHit::GetLastTrajectorySample ( ) const

Get the last trajectory sample.

Returns
the last trajectory sample, if at least two samples are present
Exceptions
StatusCodeException

Definition at line 452 of file ThreeDHitCreationAlgorithm.cc.

453 {
454  if (m_trajectorySampleVector.size() < 2)
455  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
456 
457  return m_trajectorySampleVector.back();
458 }
TrajectorySampleVector m_trajectorySampleVector
The trajectory sample vector.
unsigned int lar_content::ThreeDHitCreationAlgorithm::ProtoHit::GetNTrajectorySamples ( ) const
inline

Get the number of trajectory samples.

Returns
the number of trajectory samples

Definition at line 344 of file ThreeDHitCreationAlgorithm.h.

References m_trajectorySampleVector.

345 {
346  return m_trajectorySampleVector.size();
347 }
TrajectorySampleVector m_trajectorySampleVector
The trajectory sample vector.
const CartesianVector & lar_content::ThreeDHitCreationAlgorithm::ProtoHit::GetPosition3D ( ) const

Get the output 3D position.

Returns
the output 3D position, if set
Exceptions
StatusCodeException

Definition at line 422 of file ThreeDHitCreationAlgorithm.cc.

Referenced by lar_content::TransverseTrackHitsBaseTool::AddTransverseChi2(), lar_content::ThreeDHitCreationAlgorithm::CheckThreeDHit(), and lar_content::ThreeDHitCreationAlgorithm::CreateThreeDHit().

423 {
424  if (!m_isPositionSet)
425  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
426 
427  return m_position3D;
428 }
bool m_isPositionSet
Whether the output 3D position has been set.
pandora::CartesianVector m_position3D
The output 3D position.
bool lar_content::ThreeDHitCreationAlgorithm::ProtoHit::IsPositionSet ( ) const
inline
void lar_content::ThreeDHitCreationAlgorithm::ProtoHit::SetPosition3D ( const pandora::CartesianVector &  position3D,
const double  chi2 
)
inline

Set position 3D.

Parameters
theoutput 3D position
theoutput chi squared value

Definition at line 351 of file ThreeDHitCreationAlgorithm.h.

References m_chi2, m_isPositionSet, and m_position3D.

Referenced by lar_content::TransverseTrackHitsBaseTool::AddTransverseChi2(), and lar_content::HitCreationBaseTool::~HitCreationBaseTool().

352 {
353  m_position3D = position3D;
354  m_chi2 = chi2;
355  m_isPositionSet = true;
356 }
bool m_isPositionSet
Whether the output 3D position has been set.
pandora::CartesianVector m_position3D
The output 3D position.

Member Data Documentation

double lar_content::ThreeDHitCreationAlgorithm::ProtoHit::m_chi2
private

The output chi squared value.

Definition at line 159 of file ThreeDHitCreationAlgorithm.h.

Referenced by SetPosition3D().

bool lar_content::ThreeDHitCreationAlgorithm::ProtoHit::m_isPositionSet
private

Whether the output 3D position has been set.

Definition at line 157 of file ThreeDHitCreationAlgorithm.h.

Referenced by IsPositionSet(), and SetPosition3D().

pandora::CartesianVector lar_content::ThreeDHitCreationAlgorithm::ProtoHit::m_position3D
private

The output 3D position.

Definition at line 158 of file ThreeDHitCreationAlgorithm.h.

Referenced by SetPosition3D().

const pandora::CaloHit* lar_content::ThreeDHitCreationAlgorithm::ProtoHit::m_pParentCaloHit2D
private

The address of the parent 2D calo hit.

Definition at line 156 of file ThreeDHitCreationAlgorithm.h.

Referenced by GetParentCaloHit2D().

TrajectorySampleVector lar_content::ThreeDHitCreationAlgorithm::ProtoHit::m_trajectorySampleVector
private

The trajectory sample vector.

Definition at line 160 of file ThreeDHitCreationAlgorithm.h.

Referenced by AddTrajectorySample(), and GetNTrajectorySamples().


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