ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RandomSample::AtSampleFromReference Class Reference

Sample when PDF depends on reference. More...

#include <AtSampleFromReference.h>

Inheritance diagram for RandomSample::AtSampleFromReference:
Inheritance graph
[legend]
Collaboration diagram for RandomSample::AtSampleFromReference:
Collaboration graph
[legend]

Public Member Functions

virtual ~AtSampleFromReference ()=default
 
virtual std::vector< AtHitSampleHits (int N) override
 Sample hits (AtHit) from fHits. More...
 
virtual void SetHitsToSample (const std::vector< const AtHit * > &hits) override
 
void SetReferenceHit (AtHit hit)
 
const AtHitGetReferenceHit () const
 
- Public Member Functions inherited from RandomSample::AtSample
virtual ~AtSample ()=default
 
std::vector< ROOT::Math::XYZPointSamplePoints (int N)
 Sample spacial locations (XYZPoints) from fHits. More...
 
void SetHitsToSample (const std::vector< HitPtr > &hits)
 
void SetHitsToSample (const std::vector< AtHit > &hits)
 
void SetSampleWithReplacement (bool val)
 

Protected Member Functions

virtual void SampleReferenceHit ()
 Get reference hit from fHits. More...
 
- Protected Member Functions inherited from RandomSample::AtSample
virtual std::vector< double > PDF (const AtHit &hit)=0
 
void FillCDF ()
 
std::vector< int > sampleIndicesFromCDF (int N, std::vector< int > vetoed={})
 
int getIndexFromCDF (double r, double rmCFD, std::vector< int > vetoed)
 Get the index i where CDF[i] >= r and CDF[i-1] < r. More...
 
double getPDFfromCDF (int index)
 

Protected Attributes

AtHit fReferenceHit
 
- Protected Attributes inherited from RandomSample::AtSample
const std::vector< const AtHit * > * fHits
 
std::vector< double > fCDF
 
bool fWithReplacement {false}
 

Additional Inherited Members

- Protected Types inherited from RandomSample::AtSample
using HitPtr = std::unique_ptr< AtHit >
 
- Static Protected Member Functions inherited from RandomSample::AtSample
template<typename T >
static bool isInVector (T val, std::vector< T > vec)
 

Detailed Description

Sample when PDF depends on reference.

Interface for sampling a collection of AtHits where the PDF depends on a reference hit.

Definition at line 18 of file AtSampleFromReference.h.

Constructor & Destructor Documentation

◆ ~AtSampleFromReference()

virtual RandomSample::AtSampleFromReference::~AtSampleFromReference ( )
virtualdefault

Member Function Documentation

◆ GetReferenceHit()

const AtHit& RandomSample::AtSampleFromReference::GetReferenceHit ( ) const
inline

Definition at line 27 of file AtSampleFromReference.h.

◆ SampleHits()

std::vector< AtHit > AtSampleFromReference::SampleHits ( int  N)
overridevirtual

Sample hits (AtHit) from fHits.

Assumes fCDF is already setup and we are just using it.

Reimplemented from RandomSample::AtSample.

Definition at line 11 of file AtSampleFromReference.cxx.

◆ SampleReferenceHit()

void AtSampleFromReference::SampleReferenceHit ( )
protectedvirtual

Get reference hit from fHits.

Uniformly samples from fHits

Reimplemented in RandomSample::AtWeightedGaussian.

Definition at line 23 of file AtSampleFromReference.cxx.

◆ SetHitsToSample()

virtual void RandomSample::AtSampleFromReference::SetHitsToSample ( const std::vector< const AtHit * > &  hits)
inlineoverridevirtual

Implements RandomSample::AtSample.

Reimplemented in RandomSample::AtWeightedGaussian.

Definition at line 25 of file AtSampleFromReference.h.

◆ SetReferenceHit()

void AtSampleFromReference::SetReferenceHit ( AtHit  hit)

Definition at line 29 of file AtSampleFromReference.cxx.

Member Data Documentation

◆ fReferenceHit

AtHit RandomSample::AtSampleFromReference::fReferenceHit
protected

Definition at line 20 of file AtSampleFromReference.h.


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