19 SMonolith(std::vector<std::vector<TResponseFunction_red*> > &MasterSpline,
20 const std::vector<RespFuncType> &SplineType,
21 const bool SaveFlatTree =
false,
22 const std::string& _FastSplineName =
"SplineFile.root");
33 inline std::string
GetName()
const override {
return "SplineMonolith";};
74 inline void ScanMasterSpline(std::vector<std::vector<TResponseFunction_red*> > & MasterSpline,
75 unsigned int &nEvents,
79 unsigned int &NSplinesValid,
80 unsigned int &numKnots,
81 unsigned int &nTF1Valid,
82 unsigned int &nTF1_coeff,
83 const std::vector<RespFuncType> &SplineType);
86 inline void PrepareForGPU(std::vector<std::vector<TResponseFunction_red*> > &MasterSpline,
const std::vector<RespFuncType> &SplineType);
Class responsible for calculating spline weight on GPU.
Even-by-event class calculating response for spline parameters. It is possible to use GPU acceleratio...
SMonolithGPU * gpu_spline_handler
KS: Store info about Spline monolith, this allow to obtain better step time. As all necessary informa...
std::vector< unsigned int > cpu_nParamPerEvent
KS: CPU map keeping track how many parameters applies to each event, we keep two numbers here {number...
unsigned int NTF1_valid
Number of valid TF1.
std::vector< short int > cpu_nPoints_arr
CPU arrays to hold number of points.
void Evaluate() override
CW: This Eval should be used when using two separate x,{y,a,b,c,d} arrays to store the weights; proba...
unsigned int nTF1coeff
Sum of all coefficients over all TF1.
void setSplinePointers(std::vector< const double * > spline_ParsPointers)
KS: Set pointers to spline params.
std::vector< float > cpu_coeff_TF1_many
CPU arrays to hold TF1 coefficients.
void Initialise()
KS: Set everything to null etc.
SplineMonoStruct * cpu_spline_handler
KS: Store info about Spline monolith, this allow to obtain better step time. As all necessary informa...
float * cpu_weights_tf1_var
CPU arrays to hold weight for each TF1.
void PrintInitialsiation()
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...
void SynchroniseMemTransfer()
KS: After calculations are done on GPU we copy memory to CPU. This operation is asynchronous meaning ...
std::vector< int > index_TF1_cpu
holds the index for good TF1; don't do unsigned since starts with negative value!
void ModifyWeights_GPU()
Conversion from valid splines to all.
const float * retPointer(const int event)
KS: Get pointer to total weight to make fit faster wrooom!
float * cpu_weights
The returned gpu weights, read by the GPU.
float * cpu_weights_spline_var
CPU arrays to hold weight for each spline.
std::vector< int > index_spline_cpu
holds the index for good splines; don't do unsigned since starts with negative value!
void PrepareForGPU(std::vector< std::vector< TResponseFunction_red * > > &MasterSpline, const std::vector< RespFuncType > &SplineType)
CW: Prepare the TSpline3_red objects for the GPU.
void CalcSplineWeights() override
CPU based code which eval weight for each spline.
std::string FastSplineName
Name of Fast Spline to which will be saved.
void MoveToGPU()
CW: The shared initialiser from constructors of TResponseFunction_red.
bool SaveSplineFile
Flag telling whether we are saving spline monolith into handy root file.
float * cpu_total_weights
KS: This holds the total CPU weights that gets read in samplePDFND.
unsigned int NSplines_valid
Number of valid splines.
SMonolith(std::vector< std::vector< TResponseFunction_red * > > &MasterSpline, const std::vector< RespFuncType > &SplineType, const bool SaveFlatTree=false, const std::string &_FastSplineName="SplineFile.root")
Constructor.
virtual ~SMonolith()
Destructor for SMonolith class.
void ModifyWeights() override
Calc total event weight.
unsigned int NEvents
Number of events.
void getSplineCoeff_SepMany(TSpline3_red *&spl, int &nPoints, float *&xArray, float *&manyArray)
CW: This loads up coefficients into two arrays: one x array and one yabcd array.
void LoadSplineFile(std::string FileName) override
KS: Load preprocessed spline file.
unsigned int NSplines_total_large
Number of total splines if each event had every parameter's spline.
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) override
KS: Prepare spline file that can be used for fast loading.
short int _max_knots
Max knots for production.
std::vector< short int > cpu_paramNo_TF1_arr
CW: CPU array with the number of points per spline (not per spline point!)
std::vector< const double * > splineParsPointer
This holds pointer to parameter position which we later copy paste it to GPU.
unsigned int nKnots
Sum of all knots over all splines.
std::string GetName() const override
Get class name.
Base class for calculating weight from spline.
short int nParams
Number of parameters that have splines.
std::vector< FastSplineInfo > SplineInfoArray
CW: Reduced TSpline3 class.
KS: Struct storing information for spline monolith.