ATTPCROOT
0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
|
Uniformly sample a collection of AtHits. More...
#include <AtUniform.h>
Public Member Functions | |
virtual std::vector< AtHit > | SampleHits (int N) override |
Sample hits (AtHit) from fHits. More... | |
virtual void | SetHitsToSample (const std::vector< const AtHit * > &hits) override |
![]() | |
virtual | ~AtSample ()=default |
std::vector< ROOT::Math::XYZPoint > | SamplePoints (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 |
![]() | |
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 | |
![]() | |
using | HitPtr = std::unique_ptr< AtHit > |
![]() | |
template<typename T > | |
static bool | isInVector (T val, std::vector< T > vec) |
![]() | |
const std::vector< const AtHit * > * | fHits |
std::vector< double > | fCDF |
bool | fWithReplacement {false} |
Uniformly sample a collection of AtHits.
Definition at line 16 of file AtUniform.h.
|
overrideprotectedvirtual |
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)};
Implements RandomSample::AtSample.
Definition at line 24 of file AtUniform.cxx.
|
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 AtUniform.cxx.
|
inlineoverridevirtual |
Implements RandomSample::AtSample.
Definition at line 19 of file AtUniform.h.