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

Interface for independent samples. More...

#include <AtIndependentSample.h>

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

Public Member Functions

virtual ~AtIndependentSample ()=default
 
virtual void SetHitsToSample (const std::vector< const AtHit * > &hits) override
 
- Public Member Functions inherited from RandomSample::AtSample
virtual ~AtSample ()=default
 
virtual std::vector< AtHitSampleHits (int N)
 Sample hits (AtHit) from fHits. More...
 
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 std::vector< double > PDF (const AtHit &hit) override=0
 
- Protected Member Functions inherited from RandomSample::AtSample
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)
 

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)
 
- Protected Attributes inherited from RandomSample::AtSample
const std::vector< const AtHit * > * fHits
 
std::vector< double > fCDF
 
bool fWithReplacement {false}
 

Detailed Description

Interface for independent samples.

Interface for sampling a collection of AtHits where the points sampled are independent of one another.

Definition at line 17 of file AtIndependentSample.h.

Constructor & Destructor Documentation

◆ ~AtIndependentSample()

virtual RandomSample::AtIndependentSample::~AtIndependentSample ( )
virtualdefault

Member Function Documentation

◆ PDF()

virtual std::vector<double> RandomSample::AtIndependentSample::PDF ( const AtHit hit)
overrideprotectedpure virtual

Computes the unnormalized marginal PDFs at the hit.

For example, a charge-weighted and spacial gaussian would looke like return {charge, gaussian_pdf(distance, sigma)};

Returns
vector where each element is a different maginal pdf

Implements RandomSample::AtSample.

Implemented in RandomSample::AtY, and RandomSample::AtChargeWeighted.

◆ SetHitsToSample()

void AtIndependentSample::SetHitsToSample ( const std::vector< const AtHit * > &  hits)
overridevirtual

Implements RandomSample::AtSample.

Reimplemented in RandomSample::AtY, and RandomSample::AtWeightedY.

Definition at line 5 of file AtIndependentSample.cxx.


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