With the following code:
TFile * fw = TFile::Open("workspaces/modelTwoHypo.root");
RooWorkspace *w = (RooWorkspace *) fw -> Get("w");
RooRealVar * CMS_th1x = w -> var("CMS_th1x");
RooPlot * frame = CMS_th1x -> frame();
RooAbsPdf *ttbar = w -> pdf("shapeSig_b1_ttbar_morph");
ttbar -> plotOn(frame);
TCanvas * c = new TCanvas("c", "c");
frame -> Draw();
I get a frame drawn on a canvas matching the expectations.
To get a similar histogram I try:
TH1 * h = ttbar -> createHistogram("??", CMS_th1x -> getValV());
I am particularly uncertain about what to supply for varNameList
. How can I check what variable was used to make the frame?
The output from ttbar -> Print()
is
FastVerticalInterpHistPdf2::shapeSig_b1_ttbar_morph[ coefList=(MC13TeV_TTJets_jec_CorrelationGroupMPFInSitu,MC13TeV_TTJets_jec_RelativeFSR,MC13TeV_TTJets_jec_CorrelationGroupUncorrelated,MC13TeV_TTJets_jec_FlavorPureGluon,MC13TeV_TTJets_jec_FlavorPureQuark,MC13TeV_TTJets_jec_FlavorPureCharm,MC13TeV_TTJets_jec_FlavorPureBottom,MC13TeV_TTJets_jer,MC13TeV_TTJets_btag_heavy,MC13TeV_TTJets_btag_light,MC13TeV_TTJets_csv_heavy,MC13TeV_TTJets_csv_light,MC13TeV_TTJets_tracking,MC13TeV_TTJets_isr,MC13TeV_TTJets_fsr,MC13TeV_TTJets_hdamp,MC13TeV_TTJets_ue) x=CMS_th1x ] = 0.0407928