1 /***************************************************************************
3 * $Id: AliFemtoCorrFctn3DSphercicalEMCIC.h $
5 * Author: Nicolas Bock, Ohio State University, bock@mps.ohio-state.edu
6 ***************************************************************************
8 * Description: Calculates of the 3D Correlation Function in Spherical
9 * coordinates, and also produces histograms to calculate
10 * Energy Momentum Conservation Induced Correlations (EMCICs)
12 * This Class produces the following histograms as function of Q, theta, phi
13 * (for both real and mixed pairs):
19 * This class is similar to AliFemtoCorrFctn3DSpherical, but it uses Q
20 * instead of K to do the binning.
22 * NOTE: The EMCIC histograms are not averaged in this class, to obtain
23 * the average, the user needs to divide the real pair histograms by
24 * the numerator, and the mixed pair histograms by the denominator.
26 ***************************************************************************
28 **************************************************************************/
30 #include "AliFemtoCorrFctn3DSphericalEMCIC.h"
36 ClassImp(AliFemtoCorrFctn3DSphericalEMCIC)
40 //____________________________
41 AliFemtoCorrFctn3DSphericalEMCIC::AliFemtoCorrFctn3DSphericalEMCIC(char* title, const int& nqbins, const float& QLo, const float& QHi, const int& nphibins, const int& ncthetabins):
56 // To better sample on phi shift bin low edge by binsize/2 = Pi/numBins.
57 Double_t shiftPhi=TMath::Pi()/nphibins;
59 char tTitNum[100] = "Num";
60 strcat(tTitNum,title);
61 fNumerator = new TH3D(tTitNum,title,nqbins,QLo,QHi,nphibins,
62 -TMath::Pi()-shiftPhi,TMath::Pi()-shiftPhi,ncthetabins,-1.0,1.0);
64 char tTitDen[100] = "Den";
65 strcat(tTitDen,title);
66 fDenominator = new TH3D(tTitDen,title,nqbins,QLo,QHi,nphibins,
67 -TMath::Pi()-shiftPhi,TMath::Pi()-shiftPhi,ncthetabins,-1.0,1.0);
69 //Added histograms to calculate EMCICs , Nicolas Bock 19.01.2010
70 //Setup EnergyTotalReal
71 char tTitNum1[100] = "ESumReal";
72 strcat(tTitNum1,title);
73 fEnergyTotalReal = new TH3D(tTitNum1,title,nqbins,QLo,QHi,nphibins,
74 -TMath::Pi()-shiftPhi,TMath::Pi()-shiftPhi,ncthetabins,-1.0,1.0);
76 //Setup EnergyMultReal
77 char tTitNum2[100] = "EMultReal";
78 strcat(tTitNum2,title);
79 fEnergyMultReal = new TH3D(tTitNum2,title,nqbins,QLo,QHi,nphibins,
80 -TMath::Pi()-shiftPhi,TMath::Pi()-shiftPhi,ncthetabins,-1.0,1.0);
83 char tTitNum3[100] = "PzMultReal";
84 strcat(tTitNum3,title);
85 fPzMultReal = new TH3D(tTitNum3,title,nqbins,QLo,QHi,nphibins,
86 -TMath::Pi()-shiftPhi,TMath::Pi()-shiftPhi,ncthetabins,-1.0,1.0);
89 char tTitNum4[100] = "PtMultReal";
90 strcat(tTitNum4,title);
91 fPtMultReal = new TH3D(tTitNum4,title,nqbins,QLo,QHi,nphibins,
92 -TMath::Pi()-shiftPhi,TMath::Pi()-shiftPhi,ncthetabins,-1.0,1.0);
96 //Setup EnergyTotalMix
97 char tTitNum5[100] = "ESumMix";
98 strcat(tTitNum5,title);
99 fEnergyTotalMix = new TH3D(tTitNum5,title,nqbins,QLo,QHi,nphibins,
100 -TMath::Pi()-shiftPhi,TMath::Pi()-shiftPhi,ncthetabins,-1.0,1.0);
102 //Setup EnergyMultMix
103 char tTitNum6[100] = "EMultMix";
104 strcat(tTitNum6,title);
105 fEnergyMultMix = new TH3D(tTitNum6,title,nqbins,QLo,QHi,nphibins,
106 -TMath::Pi()-shiftPhi,TMath::Pi()-shiftPhi,ncthetabins,-1.0,1.0);
109 char tTitNum7[100] = "PzMultMix";
110 strcat(tTitNum7,title);
111 fPzMultMix = new TH3D(tTitNum7,title,nqbins,QLo,QHi,nphibins,
112 -TMath::Pi()-shiftPhi,TMath::Pi()-shiftPhi,ncthetabins,-1.0,1.0);
115 char tTitNum8[100] = "PtMultMix";
116 strcat(tTitNum8,title);
117 fPtMultMix = new TH3D(tTitNum8,title,nqbins,QLo,QHi,nphibins,
118 -TMath::Pi()-shiftPhi,TMath::Pi()-shiftPhi,
119 ncthetabins,-1.0,1.0);
121 // to enable error bar calculation...
123 fDenominator->Sumw2();
124 fEnergyTotalReal->Sumw2();
125 fEnergyMultReal->Sumw2();
126 fPzMultReal->Sumw2();
127 fPtMultReal->Sumw2();
128 fEnergyTotalMix->Sumw2();
129 fEnergyMultMix->Sumw2();
136 AliFemtoCorrFctn3DSphericalEMCIC::AliFemtoCorrFctn3DSphericalEMCIC(const AliFemtoCorrFctn3DSphericalEMCIC& aCorrFctn) :
151 fNumerator = new TH3D(*aCorrFctn.fNumerator);
152 fDenominator = new TH3D(*aCorrFctn.fDenominator);
153 fEnergyTotalReal = new TH3D(*aCorrFctn.fEnergyTotalReal);
154 fEnergyMultReal = new TH3D(*aCorrFctn.fEnergyMultReal);
155 fPzMultReal = new TH3D(*aCorrFctn.fPzMultReal);
156 fPtMultReal = new TH3D(*aCorrFctn.fPtMultReal);
157 fEnergyTotalMix = new TH3D(*aCorrFctn.fEnergyTotalMix);
158 fEnergyMultMix = new TH3D(*aCorrFctn.fEnergyMultMix);
159 fPzMultMix = new TH3D(*aCorrFctn.fPzMultMix);
160 fPtMultMix = new TH3D(*aCorrFctn.fPtMultMix);
161 fPairCut = aCorrFctn.fPairCut;
163 //____________________________
164 AliFemtoCorrFctn3DSphericalEMCIC::~AliFemtoCorrFctn3DSphericalEMCIC(){
168 delete fEnergyTotalReal;
169 delete fEnergyMultReal;
172 delete fEnergyTotalMix;
173 delete fEnergyMultMix;
177 //_________________________
178 AliFemtoCorrFctn3DSphericalEMCIC& AliFemtoCorrFctn3DSphericalEMCIC::operator=(const AliFemtoCorrFctn3DSphericalEMCIC& aCorrFctn)
180 // assignment operator
181 if (this == &aCorrFctn)
184 if (fNumerator) delete fNumerator;
185 fNumerator = new TH3D(*aCorrFctn.fNumerator);
186 if (fDenominator) delete fDenominator;
187 fDenominator = new TH3D(*aCorrFctn.fDenominator);
188 if (fEnergyTotalReal) delete fEnergyTotalReal;
189 fEnergyTotalReal = new TH3D(*aCorrFctn.fEnergyTotalReal);
190 if (fEnergyMultReal) delete fEnergyMultReal;
191 fEnergyMultReal = new TH3D(*aCorrFctn.fEnergyMultReal);
192 if (fPzMultReal) delete fPzMultReal;
193 fPzMultReal = new TH3D(*aCorrFctn.fPzMultReal);
194 if (fPtMultReal) delete fPtMultReal;
195 fPtMultReal = new TH3D(*aCorrFctn.fPtMultReal);
196 if (fEnergyTotalMix) delete fEnergyTotalMix;
197 fEnergyTotalMix = new TH3D(*aCorrFctn.fEnergyTotalMix);
198 if (fEnergyMultMix) delete fEnergyMultMix;
199 fEnergyMultMix = new TH3D(*aCorrFctn.fEnergyMultMix);
200 if (fPzMultMix) delete fPzMultMix;
201 fPzMultMix = new TH3D(*aCorrFctn.fPzMultMix);
202 if (fPtMultMix) delete fPtMultMix;
203 fPtMultMix = new TH3D(*aCorrFctn.fPtMultMix);
204 fPairCut = aCorrFctn.fPairCut;
209 //_________________________
210 void AliFemtoCorrFctn3DSphericalEMCIC::WriteOutHistos(){
211 // Write out all histograms to file
213 fDenominator->Write();
214 fEnergyTotalReal->Write();
215 fEnergyMultReal->Write();
216 fPzMultReal->Write();
217 fPtMultReal->Write();
218 fEnergyTotalMix->Write();
219 fEnergyMultMix->Write();
223 //______________________________
224 TList* AliFemtoCorrFctn3DSphericalEMCIC::GetOutputList()
226 // Prepare the list of objects to be written to the output
227 TList *tOutputList = new TList();
229 tOutputList->Add(fNumerator);
230 tOutputList->Add(fDenominator);
231 tOutputList->Add(fEnergyTotalReal);
232 tOutputList->Add(fEnergyMultReal);
233 tOutputList->Add(fPzMultReal);
234 tOutputList->Add(fPtMultReal);
235 tOutputList->Add(fEnergyTotalMix );
236 tOutputList->Add(fEnergyMultMix );
237 tOutputList->Add(fPzMultMix);
238 tOutputList->Add(fPtMultMix);
242 //_________________________
243 void AliFemtoCorrFctn3DSphericalEMCIC::Finish(){
244 // here is where we should normalize, fit, etc...
247 //____________________________
248 AliFemtoString AliFemtoCorrFctn3DSphericalEMCIC::Report(){
249 // Construct the report
250 string stemp = "PRF Frame SphericalEMCIC 3D Correlation Function Report:\n";
252 sprintf(ctemp,"Number of entries in numerator:\t%E\n",fNumerator->GetEntries());
254 sprintf(ctemp,"Number of entries in denominator:\t%E\n",fDenominator->GetEntries());
258 sprintf(ctemp,"Here is the PairCut specific to this CorrFctn\n");
260 stemp += fPairCut->Report();
263 sprintf(ctemp,"No PairCut specific to this CorrFctn\n");
268 AliFemtoString returnThis = stemp;
271 //____________________________
272 void AliFemtoCorrFctn3DSphericalEMCIC::AddRealPair( AliFemtoPair* pair){
273 // perform operations on real pairs
275 if (!(fPairCut->Pass(pair))) return;
278 // //Changed K to Q to be in LCMS, N. Bock
279 double tKO = pair->QOutCMS(); //KOut();
280 double tKS = pair->QSideCMS(); //KSide();
281 double tKL = pair->QLongCMS(); // KLong();
283 double tKR = sqrt(tKO*tKO + tKS*tKS + tKL*tKL);
285 if ( fabs(tKR) < 1e-10 ) tKC = 0.0;
287 double tKP=atan2(tKS,tKO);
289 fNumerator->Fill(tKR,tKP,tKC);
292 AliFemtoLorentzVector tMom1 = pair->Track1()->FourMomentum();
293 AliFemtoLorentzVector tMom2 = pair->Track2()->FourMomentum();
294 double tE1 = tMom1.e();
295 double tE2 = tMom2.e();
296 double tPz1 = tMom1.pz();
297 double tPz2 = tMom2.pz();
300 cout <<"AddRealPair" << "E1,E2, K,Ks,KL" <<
301 tE1 <<" " << tE2<<" " << tKR <<" " << tKS <<" " << tKL<<endl;
302 tPt1.Set(tMom1.px(),tMom1.py());
303 tPt2.Set(tMom2.px(),tMom2.py());
304 double tPt1DotPt2=tPt1*tPt2;
306 fEnergyTotalReal->Fill(tKR,tKP,tKC,tE1+tE2);
307 fEnergyMultReal->Fill(tKR,tKP,tKC,tE1*tE2);
308 fPzMultReal->Fill(tKR,tKP,tKC,tPz1*tPz2);
309 fPtMultReal->Fill(tKR,tKP,tKC,tPt1DotPt2);
313 //____________________________
314 void AliFemtoCorrFctn3DSphericalEMCIC::AddMixedPair( AliFemtoPair* pair){
315 // perform operations on mixed pairs
317 if (!(fPairCut->Pass(pair))) return;
319 // //Changed K to Q to be in LCMS, N. Bock
320 double tKO = pair->QOutCMS(); //KOut();
321 double tKS = pair->QSideCMS(); //KSide();
322 double tKL = pair->QLongCMS(); // KLong();
324 double tKR = sqrt(tKO*tKO + tKS*tKS + tKL*tKL);
326 if ( fabs(tKR) < 1e-10 ) tKC = 0.0;
328 double tKP=atan2(tKS,tKO);
330 fDenominator->Fill(tKR,tKP,tKC);
333 AliFemtoLorentzVector tMom1 = pair->Track1()->FourMomentum();
334 AliFemtoLorentzVector tMom2 = pair->Track2()->FourMomentum();
335 double tE1 = tMom1.e();
336 double tE2 = tMom2.e();
337 double tPz1 = tMom1.pz();
338 double tPz2 = tMom2.pz();
341 tPt1.Set(tMom1.px(),tMom1.py());
342 tPt2.Set(tMom2.px(),tMom2.py());
343 double tPt1DotPt2=tPt1*tPt2;
345 fEnergyTotalMix->Fill(tKR,tKP,tKC,tE1+tE2);
346 fEnergyMultMix->Fill(tKR,tKP,tKC,tE1*tE2);
347 fPzMultMix->Fill(tKR,tKP,tKC,tPz1*tPz2);
348 fPtMultMix->Fill(tKR,tKP,tKC,tPt1DotPt2);