Hello,
I’m quite new to this so I’m gonna ask a few things,
I have a tree that contains 6 branches and i want to import this tree to another script and create a pull distribution
I manage to import the branches but how should i proceed?
how can i declare a RooHist with the specific function i want to use?
I need a pull distribution for sigma and one for mean (i.e. sigmaFit-sigmaInj)/sigmaFitError
thanks in advance
Code (i’ve only gone that far) is below:
#ifndef __CINT__
#include "RooGlobalFunc.h"
#endif
#include "RooRealVar.h"
#include "RooDataSet.h"
#include "RooGaussian.h"
#include "RooDataHist.h"
#include "TCanvas.h"
#include "RooPlot.h"
#include "TAxis.h"
#include "TFile.h"
#include "RooWorkspace.h"
using namespace RooFit ;
void roofit_test_loops_readtree(){
RooMsgService::instance().setSilentMode(kTRUE);
RooMsgService::instance().setStreamStatus(0,kFALSE);
RooMsgService::instance().setStreamStatus(1,kFALSE);
gROOT->Reset();
gROOT->SetStyle("Plain");
gStyle->SetOptStat(0);
gStyle->SetOptFit(0);
gStyle->SetPadColor(0);
gStyle->SetPalette(1);
TFile *f = TFile::Open("pdfloop.root", "READ");
TTree *tree = (TTree*)f->Get("tree");
TFile *outf = TFile::Open("pdfloopdraw.root", "RECREATE");
float sigmaInj, meanInj, sigmaFit, meanFit, sigmaFitError,meanFitError;
tree->SetBranchAddress("sigmaInj",&sigmaInj);
tree->SetBranchAddress("meanInj",&meanInj);
tree->SetBranchAddress("sigmaFit",&sigmaFit);
tree->SetBranchAddress("meanFit",&meanFit);
tree->SetBranchAddress("sigmaFitError",&sigmaFitError);
tree->SetBranchAddress("meanFitError",&meanFitError);