Roofit in Windows 7


Due to some hardware issue in my laptop i have been pushed to work in Windows against Ubuntu. I have installed Root 5.32 in Win 7 and tried to execute a macro which worked in ubuntu previously.

The macro uses roofit to fit a histogram, i used RooChebychev and Roogaussian and the parameters are set in such a way that it did a perfect fit when i ran it in ubuntu, but when i ran it in Windows the Minuit was keep on running and never stopped and i believe it couldnt optimize the fit ever!
I am not sure why is that. Is there any configuration problem of Roofit with Windows?


You’ll get the best response if you can post a STC (simple test case) that shows the problem you are having. Posting something complicated is better than not giving any example at all.


p.s. I often find that when trying to isolate the problem for writing the STC, I find what the problem actually is.


Here my macro

#include <vector>
#ifndef __CINT__
#include "RooGlobalFunc.h"
#include "RooRealVar.h"
#include "RooDataSet.h"
#include "RooGaussian.h"
#include "RooPolynomial.h"
#include "RooAddPdf.h"
#include "RooFitResult.h"
#include "RooFFTConvPdf.h"
#include "TCanvas.h"
#include "RooPlot.h"
#include "TAxis.h"
#include "TH1.h"

void roo_nsig_cut4_A007() {
using namespace RooFit ;

f = new TFile("path/to/root/file/histo.root");

Int_t grp = 6;
Double_t xmin = 0.85;
Double_t xmax = 1.1;

RooRealVar x("x", "", xmin, xmax);

TH1F *hnew1 = 0;
gDirectory->GetObject("cut4_AND_0.07", hnew1);
hnew1->GetXaxis()->SetRangeUser(xmin, xmax);


RooDataHist dh("dh","dh", x, Import(*hnew1));

//Fit parameters
RooRealVar mean("mean","mean",[i]value,min,max[/i]);
RooRealVar sigma("sigma","sigma",0.006,0.001,0.009);

RooGaussian sig("sig","signal p.d.f.",x,mean,sigma);

RooRealVar c0("c0","coefficient #0", -0.2, -1.,3.);
RooRealVar c1("c1","coefficient #1", 0.01,-1.,1.);
RooRealVar c2("c2","coefficient #2",-0.003,-1.,1.);

RooChebychev bkg("bkg","background p.d.f.",x,RooArgList(c0,c1,c2)) ;

RooRealVar nsig("nsig","signal fraction",6000,0.,100000.);
RooRealVar nbkg("nbkg","background fraction",30000,0.,1000000.);

// model(x) = fsig*sig(x) + (1-fsig)*bkg(x)
RooAddPdf model("model","model",RooArgList(sig,bkg),RooArgList(nsig,nbkg)) ;


RooPlot* xframe =x.frame(Title("W/SS_OR_No_d0_And007"));



model.paramOn(xframe, Layout(0.55,0.99,0.4));
//dh.statOn(xframe, Layout(0.75, 0.99, 0.8));

cout << "chi^2 = " << xframe->chiSquare() << endl;


I cannot show the output of this macro, because it never stops, the minuit function that runs during fit keeps on running to get the best fit, but it nevers stops. This same macro worked when i ran it in ubuntu. You would need some more information?