]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/SPECTRA/LambdaK0PbPb/FitSpectrum.C
Main fitting macro
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / LambdaK0PbPb / FitSpectrum.C
1 void FitSpectrum(const char* filename, const char * listName = "clambdak0Histo_00", const char* suffix = "test", Int_t iparticle) {
2   
3   // load basic libs, needed to 
4   gROOT->LoadMacro("run.C");
5   InitAndLoadLibs();
6
7   // Load Lee's Macro
8   gROOT->LoadMacro("FitControl.h+g");
9   gROOT->LoadMacro("PtMassAna2.C");
10   gROOT->LoadMacro("MultYields2.C");
11
12   char* histName = 0;
13   switch (iparticle) {
14   case 1:
15     histName = "h2PtVsMassLambda";
16     break;
17   default:
18     cout << "Particle "<< iparticle << " to be implemented" << endl;  
19   }
20
21   TFile *file = new TFile(filename);
22   TList *list = file->Get(listName); 
23
24   TH2F * h2 = (TH2F*) list->FindObject(histName);
25
26   TString suffixFull = histName;
27   if(strlen(suffix)) suffixFull = suffixFull + "_" + suffix;
28   MultYields2((TH3F*)h2,iparticle,0,suffixFull); // FIXME: modify MultYields2 to handle 1D histos
29
30   
31 }