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

Sample AtHits according to charge for Y shaped tracks. More...

#include <AtWeightedY.h>

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

Public Member Functions

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

std::vector< int > fVetoIn
 
std::vector< int > fVetoOut
 
- 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 >
 
- Protected Member Functions inherited from RandomSample::AtChargeWeighted
virtual std::vector< double > PDF (const AtHit &hit) override
 
- 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)
 
- Static Protected Member Functions inherited from RandomSample::AtSample
template<typename T >
static bool isInVector (T val, std::vector< T > vec)
 

Detailed Description

Sample AtHits according to charge for Y shaped tracks.

Follows the PDF: P(q) = q/TotalCharge

Definition at line 17 of file AtWeightedY.h.

Member Function Documentation

◆ SampleHits()

std::vector< AtHit > AtWeightedY::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 13 of file AtWeightedY.cxx.

◆ SetHitsToSample()

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

Reimplemented from RandomSample::AtIndependentSample.

Definition at line 33 of file AtWeightedY.cxx.

Member Data Documentation

◆ fVetoIn

std::vector<int> RandomSample::AtWeightedY::fVetoIn
protected

Definition at line 19 of file AtWeightedY.h.

◆ fVetoOut

std::vector<int> RandomSample::AtWeightedY::fVetoOut
protected

Definition at line 20 of file AtWeightedY.h.


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