void rf711_lagrangianmorph()
{
std::string observablename = "pTV";
RooRealVar obsvar(observablename.c_str(),
"p_{T}^{V}", 10, 600);
RooRealVar cHq3(
"cHq3",
"EFT modifier", 0.0, 1.0);
cHq3.setAttribute("NewPhysics", true);
std::string infilename = std::string(
gROOT->GetTutorialDir()) +
"/roofit/roofit/input_histos_rf_lagrangianmorph.root";
std::vector<std::string> samplelist = {"SM_NPsq0", "cHq3_NPsq1", "cHq3_NPsq2"};
morphfunc.setParameter("cHq3", 0.01);
auto morph_hist_0p01 = morphfunc.createTH1("morph_cHq3=0.01");
morphfunc.setParameter("cHq3", 0.25);
auto morph_hist_0p25 = morphfunc.createTH1("morph_cHq3=0.25");
morphfunc.setParameter("cHq3", 0.5);
auto morph_hist_0p5 = morphfunc.createTH1("morph_cHq3=0.5");
RooDataHist morph_datahist_0p01(
"morph_dh_cHq3=0.01",
"", {obsvar}, morph_hist_0p01);
RooDataHist morph_datahist_0p25(
"morph_dh_cHq3=0.25",
"", {obsvar}, morph_hist_0p25);
RooDataHist morph_datahist_0p5(
"morph_dh_cHq3=0.5",
"", {obsvar}, morph_hist_0p5);
TFile *file =
new TFile(infilename.c_str(),
"READ");
file->GetObject(samplelist[0].c_str(), folder);
TH1 *input_hist0 =
dynamic_cast<TH1 *
>(folder->
FindObject(observablename.c_str()));
file->GetObject(samplelist[1].c_str(), folder);
TH1 *input_hist1 =
dynamic_cast<TH1 *
>(folder->
FindObject(observablename.c_str()));
file->GetObject(samplelist[2].c_str(), folder);
TH1 *input_hist2 =
dynamic_cast<TH1 *
>(folder->
FindObject(observablename.c_str()));
file->Close();
RooDataHist input_dh0(samplelist[0],
"", {obsvar}, input_hist0);
RooDataHist input_dh1(samplelist[1],
"", {obsvar}, input_hist1);
RooDataHist input_dh2(samplelist[2],
"", {obsvar}, input_hist2);
auto frame0 = obsvar.frame(
Title(
"Input templates for p_{T}^{V}"));
auto frame1 = obsvar.
frame(
Title(
"Morphed templates for selected values"));
std::unique_ptr<RooDataSet>
data{model.generate({cHq3, obsvar}, 1000000)};
hh_data->
SetTitle(
"Morphing prediction");
gPad->SetLeftMargin(0.15);
gPad->SetRightMargin(0.05);
frame0->Draw();
leg1->
AddEntry(
"cHq3_NPsq1",
"c_{Hq^(3)}=1.0 at #Lambda^{-2}",
"LP");
leg1->
AddEntry(
"cHq3_NPsq2",
"c_{Hq^(3)}=1.0 at #Lambda^{-4}",
"LP");
gPad->SetLeftMargin(0.15);
gPad->SetRightMargin(0.05);
frame1->Draw();
leg2->
AddEntry(
"morph_dh_cHq3=0.01",
"c_{Hq^{(3)}}=0.01",
"L");
leg2->
AddEntry(
"morph_dh_cHq3=0.25",
"c_{Hq^{(3)}}=0.25",
"L");
leg2->
AddEntry(
"morph_dh_cHq3=0.5",
"c_{Hq^{(3)}}=0.5",
"L");
gPad->SetLeftMargin(0.12);
gPad->SetRightMargin(0.18);
gStyle->SetNumberContours(255);
c1->SaveAs(
"rf711_lagrangianmorph.png");
}
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
Container class to hold N-dimensional binned data.
Class RooLagrangianMorphing is a implementation of the method of Effective Lagrangian Morphing,...
static RooPlot * frame(const RooAbsRealLValue &var, double xmin, double xmax, Int_t nBins)
Create a new frame for a given variable in x.
Variable that can be changed from the outside.
The RooWrapperPdf is a class that can be used to convert a function into a PDF.
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
Set the viewing range for the axis from ufirst to ulast (in user coordinates, that is,...
static void InvertPalette()
<div class="legacybox"><h2>Legacy Code</h2> TFolder is a legacy interface: there will be no bug fixes...
TObject * FindObject(const char *name) const override
Search object identified by name in the tree of folders inside this folder.
TH1 is the base class of all histogram classes in ROOT.
void SetTitle(const char *title) override
Set the title of the TNamed.
virtual void SetDirectory(TDirectory *dir)
void Draw(Option_t *option="") override
Default Draw method for all objects.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
void Draw(Option_t *option="") override
Draw this box with its current attributes.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Mother of all ROOT objects.
RooCmdArg Title(const char *name)
RooCmdArg YVar(const RooAbsRealLValue &var, const RooCmdArg &arg={})
RooCmdArg DataError(Int_t)
RooCmdArg Binning(const RooAbsBinning &binning)
RooCmdArg DrawOption(const char *opt)
RooCmdArg LineColor(TColorNumber color)
RooCmdArg XErrorSize(double width)
RooCmdArg MarkerSize(Size_t size)
RooCmdArg MarkerColor(TColorNumber color)
RooCmdArg Name(const char *name)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
std::string observableName
std::vector< std::string > folderNames
[#0] PROGRESS:InputArguments -- initializing physics inputs from file /home/stephan/code/root-opt/tutorials/roofit/roofit/input_histos_rf_lagrangianmorph.root with object name(s) 'pTV'
[#0] PROGRESS:Caching -- creating cache from getCache function for 0x7ffe60c8b8e0
[#0] PROGRESS:Caching -- current storage has size 3
[#0] PROGRESS:ObjectHandling -- observable: pTV
[#0] PROGRESS:ObjectHandling -- binWidth: binWidth_pTV
[#1] INFO:DataHandling -- RooDataHist::adjustBinning(morph_dh_cHq3=0.01): fit range of variable pTV expanded to nearest bin boundaries: [10,600] --> [0,600]
[#1] INFO:InputArguments -- RooAbsData::plotOn(SM_NPsq0) INFO: dataset has non-integer weights, auto-selecting SumW2 errors instead of Poisson errors
[#1] INFO:InputArguments -- RooAbsData::plotOn(cHq3_NPsq1) INFO: dataset has non-integer weights, auto-selecting SumW2 errors instead of Poisson errors
[#1] INFO:Plotting -- RooPlot::updateFitRangeNorm: New event count of 24931.9 will supersede previous event count of 10852.3 for normalization of PDF projections
[#1] INFO:InputArguments -- RooAbsData::plotOn(cHq3_NPsq2) INFO: dataset has non-integer weights, auto-selecting SumW2 errors instead of Poisson errors
[#1] INFO:Plotting -- RooPlot::updateFitRangeNorm: New event count of 29789.2 will supersede previous event count of 24931.9 for normalization of PDF projections
[#1] INFO:Plotting -- RooPlot::updateFitRangeNorm: New event count of 18947.1 will supersede previous event count of 11104.6 for normalization of PDF projections
[#1] INFO:Plotting -- RooPlot::updateFitRangeNorm: New event count of 30765.5 will supersede previous event count of 18947.1 for normalization of PDF projections
[#0] PROGRESS:Caching -- creating cache from getCache function for 0x55bf098cb890
[#0] PROGRESS:Caching -- current storage has size 3
[#0] PROGRESS:ObjectHandling -- observable: pTV
[#0] PROGRESS:ObjectHandling -- binWidth: binWidth_pTV
[#1] INFO:NumericIntegration -- RooRealIntegral::init(w_SM_NPsq0_morphfunc_Int[cHq3]) using numeric integrator RooIntegrator1D to calculate Int(cHq3)
[#1] INFO:NumericIntegration -- RooRealIntegral::init(w_cHq3_NPsq1_morphfunc_Int[cHq3]) using numeric integrator RooIntegrator1D to calculate Int(cHq3)
[#1] INFO:NumericIntegration -- RooRealIntegral::init(w_cHq3_NPsq2_morphfunc_Int[cHq3]) using numeric integrator RooIntegrator1D to calculate Int(cHq3)
[#0] PROGRESS:Caching -- creating cache from getCache function for 0x55bf09853bf0
[#0] PROGRESS:Caching -- current storage has size 3
[#0] PROGRESS:ObjectHandling -- observable: pTV
[#0] PROGRESS:ObjectHandling -- binWidth: binWidth_pTV
[#1] INFO:NumericIntegration -- RooRealIntegral::init(w_SM_NPsq0_morphfunc_Int[cHq3]) using numeric integrator RooIntegrator1D to calculate Int(cHq3)
[#1] INFO:NumericIntegration -- RooRealIntegral::init(w_cHq3_NPsq1_morphfunc_Int[cHq3]) using numeric integrator RooIntegrator1D to calculate Int(cHq3)
[#1] INFO:NumericIntegration -- RooRealIntegral::init(w_cHq3_NPsq2_morphfunc_Int[cHq3]) using numeric integrator RooIntegrator1D to calculate Int(cHq3)