1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15 //Obtain single particle efficiencies from output AliAnalysisTaskDiHadron (when ran over MC events and MC histograms filled)
16 //Author: Jason Glyndwr Ulery, ulery@uni-frankfurt.de
34 void SingleEff(int Cent){
36 gROOT->LoadMacro("Util9.C");
40 // char *EffFolder="2010-08-13/7Pythia_LHC10b5";
41 char *EffFolder="2010-08-13/LHC10c6_900Pythia";
44 sprintf(effName,"%s/julery_DiHadron.root",EffFolder);
45 TFile *effFile=new TFile(effName);
46 TList *effList=effFile->Get("julery_DiHadron");
49 sprintf(name,"fHistPtEff_C%d",Cent);
50 TH1F *fHistPt=(TH1F*)effList->FindObject(name);
51 sprintf(name,"fHistPtEff_C%d_MC",Cent);
52 TH1F *fHistPtMC=(TH1F*)effList->FindObject(name);
54 TH1F *fHistEff=(TH1F*)fHistPt->Clone();
55 fHistEff->SetName("fHistEff");
56 fHistEff->GetYaxis()->SetTitle("Efficiency+Contamination");
57 fHistEff->SetTitle("");
58 fHistEff->Divide(fHistPtMC);
60 c1=new TCanvas("c1","",800,600);
62 fHistEff->SetMaximum(1);
63 fHistEff->SetMinimum(0);
64 fHistEff->GetXaxis()->SetRange(0,100);
66 //TF1 *fit1=new TF1("fit1","[0]+[1]*x+[2]*x**2+[3]*x**3+[4]*x**4+[5]*x**5",0,100);
67 //fit1->SetParameters(0.8,0.001,0.001,0.001,0.001,0.001)
68 fit2=new TF1("fit2","[0]",3,100);
69 fit2->SetParameter(0,0.8);
70 TF1 *fit3=new TF1("fit3","[0]/[1]*exp(-0.5*pow(x/[1],2))+[2]+[3]*x",0,3);
71 fit3->SetParameters(0.1,0.1,1,0.1,0.1,0.1);
72 fit3->SetParLimits(0,-2,0);
73 fit3->SetLineColor(4);
74 fHistEff->Fit(fit3,"r");
75 fit2->SetLineColor(2);
76 fHistEff->Fit(fit2,"r");
78 sprintf(name,"%s/SingleEff1_%d.gif",EffFolder,Cent);
80 c2=new TCanvas("c2","",800,600);
81 fHistEff->GetXaxis()->SetRange(0,30);
85 sprintf(name,"%s/SingleEff2_%d.gif",EffFolder,Cent);
88 cout << fit3->GetParameter(0) << ", " << fit3->GetParameter(1) << ", " << fit3->GetParameter(2) << ", " << fit3->GetParameter(3) << endl;
89 cout << fit2->GetParameter(0) << endl;