ATTPCROOT
0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
|
Sample with a charge-weighted gaussian. More...
#include <AtWeightedGaussian.h>
Public Member Functions | |
AtWeightedGaussian (double sigma=30) | |
virtual void | SetHitsToSample (const std::vector< const AtHit * > &hits) override |
![]() | |
virtual | ~AtSampleFromReference ()=default |
virtual std::vector< AtHit > | SampleHits (int N) override |
Sample hits (AtHit) from fHits. More... | |
void | SetReferenceHit (AtHit hit) |
const AtHit & | GetReferenceHit () const |
![]() | |
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 |
virtual void | SampleReferenceHit () override |
Get reference hit from fHits. More... | |
![]() | |
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 | |
double | fSigma |
AtChargeWeighted | fChargeSample |
![]() | |
AtHit | fReferenceHit |
![]() | |
const std::vector< const AtHit * > * | fHits |
std::vector< double > | fCDF |
bool | fWithReplacement {false} |
Additional Inherited Members | |
![]() | |
using | HitPtr = std::unique_ptr< AtHit > |
![]() | |
template<typename T > | |
static bool | isInVector (T val, std::vector< T > vec) |
Sample with a charge-weighted gaussian.
Class for sampling a collection of AtHits in a spacial gaussian distribution around the reference hit where the hits are weighted by charge.
Definition at line 20 of file AtWeightedGaussian.h.
|
inline |
Definition at line 26 of file AtWeightedGaussian.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 20 of file AtWeightedGaussian.cxx.
|
overrideprotectedvirtual |
Get reference hit from fHits.
Uniformly samples from fHits
Reimplemented from RandomSample::AtSampleFromReference.
Definition at line 27 of file AtWeightedGaussian.cxx.
|
overridevirtual |
Reimplemented from RandomSample::AtSampleFromReference.
Definition at line 14 of file AtWeightedGaussian.cxx.
|
protected |
Definition at line 23 of file AtWeightedGaussian.h.
|
protected |
Definition at line 22 of file AtWeightedGaussian.h.