1 ///////////////////////////////////////////////////////////////////////////
3 // AliFemtoCorrFctn3DSpherical: a class to calculate 3D correlation //
4 // for pairs of identical particles, binned in spherical coordinates. //
5 // In analysis the function should be first created in a macro, then //
6 // added to the analysis, and at the end of the macro the procedure to //
7 // write out histograms should be called. //
9 ///////////////////////////////////////////////////////////////////////////
11 #include "AliFemtoCorrFctn3DSpherical.h"
16 ClassImp(AliFemtoCorrFctn3DSpherical)
19 //____________________________
20 AliFemtoCorrFctn3DSpherical::AliFemtoCorrFctn3DSpherical(char* title, const int& nqbins, const float& QLo, const float& QHi, const int& nphibins, const int& ncthetabins):
26 char tTitNum[101] = "Num";
27 strncat(tTitNum,title, 100);
28 fNumerator = new TH3D(tTitNum,title,nqbins,QLo,QHi,nphibins,-TMath::Pi(),TMath::Pi(),ncthetabins,-1.0,1.0);
30 char tTitDen[101] = "Den";
31 strncat(tTitDen,title, 100);
32 fDenominator = new TH3D(tTitDen,title,nqbins,QLo,QHi,nphibins,-TMath::Pi(),TMath::Pi(),ncthetabins,-1.0,1.0);
34 // to enable error bar calculation...
36 fDenominator->Sumw2();
39 AliFemtoCorrFctn3DSpherical::AliFemtoCorrFctn3DSpherical(const AliFemtoCorrFctn3DSpherical& aCorrFctn) :
40 AliFemtoCorrFctn(aCorrFctn),
46 fNumerator = new TH3D(*aCorrFctn.fNumerator);
47 fDenominator = new TH3D(*aCorrFctn.fDenominator);
48 // fPairCut = aCorrFctn.fPairCut;
50 //____________________________
51 AliFemtoCorrFctn3DSpherical::~AliFemtoCorrFctn3DSpherical(){
56 //_________________________
57 AliFemtoCorrFctn3DSpherical& AliFemtoCorrFctn3DSpherical::operator=(const AliFemtoCorrFctn3DSpherical& aCorrFctn)
59 // assignment operator
60 if (this == &aCorrFctn)
63 if (fNumerator) delete fNumerator;
64 fNumerator = new TH3D(*aCorrFctn.fNumerator);
65 if (fDenominator) delete fDenominator;
66 fDenominator = new TH3D(*aCorrFctn.fDenominator);
68 // fPairCut = aCorrFctn.fPairCut;
73 //_________________________
74 void AliFemtoCorrFctn3DSpherical::WriteOutHistos(){
75 // Write out all histograms to file
77 fDenominator->Write();
79 //______________________________
80 TList* AliFemtoCorrFctn3DSpherical::GetOutputList()
82 // Prepare the list of objects to be written to the output
83 TList *tOutputList = new TList();
85 tOutputList->Add(fNumerator);
86 tOutputList->Add(fDenominator);
91 //_________________________
92 void AliFemtoCorrFctn3DSpherical::Finish(){
93 // here is where we should normalize, fit, etc...
96 //____________________________
97 AliFemtoString AliFemtoCorrFctn3DSpherical::Report(){
98 // Construct the report
99 string stemp = "PRF Frame Spherical 3D Correlation Function Report:\n";
101 snprintf(ctemp , 100, "Number of entries in numerator:\t%E\n",fNumerator->GetEntries());
103 snprintf(ctemp , 100, "Number of entries in denominator:\t%E\n",fDenominator->GetEntries());
107 snprintf(ctemp , 100, "Here is the PairCut specific to this CorrFctn\n");
109 stemp += fPairCut->Report();
112 snprintf(ctemp , 100, "No PairCut specific to this CorrFctn\n");
117 AliFemtoString returnThis = stemp;
120 //____________________________
121 void AliFemtoCorrFctn3DSpherical::AddRealPair( AliFemtoPair* pair){
122 // perform operations on real pairs
124 if (!(fPairCut->Pass(pair))) return;
127 double tKO = pair->KOut();
128 double tKS = pair->KSide();
129 double tKL = pair->KLong();
131 double tKR = sqrt(tKO*tKO + tKS*tKS + tKL*tKL);
133 if ( fabs(tKR) < 1e-10 ) tKC = 0.0;
135 double tKP=atan2(tKS,tKO);
137 fNumerator->Fill(tKR,tKP,tKC);
139 //____________________________
140 void AliFemtoCorrFctn3DSpherical::AddMixedPair( AliFemtoPair* pair){
141 // perform operations on mixed pairs
143 if (!(fPairCut->Pass(pair))) return;
146 double tKO = pair->KOut();
147 double tKS = pair->KSide();
148 double tKL = pair->KLong();
150 double tKR = sqrt(tKO*tKO + tKS*tKS + tKL*tKL);
152 if ( fabs(tKR) < 1e-10 ) tKC = 0.0;
154 double tKP=atan2(tKS,tKO);
156 fDenominator->Fill(tKR,tKP,tKC);