1 /**************************************************************************
2 * Copyright(c) 2007-2009, 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 **************************************************************************/
17 #include "AliEventPlaneResolution.h"
21 ///////////////////////////////////////////////////////////////////
23 // Implementation of the class to compute event plane resolution //
24 // for flow analyses //
25 // Origin: F.Prino, Torino, prino@to.infn.it //
27 ///////////////////////////////////////////////////////////////////
29 ClassImp(AliEventPlaneResolution)
31 //______________________________________________________________________
32 AliEventPlaneResolution::AliEventPlaneResolution():TObject(),
40 //______________________________________________________________________
41 AliEventPlaneResolution::AliEventPlaneResolution(Int_t k):
46 // Standard constructor
50 //______________________________________________________________________
51 Double_t AliEventPlaneResolution::Pol(Double_t x, Int_t k){
52 // compute chi from polynomial approximation
55 c[0]=0.626657; c[1]=0.; c[2]=-0.09694; c[3]=0.02754; c[4]=-0.002283;
58 c[0]=0.; c[1]=0.25; c[2]=-0.011414; c[3]=-0.034726; c[4]=0.006815;
61 return c[0]*x+c[1]*x*x+c[2]*x*x*x+c[3]*x*x*x*x+c[4]*x*x*x*x*x;
64 //______________________________________________________________________
65 Double_t AliEventPlaneResolution:: ResolK1(Double_t x){
66 return TMath::Sqrt(TMath::Pi()/8)*x*TMath::Exp(-x*x/4)*(TMath::BesselI0(x*x/4)+TMath::BesselI1(x*x/4));
70 //______________________________________________________________________
71 Double_t AliEventPlaneResolution::FindChi(Double_t res, Int_t k){
72 // compute chi variable (=v2*sqrt(N)) from external values
87 if(y1*y2>0) return -1;
92 while((x2-x1)>0.0001){
97 ymed=ResolK1(xmed)-res;
102 ymed=Pol(xmed,2)-res;
105 if((y1*ymed)<0) x2=xmed;
106 if((y2*ymed)<0)x1=xmed;
107 if(ymed==0) return xmed;
113 //______________________________________________________________________
114 Double_t AliEventPlaneResolution::GetFullEvResol(Double_t resSub, Int_t k){
115 // computes event plane resolution starting from sub event resolution
116 Double_t chisub=FindChi(resSub,k);
117 Double_t chifull=chisub*TMath::Sqrt(2);
118 if(k==1) return ResolK1(chifull);
119 else if(k==2) return Pol(chifull,2);
121 printf("k should be <=2\n");
126 //______________________________________________________________________
127 Double_t AliEventPlaneResolution::GetFullEvResol(const TH1F* hSubEvCorr, Int_t k){
128 // computes event plane resolution starting from sub event correlation histogram
129 if(!hSubEvCorr) return 1.;
130 Double_t resSub=GetSubEvResol(hSubEvCorr);
131 return GetFullEvResol(resSub,k);