MaCh3  2.4.2
Reference Guide
Public Member Functions | List of all members
PySampleHandlerFD Class Reference

As SampleHandlerFD is an abstract base class we have to do some gymnastics to get it to get it into python. More...

Inheritance diagram for PySampleHandlerFD:
[legend]
Collaboration diagram for PySampleHandlerFD:
[legend]

Public Member Functions

void AddAdditionalWeightPointers () override
 DB Function to determine which weights apply to which types of samples. More...
 
void CleanMemoryBeforeFit () override
 Allow to clean not used memory before fit starts. More...
 
void SetupSplines () override
 initialise your splineXX object and then use InitialiseSplineObject to conviently setup everything up More...
 
void Init () override
 Initialise any variables that your experiment specific SampleHandler needs. More...
 
int SetupExperimentMC () override
 Experiment specific setup, returns the number of events which were loaded. More...
 
void SetupFDMC () override
 Function which translates experiment struct into core struct. More...
 
int ReturnKinematicParameterFromString (std::string)
 
std::string ReturnStringFromKinematicParameter (int)
 
double ReturnKinematicParameter (std::string, int) override
 Return the value of an associated kinematic parameter for an event. More...
 
double ReturnKinematicParameter (int, int) override
 
const double * GetPointerToKinematicParameter (std::string, int) override
 
const double * GetPointerToKinematicParameter (double, int) override
 
void RegisterFunctionalParameters () override
 HH - a experiment-specific function where the maps to actual functions are set up. More...
 
 SampleHandlerFD (std::string ConfigFileName, ParameterHandlerGeneric *xsec_cov, const std::shared_ptr< OscillationHandler > &OscillatorObj_=nullptr)
 Constructor. More...
 
- Public Member Functions inherited from SampleHandlerFD
 SampleHandlerFD (std::string ConfigFileName, ParameterHandlerGeneric *xsec_cov, const std::shared_ptr< OscillationHandler > &OscillatorObj_=nullptr)
 Constructor. More...
 
virtual ~SampleHandlerFD ()
 destructor More...
 
int GetNDim (const int Sample) const override
 DB Function to differentiate 1D or 2D binning. More...
 
std::string GetName () const override
 
std::string GetSampleTitle (const int Sample) const override
 
std::string GetKinVarName (const int iSample, const int Dimension) const override
 Return Kinematic Variable name for specified sample and dimension for example "Reconstructed_Neutrino_Energy". More...
 
std::string GetXBinVarName (const int Sample) const
 
std::string GetYBinVarName (const int Sample) const
 
const BinningHandlerGetBinningHandler () const
 Get pointer to binning handler. More...
 
void PrintIntegral (const int iSample, const TString &OutputName="/dev/null", const int WeightStyle=0, const TString &OutputCSVName="/dev/null")
 
void AddData (const int Sample, TH1 *Data)
 
void AddData (const int Sample, const std::vector< double > &Data_Array)
 
void PrintRates (const bool DataOnly=false) override
 Helper function to print rates for the samples with LLH. More...
 
double GetLikelihood () const override
 DB Multi-threaded GetLikelihood. More...
 
double GetSampleLikelihood (const int isample) const override
 Get likelihood for single sample. More...
 
int GetSampleIndex (const std::string &SampleTitle) const
 Get index of sample based on name. More...
 
TH1 * GetDataHist (const int Sample) override
 Get Data histogram. More...
 
TH1 * GetDataHist (const std::string &Sample)
 
TH1 * GetMCHist (const int Sample) override
 Get MC histogram. More...
 
TH1 * GetMCHist (const std::string &Sample)
 
TH1 * GetW2Hist (const int Sample) override
 Get W2 histogram. More...
 
TH1 * GetW2Hist (const std::string &Sample)
 
void Reweight () override
 
M3::float_t GetEventWeight (const int iEntry)
 
void InitialiseNuOscillatorObjects ()
 including Dan's magic NuOscillator More...
 
void SetupNuOscillatorPointers ()
 
const M3::float_tGetNuOscillatorPointers (const int iEvent) const
 
void ReadConfig ()
 
void LoadSingleSample (const int iSample, const YAML::Node &Settings)
 
int GetNOscChannels (const int iSample) const override
 
std::string GetFlavourName (const int iSample, const int iChannel) const override
 
std::vector< std::vector< KinematicCut > > ApplyTemporarySelection (const int iSample, const std::vector< KinematicCut > &ExtraCuts)
 Temporarily extend Selection for a given sample with additional cuts. Returns the original Selection so the caller can restore it later. More...
 
TH1 * Get1DVarHist (const int iSample, const std::string &ProjectionVar, const std::vector< KinematicCut > &EventSelectionVec={}, int WeightStyle=0, TAxis *Axis=nullptr, const std::vector< KinematicCut > &SubEventSelectionVec={}) override
 
TH2 * Get2DVarHist (const int iSample, const std::string &ProjectionVarX, const std::string &ProjectionVarY, const std::vector< KinematicCut > &EventSelectionVec={}, int WeightStyle=0, TAxis *AxisX=nullptr, TAxis *AxisY=nullptr, const std::vector< KinematicCut > &SubEventSelectionVec={}) override
 
std::vector< KinematicCutBuildModeChannelSelection (const int iSample, const int kModeToFill, const int kChannelToFill) const
 
void Fill1DSubEventHist (const int iSample, TH1D *_h1DVar, const std::string &ProjectionVar, const std::vector< KinematicCut > &SubEventSelectionVec={}, int WeightStyle=0)
 
void Fill2DSubEventHist (const int iSample, TH2D *_h2DVar, const std::string &ProjectionVarX, const std::string &ProjectionVarY, const std::vector< KinematicCut > &SubEventSelectionVec={}, int WeightStyle=0)
 
TH1 * Get1DVarHistByModeAndChannel (const int iSample, const std::string &ProjectionVar_Str, int kModeToFill=-1, int kChannelToFill=-1, int WeightStyle=0, TAxis *Axis=nullptr) override
 
TH2 * Get2DVarHistByModeAndChannel (const int iSample, const std::string &ProjectionVar_StrX, const std::string &ProjectionVar_StrY, int kModeToFill=-1, int kChannelToFill=-1, int WeightStyle=0, TAxis *AxisX=nullptr, TAxis *AxisY=nullptr) override
 
TH1 * GetModeHist1D (const int iSample, int s, int m, int style=0)
 
TH2 * GetModeHist2D (const int iSample, int s, int m, int style=0)
 
std::vector< TH1 * > ReturnHistsBySelection1D (const int iSample, const std::string &KinematicProjection, int Selection1, int Selection2=-1, int WeightStyle=0, TAxis *Axis=nullptr)
 
std::vector< TH2 * > ReturnHistsBySelection2D (const int iSample, const std::string &KinematicProjectionX, const std::string &KinematicProjectionY, int Selection1, int Selection2=-1, int WeightStyle=0, TAxis *XAxis=nullptr, TAxis *YAxis=nullptr)
 
THStack * ReturnStackedHistBySelection1D (const int iSample, const std::string &KinematicProjection, int Selection1, int Selection2=-1, int WeightStyle=0, TAxis *Axis=nullptr)
 
TLegend * ReturnStackHistLegend ()
 
int ReturnKinematicParameterFromString (const std::string &KinematicStr) const
 ETA function to generically convert a string from xsec cov to a kinematic type. More...
 
std::string ReturnStringFromKinematicParameter (const int KinematicVariable) const
 ETA function to generically convert a kinematic type from xsec cov to a string. More...
 
void SaveAdditionalInfo (TDirectory *Dir) override
 Store additional info in a chan. More...
 
int ReturnKinematicVectorFromString (const std::string &KinematicStr) const
 
std::string ReturnStringFromKinematicVector (const int KinematicVariable) const
 
bool IsSubEventVarString (const std::string &VarStr)
 JM Check if a kinematic parameter string corresponds to a subevent-level variable. More...
 
std::vector< double > GetDataArray () const
 Return array storing data entries for every bin. More...
 
std::vector< double > GetMCArray () const
 Return array storing MC entries for every bin. More...
 
std::vector< double > GetW2Array () const
 Return array storing W2 entries for every bin. More...
 
std::vector< double > GetArrayForSample (const int Sample, const double *array) const
 Return a sub-array for a given sample. More...
 
std::vector< double > GetDataArray (const int Sample) const
 Return array storing data entries for every bin. More...
 
std::vector< double > GetMCArray (const int Sample) const
 Return array storing MC entries for every bin. More...
 
std::vector< double > GetW2Array (const int Sample) const
 Return array storing W2 entries for single sample. More...
 
- Public Member Functions inherited from SampleHandlerBase
 SampleHandlerBase ()
 The main constructor. More...
 
virtual ~SampleHandlerBase ()
 destructor More...
 
virtual M3::int_t GetNsamples ()
 
MaCh3ModesGetMaCh3Modes () const
 Return pointer to MaCh3 modes. More...
 
unsigned int GetNEvents () const
 
double GetPoissonLLH (const double data, const double mc) const
 Calculate test statistic for a single bin using Poisson. More...
 
double GetTestStatLLH (const double data, const double mc, const double w2) const
 Calculate test statistic for a single bin. Calculation depends on setting of fTestStatistic. Data and mc -> 0 cut-offs are defined in M3::LOW_MC_BOUND. More...
 
void SetTestStatistic (TestStatistic testStat)
 Set the test statistic to be used when calculating the binned likelihoods. More...
 
TestStatistic GetTestStatistic () const
 Get the test statistic used when calculating the binned likelihoods. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SampleHandlerFD
void SetupKinematicMap ()
 Ensure Kinematic Map is setup and make sure it is initialised correctly. More...
 
void Initialise ()
 Function which does a lot of the lifting regarding the workflow in creating different MC objects. More...
 
void SetSplinePointers ()
 Set pointers for each event to appropriate weights, for unbinned based on event number while for binned based on other kinematical properties. More...
 
void FindNominalBinAndEdges ()
 
void SetBinning ()
 set the binning for 2D sample used for the likelihood calculation More...
 
void SetupReweightArrays ()
 Initialise data, MC and W2 histograms. More...
 
virtual void SetupFunctionalParameters ()
 ETA - a function to setup and pass values to functional parameters where you need to pass a value to some custom reweight calc or engine. More...
 
void RegisterIndividualFunctionalParameter (const std::string &fpName, int fpEnum, FuncParFuncType fpFunc)
 HH - a helper function for RegisterFunctionalParameter. More...
 
virtual void PrepFunctionalParameters ()
 Update the functional parameter values to the latest proposed values. Needs to be called before every new reweight so is called in fillArray. More...
 
virtual void ApplyShifts (const int iEvent)
 ETA - generic function applying shifts. More...
 
bool IsEventSelected (const int iSample, const int iEvent) _noexcept_
 DB Function which determines if an event is selected, where Selection double looks like {{ND280KinematicTypes Var1, douuble LowBound}. More...
 
bool IsSubEventSelected (const std::vector< KinematicCut > &SubEventCuts, const int iEvent, unsigned const int iSubEvent, size_t nsubevents)
 JM Function which determines if a subevent is selected. More...
 
virtual void ResetShifts (const int iEvent)
 HH - reset the shifted values to the original values. More...
 
void CalcNormsBins (std::vector< NormParameter > &norm_parameters, std::vector< std::vector< int > > &norms_bins)
 Check whether a normalisation systematic affects an event or not. More...
 
template<typename ParT >
bool PassesSelection (const ParT &Par, std::size_t iEvent)
 
M3::float_t CalcWeightTotal (const EventInfo *_restrict_ MCEvent) const
 Calculate the total weight weight for a given event. More...
 
virtual void CalcWeightFunc (int iEvent)
 Calculate weights for function parameters. More...
 
virtual std::vector< double > ReturnKinematicVector (std::string KinematicParameter, int iEvent)
 
virtual std::vector< double > ReturnKinematicVector (int KinematicVariable, int iEvent)
 
std::vector< double > ReturnKinematicParameterBinning (const int Sample, const std::string &KinematicParameter) const override
 Return the binning used to draw a kinematic parameter. More...
 
const double * GetPointerToOscChannel (const int iEvent) const
 Get pointer to oscillation channel associated with given event. Osc channel is const. More...
 
void SetupNormParameters ()
 Setup the norm parameters by assigning each event with bin. More...
 
void FillHist (const int Sample, TH1 *Hist, double *Array)
 Fill a histogram with the event-level information used in the fit. More...
 
void FillArray ()
 DB Nice new multi-threaded function which calculates the event weights and fills the relevant bins of an array. More...
 
void ResetHistograms ()
 Helper function to reset histograms. More...
 
void InitialiseSplineObject ()
 
NuPDG GetInitPDGFromFileName (const std::string &FileName) const
 Retrieve the initial neutrino PDG code associated with a given input file name. More...
 
NuPDG GetFinalPDGFromFileName (const std::string &FileName) const
 Retrieve the final neutrino PDG code associated with a given input file name. More...
 
- Protected Member Functions inherited from SampleHandlerBase
void QuietPlease ()
 CW: Redirect std::cout to silence some experiment specific libraries. More...
 
void NowTalk ()
 CW: Redirect std::cout to silence some experiment specific libraries. More...
 
template<typename T >
bool MatchCondition (const std::vector< T > &allowedValues, const T &value)
 check if event is affected by following conditions, for example pdg, or modes etc More...
 
- Protected Attributes inherited from SampleHandlerFD
std::unique_ptr< SplineBaseSplineHandler
 Contains all your splines (binned or unbinned) and handles the setup and the returning of weights from spline evaluations. More...
 
std::shared_ptr< OscillationHandlerOscillator
 Contains oscillator handling calculating oscillation probabilities. More...
 
std::vector< std::vector< FunctionalShifter * > > funcParsGrid
 HH - a grid of vectors of enums for each sample and event. More...
 
std::vector< FunctionalShifterfuncParsMap
 HH - a map that relates the funcpar enum to pointer of FuncPars struct HH - Changed to a vector of pointers since it's faster than unordered_map and we are using ints as keys. More...
 
std::vector< FunctionalParameterfuncParsVec
 HH - a vector that stores all the FuncPars struct. More...
 
std::unordered_map< std::string, int > funcParsNamesMap
 HH - a map that relates the name of the functional parameter to funcpar enum. More...
 
std::unordered_map< int, FuncParFuncTypefuncParsFuncMap
 HH - a map that relates the funcpar enum to pointer of the actual function. More...
 
std::vector< std::string > funcParsNamesVec = {}
 HH - a vector of string names for each functional parameter. More...
 
std::unique_ptr< BinningHandlerBinning
 KS: This stores binning information, in future could be come vector to store binning for every used sample. More...
 
double * SampleHandlerFD_array
 DB Array to be filled after reweighting. More...
 
double * SampleHandlerFD_array_w2
 KS Array used for MC stat. More...
 
double * SampleHandlerFD_data
 DB Array to be filled in AddData. More...
 
std::vector< EventInfoMCSamples
 Stores information about every MC event. More...
 
std::vector< SampleInfoSampleDetails
 Stores info about currently initialised sample. More...
 
ParameterHandlerGenericParHandler = nullptr
 ETA - All experiments will need an xsec, det and osc cov. More...
 
std::string SampleHandlerName
 A unique ID for each sample based on which we can define what systematic should be applied. More...
 
std::vector< std::vector< KinematicCut > > StoredSelection
 What gets pulled from config options, these are constant after loading in this is of length 3: 0th index is the value, 1st is lower bound, 2nd is upper bound. More...
 
std::vector< std::vector< KinematicCut > > Selection
 a way to store selection cuts which you may push back in the get1DVar functions most of the time this is just the same as StoredSelection More...
 
const std::unordered_map< std::string, int > * KinematicParameters
 Mapping between string and kinematic enum. More...
 
const std::unordered_map< int, std::string > * ReversedKinematicParameters
 Mapping between kinematic enum and string. More...
 
const std::unordered_map< std::string, int > * KinematicVectors
 
const std::unordered_map< int, std::string > * ReversedKinematicVectors
 
std::unique_ptr< ManagerSampleManager
 The manager object used to read the sample yaml file. More...
 
std::unordered_map< std::string, double > _modeNomWeightMap
 
TLegend * THStackLeg = nullptr
 DB Miscellaneous Variables. More...
 
bool FirstTimeW2
 KS:Super hacky to update W2 or not. More...
 
bool UpdateW2
 KS:Super hacky to update W2 or not. More...
 
- Protected Attributes inherited from SampleHandlerBase
TestStatistic fTestStatistic
 Test statistic tells what kind of likelihood sample is using. More...
 
std::streambuf * buf
 Keep the cout buffer. More...
 
std::streambuf * errbuf
 Keep the cerr buffer. More...
 
M3::int_t nSamples
 Contains how many samples we've got. More...
 
unsigned int nEvents
 Number of MC events are there. More...
 
std::unique_ptr< MaCh3ModesModes
 Holds information about used Generator and MaCh3 modes. More...
 

Detailed Description

As SampleHandlerFD is an abstract base class we have to do some gymnastics to get it to get it into python.

Definition at line 252 of file samples.cpp.

Member Function Documentation

◆ AddAdditionalWeightPointers()

void PySampleHandlerFD::AddAdditionalWeightPointers ( )
inlineoverridevirtual

DB Function to determine which weights apply to which types of samples.

Implements SampleHandlerFD.

Definition at line 258 of file samples.cpp.

258  {
259  PYBIND11_OVERRIDE_PURE_NAME(
260  void, /* Return type */
261  SampleHandlerFD, /* Parent class */
262  "add_additional_weight_pointers", /*python name*/
263  AddAdditionalWeightPointers, /* Name of function in C++ */
264  /* Argument(s) */
265  );
266  }
void AddAdditionalWeightPointers() override
DB Function to determine which weights apply to which types of samples.
Definition: samples.cpp:258
Class responsible for handling implementation of samples used in analysis, reweighting and returning ...

◆ CleanMemoryBeforeFit()

void PySampleHandlerFD::CleanMemoryBeforeFit ( )
inlineoverridevirtual

Allow to clean not used memory before fit starts.

Implements SampleHandlerBase.

Definition at line 269 of file samples.cpp.

269  {
270  PYBIND11_OVERRIDE_PURE(
271  void, /* Return type */
272  SampleHandlerFD, /* Parent class */
273  CleanMemoryBeforeFit /* Name of function in C++ (must match Python name) */
274  );
275  }
void CleanMemoryBeforeFit() override
Allow to clean not used memory before fit starts.
Definition: samples.cpp:269

◆ GetPointerToKinematicParameter() [1/2]

const double* PySampleHandlerFD::GetPointerToKinematicParameter ( double  ,
int   
)
inlineoverridevirtual

Implements SampleHandlerFD.

Definition at line 371 of file samples.cpp.

371  {
372  PYBIND11_OVERRIDE_PURE_NAME(
373  const double *, /* Return type */
374  SampleHandlerFD, /* Parent class */
375  "get_event_kinematic_value_reference",/* python name*/
376  GetPointerToKinematicParameter, /* Name of function in C++ (must match Python name) */
377  py::arg("variable"),
378  py::arg("event") /* Argument(s) */
379  );
380  }
const double * GetPointerToKinematicParameter(std::string, int) override
Definition: samples.cpp:361

◆ GetPointerToKinematicParameter() [2/2]

const double* PySampleHandlerFD::GetPointerToKinematicParameter ( std::string  ,
int   
)
inlineoverridevirtual

Implements SampleHandlerFD.

Definition at line 361 of file samples.cpp.

361  {
362  PYBIND11_OVERRIDE_PURE_NAME(
363  const double *, /* Return type */
364  SampleHandlerFD, /* Parent class */
365  "get_event_kinematic_value_reference",/* python name*/
366  GetPointerToKinematicParameter, /* Name of function in C++ (must match Python name) */
367  py::arg("variable"),
368  py::arg("event") /* Argument(s) */
369  );
370  }

◆ Init()

void PySampleHandlerFD::Init ( )
inlineoverridevirtual

Initialise any variables that your experiment specific SampleHandler needs.

Implements SampleHandlerFD.

Definition at line 289 of file samples.cpp.

289  {
290  PYBIND11_OVERRIDE_PURE_NAME(
291  void, /* Return type */
292  SampleHandlerFD, /* Parent class */
293  "init", /*python name*/
294  Init, /* Name of function in C++ */
295  /* Argument(s) */
296  );
297  }
void Init() override
Initialise any variables that your experiment specific SampleHandler needs.
Definition: samples.cpp:289

◆ RegisterFunctionalParameters()

void PySampleHandlerFD::RegisterFunctionalParameters ( )
inlineoverridevirtual

HH - a experiment-specific function where the maps to actual functions are set up.

Implements SampleHandlerFD.

Definition at line 382 of file samples.cpp.

382  {
383  PYBIND11_OVERRIDE_PURE_NAME(
384  void,
386  "register_functional_parameters",
388  );
389  }
void RegisterFunctionalParameters() override
HH - a experiment-specific function where the maps to actual functions are set up.
Definition: samples.cpp:382

◆ ReturnKinematicParameter() [1/2]

double PySampleHandlerFD::ReturnKinematicParameter ( int  ,
int   
)
inlineoverridevirtual

Implements SampleHandlerFD.

Definition at line 350 of file samples.cpp.

350  {
351  PYBIND11_OVERRIDE_PURE_NAME(
352  double, /* Return type */
353  SampleHandlerFD, /* Parent class */
354  "get_event_kinematic_value",/* python name*/
355  ReturnKinematicParameter, /* Name of function in C++ (must match Python name) */
356  py::arg("variable"),
357  py::arg("event") /* Argument(s) */
358  );
359  }
double ReturnKinematicParameter(std::string, int) override
Return the value of an associated kinematic parameter for an event.
Definition: samples.cpp:339

◆ ReturnKinematicParameter() [2/2]

double PySampleHandlerFD::ReturnKinematicParameter ( std::string  KinematicParamter,
int  iEvent 
)
inlineoverridevirtual

Return the value of an associated kinematic parameter for an event.

Implements SampleHandlerFD.

Definition at line 339 of file samples.cpp.

339  {
340  PYBIND11_OVERRIDE_PURE_NAME(
341  double, /* Return type */
342  SampleHandlerFD, /* Parent class */
343  "get_event_kinematic_value",/* python name*/
344  ReturnKinematicParameter, /* Name of function in C++ (must match Python name) */
345  py::arg("variable"),
346  py::arg("event") /* Argument(s) */
347  );
348  }

◆ ReturnKinematicParameterFromString()

int PySampleHandlerFD::ReturnKinematicParameterFromString ( std::string  )
inline

Definition at line 319 of file samples.cpp.

319  {
320  PYBIND11_OVERRIDE_PURE_NAME(
321  int, /* Return type */
322  SampleHandlerFD, /* Parent class */
323  "get_kinematic_by_name", /* python name*/
324  ReturnKinematicParameterFromString, /* Name of function in C++ (must match Python name) */
325  py::arg("variable_name")
326  );
327  }
int ReturnKinematicParameterFromString(std::string)
Definition: samples.cpp:319

◆ ReturnStringFromKinematicParameter()

std::string PySampleHandlerFD::ReturnStringFromKinematicParameter ( int  )
inline

Definition at line 329 of file samples.cpp.

329  {
330  PYBIND11_OVERRIDE_PURE_NAME(
331  std::string, /* Return type */
332  SampleHandlerFD, /* Parent class */
333  "get_kinematic_name", /* python name*/
334  ReturnStringFromKinematicParameter, /* Name of function in C++ (must match Python name) */
335  py::arg("variable_id")
336  );
337  }
std::string ReturnStringFromKinematicParameter(int)
Definition: samples.cpp:329

◆ SampleHandlerFD()

SampleHandlerFD::SampleHandlerFD

Constructor.

Parameters
ConfigFileNameName of config to initialise the sample object

Definition at line 27 of file SampleHandlerFD.cpp.

13  : SampleHandlerBase() {
14 // ************************************************
15  MACH3LOG_INFO("-------------------------------------------------------------------");
16  MACH3LOG_INFO("Creating SampleHandlerFD object");
17 
18  //ETA - safety feature so you can't pass a NULL xsec_cov
19  if(!xsec_cov){
20  MACH3LOG_ERROR("You've passed me a nullptr to a SystematicHandlerGeneric... I need this to setup splines!");
21  throw MaCh3Exception(__FILE__, __LINE__);
22  }
23  ParHandler = xsec_cov;
24 
25  nSamples = 1;
26 
27  if (OscillatorObj_ != nullptr) {
28  MACH3LOG_WARN("You have passed an Oscillator object through the constructor of a SampleHandlerFD object - this will be used for all oscillation channels");
29  Oscillator = OscillatorObj_;
30  }
31 
32  KinematicParameters = nullptr;
34  KinematicVectors = nullptr;
35  ReversedKinematicVectors = nullptr;
36 
37  SampleHandlerFD_array = nullptr;
38  SampleHandlerFD_data = nullptr;
39  SampleHandlerFD_array_w2 = nullptr;
40  SampleHandlerName = "";
41  SampleManager = std::make_unique<Manager>(ConfigFileName.c_str());
42  Binning = std::make_unique<BinningHandler>();
43  // Variables related to MC stat
44  FirstTimeW2 = true;
45  UpdateW2 = false;
46 }
#define MACH3LOG_ERROR
Definition: MaCh3Logger.h:37
#define MACH3LOG_INFO
Definition: MaCh3Logger.h:35
#define MACH3LOG_WARN
Definition: MaCh3Logger.h:36
Custom exception class used throughout MaCh3.
SampleHandlerBase()
The main constructor.
M3::int_t nSamples
Contains how many samples we've got.
ParameterHandlerGeneric * ParHandler
ETA - All experiments will need an xsec, det and osc cov.
bool FirstTimeW2
KS:Super hacky to update W2 or not.
std::unique_ptr< BinningHandler > Binning
KS: This stores binning information, in future could be come vector to store binning for every used s...
double * SampleHandlerFD_data
DB Array to be filled in AddData.
const std::unordered_map< int, std::string > * ReversedKinematicVectors
std::unique_ptr< Manager > SampleManager
The manager object used to read the sample yaml file.
const std::unordered_map< std::string, int > * KinematicVectors
double * SampleHandlerFD_array
DB Array to be filled after reweighting.
std::string SampleHandlerName
A unique ID for each sample based on which we can define what systematic should be applied.
bool UpdateW2
KS:Super hacky to update W2 or not.
std::shared_ptr< OscillationHandler > Oscillator
Contains oscillator handling calculating oscillation probabilities.
const std::unordered_map< std::string, int > * KinematicParameters
Mapping between string and kinematic enum.
const std::unordered_map< int, std::string > * ReversedKinematicParameters
Mapping between kinematic enum and string.
double * SampleHandlerFD_array_w2
KS Array used for MC stat.

◆ SetupExperimentMC()

int PySampleHandlerFD::SetupExperimentMC ( )
inlineoverridevirtual

Experiment specific setup, returns the number of events which were loaded.

Implements SampleHandlerFD.

Definition at line 300 of file samples.cpp.

300  {
301  PYBIND11_OVERRIDE_PURE_NAME(
302  int, /* Return type */
303  SampleHandlerFD, /* Parent class */
304  "setup_experiment_MC", /*python name*/
305  SetupExperimentMC, /* Name of function in C++ */
306  );
307  }
int SetupExperimentMC() override
Experiment specific setup, returns the number of events which were loaded.
Definition: samples.cpp:300

◆ SetupFDMC()

void PySampleHandlerFD::SetupFDMC ( )
inlineoverridevirtual

Function which translates experiment struct into core struct.

Implements SampleHandlerFD.

Definition at line 310 of file samples.cpp.

310  {
311  PYBIND11_OVERRIDE_PURE_NAME(
312  void, /* Return type */
313  SampleHandlerFD, /* Parent class */
314  "setup_FD_MC", /*python name*/
315  SetupFDMC, /* Name of function in C++ */
316  );
317  }
void SetupFDMC() override
Function which translates experiment struct into core struct.
Definition: samples.cpp:310

◆ SetupSplines()

void PySampleHandlerFD::SetupSplines ( )
inlineoverridevirtual

initialise your splineXX object and then use InitialiseSplineObject to conviently setup everything up

Todo:
abstract the spline initialisation completely to core

Implements SampleHandlerFD.

Definition at line 278 of file samples.cpp.

278  {
279  PYBIND11_OVERRIDE_PURE_NAME(
280  void, /* Return type */
281  SampleHandlerFD, /* Parent class */
282  "setup_splines", /*python name*/
283  SetupSplines, /* Name of function in C++ */
284  /* Argument(s) */
285  );
286  }
void SetupSplines() override
initialise your splineXX object and then use InitialiseSplineObject to conviently setup everything up
Definition: samples.cpp:278

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