1 #ifndef PROTODUNEFITUTILS_h 2 #define PROTODUNEFITUTILS_h 14 #include <RooArgSet.h> 15 #include <RooArgList.h> 16 #include <RooWorkspace.h> 17 #include <RooFitResult.h> 21 namespace ProtoDUNEFitUtils{
43 bool LoadSnapshot(RooWorkspace* ws, TString snapshotname);
57 RooWorkspace *work, TString name, TString
error, TString plottodraw,
58 std::vector<TString> binnames, std::vector<double> recobins,
59 std::vector<TString> incidentBinNames,
60 std::vector<TString> sidebandBinNames, std::vector<double> sidebandBins,
61 TString measurement=
"PDFit",
62 bool doNegativeReco=
false,RooAbsData*
data=NULL,
63 RooFitResult* result=NULL);
67 std::vector<TString> binnames, std::vector<double> recobins,
68 std::vector<TString> incidentBinNames, RooAbsData *
data = 0x0,
69 RooFitResult * result = 0x0);
72 std::vector<TCanvas*>
PlotNLL(RooWorkspace *work, TString name, RooFitResult* result,
bool plotPLL=
false);
75 std::vector<TCanvas*>
PlotNuisanceParametersImpact(RooWorkspace *work, RooFitResult* result, TString snapshotload, std::vector<std::string> SystsToConsider);
87 TCanvas*
PlotAverageResultsFromToys(TTree* tree, RooWorkspace* ws, TString channelname, TString catname, RooArgList * PreFit_POI = 0x0);
96 void ResetValues(RooWorkspace* ws,
const RooArgList& parList);
102 void ResetError(RooWorkspace* ws,
const RooArgList& parList);
bool IsSingleBinHisto(TH1 *histo)
std::vector< TCanvas * > PlotDatasetsAndPdfs(RooWorkspace *work, TString name, TString error, TString plottodraw, std::vector< TString > binnames, std::vector< double > recobins, std::vector< TString > incidentBinNames, std::vector< TString > sidebandBinNames, std::vector< double > sidebandBins, TString measurement="PDFit", bool doNegativeReco=false, RooAbsData *data=NULL, RooFitResult *result=NULL)
RooArgList GetPostfitPOIList(RooArgList paramsfit, bool print=false)
void ResetValues(RooWorkspace *ws, const RooArgList &parList)
void SetInterpolationCode(RooWorkspace *ws, int code)
void SaveWorkspace(RooWorkspace *ws, TString outFileName)
TH1 * GetStatsSystHistogram(TH1 *nominal)
bool LoadSnapshot(RooWorkspace *ws, TString snapshotname)
void MakeNuisanceParamsConstant(RooWorkspace *ws, TString exceptPar)
std::vector< TH1 * > PlotXSecs(RooWorkspace *work, std::string name, std::vector< TString > binnames, std::vector< double > recobins, std::vector< TString > incidentBinNames, RooAbsData *data=0x0, RooFitResult *result=0x0)
TH1 * GetSystematicHistoFromNominal(TH1 *nominal, TH1 *syst, TString name)
void RemoveEmptyBins(RooPlot *frame)
std::vector< TCanvas * > PlotNuisanceParametersImpact(RooWorkspace *work, RooFitResult *result, TString snapshotload, std::vector< std::string > SystsToConsider)
TH2 * GetFitCovariance(RooFitResult *result)
TCanvas * PlotParametersPull(TTree *tree, RooWorkspace *ws)
double GetDataMCChi2(RooWorkspace *work, TString channelname, RooAbsData *data=NULL)
CodeOutputInterface * code
double GetArgonNumberDensity(double argon_density=1.3973, double argon_molecularmass=39.948)
void ResetValuesToNominal(RooWorkspace *ws, const RooArgSet &parSet)
TCanvas * PlotNuisanceParameters(TTree *tree, RooWorkspace *ws)
std::vector< TCanvas * > PlotNLL(RooWorkspace *work, TString name, RooFitResult *result, bool plotPLL=false)
TH2 * GetFitCorrelationMatrix(RooFitResult *result)
void SaveSnapshot(RooWorkspace *ws, TString snapshotname)
void ResetError(RooWorkspace *ws, const RooArgList &parList)
TCanvas * PlotAverageResultsFromToys(TTree *tree, RooWorkspace *ws, TString channelname, TString catname, RooArgList *PreFit_POI=0x0)
TCanvas * PlotNuisanceParametersPull(TTree *tree, RooWorkspace *ws)
std::vector< TH1 * > GetSystHistograms(std::string name)
void ResetAllValuesAndErrors(RooWorkspace *ws)