ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
AtPatterns::AtPattern Class Referenceabstract

Describes a shape in 3D space. More...

#include <AtPattern.h>

Inheritance diagram for AtPatterns::AtPattern:
Inheritance graph
[legend]
Collaboration diagram for AtPatterns::AtPattern:
Collaboration graph
[legend]

Public Types

using XYZPoint = ROOT::Math::XYZPoint
 

Public Member Functions

 AtPattern (Int_t numPoints=0)
 
 AtPattern (const AtPattern &)=default
 
 AtPattern (AtPattern &&)=default
 
virtual ~AtPattern ()=default
 
Double_t FitPattern (const std::vector< AtHit > &pointsToFit, Double_t qThreshold=-1)
 Fit the pattern. More...
 
Double_t FitPattern (const std::vector< const AtHit * > &pointsToFit, Double_t qThreshold=-1)
 
Double_t FitPattern (const std::vector< XYZPoint > &pointsToFit)
 Fit the pattern shape. More...
 
virtual void DefinePattern (const std::vector< XYZPoint > &points)=0
 Define based on points. More...
 
virtual void DefinePattern (std::vector< double > par)
 Define based on parameters. More...
 
virtual Double_t DistanceToPattern (const XYZPoint &point) const =0
 Closest distance to pattern. More...
 
virtual XYZPoint ClosestPointOnPattern (const XYZPoint &point) const =0
 Closest point on pattern. More...
 
virtual XYZPoint GetPointAt (double t) const =0
 Point on pattern at t. More...
 
TEveLine * GetEveLine (double tMin, double tMax, int n) const
 Get visual representation of pattern. More...
 
virtual TEveElement * GetEveElement () const =0
 Get visual representation of pattern. More...
 
virtual std::unique_ptr< AtPatternClone () const =0
 
Int_t GetNumPoints () const
 Number of points to define the pattern. More...
 
Double_t GetChi2 () const
 
Int_t GetNFree () const
 
virtual std::vector< double > GetPatternPar () const
 Get list or parameters that describe the pattern. More...
 
Double_t GetTotCharge () const
 
void SetPatternPar (std::vector< double > par)
 
void SetChi2 (double chi2)
 

Protected Types

using TEveLineVec = std::vector< std::unique_ptr< TEveLine > >
 

Protected Member Functions

virtual void FitPattern (const std::vector< XYZPoint > &pointsToFit, const std::vector< double > &pointCharge)=0
 

Protected Attributes

std::vector< Double_t > fPatternPar
 
Double_t fChi2 {NAN}
 
Int_t fNFree {0}
 
const Int_t fNumPoints
 
Double_t fTotCharge {0}
 

Detailed Description

Describes a shape in 3D space.

A base class that describes the pattern of a track. For example a 2D circle or a line These patterns are parameterized by some number (t)

Definition at line 40 of file AtPattern.h.

Member Typedef Documentation

◆ TEveLineVec

using AtPatterns::AtPattern::TEveLineVec = std::vector<std::unique_ptr<TEveLine> >
protected

Definition at line 51 of file AtPattern.h.

◆ XYZPoint

using AtPatterns::AtPattern::XYZPoint = ROOT::Math::XYZPoint

Definition at line 42 of file AtPattern.h.

Constructor & Destructor Documentation

◆ AtPattern() [1/3]

AtPattern::AtPattern ( Int_t  numPoints = 0)

Definition at line 12 of file AtPattern.cxx.

◆ AtPattern() [2/3]

AtPatterns::AtPattern::AtPattern ( const AtPattern )
default

◆ AtPattern() [3/3]

AtPatterns::AtPattern::AtPattern ( AtPattern &&  )
default

◆ ~AtPattern()

virtual AtPatterns::AtPattern::~AtPattern ( )
virtualdefault

Member Function Documentation

◆ Clone()

virtual std::unique_ptr<AtPattern> AtPatterns::AtPattern::Clone ( ) const
pure virtual

◆ ClosestPointOnPattern()

virtual XYZPoint AtPatterns::AtPattern::ClosestPointOnPattern ( const XYZPoint point) const
pure virtual

Closest point on pattern.

Parameters
[in]pointPoint to get the closest point on the pattern.
Returns
Closest point on pattern

Implemented in AtPatterns::AtPatternY, AtPatterns::AtPatternLine, AtPatterns::AtPatternCircle2D, and AtPatterns::AtPatternRay.

◆ DefinePattern() [1/2]

virtual void AtPatterns::AtPattern::DefinePattern ( const std::vector< XYZPoint > &  points)
pure virtual

Define based on points.

Will set-up the pattern using the vector of XYZPoints. Assumes the size of points is equal to fNumPoints

Parameters
[in]points3D points to use when defining the pattern

Implemented in AtPatterns::AtPatternY, AtPatterns::AtPatternLine, AtPatterns::AtPatternCircle2D, and AtPatterns::AtPatternRay.

◆ DefinePattern() [2/2]

virtual void AtPatterns::AtPattern::DefinePattern ( std::vector< double >  par)
inlinevirtual

Define based on parameters.

Sets up the pattern according to the passed parameters. The internal implementation of what these parameters mean may change. It is the inverse operation of GetPatternPar()

Reimplemented in AtPatterns::AtPatternY.

Definition at line 79 of file AtPattern.h.

◆ DistanceToPattern()

virtual Double_t AtPatterns::AtPattern::DistanceToPattern ( const XYZPoint point) const
pure virtual

Closest distance to pattern.

Parameters
[in]pointPoint to get the distance from.
Returns
distance from point to pattern in mm.

Implemented in AtPatterns::AtPatternY, AtPatterns::AtPatternLine, AtPatterns::AtPatternCircle2D, and AtPatterns::AtPatternRay.

◆ FitPattern() [1/4]

Double_t AtPattern::FitPattern ( const std::vector< AtHit > &  pointsToFit,
Double_t  qThreshold = -1 
)

Fit the pattern.

Fit the pattern shape using all hits in pointsToFit. Does a charge weighted fit if qThreshold is not equal to -1. Sets fPatternPar parameters, and fChi2.

Parameters
[in]pointsPoints in 3D space to fit with charge information
[in]qThresholdOnly fit points that are above this charge threshold.
Returns
Chi-squared of the fit

Definition at line 24 of file AtPattern.cxx.

◆ FitPattern() [2/4]

Double_t AtPattern::FitPattern ( const std::vector< const AtHit * > &  pointsToFit,
Double_t  qThreshold = -1 
)

Definition at line 30 of file AtPattern.cxx.

◆ FitPattern() [3/4]

Double_t AtPattern::FitPattern ( const std::vector< XYZPoint > &  pointsToFit)

Fit the pattern shape.

Fit the pattern shape using all points in pointsToFit. Does not weight for charge. Sets fPatternPar parameters, and fChi2.

Parameters
[in]pointsToFitPoints in 3D space to fit
Returns
Chi-squared of the fit

Definition at line 56 of file AtPattern.cxx.

◆ FitPattern() [4/4]

virtual void AtPatterns::AtPattern::FitPattern ( const std::vector< XYZPoint > &  pointsToFit,
const std::vector< double > &  pointCharge 
)
protectedpure virtual

Called by other versions of FitPattern. If pointCharge is not empty does charge weighted fit. Sets fPatternPar, fChi2, and fNFree

Implemented in AtPatterns::AtPatternY, AtPatterns::AtPatternLine, AtPatterns::AtPatternCircle2D, and AtPatterns::AtPatternFission.

◆ GetChi2()

Double_t AtPatterns::AtPattern::GetChi2 ( ) const
inline

Definition at line 131 of file AtPattern.h.

◆ GetEveElement()

virtual TEveElement* AtPatterns::AtPattern::GetEveElement ( ) const
pure virtual

Get visual representation of pattern.

Calls GetEveLine(double tMin, double tMax, int n) with reasonable defaults for the shape

Implemented in AtPatterns::AtPatternY, AtPatterns::AtPatternLine, AtPatterns::AtPatternCircle2D, and AtPatterns::AtPatternRay.

◆ GetEveLine()

TEveLine * AtPattern::GetEveLine ( double  tMin,
double  tMax,
int  n 
) const

Get visual representation of pattern.

Implemented for single-valued patterns (one point in space per value of parameter t)

Todo:
Generalize for multi-valued patterns
Parameters
[in]tMinParameter to start drawing line at
[in]tMaxParameter to stop drawing line at
[in]dtStep size between points on polyline
Returns
Representation of line

Definition at line 63 of file AtPattern.cxx.

◆ GetNFree()

Int_t AtPatterns::AtPattern::GetNFree ( ) const
inline

Definition at line 132 of file AtPattern.h.

◆ GetNumPoints()

Int_t AtPatterns::AtPattern::GetNumPoints ( ) const
inline

Number of points to define the pattern.

The minimum number of unique points needed to define the pattern.

Definition at line 130 of file AtPattern.h.

◆ GetPatternPar()

virtual std::vector<double> AtPatterns::AtPattern::GetPatternPar ( ) const
inlinevirtual

Get list or parameters that describe the pattern.

It is the inverse operation of DefinePattern(std::vector<double>)

Reimplemented in AtPatterns::AtPatternY.

Definition at line 139 of file AtPattern.h.

◆ GetPointAt()

virtual XYZPoint AtPatterns::AtPattern::GetPointAt ( double  t) const
pure virtual

Point on pattern at t.

Get the point on the pattern at parameter t. What t physically represents is pattern dependent.

Todo:
Generalize for multi-valued patterns

Implemented in AtPatterns::AtPatternY, AtPatterns::AtPatternLine, AtPatterns::AtPatternRay, and AtPatterns::AtPatternCircle2D.

◆ GetTotCharge()

Double_t AtPatterns::AtPattern::GetTotCharge ( ) const
inline

Definition at line 141 of file AtPattern.h.

◆ SetChi2()

void AtPatterns::AtPattern::SetChi2 ( double  chi2)
inline

Definition at line 143 of file AtPattern.h.

◆ SetPatternPar()

void AtPatterns::AtPattern::SetPatternPar ( std::vector< double >  par)
inline

Definition at line 142 of file AtPattern.h.

Member Data Documentation

◆ fChi2

Double_t AtPatterns::AtPattern::fChi2 {NAN}
protected

Definition at line 46 of file AtPattern.h.

◆ fNFree

Int_t AtPatterns::AtPattern::fNFree {0}
protected

Definition at line 47 of file AtPattern.h.

◆ fNumPoints

const Int_t AtPatterns::AtPattern::fNumPoints
protected

Definition at line 48 of file AtPattern.h.

◆ fPatternPar

std::vector<Double_t> AtPatterns::AtPattern::fPatternPar
protected

Definition at line 45 of file AtPattern.h.

◆ fTotCharge

Double_t AtPatterns::AtPattern::fTotCharge {0}
protected

Definition at line 49 of file AtPattern.h.


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