MaCh3 2.2.1
Reference Guide
Loading...
Searching...
No Matches
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 SetupWeightPointers () override
 DB Function to determine which weights apply to which types of samples pure virtual!!
 
void CleanMemoryBeforeFit () override
 Allow to clean not used memory before fit starts.
 
void SetupSplines () override
 initialise your splineXX object and then use InitialiseSplineObject to conviently setup everything up
 
void Init () override
 Initialise any variables that your experiment specific SampleHandler needs.
 
int SetupExperimentMC () override
 Experiment specific setup, returns the number of events which were loaded.
 
void SetupFDMC () override
 Function which translates experiment struct into core struct.
 
int ReturnKinematicParameterFromString (std::string)
 
std::string ReturnStringFromKinematicParameter (int)
 
double ReturnKinematicParameter (std::string, int) override
 Return the value of an assocaited kinematic parameter for an event.
 
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.
 
 SampleHandlerFD (std::string ConfigFileName, ParameterHandlerGeneric *xsec_cov, const std::shared_ptr< OscillationHandler > &OscillatorObj_=nullptr)
 Constructor.
 
- Public Member Functions inherited from SampleHandlerFD
 SampleHandlerFD (std::string ConfigFileName, ParameterHandlerGeneric *xsec_cov, const std::shared_ptr< OscillationHandler > &OscillatorObj_=nullptr)
 Constructor.
 
virtual ~SampleHandlerFD ()
 destructor
 
int GetNDim () const
 DB Function to differentiate 1D or 2D binning.
 
std::string GetSampleName (int iSample=0) const override
 
std::string GetTitle () const override
 
std::string GetXBinVarName ()
 
std::string GetYBinVarName ()
 
void PrintIntegral (TString OutputName="/dev/null", int WeightStyle=0, TString OutputCSVName="/dev/null")
 
void AddData (TH1D *Data)
 
void AddData (TH2D *Data)
 
void AddData (std::vector< double > &data)
 
void AddData (std::vector< std::vector< double > > &data)
 
double GetLikelihood () override
 DB Multi-threaded GetLikelihood.
 
TH1 * GetMCHist (const int Dimension)
 Get MC histogram.
 
TH1 * GetW2Hist (const int Dimension)
 Get W2 histogram.
 
TH1 * GetDataHist (const int Dimension)
 Get Data histogram.
 
void Reweight () override
 
M3::float_t GetEventWeight (const int iEntry) const
 
void InitialiseNuOscillatorObjects ()
 including Dan's magic NuOscillator
 
void SetupNuOscillatorPointers ()
 
void ReadSampleConfig ()
 
int GetNOscChannels () override
 
std::string GetFlavourName (const int iChannel)
 
TH1 * Get1DVarHist (const std::string &ProjectionVar, const std::vector< KinematicCut > &EventSelectionVec=std::vector< KinematicCut >(), int WeightStyle=0, TAxis *Axis=nullptr, const std::vector< KinematicCut > &SubEventSelectionVec=std::vector< KinematicCut >())
 
TH2 * Get2DVarHist (const std::string &ProjectionVarX, const std::string &ProjectionVarY, const std::vector< KinematicCut > &EventSelectionVec=std::vector< KinematicCut >(), int WeightStyle=0, TAxis *AxisX=nullptr, TAxis *AxisY=nullptr, const std::vector< KinematicCut > &SubEventSelectionVec=std::vector< KinematicCut >())
 
void Fill1DSubEventHist (TH1D *_h1DVar, const std::string &ProjectionVar, const std::vector< KinematicCut > &SubEventSelectionVec=std::vector< KinematicCut >(), int WeightStyle=0)
 
void Fill2DSubEventHist (TH2D *_h2DVar, const std::string &ProjectionVarX, const std::string &ProjectionVarY, const std::vector< KinematicCut > &SubEventSelectionVec=std::vector< KinematicCut >(), int WeightStyle=0)
 
TH1 * Get1DVarHistByModeAndChannel (const std::string &ProjectionVar_Str, int kModeToFill=-1, int kChannelToFill=-1, int WeightStyle=0, TAxis *Axis=nullptr)
 
TH2 * Get2DVarHistByModeAndChannel (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)
 
TH1 * GetModeHist1D (int s, int m, int style=0)
 
TH2 * GetModeHist2D (int s, int m, int style=0)
 
std::vector< TH1 * > ReturnHistsBySelection1D (std::string KinematicProjection, int Selection1, int Selection2=-1, int WeightStyle=0, TAxis *Axis=0)
 
std::vector< TH2 * > ReturnHistsBySelection2D (std::string KinematicProjectionX, std::string KinematicProjectionY, int Selection1, int Selection2=-1, int WeightStyle=0, TAxis *XAxis=0, TAxis *YAxis=0)
 
THStack * ReturnStackedHistBySelection1D (std::string KinematicProjection, int Selection1, int Selection2=-1, int WeightStyle=0, TAxis *Axis=0)
 
TLegend * ReturnStackHistLegend ()
 
int ReturnKinematicParameterFromString (const std::string &KinematicStr) const
 ETA function to generically convert a string from xsec cov to a kinematic type.
 
std::string ReturnStringFromKinematicParameter (const int KinematicVariable) const
 ETA function to generically convert a kinematic type from xsec cov to a string.
 
void SaveAdditionalInfo (TDirectory *Dir) override
 Store additional info in a chan.
 
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.
 
- Public Member Functions inherited from SampleHandlerBase
 SampleHandlerBase ()
 The main constructor.
 
virtual ~SampleHandlerBase ()
 destructor
 
virtual M3::int_t GetNsamples ()
 
virtual std::string GetTitle () const
 
virtual std::string GetSampleName (int Sample) const =0
 
virtual double GetSampleLikelihood (const int isample)
 
virtual void CleanMemoryBeforeFit ()=0
 Allow to clean not used memory before fit starts.
 
virtual void SaveAdditionalInfo (TDirectory *Dir)
 Store additional info in a chan.
 
MaCh3ModesGetMaCh3Modes () const
 Return pointer to MaCh3 modes.
 
virtual void Reweight ()=0
 
virtual double GetLikelihood ()=0
 
unsigned int GetNEvents () const
 
virtual int GetNMCSamples ()
 
virtual int GetNOscChannels ()
 
virtual void SetupBinning (const M3::int_t Selection, std::vector< double > &BinningX, std::vector< double > &BinningY)
 
virtual TH1 * GetData (const int Selection)
 
virtual TH2Poly * GetW2 (const int Selection)
 
virtual TH1 * GetPDF (const int Selection)
 
virtual TH1 * GetPDFMode (const int Selection, const int Mode)
 
virtual std::string GetKinVarLabel (const int sample, const int Dimension)
 
double GetTestStatLLH (double data, double mc) const
 Calculate test statistic for a single bin using Poisson.
 
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.
 
void SetTestStatistic (TestStatistic testStat)
 Set the test statistic to be used when calculating the binned likelihoods.
 

Additional Inherited Members

- Protected Member Functions inherited from SampleHandlerFD
virtual void SetupWeightPointers ()=0
 DB Function to determine which weights apply to which types of samples pure virtual!!
 
void SetupKinematicMap ()
 Ensure Kinematic Map is setup and make sure it is initialised correctly.
 
virtual void SetupSplines ()=0
 initialise your splineXX object and then use InitialiseSplineObject to conviently setup everything up
 
virtual void Init ()=0
 Initialise any variables that your experiment specific SampleHandler needs.
 
virtual int SetupExperimentMC ()=0
 Experiment specific setup, returns the number of events which were loaded.
 
virtual void SetupFDMC ()=0
 Function which translates experiment struct into core struct.
 
void Initialise ()
 Function which does a lot of the lifting regarding the workflow in creating different MC objects.
 
void FillSplineBins ()
 Finds the binned spline that an event should apply to and stored them in a a vector for easy evaluation in the fillArray() function.
 
void FindNominalBinAndEdges1D ()
 
void FindNominalBinAndEdges2D ()
 
void Set1DBinning (size_t nbins, double *boundaries)
 sets the binning used for the likelihood calculation, used for both data and MC
 
void Set2DBinning (size_t nbins1, double *boundaries1, size_t nbins2, double *boundaries2)
 set the binning for 2D sample used for the likelihood calculation
 
void Set1DBinning (std::vector< double > &XVec)
 set the binning for 1D sample used for the likelihood calculation
 
void Set2DBinning (std::vector< double > &XVec, std::vector< double > &YVec)
 set the binning for 2D sample used for the likelihood calculation
 
void SetupSampleBinning ()
 wrapper to call set binning functions based on sample config info
 
void SetupReweightArrays (const size_t numberXBins, const size_t numberYBins)
 Initialise data, MC and W2 histograms.
 
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.
 
void RegisterIndividualFunctionalParameter (const std::string &fpName, int fpEnum, FuncParFuncType fpFunc)
 HH - a helper function for RegisterFunctionalParameter.
 
virtual void RegisterFunctionalParameters ()=0
 HH - a experiment-specific function where the maps to actual functions are set up.
 
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.
 
virtual void ApplyShifts (int iEvent)
 ETA - generic function applying shifts.
 
bool IsEventSelected (const int iEvent)
 DB Function which determines if an event is selected, where Selection double looks like {{ND280KinematicTypes Var1, douuble LowBound}.
 
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.
 
virtual void resetShifts (int iEvent)
 HH - reset the shifted values to the original values.
 
void CalcNormsBins (std::vector< NormParameter > &norm_parameters, std::vector< std::vector< int > > &xsec_norms_bins)
 Check whether a normalisation systematic affects an event or not.
 
M3::float_t CalcWeightSpline (const FarDetectorCoreInfo *MCEvent) const
 Calculate the spline weight for a given event.
 
M3::float_t CalcWeightNorm (const FarDetectorCoreInfo *MCEvent) const
 Calculate the norm weight for a given event.
 
virtual void CalcWeightFunc (int iEvent)
 Calculate weights for function parameters.
 
virtual double ReturnKinematicParameter (std::string KinematicParamter, int iEvent)=0
 Return the value of an assocaited kinematic parameter for an event.
 
virtual double ReturnKinematicParameter (int KinematicVariable, int iEvent)=0
 
virtual std::vector< double > ReturnKinematicVector (std::string KinematicParameter, int iEvent)
 
virtual std::vector< double > ReturnKinematicVector (int KinematicVariable, int iEvent)
 
std::vector< double > ReturnKinematicParameterBinning (const std::string &KinematicParameter)
 Return the binning used to draw a kinematic parameter.
 
virtual const double * GetPointerToKinematicParameter (std::string KinematicParamter, int iEvent)=0
 
virtual const double * GetPointerToKinematicParameter (double KinematicVariable, int iEvent)=0
 
const double * GetPointerToOscChannel (const int iEvent) const
 Get pointer to oscillation channel associated with given event. Osc channel is const.
 
void SetupNormParameters ()
 Setup the norm parameters by assigning each event with bin.
 
void Fill1DHist ()
 Fill a 1D histogram with the event-level information used in the fit.
 
void Fill2DHist ()
 Fill a 2D histogram with the event-level information used in the fit.
 
void FillArray ()
 DB Nice new multi-threaded function which calculates the event weights and fills the relevant bins of an array.
 
void ResetHistograms ()
 Helper function to reset histograms.
 
void InitialiseSingleFDMCObject ()
 function to create the member of the FarDetectorInfo struct so they are the appropriate size.
 
void InitialiseSplineObject ()
 
NuPDG GetInitPDGFromFileName (const std::string &FileName) const
 Retrieve the initial neutrino PDG code associated with a given input file name.
 
NuPDG GetFinalPDGFromFileName (const std::string &FileName) const
 Retrieve the final neutrino PDG code associated with a given input file name.
 
- Protected Member Functions inherited from SampleHandlerBase
void QuietPlease ()
 CW: Redirect std::cout to silence some experiment specific libraries.
 
void NowTalk ()
 CW: Redirect std::cout to silence some experiment specific libraries.
 
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
 
- Protected Attributes inherited from SampleHandlerFD
std::unique_ptr< BinnedSplineHandlerSplineHandler
 Contains all your binned splines and handles the setup and the returning of weights from spline evaluations.
 
std::shared_ptr< OscillationHandlerOscillator
 Contains all your binned splines and handles the setup and the returning of weights from spline evaluations.
 
std::string XVarStr
 the strings associated with the variables used for the binning e.g. "RecoNeutrinoEnergy"
 
std::string YVarStr
 
std::vector< FunctionalParameterfuncParsVec
 HH - a vector that stores all the FuncPars struct.
 
std::unordered_map< std::string, int > funcParsNamesMap
 HH - a map that relates the name of the functional parameter to funcpar enum.
 
std::vector< FunctionalParameter * > funcParsMap
 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.
 
std::unordered_map< int, FuncParFuncTypefuncParsFuncMap
 HH - a map that relates the funcpar enum to pointer of the actual function.
 
std::vector< std::vector< int > > funcParsGrid
 HH - a grid of vectors of enums for each sample and event.
 
std::vector< std::string > funcParsNamesVec = {}
 HH - a vector of string names for each functional parameter.
 
SampleBinningInfo Binning
 KS: This stores binning information, in future could be come vector to store binning for every used sample.
 
double ** SampleHandlerFD_array
 DB Array to be filled after reweighting.
 
double ** SampleHandlerFD_array_w2
 KS Array used for MC stat.
 
double ** SampleHandlerFD_data
 DB Array to be filled in AddData.
 
std::vector< FarDetectorCoreInfoMCSamples
 
std::vector< OscChannelInfoOscChannels
 
ParameterHandlerGenericParHandler = nullptr
 
int nDimensions = M3::_BAD_INT_
 Keep track of the dimensions of the sample binning.
 
std::string SampleName
 A unique ID for each sample based on powers of two for quick binary operator comparisons.
 
std::string SampleTitle
 the name of this sample e.g."muon-like"
 
std::vector< KinematicCutStoredSelection
 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.
 
std::vector< KinematicCutSelection
 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
 
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.
 
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.
 
std::vector< std::string > mc_files
 names of mc files associated associated with this object
 
std::vector< std::string > spline_files
 names of spline files associated associated with this object
 
std::unordered_map< std::string, double > _modeNomWeightMap
 
TLegend * THStackLeg = nullptr
 DB Miscellaneous Variables.
 
bool FirstTimeW2
 KS:Super hacky to update W2 or not.
 
bool UpdateW2
 KS:Super hacky to update W2 or not.
 
TH1D * dathist
 
TH2D * dathist2d
 
TH1D * _hPDF1D
 
TH2D * _hPDF2D
 
- Protected Attributes inherited from SampleHandlerBase
TestStatistic fTestStatistic
 Test statistic tells what kind of likelihood sample is using.
 
std::streambuf * buf
 Keep the cout buffer.
 
std::streambuf * errbuf
 Keep the cerr buffer.
 
M3::int_t nSamples
 Contains how many samples we've got.
 
unsigned int nEvents
 Number of MC events are there.
 
std::unique_ptr< MaCh3ModesModes
 Holds information about used Generator and MaCh3 modes.
 

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 56 of file samples.cpp.

Member Function Documentation

◆ CleanMemoryBeforeFit()

void PySampleHandlerFD::CleanMemoryBeforeFit ( )
inlineoverridevirtual

Allow to clean not used memory before fit starts.

Implements SampleHandlerBase.

Definition at line 73 of file samples.cpp.

73 {
74 PYBIND11_OVERRIDE_PURE(
75 void, /* Return type */
76 SampleHandlerFD, /* Parent class */
77 CleanMemoryBeforeFit /* Name of function in C++ (must match Python name) */
78 );
79 }
void CleanMemoryBeforeFit() override
Allow to clean not used memory before fit starts.
Definition: samples.cpp:73
Class responsible for handling implementation of samples used in analysis, reweighting and returning ...

◆ GetPointerToKinematicParameter() [1/2]

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

Implements SampleHandlerFD.

Definition at line 175 of file samples.cpp.

175 {
176 PYBIND11_OVERRIDE_PURE_NAME(
177 const double *, /* Return type */
178 SampleHandlerFD, /* Parent class */
179 "get_event_kinematic_value_reference",/* python name*/
180 GetPointerToKinematicParameter, /* Name of function in C++ (must match Python name) */
181 py::arg("variable"),
182 py::arg("event") /* Argument(s) */
183 );
184 }
const double * GetPointerToKinematicParameter(std::string, int) override
Definition: samples.cpp:165

◆ GetPointerToKinematicParameter() [2/2]

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

Implements SampleHandlerFD.

Definition at line 165 of file samples.cpp.

165 {
166 PYBIND11_OVERRIDE_PURE_NAME(
167 const double *, /* Return type */
168 SampleHandlerFD, /* Parent class */
169 "get_event_kinematic_value_reference",/* python name*/
170 GetPointerToKinematicParameter, /* Name of function in C++ (must match Python name) */
171 py::arg("variable"),
172 py::arg("event") /* Argument(s) */
173 );
174 }

◆ Init()

void PySampleHandlerFD::Init ( )
inlineoverridevirtual

Initialise any variables that your experiment specific SampleHandler needs.

Implements SampleHandlerFD.

Definition at line 93 of file samples.cpp.

93 {
94 PYBIND11_OVERRIDE_PURE_NAME(
95 void, /* Return type */
96 SampleHandlerFD, /* Parent class */
97 "init", /*python name*/
98 Init, /* Name of function in C++ */
99 /* Argument(s) */
100 );
101 }
void Init() override
Initialise any variables that your experiment specific SampleHandler needs.
Definition: samples.cpp:93

◆ RegisterFunctionalParameters()

void PySampleHandlerFD::RegisterFunctionalParameters ( )
inlineoverridevirtual

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

Implements SampleHandlerFD.

Definition at line 186 of file samples.cpp.

186 {
187 PYBIND11_OVERRIDE_PURE_NAME(
188 void,
190 "register_functional_parameters",
192 );
193 }
void RegisterFunctionalParameters() override
HH - a experiment-specific function where the maps to actual functions are set up.
Definition: samples.cpp:186

◆ ReturnKinematicParameter() [1/2]

double PySampleHandlerFD::ReturnKinematicParameter ( int  ,
int   
)
inlineoverridevirtual

Implements SampleHandlerFD.

Definition at line 154 of file samples.cpp.

154 {
155 PYBIND11_OVERRIDE_PURE_NAME(
156 double, /* Return type */
157 SampleHandlerFD, /* Parent class */
158 "get_event_kinematic_value",/* python name*/
159 ReturnKinematicParameter, /* Name of function in C++ (must match Python name) */
160 py::arg("variable"),
161 py::arg("event") /* Argument(s) */
162 );
163 }
double ReturnKinematicParameter(std::string, int) override
Return the value of an assocaited kinematic parameter for an event.
Definition: samples.cpp:143

◆ ReturnKinematicParameter() [2/2]

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

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

Implements SampleHandlerFD.

Definition at line 143 of file samples.cpp.

143 {
144 PYBIND11_OVERRIDE_PURE_NAME(
145 double, /* Return type */
146 SampleHandlerFD, /* Parent class */
147 "get_event_kinematic_value",/* python name*/
148 ReturnKinematicParameter, /* Name of function in C++ (must match Python name) */
149 py::arg("variable"),
150 py::arg("event") /* Argument(s) */
151 );
152 }

◆ ReturnKinematicParameterFromString()

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

Definition at line 123 of file samples.cpp.

123 {
124 PYBIND11_OVERRIDE_PURE_NAME(
125 int, /* Return type */
126 SampleHandlerFD, /* Parent class */
127 "get_kinematic_by_name", /* python name*/
128 ReturnKinematicParameterFromString, /* Name of function in C++ (must match Python name) */
129 py::arg("variable_name")
130 );
131 }
int ReturnKinematicParameterFromString(std::string)
Definition: samples.cpp:123

◆ ReturnStringFromKinematicParameter()

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

Definition at line 133 of file samples.cpp.

133 {
134 PYBIND11_OVERRIDE_PURE_NAME(
135 std::string, /* Return type */
136 SampleHandlerFD, /* Parent class */
137 "get_kinematic_name", /* python name*/
138 ReturnStringFromKinematicParameter, /* Name of function in C++ (must match Python name) */
139 py::arg("variable_id")
140 );
141 }
std::string ReturnStringFromKinematicParameter(int)
Definition: samples.cpp:133

◆ SampleHandlerFD()

SampleHandlerFD::SampleHandlerFD ( std::string  ConfigFileName,
ParameterHandlerGeneric xsec_cov,
const std::shared_ptr< OscillationHandler > &  OscillatorObj_ = nullptr 
)

Constructor.

Parameters
ConfigFileNameName of config to initialise the sample object

Definition at line 24 of file SampleHandlerFD.cpp.

12// ************************************************
13 MACH3LOG_INFO("-------------------------------------------------------------------");
14 MACH3LOG_INFO("Creating SampleHandlerFD object");
15
16 //ETA - safety feature so you can't pass a NULL xsec_cov
17 if(!xsec_cov){
18 MACH3LOG_ERROR("You've passed me a nullptr to a SystematicHandlerGeneric... I need this to setup splines!");
19 throw MaCh3Exception(__FILE__, __LINE__);
20 }
21 ParHandler = xsec_cov;
22
23 nSamples = 1;
24
25 if (OscillatorObj_ != nullptr) {
26 MACH3LOG_WARN("You have passed an Oscillator object through the constructor of a SampleHandlerFD object - this will be used for all oscillation channels");
27 Oscillator = OscillatorObj_;
28 }
29 dathist = nullptr;
30 dathist2d = nullptr;
31 _hPDF1D = nullptr;
32 _hPDF2D = nullptr;
33
34 KinematicParameters = nullptr;
36 KinematicVectors = nullptr;
38
39 SampleHandlerFD_array = nullptr;
40 SampleHandlerFD_data = nullptr;
42 SampleName = "";
43 SampleManager = std::unique_ptr<manager>(new manager(ConfigFileName.c_str()));
44
45 // Variables related to MC stat
46 FirstTimeW2 = true;
47 UpdateW2 = false;
48}
#define MACH3LOG_ERROR
Definition: MaCh3Logger.h:25
#define MACH3LOG_INFO
Definition: MaCh3Logger.h:23
#define MACH3LOG_WARN
Definition: MaCh3Logger.h:24
Custom exception class for MaCh3 errors.
SampleHandlerBase()
The main constructor.
M3::int_t nSamples
Contains how many samples we've got.
ParameterHandlerGeneric * ParHandler
bool FirstTimeW2
KS:Super hacky to update W2 or not.
const std::unordered_map< int, std::string > * ReversedKinematicVectors
double ** SampleHandlerFD_array_w2
KS Array used for MC stat.
const std::unordered_map< std::string, int > * KinematicVectors
std::unique_ptr< manager > SampleManager
The manager object used to read the sample yaml file.
bool UpdateW2
KS:Super hacky to update W2 or not.
std::shared_ptr< OscillationHandler > Oscillator
Contains all your binned splines and handles the setup and the returning of weights from spline evalu...
double ** SampleHandlerFD_array
DB Array to be filled after reweighting.
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_data
DB Array to be filled in AddData.
std::string SampleName
A unique ID for each sample based on powers of two for quick binary operator comparisons.
The manager class is responsible for managing configurations and settings.
Definition: Manager.h:16

◆ SetupExperimentMC()

int PySampleHandlerFD::SetupExperimentMC ( )
inlineoverridevirtual

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

Implements SampleHandlerFD.

Definition at line 104 of file samples.cpp.

104 {
105 PYBIND11_OVERRIDE_PURE_NAME(
106 int, /* Return type */
107 SampleHandlerFD, /* Parent class */
108 "setup_experiment_MC", /*python name*/
109 SetupExperimentMC, /* Name of function in C++ */
110 );
111 }
int SetupExperimentMC() override
Experiment specific setup, returns the number of events which were loaded.
Definition: samples.cpp:104

◆ SetupFDMC()

void PySampleHandlerFD::SetupFDMC ( )
inlineoverridevirtual

Function which translates experiment struct into core struct.

Implements SampleHandlerFD.

Definition at line 114 of file samples.cpp.

114 {
115 PYBIND11_OVERRIDE_PURE_NAME(
116 void, /* Return type */
117 SampleHandlerFD, /* Parent class */
118 "setup_FD_MC", /*python name*/
119 SetupFDMC, /* Name of function in C++ */
120 );
121 }
void SetupFDMC() override
Function which translates experiment struct into core struct.
Definition: samples.cpp:114

◆ 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 82 of file samples.cpp.

82 {
83 PYBIND11_OVERRIDE_PURE_NAME(
84 void, /* Return type */
85 SampleHandlerFD, /* Parent class */
86 "setup_splines", /*python name*/
87 SetupSplines, /* Name of function in C++ */
88 /* Argument(s) */
89 );
90 }
void SetupSplines() override
initialise your splineXX object and then use InitialiseSplineObject to conviently setup everything up
Definition: samples.cpp:82

◆ SetupWeightPointers()

void PySampleHandlerFD::SetupWeightPointers ( )
inlineoverridevirtual

DB Function to determine which weights apply to which types of samples pure virtual!!

Implements SampleHandlerFD.

Definition at line 62 of file samples.cpp.

62 {
63 PYBIND11_OVERRIDE_PURE_NAME(
64 void, /* Return type */
65 SampleHandlerFD, /* Parent class */
66 "setup_weight_pointers", /*python name*/
67 SetupWeightPointers, /* Name of function in C++ */
68 /* Argument(s) */
69 );
70 }
void SetupWeightPointers() override
DB Function to determine which weights apply to which types of samples pure virtual!...
Definition: samples.cpp:62

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