![]() |
MaCh3
2.2.3
Reference Guide
|
As SampleHandlerFD is an abstract base class we have to do some gymnastics to get it to get it into python. More...
Public Member Functions | |
void | SetupWeightPointers () override |
DB Function to determine which weights apply to which types of samples pure virtual!! 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... | |
![]() | |
SampleHandlerFD (std::string ConfigFileName, ParameterHandlerGeneric *xsec_cov, const std::shared_ptr< OscillationHandler > &OscillatorObj_=nullptr) | |
Constructor. More... | |
virtual | ~SampleHandlerFD () |
destructor More... | |
int | GetNDim () const |
DB Function to differentiate 1D or 2D binning. More... | |
std::string | GetSampleName (int iSample=0) const override |
std::string | GetTitle () const override |
std::string | GetXBinVarName () const |
std::string | GetYBinVarName () const |
void | PrintIntegral (const TString &OutputName="/dev/null", const int WeightStyle=0, const 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. More... | |
TH1 * | GetMCHist (const int Dimension) |
Get MC histogram. More... | |
TH1 * | GetW2Hist (const int Dimension) |
Get W2 histogram. More... | |
TH1 * | GetDataHist (const int Dimension) |
Get Data histogram. More... | |
void | Reweight () override |
M3::float_t | GetEventWeight (const int iEntry) const |
void | InitialiseNuOscillatorObjects () |
including Dan's magic NuOscillator More... | |
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. 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... | |
![]() | |
SampleHandlerBase () | |
The main constructor. More... | |
virtual | ~SampleHandlerBase () |
destructor More... | |
virtual M3::int_t | GetNsamples () |
virtual double | GetSampleLikelihood (const int isample) |
MaCh3Modes * | GetMaCh3Modes () const |
Return pointer to MaCh3 modes. More... | |
unsigned int | GetNEvents () const |
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 | 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... | |
Additional Inherited Members | |
![]() | |
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 | 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. More... | |
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 More... | |
void | Set2DBinning (size_t nbins1, double *boundaries1, size_t nbins2, double *boundaries2) |
set the binning for 2D sample used for the likelihood calculation More... | |
void | Set1DBinning (std::vector< double > &XVec) |
set the binning for 1D sample used for the likelihood calculation More... | |
void | Set2DBinning (std::vector< double > &XVec, std::vector< double > &YVec) |
set the binning for 2D sample used for the likelihood calculation More... | |
void | SetupSampleBinning () |
Function to setup the binning of your sample histograms and the underlying arrays that get handled in fillArray() and fillArray_MP(). The Binning.XBinEdges are filled in the daughter class from the sample config file. This "passing" can be removed. More... | |
void | SetupReweightArrays (const size_t numberXBins, const size_t numberYBins) |
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 (int iEvent) |
ETA - generic function applying shifts. More... | |
bool | IsEventSelected (const int iEvent) |
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 (int iEvent) |
HH - reset the shifted values to the original values. More... | |
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. More... | |
M3::float_t | CalcWeightSpline (const FarDetectorCoreInfo *MCEvent) const |
Calculate the spline weight for a given event. More... | |
M3::float_t | CalcWeightNorm (const FarDetectorCoreInfo *MCEvent) const |
Calculate the norm 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 std::string &KinematicParameter) |
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 | FillMCHist (const int Dimension) |
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 | InitialiseSingleFDMCObject () |
function to create the member of the FarDetectorInfo struct so they are the appropriate size. 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... | |
![]() | |
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... | |
![]() | |
std::unique_ptr< BinnedSplineHandler > | SplineHandler |
Contains all your binned splines and handles the setup and the returning of weights from spline evaluations. More... | |
std::shared_ptr< OscillationHandler > | Oscillator |
Contains all your binned splines and handles the setup and the returning of weights from spline evaluations. More... | |
std::vector< FunctionalParameter > | funcParsVec |
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::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. More... | |
std::unordered_map< int, FuncParFuncType > | funcParsFuncMap |
HH - a map that relates the funcpar enum to pointer of the actual function. More... | |
std::vector< std::vector< int > > | funcParsGrid |
HH - a grid of vectors of enums for each sample and event. More... | |
std::vector< std::string > | funcParsNamesVec = {} |
HH - a vector of string names for each functional parameter. More... | |
SampleBinningInfo | Binning |
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< FarDetectorCoreInfo > | MCSamples |
Stores information about every MC event. More... | |
SampleInfo | SampleDetails |
Stores info about currently initialised sample. More... | |
std::vector< OscChannelInfo > | OscChannels |
Stores info about oscillation channel for a single sample. More... | |
ParameterHandlerGeneric * | ParHandler = nullptr |
std::string | SampleName |
A unique ID for each sample based on which we can define what systematic should be applied. More... | |
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< 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< manager > | SampleManager |
The manager object used to read the sample yaml file. More... | |
std::vector< std::string > | mc_files |
names of mc files associated associated with this object More... | |
std::vector< std::string > | spline_files |
names of spline files associated associated with this object 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... | |
![]() | |
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< MaCh3Modes > | Modes |
Holds information about used Generator and MaCh3 modes. More... | |
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.
|
inlineoverridevirtual |
Allow to clean not used memory before fit starts.
Implements SampleHandlerBase.
Definition at line 73 of file samples.cpp.
|
inlineoverridevirtual |
Implements SampleHandlerFD.
Definition at line 175 of file samples.cpp.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Initialise any variables that your experiment specific SampleHandler needs.
Implements SampleHandlerFD.
Definition at line 93 of file samples.cpp.
|
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.
|
inlineoverridevirtual |
Implements SampleHandlerFD.
Definition at line 154 of file samples.cpp.
|
inlineoverridevirtual |
Return the value of an associated kinematic parameter for an event.
Implements SampleHandlerFD.
Definition at line 143 of file samples.cpp.
|
inline |
Definition at line 123 of file samples.cpp.
|
inline |
Definition at line 133 of file samples.cpp.
SampleHandlerFD::SampleHandlerFD |
Constructor.
ConfigFileName | Name of config to initialise the sample object |
Definition at line 24 of file SampleHandlerFD.cpp.
|
inlineoverridevirtual |
Experiment specific setup, returns the number of events which were loaded.
Implements SampleHandlerFD.
Definition at line 104 of file samples.cpp.
|
inlineoverridevirtual |
Function which translates experiment struct into core struct.
Implements SampleHandlerFD.
Definition at line 114 of file samples.cpp.
|
inlineoverridevirtual |
initialise your splineXX object and then use InitialiseSplineObject to conviently setup everything up
Implements SampleHandlerFD.
Definition at line 82 of file samples.cpp.
|
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.