16 const std::vector<RespFuncType> &SplineType,
17 const bool SaveFlatTree =
false,
18 const std::string& _FastSplineName =
"SplineFile.root",
19 const bool Use_GPU =
true);
30 std::string
GetName()
const override {
return "SplineMonolith";};
60 void ScanMasterSpline(std::vector<std::vector<TResponseFunction_red*> > & MasterSpline,
61 unsigned int &nEvents,
65 unsigned int &NSplinesValid,
66 unsigned int &numKnots,
67 unsigned int &nTF1Valid,
68 unsigned int &nTF1_coeff,
69 const std::vector<RespFuncType> &SplineType);
72 void PrepareForGPU(std::vector<std::vector<TResponseFunction_red*> > &MasterSpline,
const std::vector<RespFuncType> &SplineType);
Base class for calculating weight from spline.
short int nParams
Number of parameters that have splines.
std::vector< FastSplineInfo > SplineInfoArray
CW: Reduced TSpline3 class.
Even-by-event class calculating response for spline parameters. It is possible to use GPU acceleratio...
float * cpu_weights_tf1_var
CPU arrays to hold weight for each TF1.
float * cpu_weights_spline_var
CPU arrays to hold weight for each spline.
unsigned int nTF1coeff
Sum of all coefficients over all TF1.
unsigned int NTF1_valid
Number of valid TF1.
void ScanMasterSpline(std::vector< std::vector< TResponseFunction_red * > > &MasterSpline, unsigned int &nEvents, short int &MaxPoints, short int &numParams, int &nSplines, unsigned int &NSplinesValid, unsigned int &numKnots, unsigned int &nTF1Valid, unsigned int &nTF1_coeff, const std::vector< RespFuncType > &SplineType)
CW: Function to scan through the MasterSpline of TSpline3.
void PrepareSplineFile(std::string FileName) final
KS: Prepare spline file that can be used for fast loading.
std::vector< unsigned int > cpu_nParamPerEvent
KS: CPU map keeping track how many parameters applies to each event, we keep two numbers here {number...
void Evaluate() final
CW: This Eval should be used when using two separate x,{y,a,b,c,d} arrays to store the weights; proba...
const M3::float_t * RetPointer(const int event) const
KS: Get pointer to total weight to make fit faster wrooom!
std::vector< short int > cpu_paramNo_TF1_arr
CW: CPU array with the number of points per spline (not per spline point!)
void PrintInitialsiation() const
KS: Print info about how much knots etc has been initialised.
std::vector< unsigned int > cpu_nParamPerEvent_tf1
KS: CPU map keeping track how many parameters applies to each event, we keep two numbers here {number...
SplineMonoStruct * cpu_monolith
KS: Store info about Spline monolith, this allow to obtain better step time. As all necessary informa...
void MoveToGPU()
CW: The shared initialiser from constructors of TResponseFunction_red.
unsigned int nKnots
Sum of all knots over all splines.
void SetSplinePointers(std::vector< const M3::float_t * > spline_ParsPointers)
KS: Set pointers to spline params.
void CalcSplineWeights() final
CPU based code which eval weight for each spline.
UnbinnedSplineHandler(std::vector< std::vector< TResponseFunction_red * > > &MasterSpline, const std::vector< RespFuncType > &SplineType, const bool SaveFlatTree=false, const std::string &_FastSplineName="SplineFile.root", const bool Use_GPU=true)
Constructor.
std::vector< short int > cpu_nPoints_arr
CPU arrays to hold number of points.
void PrepareForGPU(std::vector< std::vector< TResponseFunction_red * > > &MasterSpline, const std::vector< RespFuncType > &SplineType)
CW: Prepare the TSpline3_red objects for the GPU.
void Initialise()
KS: Set everything to null etc.
void LoadSplineFile(std::string FileName) final
KS: Load preprocessed spline file.
virtual ~UnbinnedSplineHandler()
Destructor for UnbinnedSplineHandler class.
std::string GetName() const override
Get class name.
std::vector< float > cpu_coeff_TF1_many
CPU arrays to hold TF1 coefficients.
void GetSplineCoeff_SepMany(TSpline3_red *&spl, int &nPoints, float *&xArray, float *&manyArray) const
CW: This loads up coefficients into two arrays: one x array and one yabcd array.
M3::float_t * cpu_total_weights
KS: This holds the total CPU weights that gets read in SampleHandler.
bool SaveSplineFile
Flag telling whether we are saving spline monolith into handy root file.
unsigned int NEvents
Number of events.
std::string FastSplineName
Name of Fast Spline to which will be saved.
void CalcTotalEventWeight()
Calc total event weight.
Main namespace for MaCh3 software.
KS: Struct storing information for spline monolith.