![]() |
MaCh3 2.2.1
Reference Guide
|
This class extends MCMC and allow specialised for Oscillation parameters analysis which require specialised hardcoding. More...
#include <Fitters/OscProcessor.h>
Public Member Functions | |
OscProcessor (const std::string &InputFile) | |
Constructs an OscProcessor object with the specified input file and options. | |
virtual | ~OscProcessor () |
Destroys the OscProcessor object. | |
void | PerformJarlskogAnalysis () |
Perform Several Jarlskog Plotting. | |
![]() | |
MCMCProcessor (const std::string &InputFile) | |
Constructs an MCMCProcessor object with the specified input file and options. | |
virtual | ~MCMCProcessor () |
Destroys the MCMCProcessor object. | |
void | Initialise () |
Scan chain, what parameters we have and load information from covariance matrices. | |
void | MakePostfit () |
Make 1D projection for each parameter and prepare structure. | |
void | MakeCovariance () |
Calculate covariance by making 2D projection of each combination of parameters. | |
void | CacheSteps () |
KS:By caching each step we use multithreading. | |
void | MakeCovariance_MP (const bool Mute=false) |
Calculate covariance by making 2D projection of each combination of parameters using multithreading. | |
void | MakeSubOptimality (const int NIntervals=10) |
Make and Draw SubOptimality [24]. | |
void | ResetHistograms () |
Reset 2D posteriors, in case we would like to calculate in again with different BurnInCut. | |
void | DrawPostfit () |
Draw the post-fit comparisons. | |
void | MakeViolin () |
Make and Draw Violin. | |
void | MakeCredibleIntervals (const std::vector< double > &CredibleIntervals={0.99, 0.90, 0.68 }, const std::vector< Color_t > &CredibleIntervalsColours={kCyan+4, kCyan-2, kCyan-10}, const bool CredibleInSigmas=false) |
Make and Draw Credible intervals. | |
void | DrawCovariance () |
Draw the post-fit covariances. | |
void | MakeCredibleRegions (const std::vector< double > &CredibleRegions={0.99, 0.90, 0.68}, const std::vector< Style_t > &CredibleRegionStyle={kDashed, kSolid, kDotted}, const std::vector< Color_t > &CredibleRegionColor={kGreen-3, kGreen-10, kGreen}, const bool CredibleInSigmas=false, const bool Draw2DPosterior=true, const bool DrawBestFit=true) |
Make and Draw Credible Regions. | |
void | MakeTrianglePlot (const std::vector< std::string > &ParNames, const std::vector< double > &CredibleIntervals={0.99, 0.90, 0.68 }, const std::vector< Color_t > &CredibleIntervalsColours={kCyan+4, kCyan-2, kCyan-10}, const std::vector< double > &CredibleRegions={0.99, 0.90, 0.68}, const std::vector< Style_t > &CredibleRegionStyle={kDashed, kSolid, kDotted}, const std::vector< Color_t > &CredibleRegionColor={kGreen-3, kGreen-10, kGreen}, const bool CredibleInSigmas=false) |
Make fancy triangle plot for selected parameters. | |
void | CheckCredibleIntervalsOrder (const std::vector< double > &CredibleIntervals, const std::vector< Color_t > &CredibleIntervalsColours) |
Checks the order and size consistency of the CredibleIntervals and CredibleIntervalsColours vectors. | |
void | CheckCredibleRegionsOrder (const std::vector< double > &CredibleRegions, const std::vector< Style_t > &CredibleRegionStyle, const std::vector< Color_t > &CredibleRegionColor) |
Checks the order and size consistency of the CredibleRegions , CredibleRegionStyle , and CredibleRegionColor vectors. | |
void | GetPolarPlot (const std::vector< std::string > &ParNames) |
Make funny polar plot. | |
void | GetBayesFactor (const std::vector< std::string > &ParName, const std::vector< std::vector< double > > &Model1Bounds, const std::vector< std::vector< double > > &Model2Bounds, const std::vector< std::vector< std::string > > &ModelNames) |
Calculate Bayes factor for vector of params, and model boundaries. | |
void | GetSavageDickey (const std::vector< std::string > &ParName, const std::vector< double > &EvaluationPoint, const std::vector< std::vector< double > > &Bounds) |
Calculate Bayes factor for point like hypothesis using SavageDickey. | |
void | ReweightPrior (const std::vector< std::string > &Names, const std::vector< double > &NewCentral, const std::vector< double > &NewError) |
Reweight Prior by giving new central value and new error. | |
void | ParameterEvolution (const std::vector< std::string > &Names, const std::vector< int > &NIntervals) |
Make .gif of parameter evolution. | |
void | ThinMCMC (const int ThinningCut) |
Thin MCMC Chain, to save space and maintain low autocorrelations. | |
void | DiagMCMC () |
KS: Perform MCMC diagnostic including Autocorrelation, Trace etc. | |
int | GetNParams () |
Get total number of used parameters. | |
int | GetNXSec () |
int | GetNND () |
int | GetNFD () |
int | GetGroup (const std::string &name) const |
Number of params from a given group, for example flux. | |
TH1D * | GetHpost (const int i) |
Get 1D posterior for a given parameter. | |
TH2D * | GetHpost2D (const int i, const int j) |
Get 2D posterior for a given parameter combination. | |
TH2D * | GetViolin () |
Get Violin plot for all parameters with posterior values. | |
TH2D * | GetViolinPrior () |
Get Violin plot for all parameters with prior values. | |
std::vector< std::string > | GetXSecCov () const |
std::string | GetNDCov () const |
std::string | GetFDCov () const |
void | GetPostfit (TVectorD *&Central, TVectorD *&Errors, TVectorD *&Central_Gauss, TVectorD *&Errors_Gauss, TVectorD *&Peaks) |
Get the post-fit results (arithmetic and Gaussian) | |
void | GetCovariance (TMatrixDSym *&Cov, TMatrixDSym *&Corr) |
Get the post-fit covariances and correlations. | |
void | GetPostfit_Ind (TVectorD *&Central, TVectorD *&Errors, TVectorD *&Peaks, ParameterEnum kParam) |
Or the individual post-fits. | |
const std::vector< TString > & | GetBranchNames () const |
Get the vector of branch names from root file. | |
void | GetNthParameter (const int param, double &Prior, double &PriorError, TString &Title) const |
Get properties of parameter by passing it number. | |
int | GetParamIndexFromName (const std::string &Name) |
Get parameter number based on name. | |
Long64_t | GetnEntries () |
Get Number of entries that Chain has, for merged chains will not be the same Nsteps. | |
Long64_t | GetnSteps () |
Get Number of Steps that Chain has, for merged chains will not be the same nEntries. | |
void | SetStepCut (const std::string &Cuts) |
Set the step cutting by string. | |
void | SetStepCut (const int Cuts) |
Set the step cutting by int. | |
void | SetPlotRelativeToPrior (const bool PlotOrNot) |
You can set relative to prior or relative to generated. It is advised to use relate to prior. | |
void | SetPrintToPDF (const bool PlotOrNot) |
void | SetPlotErrorForFlatPrior (const bool PlotOrNot) |
Set whether you want to plot error for parameters which have flat prior. | |
void | SetPlotBinValue (const bool PlotOrNot) |
void | SetFancyNames (const bool PlotOrNot) |
void | SetSmoothing (const bool PlotOrNot) |
Set whether want to use smoothing for histograms using ROOT algorithm. | |
void | SetPost2DPlotThreshold (const double Threshold) |
Code will only plot 2D posteriors if Correlation are larger than defined threshold. | |
void | SetUseFFTAutoCorrelation (const bool useFFT) |
Toggle using the FFT-based autocorrelation calculator. | |
void | SetExcludedTypes (std::vector< std::string > Name) |
Setter related what parameters we want to exclude from analysis, for example if cross-section parameters look like xsec_, then passing "xsec_" will. | |
void | SetExcludedNames (std::vector< std::string > Name) |
void | SetnBatches (const int Batches) |
Set value of Nbatches used for batched mean, this need to be done earlier as batches are made when reading tree. | |
void | SetnLags (const int nLags) |
void | SetOutputSuffix (const std::string Suffix) |
Sett output suffix, this way jobs using the same file will have different names. | |
void | SetPosterior1DCut (const std::string Cut) |
Allow to set addtional cuts based on ROOT TBrowser cut, for to only affect one mass ordering. | |
Protected Member Functions | |
void | LoadAdditionalInfo () override |
Read the Osc cov file and get the input central values and errors Here we allow Jarlskog Shenanigans. | |
void | MakeJarlskogPlot (const std::unique_ptr< TH1D > &jarl, const std::unique_ptr< TH1D > &jarl_flatsindcp, const std::unique_ptr< TH1D > &jarl_NH, const std::unique_ptr< TH1D > &jarl_NH_flatsindcp, const std::unique_ptr< TH1D > &jarl_IH, const std::unique_ptr< TH1D > &jarl_IH_flatsindcp) |
Perform Jarlskog Plotting. | |
double | CalcJarlskog (const double s2th13, const double s2th23, const double s2th12, const double dcp) const |
Calculate Jarlskog Invariant using oscillation parameters. | |
double | SamplePriorForParam (const int paramIndex, const std::unique_ptr< TRandom3 > &randGen, const std::vector< double > &FlatBounds) const |
Draw Prior value. | |
![]() | |
std::unique_ptr< TH1D > | MakePrefit () |
Prepare prefit histogram for parameter overlay plot. | |
void | MakeOutputFile () |
prepare output root file and canvas to which we will save EVERYTHING | |
void | DrawCorrelations1D () |
Draw 1D correlations which might be more helpful than looking at huge 2D Corr matrix. | |
void | ReadInputCov () |
CW: Read the input Covariance matrix entries. Get stuff like parameter input errors, names, and so on. | |
void | ReadInputCovLegacy () |
void | FindInputFiles () |
Read the output MCMC file and find what inputs were used. | |
void | FindInputFilesLegacy () |
void | ReadModelFile () |
Read the xsec file and get the input central values and errors. | |
virtual void | LoadAdditionalInfo () |
allow loading additional info for example used for oscillation parameters | |
void | ReadNDFile () |
Read the ND cov file and get the input central values and errors. | |
void | ReadFDFile () |
Read the FD cov file and get the input central values and errors. | |
void | PrintInfo () const |
Print info like how many params have been loaded etc. | |
void | ScanInput () |
Scan Input etc. | |
void | ScanParameterOrder () |
Scan order of params from a different groups. | |
void | SetupOutput () |
Prepare all objects used for output. | |
void | PrepareDiagMCMC () |
CW: Prepare branches etc. for DiagMCMC. | |
void | ParamTraces () |
CW: Draw trace plots of the parameters i.e. parameter vs step. | |
void | AutoCorrelation () |
KS: Calculate autocorrelations supports both OpenMP and CUDA :) | |
void | AutoCorrelation_FFT () |
MJR: Autocorrelation function using FFT algorithm for extra speed. | |
void | CalculateESS (const int nLags, const std::vector< std::vector< double > > &LagL) |
KS: calc Effective Sample Size. | |
void | BatchedAnalysis () |
Get the batched means variance estimation and variable indicating if number of batches is sensible [4] [25]. | |
void | BatchedMeans () |
CW: Batched means, literally read from an array and chuck into TH1D. | |
void | GewekeDiagnostic () |
Geweke Diagnostic based on the methods described by Fang (2014) and Karlsbakk (2011). [8] [18]. | |
void | AcceptanceProbabilities () |
Acceptance Probability. | |
void | PowerSpectrumAnalysis () |
RC: Perform spectral analysis of MCMC [7]. | |
std::vector< double > | GetMargins (const std::unique_ptr< TCanvas > &Canv) const |
Get TCanvas margins, to be able to reset them if particular function need different margins. | |
void | SetMargins (std::unique_ptr< TCanvas > &Canv, const std::vector< double > &margins) |
Set TCanvas margins to specified values. | |
void | SetTLineStyle (TLine *Line, const Color_t Colour, const Width_t Width, const ELineStyle Style) const |
Configures a TLine object with the specified style parameters. | |
void | SetLegendStyle (TLegend *Legend, const double size) const |
Configures the style of a TLegend object. | |
Protected Attributes | |
bool | PlotJarlskog |
Will plot Jarlskog Invariant using information in the chain. | |
bool | OscEnabled |
Will plot Jarlskog Invariant using information in the chain. | |
std::string | Sin2Theta13Name |
Name of the parameter representing \(\sin^2\theta_{13}\). | |
std::string | Sin2Theta12Name |
Name of the parameter representing \(\sin^2\theta_{12}\). | |
std::string | Sin2Theta23Name |
Name of the parameter representing \(\sin^2\theta_{23}\). | |
std::string | DeltaCPName |
Name of the parameter representing \(\delta_{\mathrm{CP}}\) (the CP-violating phase). | |
std::string | DeltaM2_23Name |
Name of the parameter representing \(\Delta m^2_{32}\) (mass-squared difference). | |
int | Sin2Theta13Index |
Index of \(\sin^2\theta_{13}\) in the parameter list. | |
int | Sin2Theta12Index |
Index of \(\sin^2\theta_{12}\) in the parameter list. | |
int | Sin2Theta23Index |
Index of \(\sin^2\theta_{23}\) in the parameter list. | |
int | DeltaCPIndex |
Index of \(\delta_{\mathrm{CP}}\) in the parameter list. | |
int | DeltaM2_23Index |
Index of \(\Delta m^2_{32}\) in the parameter list. | |
![]() | |
std::string | MCMCFile |
Name of MCMC file. | |
std::string | OutputSuffix |
Output file suffix useful when running over same file with different settings. | |
std::vector< std::vector< std::string > > | CovPos |
Covariance matrix name position. | |
std::vector< YAML::Node > | CovConfig |
Covariance matrix config. | |
TChain * | Chain |
Main chain storing all steps etc. | |
std::string | StepCut |
BurnIn Cuts. | |
std::string | Posterior1DCut |
Cut used when making 1D Posterior distribution. | |
int | UpperCut |
KS: Used only for SubOptimality. | |
int | BurnInCut |
Value of burn in cut. | |
int | nBranches |
Number of branches in a TTree. | |
int | nEntries |
KS: For merged chains number of entries will be different from nSteps. | |
int | nSteps |
KS: For merged chains number of entries will be different from nSteps. | |
int | nSamples |
Number of sample PDF objects. | |
int | nSysts |
Number of covariance objects. | |
int | nDraw |
Number of all parameters used in the analysis. | |
std::vector< TString > | BranchNames |
std::vector< std::string > | ExcludedTypes |
std::vector< std::string > | ExcludedNames |
std::vector< bool > | IamVaried |
Is the ith parameter varied. | |
std::vector< std::vector< TString > > | ParamNames |
Name of parameters which we are going to analyse. | |
std::vector< std::vector< double > > | ParamCentral |
Parameters central values which we are going to analyse. | |
std::vector< std::vector< double > > | ParamNom |
std::vector< std::vector< double > > | ParamErrors |
Uncertainty on a single parameter. | |
std::vector< std::vector< bool > > | ParamFlat |
Whether Param has flat prior or not. | |
std::vector< int > | nParam |
Number of parameters per type. | |
std::vector< ParameterEnum > | ParamType |
Make an enum for which class this parameter belongs to so we don't have to keep string comparing. | |
std::vector< int > | ParamTypeStartPos |
std::vector< std::string > | ParameterGroup |
std::vector< TString > | SampleName_v |
Vector of each systematic. | |
std::vector< TString > | SystName_v |
Vector of each sample PDF object. | |
std::string | OutputName |
Name of output files. | |
TString | CanvasName |
Name of canvas which help to save to the sample pdf. | |
bool | PlotFlatPrior |
Whether we plot flat prior or not, we usually provide error even for flat prior params. | |
bool | plotRelativeToPrior |
Whether we plot relative to prior or nominal, in most cases is prior. | |
bool | MadePostfit |
Sanity check if Postfit is already done to not make several times. | |
bool | printToPDF |
Will plot all plot to PDF not only to root file. | |
bool | FancyPlotNames |
Whether we want fancy plot names or not. | |
bool | plotBinValue |
If true it will print value on each bin of covariance matrix. | |
bool | ApplySmoothing |
Apply smoothing for 2D histos using root algorithm. | |
double | Post2DPlotThreshold |
KS: Set Threshold when to plot 2D posterior as by default we get a LOT of plots. | |
bool | useFFTAutoCorrelation |
MJR: Use FFT-based autocorrelation algorithm (save time & resources)? | |
std::vector< int > | NDSamplesBins |
std::vector< std::string > | NDSamplesNames |
std::unique_ptr< TF1 > | Gauss |
Gaussian fitter. | |
TFile * | OutputFile |
The output file. | |
std::unique_ptr< TCanvas > | Posterior |
Fancy canvas used for our beautiful plots. | |
TVectorD * | Central_Value |
Vector with central value for each parameter. | |
TVectorD * | Means |
Vector with mean values using Arithmetic Mean. | |
TVectorD * | Errors |
Vector with errors values using RMS. | |
TVectorD * | Means_Gauss |
Vector with mean values using Gaussian fit. | |
TVectorD * | Errors_Gauss |
Vector with error values using Gaussian fit. | |
TVectorD * | Means_HPD |
Vector with mean values using Highest Posterior Density. | |
TVectorD * | Errors_HPD |
Vector with error values using Highest Posterior Density. | |
TVectorD * | Errors_HPD_Positive |
Vector with positive error (right hand side) values using Highest Posterior Density. | |
TVectorD * | Errors_HPD_Negative |
Vector with negative error (left hand side) values using Highest Posterior Density. | |
TMatrixDSym * | Covariance |
Posterior Covariance Matrix. | |
TMatrixDSym * | Correlation |
Posterior Correlation Matrix. | |
std::vector< TH1D * > | hpost |
Holds 1D Posterior Distributions. | |
std::vector< std::vector< TH2D * > > | hpost2D |
Holds 2D Posterior Distributions. | |
std::unique_ptr< TH2D > | hviolin |
Holds violin plot for all dials. | |
std::unique_ptr< TH2D > | hviolin_prior |
Holds prior violin plot for all dials,. | |
double ** | ParStep |
Array holding values for all parameters. | |
int * | StepNumber |
Step number for step, important if chains were merged. | |
int | nBins |
Number of bins. | |
double | DrawRange |
Drawrange for SetMaximum. | |
bool | CacheMCMC |
MCMC Chain has been cached. | |
bool | doDiagMCMC |
Doing MCMC Diagnostic. | |
int | nBatches |
Number of batches for Batched Mean. | |
int | AutoCorrLag |
LagL used in AutoCorrelation. | |
double * | ParamSums |
Total parameter sum for each param. | |
double ** | BatchedAverages |
Values of batched average for every param and batch. | |
double ** | SampleValues |
Holds the sample values. | |
double ** | SystValues |
Holds the systs values. | |
double * | AccProbValues |
Holds all accProb. | |
double * | AccProbBatchedAverages |
Holds all accProb in batches. | |
This class extends MCMC and allow specialised for Oscillation parameters analysis which require specialised hardcoding.
Definition at line 10 of file OscProcessor.h.
_MaCh3_Safe_Include_Start_ _MaCh3_Safe_Include_End_ OscProcessor::OscProcessor | ( | const std::string & | InputFile | ) |
Constructs an OscProcessor object with the specified input file and options.
InputFile | The path to the input file containing MCMC data. |
Definition at line 11 of file OscProcessor.cpp.
|
virtual |
Destroys the OscProcessor object.
Definition at line 26 of file OscProcessor.cpp.
|
protected |
Calculate Jarlskog Invariant using oscillation parameters.
s2th13 | Value of \( \sin^2\theta_{13} \) |
s2th23 | Value of \( \sin^2\theta_{23} \) |
s2th12 | Value of \( \sin^2\theta_{12} \) |
dcp | CP-violating phase \( \delta_{\text{CP}} \) (in radians) |
Definition at line 97 of file OscProcessor.cpp.
|
overrideprotectedvirtual |
Read the Osc cov file and get the input central values and errors Here we allow Jarlskog Shenanigans.
Reimplemented from MCMCProcessor.
Definition at line 33 of file OscProcessor.cpp.
|
protected |
Perform Jarlskog Plotting.
Definition at line 345 of file OscProcessor.cpp.
void OscProcessor::PerformJarlskogAnalysis | ( | ) |
Perform Several Jarlskog Plotting.
Definition at line 136 of file OscProcessor.cpp.
|
protected |
Draw Prior value.
Definition at line 113 of file OscProcessor.cpp.
|
protected |
Index of \(\delta_{\mathrm{CP}}\) in the parameter list.
Definition at line 75 of file OscProcessor.h.
|
protected |
Name of the parameter representing \(\delta_{\mathrm{CP}}\) (the CP-violating phase).
Definition at line 64 of file OscProcessor.h.
|
protected |
Index of \(\Delta m^2_{32}\) in the parameter list.
Definition at line 77 of file OscProcessor.h.
|
protected |
Name of the parameter representing \(\Delta m^2_{32}\) (mass-squared difference).
Definition at line 66 of file OscProcessor.h.
|
protected |
Will plot Jarlskog Invariant using information in the chain.
Definition at line 55 of file OscProcessor.h.
|
protected |
Will plot Jarlskog Invariant using information in the chain.
Definition at line 52 of file OscProcessor.h.
|
protected |
Index of \(\sin^2\theta_{12}\) in the parameter list.
Definition at line 71 of file OscProcessor.h.
|
protected |
Name of the parameter representing \(\sin^2\theta_{12}\).
Definition at line 60 of file OscProcessor.h.
|
protected |
Index of \(\sin^2\theta_{13}\) in the parameter list.
Definition at line 69 of file OscProcessor.h.
|
protected |
Name of the parameter representing \(\sin^2\theta_{13}\).
Definition at line 58 of file OscProcessor.h.
|
protected |
Index of \(\sin^2\theta_{23}\) in the parameter list.
Definition at line 73 of file OscProcessor.h.
|
protected |
Name of the parameter representing \(\sin^2\theta_{23}\).
Definition at line 62 of file OscProcessor.h.