![]() |
MaCh3
2.5.0
Reference Guide
|
Class responsible for handling implementation of samples used in analysis, reweighting and returning LLH. More...
#include <Samples/SampleHandlerBase.h>
Public Member Functions | |
| SampleHandlerBase (std::string ConfigFileName, ParameterHandlerGeneric *xsec_cov, const std::shared_ptr< OscillationHandler > &OscillatorObj_=nullptr) | |
| Constructor. More... | |
| virtual | ~SampleHandlerBase () |
| destructor More... | |
| int | GetNDim (const int Sample) const final |
| DB Get what dimensionality binning for given sample has. More... | |
| std::string | GetName () const final |
| Get name for Sample Handler. More... | |
| std::string | GetSampleTitle (const int Sample) const final |
| Get fancy title for specified samples. More... | |
| std::string | GetKinVarName (const int iSample, const int Dimension) const final |
| Return Kinematic Variable name for specified sample and dimension for example "Reconstructed_Neutrino_Energy". More... | |
| void | PrintIntegral (const int iSample, const TString &OutputName="/dev/null", const int WeightStyle=0, const TString &OutputCSVName="/dev/null") |
| Computes and prints the integral breakdown of all modes and oscillation channels for a given sample. More... | |
| void | AddData (const int Sample, TH1 *Data) |
| void | AddData (const int Sample, const std::vector< double > &Data_Array) |
| void | PrintRates (const bool DataOnly=false) final |
| 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... | |
| const TH1 * | GetDataHist (const int Sample) final |
| Get Data histogram. More... | |
| const TH1 * | GetDataHist (const std::string &Sample) |
| const TH1 * | GetMCHist (const int Sample) final |
| Get MC histogram. More... | |
| const TH1 * | GetMCHist (const std::string &Sample) |
| const TH1 * | GetW2Hist (const int Sample) final |
| Get W2 histogram. More... | |
| const TH1 * | GetW2Hist (const std::string &Sample) |
| void | Reweight () override |
| main routine modifying MC prediction based on proposed parameter values More... | |
| M3::float_t | GetEventWeight (const int iEntry) |
| Computes the total event weight for a given entry. More... | |
| const M3::float_t * | GetNuOscillatorPointers (const int iEvent) const |
| int | GetNOscChannels (const int iSample) const final |
| Get number of oscillation channels for a single sample. More... | |
| std::string | GetFlavourName (const int iSample, const int iChannel) const final |
| std::unique_ptr< TH1 > | Get1DVarHist (const int iSample, const std::string &ProjectionVar, const std::vector< KinematicCut > &EventSelectionVec={}, int WeightStyle=0, const std::vector< KinematicCut > &SubEventSelectionVec={}) final |
| std::unique_ptr< TH2 > | Get2DVarHist (const int iSample, const std::string &ProjectionVarX, const std::string &ProjectionVarY, const std::vector< KinematicCut > &EventSelectionVec={}, int WeightStyle=0, const std::vector< KinematicCut > &SubEventSelectionVec={}) final |
| 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, TH2 *_h2DVar, const std::string &ProjectionVarX, const std::string &ProjectionVarY, const std::vector< KinematicCut > &SubEventSelectionVec={}, int WeightStyle=0) |
| std::unique_ptr< TH1 > | Get1DVarHistByModeAndChannel (const int iSample, const std::string &ProjectionVar_Str, const int kModeToFill=-1, const int kChannelToFill=-1, const int WeightStyle=0) final |
| std::unique_ptr< TH2 > | Get2DVarHistByModeAndChannel (const int iSample, const std::string &ProjectionVar_StrX, const std::string &ProjectionVar_StrY, const int kModeToFill=-1, const int kChannelToFill=-1, const int WeightStyle=0) final |
| std::unique_ptr< TH1 > | GetModeHist1D (const int iSample, int s, int m, int style=0) |
| std::unique_ptr< TH2 > | GetModeHist2D (const int iSample, int s, int m, int style=0) |
| std::vector< std::unique_ptr< TH1 > > | ReturnHistsBySelection1D (const int iSample, const std::string &KinematicProjection, const int Selection1, const int Selection2=-1, const int WeightStyle=0) |
| std::vector< std::unique_ptr< TH2 > > | ReturnHistsBySelection2D (const int iSample, const std::string &KinematicProjectionX, const std::string &KinematicProjectionY, const int Selection1, const int Selection2=-1, const int WeightStyle=0) |
| std::unique_ptr< THStack > | ReturnStackedHistBySelection1D (const int iSample, const std::string &KinematicProjection, const int Selection1, const int Selection2=-1, const int WeightStyle=0) |
| const TLegend * | ReturnStackHistLegend () const |
| Return the legend used for stacked histograms with sample info. More... | |
| 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) final |
| Store additional info in a chan. More... | |
| int | ReturnKinematicVectorFromString (const std::string &KinematicStr) const |
| JM: Convert a kinematic vector name to its corresponding integer ID. More... | |
| std::string | ReturnStringFromKinematicVector (const int KinematicVariable) const |
| JM: Convert a kinematic vector integer ID to its corresponding name as a string. More... | |
| bool | IsSubEventVarString (const std::string &VarStr) const |
| JM: Check if a kinematic parameter string corresponds to a subevent-level variable. More... | |
| auto | GetDataArray () const |
| Return array storing data entries for every bin. More... | |
| auto | GetMCArray () const |
| Return array storing MC entries for every bin. More... | |
| auto | GetW2Array () const |
| Return array storing W2 entries for every bin. More... | |
| std::vector< double > | GetArrayForSample (const int Sample, std::vector< double > const &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 SampleHandlerInterface | |
| SampleHandlerInterface () | |
| The main constructor. More... | |
| virtual | ~SampleHandlerInterface () |
| 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 | |
| void | InitialiseNuOscillatorObjects () |
| including Dan's magic NuOscillator More... | |
| void | SetupNuOscillatorPointers () |
| Initialise pointer to oscillation weight to NuOscillator object. More... | |
| void | ReadConfig () |
| Load information about sample handler and corresponding samples from config file. More... | |
| void | LoadSingleSample (const int iSample, const YAML::Node &Settings) |
| Initialise single sample from config file. More... | |
| 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 | SetupMC ()=0 |
| Function which translates experiment struct into core struct. More... | |
| virtual void | InititialiseData ()=0 |
| Function responsible for loading data from file or loading from file. 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... | |
| std::vector< std::vector< int > > | GetSplineBins (int Event, BinnedSplineHandler *BinnedSpline, bool &ThrowCrititcal) const |
| Retrieve the spline bin indices associated with a given event. 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 based on KinematicCut. 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... | |
| virtual void | FinaliseShifts (const int iEvent) |
| LP - Optionally calculate derived observables after all shifts have been applied. 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 _noexcept_ |
| Calculate the total weight weight for a given event. More... | |
| virtual void | CalcWeightFunc (const int iEvent) |
| Calculate weights for function parameters. More... | |
| double | ReturnKinematicParameter (const std::string &KinematicParameter, int iEvent) const |
| Return the value of an associated kinematic parameter for an event. More... | |
| virtual double | ReturnKinematicParameter (const int KinematicVariable, const int iEvent) const =0 |
| std::vector< double > | ReturnKinematicVector (const std::string &KinematicParameter, const int iEvent) const |
| virtual std::vector< double > | ReturnKinematicVector (const int KinematicVariable, const int iEvent) const |
| std::vector< double > | ReturnKinematicParameterBinning (const int Sample, const std::string &KinematicParameter) const final |
| Return the binning used to draw a kinematic parameter. More... | |
| const double * | GetPointerToKinematicParameter (const std::string &KinematicParameter, int iEvent) const |
| virtual const double * | GetPointerToKinematicParameter (const int KinematicVariable, const int iEvent) const =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 | SetupOscParameters () |
| Setup the osc parameters. More... | |
| void | FillHist (const int Sample, TH1 *Hist, std::vector< double > &Array) |
| Fill a histogram with the event-level information used in the fit. More... | |
| void | FillArray_MP () |
| DB Nice new multi-threaded function which calculates the event weights and fills the relevant bins of an array. More... | |
| void | FillArray () |
| Function which does the core reweighting, fills the SampleHandlerBase::SampleHandler_array vector with the weight calculated from reweighting. 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 SampleHandlerInterface | |
| 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... | |
| std::vector< double > | SampleHandler_array |
| DB Array to be filled after reweighting. More... | |
| std::vector< double > | SampleHandler_array_w2 |
| KS Array used for MC stat. More... | |
| std::vector< double > | SampleHandler_data |
| DB Array to be filled in AddData. More... | |
| std::vector< EventInfo > | MCEvents |
| 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 SampleHandlerInterface | |
| 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 Member Functions | |
| 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... | |
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 SampleHandlerBase.h.
|
private |
| SampleHandlerBase::SampleHandlerBase | ( | 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 SampleHandlerBase.cpp.
|
virtual |
destructor
Definition at line 49 of file SampleHandlerBase.cpp.
|
protectedpure virtual |
DB Function to determine which weights apply to which types of samples.
Implemented in PySampleHandlerBase.
| void SampleHandlerBase::AddData | ( | const int | Sample, |
| const std::vector< double > & | Data_Array | ||
| ) |
Definition at line 1020 of file SampleHandlerBase.cpp.
| void SampleHandlerBase::AddData | ( | const int | Sample, |
| TH1 * | Data | ||
| ) |
Definition at line 948 of file SampleHandlerBase.cpp.
|
protectedvirtual |
ETA - generic function applying shifts.
Definition at line 549 of file SampleHandlerBase.cpp.
|
private |
Temporarily extend Selection for a given sample with additional cuts. Returns the original Selection so the caller can restore it later.
Definition at line 1404 of file SampleHandlerBase.cpp.
| std::vector< KinematicCut > SampleHandlerBase::BuildModeChannelSelection | ( | const int | iSample, |
| const int | kModeToFill, | ||
| const int | kChannelToFill | ||
| ) | const |
Definition at line 1734 of file SampleHandlerBase.cpp.
|
protected |
Check whether a normalisation systematic affects an event or not.
Definition at line 658 of file SampleHandlerBase.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 294 of file SampleHandlerBase.h.
|
protected |
Calculate the total weight weight for a given event.
Definition at line 572 of file SampleHandlerBase.cpp.
| void SampleHandlerBase::Fill1DSubEventHist | ( | const int | iSample, |
| TH1D * | _h1DVar, | ||
| const std::string & | ProjectionVar, | ||
| const std::vector< KinematicCut > & | SubEventSelectionVec = {}, |
||
| int | WeightStyle = 0 |
||
| ) |
Definition at line 1469 of file SampleHandlerBase.cpp.
| void SampleHandlerBase::Fill2DSubEventHist | ( | const int | iSample, |
| TH2 * | _h2DVar, | ||
| const std::string & | ProjectionVarX, | ||
| const std::string & | ProjectionVarY, | ||
| const std::vector< KinematicCut > & | SubEventSelectionVec = {}, |
||
| int | WeightStyle = 0 |
||
| ) |
Definition at line 1552 of file SampleHandlerBase.cpp.
|
protected |
Function which does the core reweighting, fills the SampleHandlerBase::SampleHandler_array vector with the weight calculated from reweighting.
Definition at line 355 of file SampleHandlerBase.cpp.
|
protected |
DB Nice new multi-threaded function which calculates the event weights and fills the relevant bins of an array.
Multithreaded version of fillArray.
Function which does the core reweighting, fills the SampleHandlerBase::SampleHandler_array vector with the weight calculated from reweighting but multithreaded
Definition at line 393 of file SampleHandlerBase.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 SampleHandler_array
Definition at line 245 of file SampleHandlerBase.cpp.
|
inlineprotectedvirtual |
LP - Optionally calculate derived observables after all shifts have been applied.
LP - For example, have shifts that varied lepton energy and hadron energy separately in a subclass implementation of this method you may add the shifted quantities together to build a shifted neutrino energy estimator
Definition at line 260 of file SampleHandlerBase.h.
|
protected |
Definition at line 851 of file SampleHandlerBase.cpp.
|
finalvirtual |
Implements SampleHandlerInterface.
Definition at line 1426 of file SampleHandlerBase.cpp.
|
finalvirtual |
Implements SampleHandlerInterface.
Definition at line 1785 of file SampleHandlerBase.cpp.
|
finalvirtual |
Implements SampleHandlerInterface.
Definition at line 1497 of file SampleHandlerBase.cpp.
|
finalvirtual |
Implements SampleHandlerInterface.
Definition at line 1793 of file SampleHandlerBase.cpp.
| std::vector< double > SampleHandlerBase::GetArrayForSample | ( | const int | Sample, |
| std::vector< double > const & | array | ||
| ) | const |
Return a sub-array for a given sample.
Definition at line 2098 of file SampleHandlerBase.cpp.
|
inline |
Return array storing data entries for every bin.
Definition at line 153 of file SampleHandlerBase.h.
|
inline |
Return array storing data entries for every bin.
Definition at line 168 of file SampleHandlerBase.h.
|
finalvirtual |
Get Data histogram.
Implements SampleHandlerInterface.
Definition at line 931 of file SampleHandlerBase.cpp.
| const TH1 * SampleHandlerBase::GetDataHist | ( | const std::string & | Sample | ) |
Definition at line 941 of file SampleHandlerBase.cpp.
| M3::float_t SampleHandlerBase::GetEventWeight | ( | const int | iEntry | ) |
Computes the total event weight for a given entry.
KS:
Definition at line 1176 of file SampleHandlerBase.cpp.
|
inlineprotected |
Retrieve the final neutrino PDG code associated with a given input file name.
Definition at line 415 of file SampleHandlerBase.h.
|
inlinefinalvirtual |
|
inlineprotected |
Retrieve the initial neutrino PDG code associated with a given input file name.
Definition at line 413 of file SampleHandlerBase.h.
|
finalvirtual |
Return Kinematic Variable name for specified sample and dimension for example "Reconstructed_Neutrino_Energy".
| iSample | Sample index |
| Dimension | Dimension index |
Implements SampleHandlerInterface.
Definition at line 2088 of file SampleHandlerBase.cpp.
|
overridevirtual |
DB Multi-threaded GetLikelihood.
Implements SampleHandlerInterface.
Definition at line 1291 of file SampleHandlerBase.cpp.
|
inline |
Return array storing MC entries for every bin.
Definition at line 157 of file SampleHandlerBase.h.
|
inline |
Return array storing MC entries for every bin.
Definition at line 172 of file SampleHandlerBase.h.
|
finalvirtual |
Get MC histogram.
Implements SampleHandlerInterface.
Definition at line 913 of file SampleHandlerBase.cpp.
| const TH1 * SampleHandlerBase::GetMCHist | ( | const std::string & | Sample | ) |
Definition at line 924 of file SampleHandlerBase.cpp.
|
inline |
Definition at line 118 of file SampleHandlerBase.h.
|
inline |
Definition at line 121 of file SampleHandlerBase.h.
|
finalvirtual |
Get name for Sample Handler.
Implements SampleHandlerInterface.
Definition at line 1163 of file SampleHandlerBase.cpp.
|
inlinefinalvirtual |
DB Get what dimensionality binning for given sample has.
| Sample | Number of sample |
Implements SampleHandlerInterface.
Definition at line 34 of file SampleHandlerBase.h.
|
inlinefinalvirtual |
Get number of oscillation channels for a single sample.
Implements SampleHandlerInterface.
Definition at line 88 of file SampleHandlerBase.h.
| const M3::float_t * SampleHandlerBase::GetNuOscillatorPointers | ( | const int | iEvent | ) | const |
Definition at line 1123 of file SampleHandlerBase.cpp.
|
protectedpure virtual |
Implemented in PySampleHandlerBase.
|
inlineprotected |
Definition at line 313 of file SampleHandlerBase.h.
|
protected |
Get pointer to oscillation channel associated with given event. Osc channel is const.
Definition at line 2027 of file SampleHandlerBase.cpp.
| int SampleHandlerBase::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 883 of file SampleHandlerBase.cpp.
|
overridevirtual |
Get likelihood for single sample.
Implements SampleHandlerInterface.
Definition at line 1269 of file SampleHandlerBase.cpp.
|
inlinefinalvirtual |
Get fancy title for specified samples.
Implements SampleHandlerInterface.
Definition at line 38 of file SampleHandlerBase.h.
|
protected |
Retrieve the spline bin indices associated with a given event.
Definition at line 1194 of file SampleHandlerBase.cpp.
|
inline |
Return array storing W2 entries for every bin.
Definition at line 161 of file SampleHandlerBase.h.
|
inline |
Return array storing W2 entries for single sample.
Definition at line 176 of file SampleHandlerBase.h.
|
finalvirtual |
Get W2 histogram.
Implements SampleHandlerInterface.
Definition at line 895 of file SampleHandlerBase.cpp.
| const TH1 * SampleHandlerBase::GetW2Hist | ( | const std::string & | Sample | ) |
Definition at line 906 of file SampleHandlerBase.cpp.
|
protectedpure virtual |
Initialise any variables that your experiment specific SampleHandler needs.
Implemented in PySampleHandlerBase.
|
protected |
Function which does a lot of the lifting regarding the workflow in creating different MC objects.
Definition at line 170 of file SampleHandlerBase.cpp.
|
protected |
including Dan's magic NuOscillator
Definition at line 1040 of file SampleHandlerBase.cpp.
|
protected |
Definition at line 1356 of file SampleHandlerBase.cpp.
|
protectedpure virtual |
Function responsible for loading data from file or loading from file.
Implemented in PySampleHandlerBase.
|
protected |
DB Function which determines if an event is selected based on KinematicCut.
Definition at line 284 of file SampleHandlerBase.cpp.
|
protected |
JM Function which determines if a subevent is selected.
Definition at line 300 of file SampleHandlerBase.cpp.
| bool SampleHandlerBase::IsSubEventVarString | ( | const std::string & | VarStr | ) | const |
JM: Check if a kinematic parameter string corresponds to a subevent-level variable.
Definition at line 1718 of file SampleHandlerBase.cpp.
|
protected |
Initialise single sample from config file.
Add new sample
Definition at line 108 of file SampleHandlerBase.cpp.
|
protected |
Definition at line 2108 of file SampleHandlerBase.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 246 of file SampleHandlerBase.h.
| void SampleHandlerBase::PrintIntegral | ( | const int | iSample, |
| const TString & | OutputName = "/dev/null", |
||
| const int | WeightStyle = 0, |
||
| const TString & | OutputCSVName = "/dev/null" |
||
| ) |
Computes and prints the integral breakdown of all modes and oscillation channels for a given sample.
Definition at line 1802 of file SampleHandlerBase.cpp.
|
finalvirtual |
Helper function to print rates for the samples with LLH.
| DataOnly | whether to print data only rates |
Implements SampleHandlerInterface.
Definition at line 2036 of file SampleHandlerBase.cpp.
|
protected |
Load information about sample handler and corresponding samples from config file.
Definition at line 54 of file SampleHandlerBase.cpp.
|
protectedpure virtual |
HH - a experiment-specific function where the maps to actual functions are set up.
Implemented in PySampleHandlerBase.
|
protected |
HH - a helper function for RegisterFunctionalParameter.
Definition at line 468 of file SampleHandlerBase.cpp.
|
protected |
|
inlineprotectedvirtual |
HH - reset the shifted values to the original values.
Definition at line 255 of file SampleHandlerBase.h.
| std::vector< std::unique_ptr< TH1 > > SampleHandlerBase::ReturnHistsBySelection1D | ( | const int | iSample, |
| const std::string & | KinematicProjection, | ||
| const int | Selection1, | ||
| const int | Selection2 = -1, |
||
| const int | WeightStyle = 0 |
||
| ) |
Definition at line 1944 of file SampleHandlerBase.cpp.
| std::vector< std::unique_ptr< TH2 > > SampleHandlerBase::ReturnHistsBySelection2D | ( | const int | iSample, |
| const std::string & | KinematicProjectionX, | ||
| const std::string & | KinematicProjectionY, | ||
| const int | Selection1, | ||
| const int | Selection2 = -1, |
||
| const int | WeightStyle = 0 |
||
| ) |
Definition at line 1983 of file SampleHandlerBase.cpp.
|
protectedpure virtual |
Implemented in PySampleHandlerBase.
|
inlineprotected |
Return the value of an associated kinematic parameter for an event.
Definition at line 297 of file SampleHandlerBase.h.
|
finalprotectedvirtual |
Return the binning used to draw a kinematic parameter.
Implements SampleHandlerInterface.
Definition at line 1665 of file SampleHandlerBase.cpp.
| int SampleHandlerBase::ReturnKinematicParameterFromString | ( | const std::string & | KinematicStr | ) | const |
ETA function to generically convert a string from xsec cov to a kinematic type.
Definition at line 1612 of file SampleHandlerBase.cpp.
|
inlineprotectedvirtual |
Definition at line 306 of file SampleHandlerBase.h.
|
inlineprotected |
Definition at line 303 of file SampleHandlerBase.h.
| int SampleHandlerBase::ReturnKinematicVectorFromString | ( | const std::string & | KinematicStr | ) | const |
JM: Convert a kinematic vector name to its corresponding integer ID.
Definition at line 1639 of file SampleHandlerBase.cpp.
| std::unique_ptr< THStack > SampleHandlerBase::ReturnStackedHistBySelection1D | ( | const int | iSample, |
| const std::string & | KinematicProjection, | ||
| const int | Selection1, | ||
| const int | Selection2 = -1, |
||
| const int | WeightStyle = 0 |
||
| ) |
Definition at line 2014 of file SampleHandlerBase.cpp.
|
inline |
Return the legend used for stacked histograms with sample info.
Definition at line 135 of file SampleHandlerBase.h.
| std::string SampleHandlerBase::ReturnStringFromKinematicParameter | ( | const int | KinematicVariable | ) | const |
ETA function to generically convert a kinematic type from xsec cov to a string.
Definition at line 1624 of file SampleHandlerBase.cpp.
| std::string SampleHandlerBase::ReturnStringFromKinematicVector | ( | const int | KinematicVariable | ) | const |
JM: Convert a kinematic vector integer ID to its corresponding name as a string.
Definition at line 1651 of file SampleHandlerBase.cpp.
|
overridevirtual |
main routine modifying MC prediction based on proposed parameter values
Implements SampleHandlerInterface.
Definition at line 319 of file SampleHandlerBase.cpp.
|
finalvirtual |
Store additional info in a chan.
Reimplemented from SampleHandlerInterface.
Definition at line 1310 of file SampleHandlerBase.cpp.
|
protected |
set the binning for 2D sample used for the likelihood calculation
Definition at line 750 of file SampleHandlerBase.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 1228 of file SampleHandlerBase.cpp.
|
protectedpure virtual |
Experiment specific setup, returns the number of events which were loaded.
Implemented in PySampleHandlerBase.
|
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 488 of file SampleHandlerBase.cpp.
|
protected |
Ensure Kinematic Map is setup and make sure it is initialised correctly.
Definition at line 208 of file SampleHandlerBase.cpp.
|
protectedpure virtual |
Function which translates experiment struct into core struct.
Implemented in PySampleHandlerBase.
|
protected |
Setup the norm parameters by assigning each event with bin.
Definition at line 628 of file SampleHandlerBase.cpp.
|
protected |
Initialise pointer to oscillation weight to NuOscillator object.
Definition at line 1105 of file SampleHandlerBase.cpp.
|
protected |
Setup the osc parameters.
Definition at line 589 of file SampleHandlerBase.cpp.
|
protected |
|
protectedpure virtual |
initialise your splineXX object and then use InitialiseSplineObject to conviently setup everything up
Implemented in PySampleHandlerBase.
|
protected |
Definition at line 400 of file SampleHandlerBase.h.
|
protected |
KS: This stores binning information, in future could be come vector to store binning for every used sample.
Definition at line 347 of file SampleHandlerBase.h.
|
private |
Definition at line 424 of file SampleHandlerBase.h.
|
private |
Definition at line 423 of file SampleHandlerBase.h.
|
protected |
KS:Super hacky to update W2 or not.
Definition at line 408 of file SampleHandlerBase.h.
|
protected |
HH - a map that relates the funcpar enum to pointer of the actual function.
Definition at line 279 of file SampleHandlerBase.h.
|
protected |
HH - a grid of vectors of enums for each sample and event.
Definition at line 262 of file SampleHandlerBase.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 267 of file SampleHandlerBase.h.
|
protected |
HH - a map that relates the name of the functional parameter to funcpar enum.
Definition at line 276 of file SampleHandlerBase.h.
|
protected |
HH - a vector of string names for each functional parameter.
Definition at line 281 of file SampleHandlerBase.h.
|
protected |
HH - a vector that stores all the FuncPars struct.
Definition at line 273 of file SampleHandlerBase.h.
|
protected |
Mapping between string and kinematic enum.
Definition at line 387 of file SampleHandlerBase.h.
|
protected |
Definition at line 392 of file SampleHandlerBase.h.
|
protected |
Stores information about every MC event.
Definition at line 358 of file SampleHandlerBase.h.
|
protected |
Contains oscillator handling calculating oscillation probabilities.
Definition at line 219 of file SampleHandlerBase.h.
|
protected |
ETA - All experiments will need an xsec, det and osc cov.
Definition at line 366 of file SampleHandlerBase.h.
|
protected |
Mapping between kinematic enum and string.
Definition at line 389 of file SampleHandlerBase.h.
|
protected |
Definition at line 393 of file SampleHandlerBase.h.
|
protected |
Stores info about currently initialised sample.
Definition at line 360 of file SampleHandlerBase.h.
|
protected |
DB Array to be filled after reweighting.
Definition at line 349 of file SampleHandlerBase.h.
|
protected |
KS Array used for MC stat.
Definition at line 351 of file SampleHandlerBase.h.
|
protected |
DB Array to be filled in AddData.
Definition at line 353 of file SampleHandlerBase.h.
|
protected |
A unique ID for each sample based on which we can define what systematic should be applied.
Definition at line 370 of file SampleHandlerBase.h.
|
protected |
The manager object used to read the sample yaml file.
Definition at line 397 of file SampleHandlerBase.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 383 of file SampleHandlerBase.h.
|
protected |
Contains all your splines (binned or unbinned) and handles the setup and the returning of weights from spline evaluations.
Definition at line 216 of file SampleHandlerBase.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 380 of file SampleHandlerBase.h.
|
protected |
DB Miscellaneous Variables.
Definition at line 404 of file SampleHandlerBase.h.
|
protected |
KS:Super hacky to update W2 or not.
Definition at line 410 of file SampleHandlerBase.h.