Dear co-rooters,
I am trying to perform a simple linear fit in a certain range on a TH1D histogram which I get from a root file (The root file can be found in https://cernbox.cern.ch/index.php/s/3XnsnbWYg2obDtD)
My code is the following
#include "TCanvas.h"
#include "TStyle.h"
#include "TFile.h"
#include "TH1.h"
void fit(){
TFile *fin = new TFile("fit.root", "OPEN");
TH1D *h = (TH1D*) fin->Get("histo_movie");
gStyle->SetOptStat(0);
TCanvas *canvas = new TCanvas("canvas", "HPGe", 500, 500);
canvas->Divide(1, 2);
// Pad 1
canvas->cd(1);
h->Draw("histo ][");
h->TH1::Fit("pol1", "WCQF", "C SAME", 5.6005e6, 5.6021e6);
//Pad 2
canvas->cd(2);
h->Draw("histo ][");
}
Although the code compiles and runs there is no plotted curve.
Any idea on what is going on?
Thanks in advance!
Note that I am running this on lxplus7, using whichever version is the latest in the cluster.

