ATTPCROOT
0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
|
Go to the documentation of this file.
4 #include <Math/Point3Dfwd.h>
37 using HitPtr = std::unique_ptr<AtHit>;
38 const std::vector<const AtHit *> *
fHits;
63 virtual std::vector<double>
PDF(
const AtHit &hit) = 0;
76 return std::find(vec.begin(), vec.end(), val) != vec.end();
81 #endif //#ifndef ATHITSAMPLER_H
virtual std::vector< AtHit > SampleHits(int N)
Sample hits (AtHit) from fHits.
virtual void SetHitsToSample(const std::vector< const AtHit * > &hits)=0
void SetSampleWithReplacement(bool val)
virtual ~AtSample()=default
SampleMethod
. Methods of random sampling.
std::vector< int > sampleIndicesFromCDF(int N, std::vector< int > vetoed={})
double getPDFfromCDF(int index)
std::unique_ptr< AtHit > HitPtr
int getIndexFromCDF(double r, double rmCFD, std::vector< int > vetoed)
Get the index i where CDF[i] >= r and CDF[i-1] < r.
std::vector< double > fCDF
const std::vector< const AtHit * > * fHits
std::vector< ROOT::Math::XYZPoint > SamplePoints(int N)
Sample spacial locations (XYZPoints) from fHits.
virtual std::vector< double > PDF(const AtHit &hit)=0
Interface for randomly sampling AtHits.
static bool isInVector(T val, std::vector< T > vec)
Point in space with charge.