20 TString stdfilename=
"HFMassFitterOutput.root";
21 stdfilename.Prepend(path);
23 cout<<
"Opening "<<stdfilename<<endl;
24 TFile *fin=
new TFile(stdfilename.Data());
26 cout<<
"File "<<stdfilename<<
" not found"<<endl;
32 TH1F *h=(TH1F*)fin->Get(histoname);
34 cout<<histoname<<
" is not here, sorry!"<<endl;
35 histoname=
"fhistoInvMass";
36 h=(TH1F*)fin->Get(histoname);
38 cout<<histoname<<
" is not here, sorry!"<<endl;
39 cout<<
"Write the name of the histo required (e.g. histMassSum<factor>_<ptbin>): ";
41 h=(TH1F*)fin->Get(histoname);
43 cout<<histoname<<
" is not in "<<stdfilename<<
" check it, please!"<<endl;
48 h->SetName(histoname);
54 cout<<histoname<<
" will be drawn!"<<endl;
55 TCanvas *c1=
new TCanvas(
"c1",histoname);
58 (h->GetFunction(
"funcbkgFullRange"))->SetLineColor(14);
59 (h->GetFunction(
"funcbkgFullRange"))->SetLineStyle(4);
62 (h->GetFunction(
"funcbkgFullRange"))->GetRange(xmin,xmax);
63 Int_t nfreepar=h->GetFunction(
"funcbkgFullRange")->GetNumberFreeParameters();
64 cout<<
"nfreepar = "<<nfreepar<<endl;
66 cout<<
"Range = ("<<xmin<<
", "<<xmax<<
")"<<endl;
67 cout<<
"Bin Width "<<h->GetBinWidth(3)<<endl;
68 cout<<
"Initial parameters:\n";
69 cout<<
"par0= "<<h->GetFunction(
"funcbkgFullRange")->GetParameter(0)<<endl;
70 cout<<
"par1= "<<h->GetFunction(
"funcbkgFullRange")->GetParameter(1)<<endl;
71 cout<<
"par2= "<<h->GetFunction(
"funcbkgFullRange")->GetParameter(2)<<endl;
72 cout<<
"Formula= "<<h->GetFunction(
"funcbkgFullRange")->GetExpFormula()<<endl;
74 TF1 *fmass=h->GetFunction(
"funcmass");
75 cout<<
"Parametri massa input:\n";
76 cout<<
"par0= "<<h->GetFunction(
"funcmass")->GetParameter(0)-h->GetFunction(
"funcmass")->GetParameter(nfreepar)<<endl;
77 cout<<
"par1= "<<h->GetFunction(
"funcmass")->GetParameter(1)<<endl;
78 cout<<
"par2= "<<h->GetFunction(
"funcmass")->GetParameter(2)<<endl;
89 fbkgfullrange_deep->SetParameter(0,(fmass->GetParameter(0)-fmass->GetParameter(nfreepar)));
90 if(nfreepar>=2) fbkgfullrange_deep->SetParameter(1,fmass->GetParameter(1));
91 if(nfreepar==3) fbkgfullrange_deep->SetParameter(2,fmass->GetParameter(2));
93 fbkgfullrange_deep->SetMinimum(0);
95 cout<<
"Final parameters:\n";
96 cout<<
"par0= "<<fbkgfullrange_deep->GetParameter(0)<<
"\tcompare with "<<fbkgfullrange_deep->Integral(xmin,xmax)<<endl;
97 cout<<
"par1= "<<fbkgfullrange_deep->GetParameter(1)<<endl;
98 cout<<
"par2= "<<fbkgfullrange_deep->GetParameter(2)<<endl;
101 fbkgfullrange_deep->SetLineStyle(1);
102 fbkgfullrange_deep->SetLineColor(2);
104 fbkgfullrange_deep->Draw(
"sames");
105 fmass->Draw(
"sames");
108 cout<<histoname<<
" is not here, sorry!"<<endl;
void plotHFMassFitterOutput(Int_t ptbin, TString path="./")
void SetSideBands(Bool_t onlysidebands=kTRUE)
change the default value of the sigma
virtual Double_t FitFunction4Bkg(Double_t *x, Double_t *par)
AliHFMassFitter for the fit of invariant mass distribution of charmed mesons.