![]() |
MaCh3
2.4.2
Reference Guide
|
Class responsible for handling implementation of samples used in analysis, reweighting and returning LLH. More...
#include <Samples/SampleHandlerFD.h>
Public Member Functions | |
| 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 BinningHandler * | GetBinningHandler () 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_t * | GetNuOscillatorPointers (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< KinematicCut > | BuildModeChannelSelection (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 () |
| virtual void | CleanMemoryBeforeFit ()=0 |
| Allow to clean not used memory before fit starts. More... | |
| MaCh3Modes * | GetMaCh3Modes () 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... | |
Protected Member Functions | |
| virtual void | AddAdditionalWeightPointers ()=0 |
| DB Function to determine which weights apply to which types of samples. More... | |
| void | SetupKinematicMap () |
| Ensure Kinematic Map is setup and make sure it is initialised correctly. More... | |
| virtual void | SetupSplines ()=0 |
| initialise your splineXX object and then use InitialiseSplineObject to conviently setup everything up More... | |
| virtual void | Init ()=0 |
| Initialise any variables that your experiment specific SampleHandler needs. More... | |
| virtual int | SetupExperimentMC ()=0 |
| Experiment specific setup, returns the number of events which were loaded. More... | |
| virtual void | SetupFDMC ()=0 |
| Function which translates experiment struct into core struct. 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 | RegisterFunctionalParameters ()=0 |
| HH - a experiment-specific function where the maps to actual functions are set up. 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 double | ReturnKinematicParameter (std::string KinematicParamter, int iEvent)=0 |
| Return the value of an associated kinematic parameter for an event. More... | |
| 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 int Sample, const std::string &KinematicParameter) const override |
| Return the binning used to draw a kinematic parameter. More... | |
| 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. 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 | |
| std::unique_ptr< SplineBase > | SplineHandler |
| Contains all your splines (binned or unbinned) and handles the setup and the returning of weights from spline evaluations. More... | |
| std::shared_ptr< OscillationHandler > | Oscillator |
| 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< FunctionalShifter > | 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::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::unordered_map< int, FuncParFuncType > | funcParsFuncMap |
| 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< BinningHandler > | 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< EventInfo > | MCSamples |
| Stores information about every MC event. More... | |
| std::vector< SampleInfo > | SampleDetails |
| Stores info about currently initialised sample. More... | |
| ParameterHandlerGeneric * | ParHandler = 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< Manager > | SampleManager |
| 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< MaCh3Modes > | Modes |
| Holds information about used Generator and MaCh3 modes. More... | |
Private Types | |
| enum | FDPlotType { kModePlot = 0 , kOscChannelPlot = 1 } |
Private Attributes | |
| std::unordered_map< std::string, NuPDG > | FileToInitPDGMap |
| std::unordered_map< std::string, NuPDG > | FileToFinalPDGMap |
Class responsible for handling implementation of samples used in analysis, reweighting and returning LLH.
Definition at line 21 of file SampleHandlerFD.h.
|
private |
| SampleHandlerFD::SampleHandlerFD | ( | std::string | ConfigFileName, |
| ParameterHandlerGeneric * | xsec_cov, | ||
| const std::shared_ptr< OscillationHandler > & | OscillatorObj_ = nullptr |
||
| ) |
Constructor.
| ConfigFileName | Name of config to initialise the sample object |
Definition at line 12 of file SampleHandlerFD.cpp.
|
virtual |
destructor
Definition at line 48 of file SampleHandlerFD.cpp.
|
protectedpure virtual |
DB Function to determine which weights apply to which types of samples.
Implemented in PySampleHandlerFD.
| void SampleHandlerFD::AddData | ( | const int | Sample, |
| const std::vector< double > & | Data_Array | ||
| ) |
Definition at line 998 of file SampleHandlerFD.cpp.
| void SampleHandlerFD::AddData | ( | const int | Sample, |
| TH1 * | Data | ||
| ) |
Definition at line 935 of file SampleHandlerFD.cpp.
|
protectedvirtual |
ETA - generic function applying shifts.
Definition at line 562 of file SampleHandlerFD.cpp.
| std::vector< std::vector< KinematicCut > > SampleHandlerFD::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.
Definition at line 1362 of file SampleHandlerFD.cpp.
| std::vector< KinematicCut > SampleHandlerFD::BuildModeChannelSelection | ( | const int | iSample, |
| const int | kModeToFill, | ||
| const int | kChannelToFill | ||
| ) | const |
Definition at line 1691 of file SampleHandlerFD.cpp.
|
protected |
Check whether a normalisation systematic affects an event or not.
Definition at line 642 of file SampleHandlerFD.cpp.
|
inlineprotectedvirtual |
Calculate weights for function parameters.
First you need to setup additional pointers in you experiment code in SetupWeightPointers Then in this function you can calculate whatever fancy function you want by filling weight to which you have pointer This way func weight shall be used in GetEventWeight
Definition at line 284 of file SampleHandlerFD.h.
|
protected |
Calculate the total weight weight for a given event.
Definition at line 583 of file SampleHandlerFD.cpp.
| void SampleHandlerFD::Fill1DSubEventHist | ( | const int | iSample, |
| TH1D * | _h1DVar, | ||
| const std::string & | ProjectionVar, | ||
| const std::vector< KinematicCut > & | SubEventSelectionVec = {}, |
||
| int | WeightStyle = 0 |
||
| ) |
Definition at line 1428 of file SampleHandlerFD.cpp.
| void SampleHandlerFD::Fill2DSubEventHist | ( | const int | iSample, |
| TH2D * | _h2DVar, | ||
| const std::string & | ProjectionVarX, | ||
| const std::string & | ProjectionVarY, | ||
| const std::vector< KinematicCut > & | SubEventSelectionVec = {}, |
||
| int | WeightStyle = 0 |
||
| ) |
Definition at line 1508 of file SampleHandlerFD.cpp.
|
protected |
DB Nice new multi-threaded function which calculates the event weights and fills the relevant bins of an array.
Function which does the core reweighting, fills the SampleHandlerFD::SampleHandlerFD_array vector with the weight calculated from reweighting
Definition at line 374 of file SampleHandlerFD.cpp.
|
protected |
Fill a histogram with the event-level information used in the fit.
DB Functions required for reweighting functions DB Replace previous implementation with reading bin contents from SampleHandlerFD_array
Definition at line 264 of file SampleHandlerFD.cpp.
|
protected |
Definition at line 839 of file SampleHandlerFD.cpp.
|
overridevirtual |
Implements SampleHandlerBase.
Definition at line 1384 of file SampleHandlerFD.cpp.
|
overridevirtual |
Implements SampleHandlerBase.
Definition at line 1742 of file SampleHandlerFD.cpp.
|
overridevirtual |
Implements SampleHandlerBase.
Definition at line 1456 of file SampleHandlerFD.cpp.
|
overridevirtual |
Implements SampleHandlerBase.
Definition at line 1750 of file SampleHandlerFD.cpp.
| std::vector< double > SampleHandlerFD::GetArrayForSample | ( | const int | Sample, |
| const double * | array | ||
| ) | const |
Return a sub-array for a given sample.
Definition at line 2055 of file SampleHandlerFD.cpp.
|
inline |
|
inline |
|
inline |
Return array storing data entries for every bin.
Definition at line 177 of file SampleHandlerFD.h.
|
overridevirtual |
Get Data histogram.
Implements SampleHandlerBase.
Definition at line 919 of file SampleHandlerFD.cpp.
| TH1 * SampleHandlerFD::GetDataHist | ( | const std::string & | Sample | ) |
Definition at line 929 of file SampleHandlerFD.cpp.
| M3::float_t SampleHandlerFD::GetEventWeight | ( | const int | iEntry | ) |
KS:
Definition at line 1151 of file SampleHandlerFD.cpp.
|
inlineprotected |
Retrieve the final neutrino PDG code associated with a given input file name.
Definition at line 397 of file SampleHandlerFD.h.
|
inlineoverridevirtual |
|
inlineprotected |
Retrieve the initial neutrino PDG code associated with a given input file name.
Definition at line 395 of file SampleHandlerFD.h.
|
overridevirtual |
Return Kinematic Variable name for specified sample and dimension for example "Reconstructed_Neutrino_Energy".
| iSample | Sample index |
| Dimension | Dimension index |
Implements SampleHandlerBase.
Definition at line 2045 of file SampleHandlerFD.cpp.
|
overridevirtual |
DB Multi-threaded GetLikelihood.
Implements SampleHandlerBase.
Definition at line 1250 of file SampleHandlerFD.cpp.
|
inline |
|
inline |
Return array storing MC entries for every bin.
Definition at line 181 of file SampleHandlerFD.h.
|
overridevirtual |
| TH1 * SampleHandlerFD::GetMCHist | ( | const std::string & | Sample | ) |
Definition at line 912 of file SampleHandlerFD.cpp.
|
inline |
Definition at line 128 of file SampleHandlerFD.h.
|
inline |
Definition at line 131 of file SampleHandlerFD.h.
|
overridevirtual |
Implements SampleHandlerBase.
Definition at line 1138 of file SampleHandlerFD.cpp.
|
inlineoverridevirtual |
DB Function to differentiate 1D or 2D binning.
Implements SampleHandlerBase.
Definition at line 33 of file SampleHandlerFD.h.
|
inlineoverridevirtual |
| const M3::float_t * SampleHandlerFD::GetNuOscillatorPointers | ( | const int | iEvent | ) | const |
Definition at line 1098 of file SampleHandlerFD.cpp.
|
protectedpure virtual |
Implemented in PySampleHandlerFD.
|
protectedpure virtual |
Implemented in PySampleHandlerFD.
|
protected |
Get pointer to oscillation channel associated with given event. Osc channel is const.
Definition at line 1983 of file SampleHandlerFD.cpp.
| int SampleHandlerFD::GetSampleIndex | ( | const std::string & | SampleTitle | ) | const |
Get index of sample based on name.
| SampleTitle | The title of the sample to search for. |
Definition at line 871 of file SampleHandlerFD.cpp.
|
overridevirtual |
Get likelihood for single sample.
Implements SampleHandlerBase.
Definition at line 1228 of file SampleHandlerFD.cpp.
|
inlineoverridevirtual |
|
inline |
Return array storing W2 entries for every bin.
Definition at line 170 of file SampleHandlerFD.h.
|
inline |
Return array storing W2 entries for single sample.
Definition at line 185 of file SampleHandlerFD.h.
|
overridevirtual |
| TH1 * SampleHandlerFD::GetW2Hist | ( | const std::string & | Sample | ) |
Definition at line 894 of file SampleHandlerFD.cpp.
|
inline |
Definition at line 42 of file SampleHandlerFD.h.
|
inline |
Definition at line 43 of file SampleHandlerFD.h.
|
protectedpure virtual |
Initialise any variables that your experiment specific SampleHandler needs.
Implemented in PySampleHandlerFD.
|
protected |
Function which does a lot of the lifting regarding the workflow in creating different MC objects.
Definition at line 163 of file SampleHandlerFD.cpp.
| void SampleHandlerFD::InitialiseNuOscillatorObjects | ( | ) |
including Dan's magic NuOscillator
Definition at line 1020 of file SampleHandlerFD.cpp.
|
protected |
Definition at line 1314 of file SampleHandlerFD.cpp.
|
protected |
DB Function which determines if an event is selected, where Selection double looks like {{ND280KinematicTypes Var1, douuble LowBound}.
Definition at line 303 of file SampleHandlerFD.cpp.
|
protected |
JM Function which determines if a subevent is selected.
Definition at line 319 of file SampleHandlerFD.cpp.
| bool SampleHandlerFD::IsSubEventVarString | ( | const std::string & | VarStr | ) |
JM Check if a kinematic parameter string corresponds to a subevent-level variable.
Definition at line 1676 of file SampleHandlerFD.cpp.
| void SampleHandlerFD::LoadSingleSample | ( | const int | iSample, |
| const YAML::Node & | Settings | ||
| ) |
Add new sample
Definition at line 113 of file SampleHandlerFD.cpp.
|
protected |
Definition at line 2065 of file SampleHandlerFD.cpp.
|
inlineprotectedvirtual |
Update the functional parameter values to the latest proposed values. Needs to be called before every new reweight so is called in fillArray.
Definition at line 241 of file SampleHandlerFD.h.
| void SampleHandlerFD::PrintIntegral | ( | const int | iSample, |
| const TString & | OutputName = "/dev/null", |
||
| const int | WeightStyle = 0, |
||
| const TString & | OutputCSVName = "/dev/null" |
||
| ) |
Definition at line 1757 of file SampleHandlerFD.cpp.
|
overridevirtual |
Helper function to print rates for the samples with LLH.
| DataOnly | whether to print data only rates |
Implements SampleHandlerBase.
Definition at line 1993 of file SampleHandlerFD.cpp.
| void SampleHandlerFD::ReadConfig | ( | ) |
Definition at line 59 of file SampleHandlerFD.cpp.
|
protectedpure virtual |
HH - a experiment-specific function where the maps to actual functions are set up.
Implemented in PySampleHandlerFD.
|
protected |
HH - a helper function for RegisterFunctionalParameter.
Definition at line 483 of file SampleHandlerFD.cpp.
|
protected |
|
inlineprotectedvirtual |
HH - reset the shifted values to the original values.
Definition at line 250 of file SampleHandlerFD.h.
| std::vector< TH1 * > SampleHandlerFD::ReturnHistsBySelection1D | ( | const int | iSample, |
| const std::string & | KinematicProjection, | ||
| int | Selection1, | ||
| int | Selection2 = -1, |
||
| int | WeightStyle = 0, |
||
| TAxis * | Axis = nullptr |
||
| ) |
Definition at line 1900 of file SampleHandlerFD.cpp.
| std::vector< TH2 * > SampleHandlerFD::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 |
||
| ) |
Definition at line 1938 of file SampleHandlerFD.cpp.
|
protectedpure virtual |
Implemented in PySampleHandlerFD.
|
protectedpure virtual |
Return the value of an associated kinematic parameter for an event.
Implemented in PySampleHandlerFD.
|
overrideprotectedvirtual |
Return the binning used to draw a kinematic parameter.
Implements SampleHandlerBase.
Definition at line 1622 of file SampleHandlerFD.cpp.
| int SampleHandlerFD::ReturnKinematicParameterFromString | ( | const std::string & | KinematicStr | ) | const |
ETA function to generically convert a string from xsec cov to a kinematic type.
Definition at line 1569 of file SampleHandlerFD.cpp.
|
inlineprotectedvirtual |
Definition at line 292 of file SampleHandlerFD.h.
|
inlineprotectedvirtual |
Definition at line 291 of file SampleHandlerFD.h.
| int SampleHandlerFD::ReturnKinematicVectorFromString | ( | const std::string & | KinematicStr | ) | const |
Definition at line 1596 of file SampleHandlerFD.cpp.
| THStack * SampleHandlerFD::ReturnStackedHistBySelection1D | ( | const int | iSample, |
| const std::string & | KinematicProjection, | ||
| int | Selection1, | ||
| int | Selection2 = -1, |
||
| int | WeightStyle = 0, |
||
| TAxis * | Axis = nullptr |
||
| ) |
Definition at line 1970 of file SampleHandlerFD.cpp.
|
inline |
Definition at line 144 of file SampleHandlerFD.h.
| std::string SampleHandlerFD::ReturnStringFromKinematicParameter | ( | const int | KinematicVariable | ) | const |
ETA function to generically convert a kinematic type from xsec cov to a string.
Definition at line 1581 of file SampleHandlerFD.cpp.
| std::string SampleHandlerFD::ReturnStringFromKinematicVector | ( | const int | KinematicVariable | ) | const |
Definition at line 1608 of file SampleHandlerFD.cpp.
|
overridevirtual |
Implements SampleHandlerBase.
Definition at line 338 of file SampleHandlerFD.cpp.
|
overridevirtual |
Store additional info in a chan.
Reimplemented from SampleHandlerBase.
Definition at line 1269 of file SampleHandlerFD.cpp.
|
protected |
set the binning for 2D sample used for the likelihood calculation
Definition at line 738 of file SampleHandlerFD.cpp.
|
protected |
Set pointers for each event to appropriate weights, for unbinned based on event number while for binned based on other kinematical properties.
Definition at line 1169 of file SampleHandlerFD.cpp.
|
protectedpure virtual |
Experiment specific setup, returns the number of events which were loaded.
Implemented in PySampleHandlerFD.
|
protectedpure virtual |
Function which translates experiment struct into core struct.
Implemented in PySampleHandlerFD.
|
protectedvirtual |
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.
Definition at line 503 of file SampleHandlerFD.cpp.
|
protected |
Ensure Kinematic Map is setup and make sure it is initialised correctly.
Definition at line 227 of file SampleHandlerFD.cpp.
|
protected |
Setup the norm parameters by assigning each event with bin.
Definition at line 613 of file SampleHandlerFD.cpp.
| void SampleHandlerFD::SetupNuOscillatorPointers | ( | ) |
Definition at line 1081 of file SampleHandlerFD.cpp.
|
protected |
|
protectedpure virtual |
initialise your splineXX object and then use InitialiseSplineObject to conviently setup everything up
Implemented in PySampleHandlerFD.
|
protected |
Definition at line 382 of file SampleHandlerFD.h.
|
protected |
KS: This stores binning information, in future could be come vector to store binning for every used sample.
Definition at line 329 of file SampleHandlerFD.h.
|
private |
Definition at line 401 of file SampleHandlerFD.h.
|
private |
Definition at line 400 of file SampleHandlerFD.h.
|
protected |
KS:Super hacky to update W2 or not.
Definition at line 390 of file SampleHandlerFD.h.
|
protected |
HH - a map that relates the funcpar enum to pointer of the actual function.
Definition at line 269 of file SampleHandlerFD.h.
|
protected |
HH - a grid of vectors of enums for each sample and event.
Definition at line 252 of file SampleHandlerFD.h.
|
protected |
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.
Definition at line 257 of file SampleHandlerFD.h.
|
protected |
HH - a map that relates the name of the functional parameter to funcpar enum.
Definition at line 266 of file SampleHandlerFD.h.
|
protected |
HH - a vector of string names for each functional parameter.
Definition at line 271 of file SampleHandlerFD.h.
|
protected |
HH - a vector that stores all the FuncPars struct.
Definition at line 263 of file SampleHandlerFD.h.
|
protected |
Mapping between string and kinematic enum.
Definition at line 369 of file SampleHandlerFD.h.
|
protected |
Definition at line 374 of file SampleHandlerFD.h.
|
protected |
Stores information about every MC event.
Definition at line 340 of file SampleHandlerFD.h.
|
protected |
Contains oscillator handling calculating oscillation probabilities.
Definition at line 217 of file SampleHandlerFD.h.
|
protected |
ETA - All experiments will need an xsec, det and osc cov.
Definition at line 348 of file SampleHandlerFD.h.
|
protected |
Mapping between kinematic enum and string.
Definition at line 371 of file SampleHandlerFD.h.
|
protected |
Definition at line 375 of file SampleHandlerFD.h.
|
protected |
Stores info about currently initialised sample.
Definition at line 342 of file SampleHandlerFD.h.
|
protected |
DB Array to be filled after reweighting.
Definition at line 331 of file SampleHandlerFD.h.
|
protected |
KS Array used for MC stat.
Definition at line 333 of file SampleHandlerFD.h.
|
protected |
DB Array to be filled in AddData.
Definition at line 335 of file SampleHandlerFD.h.
|
protected |
A unique ID for each sample based on which we can define what systematic should be applied.
Definition at line 352 of file SampleHandlerFD.h.
|
protected |
The manager object used to read the sample yaml file.
Definition at line 379 of file SampleHandlerFD.h.
|
protected |
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
Definition at line 365 of file SampleHandlerFD.h.
|
protected |
Contains all your splines (binned or unbinned) and handles the setup and the returning of weights from spline evaluations.
Definition at line 214 of file SampleHandlerFD.h.
|
protected |
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.
Definition at line 362 of file SampleHandlerFD.h.
|
protected |
DB Miscellaneous Variables.
Definition at line 386 of file SampleHandlerFD.h.
|
protected |
KS:Super hacky to update W2 or not.
Definition at line 392 of file SampleHandlerFD.h.