]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowCommon/AliFlowAnalysisWithMixedHarmonics.cxx
restore event cuts and change couts and printf's to alilog
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowCommon / AliFlowAnalysisWithMixedHarmonics.cxx
CommitLineData
489d5531 1/*************************************************************************
2* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
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. *
d66d46f7 14**************************************************************************/
15
489d5531 16/* $Id$ */
17
d66d46f7 18/**********************************************************
19 * In this class azimuthal correlators in mixed harmonics *
20 * are implemented in terms of Q-vectors. This approach *
21 * doesn't require evaluation of nested loops. This class *
22 * can be used to: *
23 * *
24 * a) Extract subdominant harmonics (like v1 and v4); *
5c078806 25 * b) Study flow of two-particle resonances; *
26 * c) Study strong parity violation. *
d66d46f7 27 * *
28 * Author: Ante Bilandzic (abilandzic@gmail.com) *
489d5531 29 *********************************************************/
30
31#define AliFlowAnalysisWithMixedHarmonics_cxx
32
33#include "Riostream.h"
34#include "AliFlowCommonConstants.h"
35#include "AliFlowCommonHist.h"
36#include "AliFlowCommonHistResults.h"
37
38#include "TMath.h"
39#include "TFile.h"
40#include "TList.h"
d66d46f7 41#include "TProfile.h"
489d5531 42#include "TProfile2D.h"
43
44#include "AliFlowEventSimple.h"
45#include "AliFlowTrackSimple.h"
46#include "AliFlowAnalysisWithMixedHarmonics.h"
47
48class TH1;
49class TList;
50ClassImp(AliFlowAnalysisWithMixedHarmonics)
51
d66d46f7 52//================================================================================================================
53
489d5531 54AliFlowAnalysisWithMixedHarmonics::AliFlowAnalysisWithMixedHarmonics():
d66d46f7 55fHistList(NULL),
489d5531 56fHistListName(NULL),
d66d46f7 57fAnalysisLabel(NULL),
58fAnalysisSettings(NULL),
5c078806 59fCorrelatorInteger(1),
d66d46f7 60fNoOfMultipicityBins(10),
61fMultipicityBinWidth(2),
62fMinMultiplicity(1),
489d5531 63fCorrectForDetectorEffects(kTRUE),
5c078806 64fPrintOnTheScreen(kTRUE),
d66d46f7 65fCommonHists(NULL),
489d5531 66fnBinsPhi(0),
67fPhiMin(0),
68fPhiMax(0),
69fPhiBinWidth(0),
70fnBinsPt(0),
71fPtMin(0),
72fPtMax(0),
73fPtBinWidth(0),
74fnBinsEta(0),
75fEtaMin(0),
76fEtaMax(0),
d66d46f7 77fEtaBinWidth(0),
489d5531 78fWeightsList(NULL),
79fUsePhiWeights(kFALSE),
80fUsePtWeights(kFALSE),
81fUseEtaWeights(kFALSE),
82fUseParticleWeights(NULL),
83fPhiWeights(NULL),
84fPtWeights(NULL),
d66d46f7 85fEtaWeights(NULL),
489d5531 86fReQnk(NULL),
87fImQnk(NULL),
d66d46f7 88fSpk(NULL),
89f3pCorrelatorEBE(NULL),
90fNonIsotropicTermsEBE(NULL),
ecac11c2 91fProfileList(NULL),
d66d46f7 92f3pCorrelatorPro(NULL),
93fNonIsotropicTermsPro(NULL),
94f3pCorrelatorVsMPro(NULL),
95fNonIsotropicTermsVsMPro(NULL),
96fResultsList(NULL),
97f3pCorrelatorHist(NULL),
98fDetectorBiasHist(NULL),
5c078806 99fDetectorBiasVsMHist(NULL)
489d5531 100{
101 // Constructor.
5c078806 102
103 // Base list to hold all output objects:
d66d46f7 104 fHistList = new TList();
489d5531 105 fHistListName = new TString("cobjMH");
106 fHistList->SetName(fHistListName->Data());
d66d46f7 107 fHistList->SetOwner(kTRUE);
108
489d5531 109 // List to hold histograms with phi, pt and eta weights:
d66d46f7 110 fWeightsList = new TList();
111
ecac11c2 112 // List to hold all all-event profiles:
113 fProfileList = new TList();
114
489d5531 115 // List to hold objects with final results:
d66d46f7 116 fResultsList = new TList();
5c078806 117
118 // Initialize all arrays:
119 this->InitializeArrays();
489d5531 120
121} // AliFlowAnalysisWithMixedHarmonics::AliFlowAnalysisWithMixedHarmonics()
122
123//================================================================================================================
124
125AliFlowAnalysisWithMixedHarmonics::~AliFlowAnalysisWithMixedHarmonics()
126{
127 // Destructor.
128
129 delete fHistList;
130
131} // end of AliFlowAnalysisWithMixedHarmonics::~AliFlowAnalysisWithMixedHarmonics()
132
133//================================================================================================================
134
135void AliFlowAnalysisWithMixedHarmonics::Init()
d66d46f7 136{
137 // Initialize and book all objects.
138
139 // a) Cross check if the user settings make sense before starting;
140 // b) Access all common constants;
489d5531 141 // c) Book and nest all lists in the base list fHistList;
d66d46f7 142 // d) Book common control histograms;
143 // e) Book all event-by-event quantities;
144 // f) Book all all-event quantities;
5c078806 145 // g) Book and fill histograms to hold phi, pt and eta weights;
146
489d5531 147 //save old value and prevent histograms from being added to directory
148 //to avoid name clashes in case multiple analaysis objects are used
149 //in an analysis
150 Bool_t oldHistAddStatus = TH1::AddDirectoryStatus();
151 TH1::AddDirectory(kFALSE);
152
5c078806 153 TH1::SetDefaultSumw2();
154
489d5531 155 this->CrossCheckSettings();
d66d46f7 156 this->AccessConstants();
157 this->BookAndNestAllLists();
489d5531 158 this->BookProfileHoldingSettings();
d66d46f7 159 this->BookCommonHistograms();
160 this->BookAllEventByEventQuantities();
161 this->BookAllAllEventQuantities();
489d5531 162 this->BookAndFillWeightsHistograms();
163
164 TH1::AddDirectory(oldHistAddStatus);
5c078806 165
489d5531 166} // end of void AliFlowAnalysisWithMixedHarmonics::Init()
167
168//================================================================================================================
169
170void AliFlowAnalysisWithMixedHarmonics::Make(AliFlowEventSimple* anEvent)
171{
172 // Running over data only in this method.
d66d46f7 173
5c078806 174 // a) Check all pointers used in this method;
175 // b) Define local variables;
176 // c) Fill common control histograms;
177 // d) Loop over data and calculate e-b-e quantities Q_{n,k} and S_{p,k};
178 // e) Calculate 3-p azimuthal correlator and non-isotropic terms in terms of Q_{n,k} and S_{p,k};
179 // f) Calculate differential 3-p azimuthal correlator cos(2phi1-psi2-psi3) in terms of Q_{2n} and p_{n}:
180 // g) Reset all event-by-event quantities.
d66d46f7 181
5c078806 182 // a) Check all pointers used in this method:
d66d46f7 183 this->CheckPointersUsedInMake();
184
5c078806 185 // b) Define local variables:
489d5531 186 Double_t dPhi = 0.; // azimuthal angle in the laboratory frame
187 Double_t dPt = 0.; // transverse momentum
188 Double_t dEta = 0.; // pseudorapidity
189 Double_t wPhi = 1.; // phi weight
190 Double_t wPt = 1.; // pt weight
d66d46f7 191 Double_t wEta = 1.; // eta weight
192 AliFlowTrackSimple *aftsTrack = NULL; // simple track
193
5c078806 194 // c) Fill common control histograms:
d66d46f7 195 fCommonHists->FillControlHistograms(anEvent);
196
5c078806 197 // d) Loop over data and calculate e-b-e quantities:
489d5531 198 Int_t nPrim = anEvent->NumberOfTracks(); // nPrim = total number of primary tracks, i.e. nPrim = nRP + nPOI + rest, where:
199 // nRP = # of particles used to determine the reaction plane ("Reference Particles");
200 // nPOI = # of particles of interest for a detailed flow analysis ("Particles of Interest");
201 // rest = # of particles which are not niether RPs nor POIs.
d66d46f7 202 // Start loop over data:
489d5531 203 for(Int_t i=0;i<nPrim;i++)
204 {
205 aftsTrack=anEvent->GetTrack(i);
206 if(aftsTrack)
207 {
208 if(!(aftsTrack->InRPSelection() || aftsTrack->InPOISelection())) continue; // consider only tracks which are either RPs or POIs
209 Int_t n = fCorrelatorInteger; // integer n in the correlator cos[n(2phi1-phi2-phi3)]
210 if(aftsTrack->InRPSelection()) // checking RP condition:
211 {
212 dPhi = aftsTrack->Phi();
213 dPt = aftsTrack->Pt();
214 dEta = aftsTrack->Eta();
215 if(fUsePhiWeights && fPhiWeights && fnBinsPhi) // determine phi-weight for this particle:
216 {
217 wPhi = fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*fnBinsPhi/TMath::TwoPi())));
218 }
219 if(fUsePtWeights && fPtWeights && fnBinsPt) // determine pt-weight for this particle:
220 {
221 wPt = fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-fPtMin)/fPtBinWidth)));
222 }
223 if(fUseEtaWeights && fEtaWeights && fEtaBinWidth) // determine eta-weight for this particle:
224 {
225 wEta = fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-fEtaMin)/fEtaBinWidth)));
226 }
227 // Calculate Re[Q_{m*n,k}] and Im[Q_{m*n,k}], (m = 1,2 and k = 0,1,2,3) for this event:
228 for(Int_t m=0;m<2;m++)
229 {
230 for(Int_t k=0;k<4;k++) // to be improved (what is maximum k that I need?)
231 {
232 (*fReQnk)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Cos((m+1)*n*dPhi);
233 (*fImQnk)(m,k)+=pow(wPhi*wPt*wEta,k)*TMath::Sin((m+1)*n*dPhi);
234 }
235 }
236 // Calculate partially S_{p,k} for this event (final calculation of S_{p,k} follows after the loop over data bellow):
237 for(Int_t p=0;p<4;p++) // to be improved (what is maximum p that I need?)
238 {
239 for(Int_t k=0;k<4;k++) // to be improved (what is maximum k that I need?)
240 {
241 (*fSpk)(p,k)+=pow(wPhi*wPt*wEta,k);
242 }
243 }
5c078806 244 } // end of if(aftsTrack->InRPSelection())
245 // POIs:
246 if(aftsTrack->InPOISelection()) // 1st POI
247 {
248 Double_t dPsi1 = aftsTrack->Phi();
249 Double_t dPt1 = aftsTrack->Pt();
250 for(Int_t j=i+1;j<nPrim;j++)
251 {
252 aftsTrack=anEvent->GetTrack(j);
253 if(aftsTrack->InPOISelection()) // 2nd POI
254 {
255 Double_t dPsi2 = aftsTrack->Phi();
256 Double_t dPt2 = aftsTrack->Pt();
257 // Fill:
258 fRePEBE[0]->Fill((dPt1+dPt2)/2.,TMath::Cos(n*(dPsi1+dPsi2)),1.);
259 fImPEBE[0]->Fill((dPt1+dPt2)/2.,TMath::Sin(n*(dPsi1+dPsi2)),1.);
260 fRePEBE[1]->Fill(TMath::Abs(dPt1-dPt2),TMath::Cos(n*(dPsi1+dPsi2)),1.);
261 fImPEBE[1]->Fill(TMath::Abs(dPt1-dPt2),TMath::Sin(n*(dPsi1+dPsi2)),1.);
262 }
263 }
264 }
489d5531 265 } else // to if(aftsTrack)
266 {
267 cout<<endl;
268 cout<<" WARNING (MH): No particle! (i.e. aftsTrack is a NULL pointer in AFAWMH::Make().)"<<endl;
269 cout<<endl;
270 }
271 } // end of for(Int_t i=0;i<nPrim;i++)
272
273 // Calculate the final expressions for S_{p,k}:
274 for(Int_t p=0;p<4;p++) // to be improved (what is maximum p that I need?)
275 {
276 for(Int_t k=0;k<4;k++) // to be improved (what is maximum that I need?)
277 {
278 (*fSpk)(p,k)=pow((*fSpk)(p,k),p+1);
279 }
d66d46f7 280 }
281
5c078806 282 // e) Calculate 3-p azimuthal correlator in terms of Q_{n,k} and S_{p,k}:
d66d46f7 283 if(anEvent->GetEventNSelTracksRP() >= 3)
284 {
285 this->Calculate3pCorrelator();
286 }
287 if(anEvent->GetEventNSelTracksRP() >= 0) // to be improved (is this correct if statement?)
288 {
289 this->CalculateNonIsotropicTerms();
290 }
291
5c078806 292 // f) Calculate differential 3-p azimuthal correlator cos(2phi1-psi2-psi3) in terms of Q_{2n} and p_{n}:
293 this->CalculateDifferential3pCorrelator(); // to be improved - add relevant if statements for the min No of RPs and POIs
294
295 // g) Reset all event-by-event quantities:
d66d46f7 296 this->ResetEventByEventQuantities();
5c078806 297
489d5531 298} // end of AliFlowAnalysisWithMixedHarmonics::Make(AliFlowEventSimple* anEvent)
5c078806 299
489d5531 300//================================================================================================================
301
302void AliFlowAnalysisWithMixedHarmonics::Finish()
303{
d66d46f7 304 // Calculate the final results.
305
306 // a) Check all pointers used in this method;
307 // b) Access settings for analysis with mixed harmonics;
5c078806 308 // c) Correct for detector effects;
309 // d) Print on the screen the final results.
d66d46f7 310
311 this->CheckPointersUsedInFinish();
312 this->AccessSettings();
5c078806 313 if(fCorrectForDetectorEffects) this->CorrectForDetectorEffects();
314 if(fPrintOnTheScreen) this->PrintOnTheScreen();
489d5531 315
316} // end of AliFlowAnalysisWithMixedHarmonics::Finish()
317
318//================================================================================================================
319
320void AliFlowAnalysisWithMixedHarmonics::GetOutputHistograms(TList *outputListHistos)
321{
d66d46f7 322 // Get pointers to all objects saved in the output file.
323
ecac11c2 324 // a) Get pointers for common control histograms.
489d5531 325 if(outputListHistos)
326 {
d66d46f7 327 this->SetHistList(outputListHistos);
328 if(!fHistList)
329 {
330 cout<<endl;
331 cout<<" WARNING (MH): fHistList is NULL in AFAWMH::GOH() !!!!"<<endl;
332 cout<<endl;
333 exit(0);
334 }
ecac11c2 335 this->GetPointersForBaseHistograms();
d66d46f7 336 this->GetPointersForCommonHistograms();
ecac11c2 337 this->GetPointersForAllEventProfiles();
489d5531 338 this->GetPointersForResultsHistograms();
d66d46f7 339 } else
340 {
341 cout<<endl;
342 cout<<" WARNING (MH): outputListHistos is NULL in AFAWMH::GOH() !!!!"<<endl;
343 cout<<endl;
344 exit(0);
345 }
489d5531 346
347} // end of void AliFlowAnalysisWithMixedHarmonics::GetOutputHistograms(TList *outputListHistos)
348
d66d46f7 349//================================================================================================================
350
ecac11c2 351void AliFlowAnalysisWithMixedHarmonics::GetPointersForBaseHistograms()
352{
353 // Get pointers to base histograms.
354
355 TString analysisSettingsName = "fAnalysisSettings";
356 TProfile *analysisSettings = dynamic_cast<TProfile*>(fHistList->FindObject(analysisSettingsName.Data()));
357 if(analysisSettings)
358 {
359 this->SetAnalysisSettings(analysisSettings);
360 } else
361 {
362 cout<<endl;
363 cout<<" WARNING (MH): analysisSettings is NULL in AFAWMH::GPFBH() !!!!"<<endl;
364 cout<<endl;
365 exit(0);
366 }
367
368} // end of void AliFlowAnalysisWithMixedHarmonics::GetPointersForBaseHistograms()
369
370//================================================================================================================
371
489d5531 372void AliFlowAnalysisWithMixedHarmonics::GetPointersForCommonHistograms()
373{
374 // Get pointers to common control histograms.
375
376 TString commonHistsName = "AliFlowCommonHistMH";
377 AliFlowCommonHist *commonHist = dynamic_cast<AliFlowCommonHist*>(fHistList->FindObject(commonHistsName.Data()));
d66d46f7 378 if(commonHist)
379 {
380 this->SetCommonHists(commonHist);
381 } else
382 {
383 cout<<endl;
384 cout<<" WARNING (MH): commonHist is NULL in AFAWMH::GPFCH() !!!!"<<endl;
385 cout<<endl;
386 exit(0);
387 }
388
389} // end of void AliFlowAnalysisWithMixedHarmonics::GetPointersForCommonHistograms()
390
391//================================================================================================================
392
ecac11c2 393void AliFlowAnalysisWithMixedHarmonics::GetPointersForAllEventProfiles()
394{
5c078806 395 // Get pointers to profiles holding final results.
ecac11c2 396
397 TList *profileList = NULL;
398 profileList = dynamic_cast<TList*>(fHistList->FindObject("Profiles"));
399 if(!profileList)
400 {
401 cout<<"WARNING: profileList is NULL in AFAWMH::GPFAEP() !!!!"<<endl;
402 exit(0);
403 }
404
405 TString s3pCorrelatorProName = "f3pCorrelatorPro";
5c078806 406 TProfile *p3pCorrelatorPro = dynamic_cast<TProfile*>(profileList->FindObject(s3pCorrelatorProName.Data()));
407 if(p3pCorrelatorPro)
ecac11c2 408 {
5c078806 409 this->Set3pCorrelatorPro(p3pCorrelatorPro);
ecac11c2 410 }
411 TString s3pCorrelatorVsMProName = "f3pCorrelatorVsMPro";
5c078806 412 TProfile *p3pCorrelatorVsMPro = dynamic_cast<TProfile*>(profileList->FindObject(s3pCorrelatorVsMProName.Data()));
413 if(p3pCorrelatorVsMPro)
ecac11c2 414 {
5c078806 415 this->Set3pCorrelatorVsMPro(p3pCorrelatorVsMPro);
ecac11c2 416 }
417 TString nonIsotropicTermsProName = "fNonIsotropicTermsPro";
418 TProfile *nonIsotropicTermsPro = dynamic_cast<TProfile*>(profileList->FindObject(nonIsotropicTermsProName.Data()));
419 if(nonIsotropicTermsPro)
420 {
421 this->SetNonIsotropicTermsPro(nonIsotropicTermsPro);
422 }
423 TString nonIsotropicTermsVsMProName = "fNonIsotropicTermsVsMPro";
424 TProfile2D *nonIsotropicTermsVsMPro = dynamic_cast<TProfile2D*>(profileList->FindObject(nonIsotropicTermsVsMProName.Data()));
425 if(nonIsotropicTermsVsMPro)
426 {
427 this->SetNonIsotropicTermsVsMPro(nonIsotropicTermsVsMPro);
5c078806 428 }
429 TString psdFlag[2] = {"PtSum","PtDiff"};
430 for(Int_t sd=0;sd<2;sd++)
431 {
432 TProfile *p3pCorrelatorVsPtSumDiffPro = dynamic_cast<TProfile*>(profileList->FindObject(Form("f3pCorrelatorVs%sPro",psdFlag[sd].Data())));
433 if(p3pCorrelatorVsPtSumDiffPro)
434 {
435 this->Set3pCorrelatorVsPtSumDiffPro(p3pCorrelatorVsPtSumDiffPro,sd);
436 }
437 }
438
ecac11c2 439} // end of void AliFlowAnalysisWithMixedHarmonics::GetPointersForAllEventProfiles()
440
441//================================================================================================================
442
489d5531 443void AliFlowAnalysisWithMixedHarmonics::GetPointersForResultsHistograms()
444{
445 // Get pointers to histograms holding final results.
446
447 TList *resultsList = NULL;
448 resultsList = dynamic_cast<TList*>(fHistList->FindObject("Results"));
449 if(!resultsList)
450 {
451 cout<<"WARNING: resultsList is NULL in AFAWMH::GPFRH() !!!!"<<endl;
452 exit(0);
d66d46f7 453 }
489d5531 454 TString s3pCorrelatorHistName = "f3pCorrelatorHist";
455 TH1D *h3pCorrelatorHist = dynamic_cast<TH1D*>(resultsList->FindObject(s3pCorrelatorHistName.Data()));
456 if(h3pCorrelatorHist)
457 {
458 this->Set3pCorrelatorHist(h3pCorrelatorHist);
d66d46f7 459 }
489d5531 460 TString detectorBiasHistName = "fDetectorBiasHist";
461 TH1D *detectorBiasHist = dynamic_cast<TH1D*>(resultsList->FindObject(detectorBiasHistName.Data()));
462 if(detectorBiasHist)
463 {
464 this->SetDetectorBiasHist(detectorBiasHist);
d66d46f7 465 }
ecac11c2 466 TString detectorBiasVsMHistName = "fDetectorBiasVsMHist";
467 TH1D *detectorBiasVsMHist = dynamic_cast<TH1D*>(resultsList->FindObject(detectorBiasVsMHistName.Data()));
468 if(detectorBiasVsMHist)
469 {
470 this->SetDetectorBiasVsMHist(detectorBiasVsMHist);
471 }
ecac11c2 472
d66d46f7 473} // end of void AliFlowAnalysisWithMixedHarmonics::GetPointersForResultsHistograms()
489d5531 474
d66d46f7 475//================================================================================================================
476
489d5531 477void AliFlowAnalysisWithMixedHarmonics::WriteHistograms(TString outputFileName)
478{
479 // Store the final results in output .root file.
480 TFile *output = new TFile(outputFileName.Data(),"RECREATE");
481 fHistList->Write(fHistList->GetName(),TObject::kSingleKey);
482 delete output;
483}
484
485//================================================================================================================
d66d46f7 486
487void AliFlowAnalysisWithMixedHarmonics::WriteHistograms(TDirectoryFile *outputFileName)
488{
489 // Store the final results in output .root file.
490 fHistList->SetName("cobjMH");
491 fHistList->SetOwner(kTRUE);
492 outputFileName->Add(fHistList);
493 outputFileName->Write(outputFileName->GetName(),TObject::kSingleKey);
494}
495
496//================================================================================================================
497
5c078806 498void AliFlowAnalysisWithMixedHarmonics::InitializeArrays()
499{
500 // Initialize arrays.
501
502 for(Int_t sd=0;sd<2;sd++)
503 {
504 fRePEBE[sd] = NULL;
505 fImPEBE[sd] = NULL;
506 f3pCorrelatorVsPtSumDiffPro[sd] = NULL;
507 }
508
509} // end of AliFlowAnalysisWithMixedHarmonics::InitializeArrays()
510
511//================================================================================================================
512
489d5531 513void AliFlowAnalysisWithMixedHarmonics::BookAndNestAllLists()
d66d46f7 514{
515 // Book and nest all list in base list fHistList.
516
517 // Weights:
489d5531 518 fWeightsList->SetName("Weights");
519 fWeightsList->SetOwner(kTRUE);
d66d46f7 520 fHistList->Add(fWeightsList);
ecac11c2 521 // Profiles:
522 fProfileList->SetName("Profiles");
523 fProfileList->SetOwner(kTRUE);
524 fHistList->Add(fProfileList);
d66d46f7 525 // Results:
489d5531 526 fResultsList->SetName("Results");
527 fResultsList->SetOwner(kTRUE);
d66d46f7 528 fHistList->Add(fResultsList);
529
530} // end of void AliFlowAnalysisWithMixedHarmonics::BookAndNestAllLists()
531
532//================================================================================================================
533
489d5531 534void AliFlowAnalysisWithMixedHarmonics::BookProfileHoldingSettings()
d66d46f7 535{
536 // Book profile to hold all analysis settings.
537
489d5531 538 TString analysisSettingsName = "fAnalysisSettings";
5c078806 539 fAnalysisSettings = new TProfile(analysisSettingsName.Data(),"Settings for analysis with mixed harmonics",6,0,6);
540 fAnalysisSettings->GetXaxis()->SetLabelSize(0.025);
d66d46f7 541 fAnalysisSettings->GetXaxis()->SetBinLabel(1,"Integer n in cos(n(2#phi_{1}-#phi_{2}-#phi_{3}))");
489d5531 542 fAnalysisSettings->Fill(0.5,fCorrelatorInteger);
d66d46f7 543 fAnalysisSettings->GetXaxis()->SetBinLabel(2,"Corrected for detector effects?");
544 fAnalysisSettings->Fill(1.5,(Int_t)fCorrectForDetectorEffects);
545 fAnalysisSettings->GetXaxis()->SetBinLabel(3,"# of multiplicity bins");
546 fAnalysisSettings->Fill(2.5,fNoOfMultipicityBins);
547 fAnalysisSettings->GetXaxis()->SetBinLabel(4,"Width of multiplicity bins");
548 fAnalysisSettings->Fill(3.5,fMultipicityBinWidth);
549 fAnalysisSettings->GetXaxis()->SetBinLabel(5,"Minimal multiplicity");
550 fAnalysisSettings->Fill(4.5,fMinMultiplicity);
5c078806 551 fAnalysisSettings->GetXaxis()->SetBinLabel(6,"Print on the screen?");
552 fAnalysisSettings->Fill(5.5,(Int_t)fPrintOnTheScreen);
d66d46f7 553 fHistList->Add(fAnalysisSettings);
554
555} // end of void AliFlowAnalysisWithMixedHarmonics::BookProfileHoldingSettings()
489d5531 556
d66d46f7 557//================================================================================================================
558
489d5531 559void AliFlowAnalysisWithMixedHarmonics::BookCommonHistograms()
560{
d66d46f7 561 // Book common control histograms and common histograms for final results.
489d5531 562
563 TString commonHistsName = "AliFlowCommonHistMH";
564 fCommonHists = new AliFlowCommonHist(commonHistsName.Data());
565 fHistList->Add(fCommonHists);
566
567} // end of void AliFlowAnalysisWithMixedHarmonics::BookCommonHistograms()
d66d46f7 568
569//================================================================================================================
570
489d5531 571void AliFlowAnalysisWithMixedHarmonics::BookAllEventByEventQuantities()
572{
d66d46f7 573 // Book all event-by-event quantitites.
574
575 // Q_{n,k} and S{p,k}:
489d5531 576 fReQnk = new TMatrixD(2,4); // to be improved(bound on k)
577 fImQnk = new TMatrixD(2,4); // to be improved(bound on k)
d66d46f7 578 fSpk = new TMatrixD(4,4); // to be improved(bound on p and k)
579 // 3-p correlator <cos[n(2phi1-phi2-phi3)]> for single event:
489d5531 580 TString s3pCorrelatorEBEName = "f3pCorrelatorEBE";
d66d46f7 581 f3pCorrelatorEBE = new TH1D(s3pCorrelatorEBEName.Data(),"<cos[n(2#phi_{1}-#phi_{2}-#phi_{3})]> for single event",1,0,1);
582 // Correction terms for non-uniform acceptance to <cos[n(2phi1-phi2-phi3)]> for single event:
489d5531 583 TString nonIsotropicTermsEBEName = "fNonIsotropicTermsEBE";
d66d46f7 584 fNonIsotropicTermsEBE = new TH1D(nonIsotropicTermsEBEName.Data(),"Non-isotropic terms for single event",10,0,10);
5c078806 585
586 // p_n vs [(p1+p2)/2,|p1-p2|]
587 TString psdFlag[2] = {"PtSum","PtDiff"};
588 for(Int_t sd=0;sd<2;sd++)
589 {
590 // to be improved: hardwired ,fnBinsPt,0.,fPtMax):
591 fRePEBE[sd] = new TProfile(Form("fRePEBE%s",psdFlag[sd].Data()),"",fnBinsPt,0.,fPtMax);
592 fImPEBE[sd] = new TProfile(Form("fImPEBE%s",psdFlag[sd].Data()),"",fnBinsPt,0.,fPtMax);
593 }
594
489d5531 595} // end fo void AliFlowAnalysisWithMixedHarmonics::BookAllEventByEventQuantities()
5c078806 596
d66d46f7 597//================================================================================================================
598
599void AliFlowAnalysisWithMixedHarmonics::BookAllAllEventQuantities()
600{
601 // Book all all-event quantitites.
602
603 // a) Book quantites without multiplicity binning;
5c078806 604 // b) Book quantites with multiplicity binning;
605 // c) Book quantities with binning in (p1+p2)/2, |p1-p2|, (eta1+eta2)/2 or |eta1-eta2|.
606
d66d46f7 607 // a) Book quantites without multiplicity binning:
5c078806 608 // 3-p correlator <<cos[n(2phi1-phi2-phi3)]>> for all events:
489d5531 609 TString s3pCorrelatorProName = "f3pCorrelatorPro";
5c078806 610 f3pCorrelatorPro = new TProfile(s3pCorrelatorProName.Data(),"",1,0,1);
611 f3pCorrelatorPro->GetXaxis()->SetLabelOffset(0.01);
612 f3pCorrelatorPro->GetXaxis()->SetLabelSize(0.05);
613 if(fCorrelatorInteger == 1)
614 {
615 f3pCorrelatorPro->GetXaxis()->SetBinLabel(1,"cos(2#phi_{1}-#phi_{2}-#phi_{3})");
616 } else
617 {
618 f3pCorrelatorPro->GetXaxis()->SetBinLabel(1,Form("cos[%d(2#phi_{1}-#phi_{2}-#phi_{3})]",fCorrelatorInteger));
619 }
ecac11c2 620 fProfileList->Add(f3pCorrelatorPro);
5c078806 621 // Non-isotropic terms in the decomposition of <cos[n(2phi1-phi2-phi3)]:
489d5531 622 TString nonIsotropicTermsProName = "fNonIsotropicTermsPro";
5c078806 623 fNonIsotropicTermsPro = new TProfile(nonIsotropicTermsProName.Data(),"",10,0,10);
624 if(fCorrelatorInteger == 1)
625 {
626 fNonIsotropicTermsPro->SetTitle("Non-isotropic terms in decomposition of cos(2#phi_{1}-#phi_{2}-#phi_{3})");
627 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(1,"cos(#phi_{1})");
628 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(2,"sin(#phi_{1})");
629 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(3,"cos(2#phi_{1})");
630 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(4,"sin(2#phi_{1})");
631 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(5,"cos(#phi_{1}+#phi_{2})");
632 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(6,"sin(#phi_{1}+#phi_{2})");
633 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(7,"cos(2#phi_{1}-#phi_{2})");
634 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(8,"sin(2#phi_{1}-#phi_{2})");
635 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(9,"cos(#phi_{1}-#phi_{2}-#phi_{3})");
636 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(10,"sin(#phi_{1}-#phi_{2}-#phi_{3})");
637 } else
638 {
639 fNonIsotropicTermsPro->SetTitle(Form("Non-isotropic terms in decomposition of cos[%d(2#phi_{1}-#phi_{2}-#phi_{3})]",fCorrelatorInteger));
640 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(1,Form("cos(%d#phi_{1})",fCorrelatorInteger));
641 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(2,Form("sin(%d#phi_{1})",fCorrelatorInteger));
642 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(3,Form("cos(%d#phi_{1})",2*fCorrelatorInteger));
643 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(4,Form("sin(%d#phi_{1})",2*fCorrelatorInteger));
644 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(5,Form("cos(%d(#phi_{1}+#phi_{2}))",fCorrelatorInteger));
645 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(6,Form("sin(%d(#phi_{1}+#phi_{2}))",fCorrelatorInteger));
646 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(7,Form("cos(%d(2#phi_{1}-#phi_{2}))",fCorrelatorInteger));
647 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(8,Form("sin(%d(2#phi_{1}-#phi_{2}))",fCorrelatorInteger));
648 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(9,Form("cos(%d(#phi_{1}-#phi_{2}-#phi_{3}))",fCorrelatorInteger));
649 fNonIsotropicTermsPro->GetXaxis()->SetBinLabel(10,Form("sin(%d(#phi_{1}-#phi_{2}-#phi_{3}))",fCorrelatorInteger));
650 }
ecac11c2 651 fProfileList->Add(fNonIsotropicTermsPro);
5c078806 652 // 3-p correlator <<cos[n(2phi1-phi2-phi3)]>> corrected for detector effects:
653 TString s3pCorrelatorHistName = "f3pCorrelatorHist";
654 f3pCorrelatorHist = new TH1D(s3pCorrelatorHistName.Data(),"",1,0,1);
655 f3pCorrelatorHist->GetXaxis()->SetLabelOffset(0.01);
656 f3pCorrelatorHist->GetXaxis()->SetLabelSize(0.05);
657 if(fCorrelatorInteger == 1)
658 {
659 f3pCorrelatorHist->GetXaxis()->SetBinLabel(1,"cos(2#phi_{1}-#phi_{2}-#phi_{3})");
660 } else
661 {
662 f3pCorrelatorHist->GetXaxis()->SetBinLabel(1,Form("cos[%d(2#phi_{1}-#phi_{2}-#phi_{3})]",fCorrelatorInteger));
663 }
664 fResultsList->Add(f3pCorrelatorHist);
665 // Quantified bias comming from detector inefficiencies to 3-p correlator <<cos[n(2phi1-phi2-phi3)]>>:
489d5531 666 TString detectorBiasHistName = "fDetectorBiasHist";
d66d46f7 667 fDetectorBiasHist = new TH1D(detectorBiasHistName.Data(),"Bias coming from detector inefficiences",1,0,1);
5c078806 668 fDetectorBiasHist->GetXaxis()->SetBinLabel(1,"#frac{corrected}{measured}");
d66d46f7 669 fResultsList->Add(fDetectorBiasHist);
670
671 // b) Book quantites with multiplicity binning.
5c078806 672 // 3-p correlator <<cos[n(2phi1-phi2-phi3)]>> versus multiplicity:
489d5531 673 TString s3pCorrelatorVsMProName = "f3pCorrelatorVsMPro";
5c078806 674 f3pCorrelatorVsMPro = new TProfile(s3pCorrelatorVsMProName.Data(),"",fNoOfMultipicityBins+2,0,fNoOfMultipicityBins+2);
675 if(fCorrelatorInteger == 1)
d66d46f7 676 {
5c078806 677 f3pCorrelatorVsMPro->SetTitle("cos(2#phi_{1}-#phi_{2}-#phi_{3}) #font[72]{vs} M");
678 } else
679 {
680 f3pCorrelatorVsMPro->SetTitle(Form("cos[%d(2#phi_{1}-#phi_{2}-#phi_{3})] #font[72]{vs} M",fCorrelatorInteger));
681 }
682 f3pCorrelatorVsMPro->GetXaxis()->SetBinLabel(1,Form("M < %d",(Int_t)fMinMultiplicity));
683 for(Int_t b=2;b<=fNoOfMultipicityBins+1;b++)
d66d46f7 684 {
5c078806 685 f3pCorrelatorVsMPro->GetXaxis()->SetBinLabel(b,Form("%d #leq M < %d",(Int_t)(fMinMultiplicity+(b-2)*fMultipicityBinWidth),(Int_t)(fMinMultiplicity+(b-1)*fMultipicityBinWidth)));
d66d46f7 686 }
5c078806 687 f3pCorrelatorVsMPro->GetXaxis()->SetBinLabel(fNoOfMultipicityBins+2,Form(" M #geq %d",(Int_t)(fMinMultiplicity+fNoOfMultipicityBins*fMultipicityBinWidth)));
688 fProfileList->Add(f3pCorrelatorVsMPro);
689 // Non-isotropic terms in the decomposition of <cos[n(2phi1-phi2-phi3)] vs multiplicity:
489d5531 690 TString nonIsotropicTermsVsMProName = "fNonIsotropicTermsVsMPro";
5c078806 691 fNonIsotropicTermsVsMPro = new TProfile2D(nonIsotropicTermsVsMProName.Data(),"Non-isotropic terms in the decomposition of cos[n(2phi1-phi2-phi3)] #font[72]{vs} M",10,0,10,fNoOfMultipicityBins+2,0,fNoOfMultipicityBins+2);
692 if(fCorrelatorInteger == 1)
d66d46f7 693 {
5c078806 694 fNonIsotropicTermsVsMPro->SetTitle("Non-isotropic terms in decomposition of cos(2#phi_{1}-#phi_{2}-#phi_{3}) #font[72]{vs} M");
695 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(1,"cos(#phi_{1})");
696 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(2,"sin(#phi_{1})");
697 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(3,"cos(2#phi_{1})");
698 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(4,"sin(2#phi_{1})");
699 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(5,"cos(#phi_{1}+#phi_{2})");
700 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(6,"sin(#phi_{1}+#phi_{2})");
701 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(7,"cos(2#phi_{1}-#phi_{2})");
702 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(8,"sin(2#phi_{1}-#phi_{2})");
703 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(9,"cos(#phi_{1}-#phi_{2}-#phi_{3})");
704 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(10,"sin(#phi_{1}-#phi_{2}-#phi_{3})");
705 } else
706 {
707 fNonIsotropicTermsVsMPro->SetTitle(Form("Non-isotropic terms in decomposition of cos[%d(2#phi_{1}-#phi_{2}-#phi_{3})]",fCorrelatorInteger));
708 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(1,Form("cos(%d#phi_{1})",fCorrelatorInteger));
709 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(2,Form("sin(%d#phi_{1})",fCorrelatorInteger));
710 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(3,Form("cos(%d#phi_{1})",2*fCorrelatorInteger));
711 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(4,Form("sin(%d#phi_{1})",2*fCorrelatorInteger));
712 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(5,Form("cos(%d(#phi_{1}+#phi_{2}))",fCorrelatorInteger));
713 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(6,Form("sin(%d(#phi_{1}+#phi_{2}))",fCorrelatorInteger));
714 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(7,Form("cos(%d(2#phi_{1}-#phi_{2}))",fCorrelatorInteger));
715 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(8,Form("sin(%d(2#phi_{1}-#phi_{2}))",fCorrelatorInteger));
716 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(9,Form("cos(%d(#phi_{1}-#phi_{2}-#phi_{3}))",fCorrelatorInteger));
717 fNonIsotropicTermsVsMPro->GetXaxis()->SetBinLabel(10,Form("sin(%d(#phi_{1}-#phi_{2}-#phi_{3}))",fCorrelatorInteger));
718 }
719 fNonIsotropicTermsVsMPro->GetYaxis()->SetBinLabel(1,Form("M < %d",(Int_t)fMinMultiplicity));
720 for(Int_t b=2;b<=fNoOfMultipicityBins+1;b++)
d66d46f7 721 {
5c078806 722 fNonIsotropicTermsVsMPro->GetYaxis()->SetBinLabel(b,Form("%d #leq M < %d",(Int_t)(fMinMultiplicity+(b-2)*fMultipicityBinWidth),(Int_t)(fMinMultiplicity+(b-1)*fMultipicityBinWidth)));
d66d46f7 723 }
5c078806 724 fNonIsotropicTermsVsMPro->GetYaxis()->SetBinLabel(fNoOfMultipicityBins+2,Form(" M #geq %d",(Int_t)(fMinMultiplicity+fNoOfMultipicityBins*fMultipicityBinWidth)));
725 fProfileList->Add(fNonIsotropicTermsVsMPro);
d66d46f7 726 // Quantified bias comming from detector inefficiencies to 3-p correlator <<cos[n(2phi1-phi2-phi3)]>> (in %)
489d5531 727 TString detectorBiasVsMHistName = "fDetectorBiasVsMHist";
5c078806 728 fDetectorBiasVsMHist = new TH1D(detectorBiasVsMHistName.Data(),"",fNoOfMultipicityBins+1,0,fNoOfMultipicityBins+1);
d66d46f7 729 for(Int_t b=1;b<=fNoOfMultipicityBins;b++)
730 {
5c078806 731 fDetectorBiasVsMHist->GetXaxis()->SetBinLabel(b,Form("%d #leq M < %d",(Int_t)(fMinMultiplicity+(b-1)*fMultipicityBinWidth),(Int_t)(fMinMultiplicity+b*fMultipicityBinWidth))); // to be imroved - wrong labeling - see other vs M profiles for correct version
d66d46f7 732 }
733 fDetectorBiasVsMHist->GetXaxis()->SetBinLabel(fNoOfMultipicityBins+1,Form(" M #geq %d",(Int_t)(fMinMultiplicity+fNoOfMultipicityBins*fMultipicityBinWidth)));
5c078806 734 //fResultsList->Add(fDetectorBiasVsMHist); // to be improved - calculated and added eventually
d66d46f7 735
5c078806 736 // c) Book quantities with binning in (p1+p2)/2, |p1-p2|, (eta1+eta2)/2 or |eta1-eta2|:
737 TString psdFlag[2] = {"PtSum","PtDiff"};
738 TString psdTitleFlag[2] = {"(p_{t,1}+p_{t,2})/2","#left|p_{t,1}-p_{t,2}#right|"};
739 //TString s3pCorrelatorVsPtSumDiffProName = "f3pCorrelatorVsPtSumDiffPro";
740 for(Int_t sd=0;sd<2;sd++)
741 {
742 // to be improved: hardwired ,fnBinsPt,0.,fPtMax):
743 f3pCorrelatorVsPtSumDiffPro[sd] = new TProfile(Form("f3pCorrelatorVs%sPro",psdFlag[sd].Data()),"",fnBinsPt,0.,fPtMax);
744 //f3pCorrelatorVsPtSumDiffPro[sd]->SetLabelSize(0.05);
745 //f3pCorrelatorVsPtSumDiffPro[sd]->SetMarkerStyle(25);
746 f3pCorrelatorVsPtSumDiffPro[sd]->GetXaxis()->SetTitle(psdTitleFlag[sd].Data());
747 fProfileList->Add(f3pCorrelatorVsPtSumDiffPro[sd]);
748 }
749
d66d46f7 750} // end of void AliFlowAnalysisWithMixedHarmonics::BookAllAllEventQuantities()
489d5531 751
d66d46f7 752//================================================================================================================
753
489d5531 754void AliFlowAnalysisWithMixedHarmonics::AccessConstants()
755{
756 // Access needed common constants from AliFlowCommonConstants.
757
758 fnBinsPhi = AliFlowCommonConstants::GetMaster()->GetNbinsPhi();
759 fPhiMin = AliFlowCommonConstants::GetMaster()->GetPhiMin();
760 fPhiMax = AliFlowCommonConstants::GetMaster()->GetPhiMax();
761 if(fnBinsPhi) fPhiBinWidth = (fPhiMax-fPhiMin)/fnBinsPhi;
762 fnBinsPt = AliFlowCommonConstants::GetMaster()->GetNbinsPt();
763 fPtMin = AliFlowCommonConstants::GetMaster()->GetPtMin();
764 fPtMax = AliFlowCommonConstants::GetMaster()->GetPtMax();
765 if(fnBinsPt) fPtBinWidth = (fPtMax-fPtMin)/fnBinsPt;
766 fnBinsEta = AliFlowCommonConstants::GetMaster()->GetNbinsEta();
767 fEtaMin = AliFlowCommonConstants::GetMaster()->GetEtaMin();
768 fEtaMax = AliFlowCommonConstants::GetMaster()->GetEtaMax();
769 if(fnBinsEta) fEtaBinWidth = (fEtaMax-fEtaMin)/fnBinsEta;
770
d66d46f7 771} // end of void AliFlowAnalysisWithMixedHarmonics::AccessConstants()
772
489d5531 773//================================================================================================================
774
775void AliFlowAnalysisWithMixedHarmonics::CrossCheckSettings()
776{
777 // Cross-check if the user settings make sense.
778
779} // end of void AliFlowAnalysisWithMixedHarmonics::CrossCheckSettings()
780
781//================================================================================================================
782
783void AliFlowAnalysisWithMixedHarmonics::BookAndFillWeightsHistograms()
784{
785 // Book and fill (by accessing file "weights.root") histograms which hold phi, pt and eta weights.
786
787 if(!fWeightsList)
788 {
789 cout<<"WARNING: fWeightsList is NULL in AFAWMH::BAFWH() !!!!"<<endl;
790 exit(0);
791 }
792 // Profile to hold flags for weights:
793 TString fUseParticleWeightsName = "fUseParticleWeightsMH";
794 fUseParticleWeights = new TProfile(fUseParticleWeightsName.Data(),"0 = particle weight not used, 1 = particle weight used ",3,0,3);
795 fUseParticleWeights->SetLabelSize(0.06);
796 (fUseParticleWeights->GetXaxis())->SetBinLabel(1,"w_{#phi}");
797 (fUseParticleWeights->GetXaxis())->SetBinLabel(2,"w_{p_{T}}");
798 (fUseParticleWeights->GetXaxis())->SetBinLabel(3,"w_{#eta}");
799 fUseParticleWeights->Fill(0.5,(Int_t)fUsePhiWeights);
800 fUseParticleWeights->Fill(1.5,(Int_t)fUsePtWeights);
801 fUseParticleWeights->Fill(2.5,(Int_t)fUseEtaWeights);
802 fWeightsList->Add(fUseParticleWeights);
803 // Phi-weights:
804 if(fUsePhiWeights)
805 {
806 if(fWeightsList->FindObject("phi_weights"))
807 {
808 fPhiWeights = dynamic_cast<TH1F*>(fWeightsList->FindObject("phi_weights"));
809 if(TMath::Abs(fPhiWeights->GetBinWidth(1)-fPhiBinWidth)>pow(10.,-6.))
810 {
d66d46f7 811 cout<<endl;
489d5531 812 cout<<"WARNING (MH): Inconsistent binning in histograms for phi-weights throughout the code."<<endl;
d66d46f7 813 cout<<endl;
489d5531 814 exit(0);
815 }
816 } else
817 {
818 cout<<"WARNING (MH): fWeightsList->FindObject(\"phi_weights\") is NULL in AFAWMH::BAFWH() !!!!"<<endl;
819 exit(0);
820 }
821 } // end of if(fUsePhiWeights)
822 // Pt-weights:
823 if(fUsePtWeights)
824 {
825 if(fWeightsList->FindObject("pt_weights"))
826 {
827 fPtWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("pt_weights"));
828 if(TMath::Abs(fPtWeights->GetBinWidth(1)-fPtBinWidth)>pow(10.,-6.))
829 {
d66d46f7 830 cout<<endl;
489d5531 831 cout<<"WARNING (MH): Inconsistent binning in histograms for pt-weights throughout the code."<<endl;
d66d46f7 832 cout<<endl;
489d5531 833 exit(0);
834 }
835 } else
836 {
837 cout<<"WARNING (MH): fWeightsList->FindObject(\"pt_weights\") is NULL in AFAWMH::BAFWH() !!!!"<<endl;
838 exit(0);
839 }
840 } // end of if(fUsePtWeights)
841 // Eta-weights:
842 if(fUseEtaWeights)
843 {
844 if(fWeightsList->FindObject("eta_weights"))
845 {
846 fEtaWeights = dynamic_cast<TH1D*>(fWeightsList->FindObject("eta_weights"));
847 if(TMath::Abs(fEtaWeights->GetBinWidth(1)-fEtaBinWidth)>pow(10.,-6.))
848 {
d66d46f7 849 cout<<endl;
489d5531 850 cout<<"WARNING (MH): Inconsistent binning in histograms for eta-weights throughout the code."<<endl;
d66d46f7 851 cout<<endl;
489d5531 852 exit(0);
853 }
854 } else
855 {
856 cout<<"WARNING: fUseEtaWeights && fWeightsList->FindObject(\"eta_weights\") is NULL in AFAWMH::BAFWH() !!!!"<<endl;
857 exit(0);
858 }
859 } // end of if(fUseEtaWeights)
860
d66d46f7 861} // end of AliFlowAnalysisWithMixedHarmonics::BookAndFillWeightsHistograms()
862
863//================================================================================================================
489d5531 864
865void AliFlowAnalysisWithMixedHarmonics::CheckPointersUsedInMake()
866{
867 // Check pointers used in method Make().
d66d46f7 868
869 if(!fReQnk || !fImQnk || !fSpk || !f3pCorrelatorEBE)
870 {
871 cout<<endl;
5c078806 872 cout<<" WARNING (MH::Make()): (!fReQnk || !fImQnk || !fSpk || !f3pCorrelatorEBE) is NULL !!!!"<<endl;
d66d46f7 873 cout<<endl;
874 exit(0);
875 }
876 if(!f3pCorrelatorPro)
877 {
878 cout<<endl;
5c078806 879 cout<<" WARNING (MH::Make()): (!f3pCorrelatorPro) is NULL !!!!"<<endl;
d66d46f7 880 cout<<endl;
881 exit(0);
5c078806 882 }
883 if(!fNonIsotropicTermsPro)
884 {
885 cout<<endl;
886 cout<<" WARNING (MH::Make()): !fNonIsotropicTermsPro is NULL !!!!"<<endl;
887 cout<<endl;
888 exit(0);
889 }
890 if(!f3pCorrelatorVsMPro)
891 {
892 cout<<endl;
893 cout<<" WARNING (MH::Make()): !f3pCorrelatorVsMPro is NULL !!!!"<<endl;
894 cout<<endl;
895 exit(0);
896 }
897 if(!fNonIsotropicTermsVsMPro)
898 {
899 cout<<endl;
900 cout<<" WARNING (MH::Make()): !fNonIsotropicTermsVsMPro is NULL !!!!"<<endl;
901 cout<<endl;
902 exit(0);
903 }
904 for(Int_t sd=0;sd<2;sd++)
905 {
906 if(!(f3pCorrelatorVsPtSumDiffPro[sd]))
907 {
908 cout<<endl;
909 cout<<" WARNING (MH::Make()): !"<<Form("f3pCorrelatorVsPtSumDiffPro[%d]",sd)<<" is NULL !!!!"<<endl;
910 cout<<endl;
911 exit(0);
912 }
d66d46f7 913 }
489d5531 914
d66d46f7 915} // end of AliFlowAnalysisWithMixedHarmonics::CheckPointersUsedInMake()
916
917//================================================================================================================
489d5531 918
919void AliFlowAnalysisWithMixedHarmonics::CheckPointersUsedInFinish()
920{
d66d46f7 921 // Check pointers used in method Finish().
ecac11c2 922
923 if(!fAnalysisSettings)
924 {
925 cout<<endl;
5c078806 926 cout<<" WARNING (MH::Finish()): !fAnalysisSettings is NULL !!!!"<<endl;
ecac11c2 927 cout<<endl;
928 exit(0);
929 }
930 if(!f3pCorrelatorPro)
931 {
932 cout<<endl;
5c078806 933 cout<<" WARNING (MH::Finish()): !f3pCorrelatorPro is NULL !!!!"<<endl;
ecac11c2 934 cout<<endl;
935 exit(0);
936 }
937 if(!fNonIsotropicTermsPro)
938 {
939 cout<<endl;
5c078806 940 cout<<" WARNING (MH::Finish()): !fNonIsotropicTermsPro is NULL !!!!"<<endl;
ecac11c2 941 cout<<endl;
942 exit(0);
943 }
944 if(!f3pCorrelatorVsMPro)
945 {
946 cout<<endl;
5c078806 947 cout<<" WARNING (MH::Finish()): !f3pCorrelatorVsMPro is NULL !!!!"<<endl;
ecac11c2 948 cout<<endl;
949 exit(0);
950 }
951 if(!fNonIsotropicTermsVsMPro)
952 {
953 cout<<endl;
5c078806 954 cout<<" WARNING (MH::Finish()): !fNonIsotropicTermsVsMPro is NULL !!!!"<<endl;
ecac11c2 955 cout<<endl;
956 exit(0);
957 }
958 if(!f3pCorrelatorHist)
959 {
960 cout<<endl;
5c078806 961 cout<<" WARNING (MH::Finish()): !f3pCorrelatorHist is NULL !!!!"<<endl;
ecac11c2 962 cout<<endl;
963 exit(0);
5c078806 964 }
ecac11c2 965 if(!fDetectorBiasHist)
966 {
967 cout<<endl;
5c078806 968 cout<<" WARNING (MH::Finish()): !fDetectorBiasHist is NULL !!!!"<<endl;
ecac11c2 969 cout<<endl;
970 exit(0);
971 }
5c078806 972 /* to be improved - enabled eventually
ecac11c2 973 if(!fDetectorBiasVsMHist)
974 {
975 cout<<endl;
5c078806 976 cout<<" WARNING (MH::Finish()): !fDetectorBiasVsMHist is NULL !!!!"<<endl;
ecac11c2 977 cout<<endl;
978 exit(0);
5c078806 979 }
980 */
981 for(Int_t sd=0;sd<2;sd++)
982 {
983 if(!(f3pCorrelatorVsPtSumDiffPro[sd]))
984 {
985 cout<<endl;
986 cout<<" WARNING (MH::Finish()): !"<<Form("f3pCorrelatorVsPtSumDiffPro[%d]",sd)<<" is NULL !!!!"<<endl;
987 cout<<endl;
988 exit(0);
989 }
990 }
ecac11c2 991
489d5531 992} // end of AliFlowAnalysisWithMixedHarmonics::CheckPointersUsedInFinish()
d66d46f7 993
994//================================================================================================================
489d5531 995
5c078806 996void AliFlowAnalysisWithMixedHarmonics::PrintOnTheScreen()
997{
998 // Print the final results on the screen.
999
1000 cout<<endl;
1001 cout<<"*******************************************************"<<endl;
1002 cout<<"*******************************************************"<<endl;
1003 cout<<" Mixed Harmonics "<<endl;
1004 cout<<endl;
1005 if(fCorrelatorInteger!=1)
1006 {
1007 cout<<" cos["<<fCorrelatorInteger<<"(2phi1-phi2-phi3)] = "<<f3pCorrelatorHist->GetBinContent(1)<<
1008 " +/- "<<f3pCorrelatorHist->GetBinError(1)<<endl;
1009 } else
1010 {
1011 cout<<" cos(2phi1-phi2-phi3) = "<<f3pCorrelatorHist->GetBinContent(1)<<" +/- "<<f3pCorrelatorHist->GetBinError(1)<<endl;
1012 }
1013 cout<<" Detector Bias = "<<fDetectorBiasHist->GetBinContent(1)<<endl;
1014 cout<<endl;
1015 cout<<"*******************************************************"<<endl;
1016 cout<<"*******************************************************"<<endl;
1017
1018} // end of void AliFlowAnalysisWithMixedHarmonics::PrintOnTheScreen()
1019
1020//================================================================================================================
1021
489d5531 1022void AliFlowAnalysisWithMixedHarmonics::AccessSettings()
1023{
d66d46f7 1024 // Access the settings for analysis with mixed harmonics.
1025
1026 fCorrelatorInteger = (Int_t)fAnalysisSettings->GetBinContent(1);
1027 fCorrectForDetectorEffects = (Bool_t)fAnalysisSettings->GetBinContent(2);
1028 fNoOfMultipicityBins = (Int_t)fAnalysisSettings->GetBinContent(3);
1029 fMultipicityBinWidth = (Double_t)fAnalysisSettings->GetBinContent(4);
1030 fMinMultiplicity = (Double_t)fAnalysisSettings->GetBinContent(5);
5c078806 1031 fPrintOnTheScreen = (Bool_t)fAnalysisSettings->GetBinContent(6);
489d5531 1032
d66d46f7 1033} // end of AliFlowAnalysisWithMixedHarmonics::AccessSettings()
1034
1035//================================================================================================================
489d5531 1036
1037void AliFlowAnalysisWithMixedHarmonics::CorrectForDetectorEffects()
1038{
d66d46f7 1039 // Correct measured 3-p correlator cos[n(2phi1-phi2-phi3)] for detector effects.
5c078806 1040
d66d46f7 1041 Double_t measured3pCorrelator = f3pCorrelatorPro->GetBinContent(1); // biased by detector effects
1042 Double_t corrected3pCorrelator = 0.; // corrected for detector effects
1043 Double_t nonIsotropicTerms[10] = {0.}; // there are 10 distinct non-isotropic terms
1044 for(Int_t nit=0;nit<10;nit++)
1045 {
1046 nonIsotropicTerms[nit] = fNonIsotropicTermsPro->GetBinContent(nit+1);
1047 }
1048 // Calculate corrected 3-p correlator:
1049 corrected3pCorrelator = measured3pCorrelator
1050 - nonIsotropicTerms[2]*nonIsotropicTerms[4]
1051 - nonIsotropicTerms[3]*nonIsotropicTerms[5]
1052 - 2.*nonIsotropicTerms[0]*nonIsotropicTerms[6]
1053 - 2.*nonIsotropicTerms[1]*nonIsotropicTerms[7]
1054 + 2.*nonIsotropicTerms[2]*(pow(nonIsotropicTerms[0],2.)-pow(nonIsotropicTerms[1],2.))
5c078806 1055 + 4.*nonIsotropicTerms[3]*nonIsotropicTerms[0]*nonIsotropicTerms[1];
1056 // Store corrected correlator:
1057 f3pCorrelatorHist->SetBinContent(1,corrected3pCorrelator);
1058 f3pCorrelatorHist->SetBinError(1,f3pCorrelatorPro->GetBinError(1)); // to be improved (propagate error for non-isotropic terms)
1059 // Quantify bias from detector inefficiences to 3-p correlator. Remark: Bias is quantified as a
1060 // ratio between corrected and measured 3-p correlator:
1061 // bias = corrected/measured
1062 // This bias is stored in histogram fDetectorBias.
1063 Double_t bias = 0.;
1064 if(measured3pCorrelator)
1065 {
1066 bias = corrected3pCorrelator/measured3pCorrelator;
1067 fDetectorBiasHist->SetBinContent(1,bias);
1068 }
489d5531 1069
d66d46f7 1070} // end of AliFlowAnalysisWithMixedHarmonics::CorrectForDetectorEffects()
1071
1072//================================================================================================================
489d5531 1073
489d5531 1074void AliFlowAnalysisWithMixedHarmonics::ResetEventByEventQuantities()
1075{
1076 // Reset all event by event quantities.
1077
1078 fReQnk->Zero();
1079 fImQnk->Zero();
d66d46f7 1080 fSpk->Zero();
1081
489d5531 1082 f3pCorrelatorEBE->Reset();
5c078806 1083
1084 for(Int_t sd=0;sd<2;sd++)
1085 {
1086 fRePEBE[sd]->Reset();
1087 fImPEBE[sd]->Reset();
1088 }
1089
d66d46f7 1090} // end of void AliFlowAnalysisWithMixedHarmonics::ResetEventByEventQuantities()
1091
1092//================================================================================================================
1093
489d5531 1094void AliFlowAnalysisWithMixedHarmonics::Calculate3pCorrelator()
1095{
1096 // Calculate 3-p azimuthal correlator cos[n(2phi1-phi2-phi3)] in terms of Q_{n,k} and S_{p,k}.
d66d46f7 1097
1098 // a) Calculate 3-p correlator without using particle weights;
1099 // b) Calculate 3-p correlator with using particle weights.
1100
489d5531 1101 // a) Calculate 3-p correlator without using particle weights:
d66d46f7 1102 if(!(fUsePhiWeights || fUsePtWeights || fUseEtaWeights))
1103 {
489d5531 1104 // Multiplicity (number of RPs):
1105 Double_t dMult = (*fSpk)(0,0);
1106 // Real and imaginary parts of non-weighted Q-vectors (Q_{n,0}) evaluated in harmonics n and 2n:
1107 Double_t dReQ1n = (*fReQnk)(0,0);
1108 Double_t dReQ2n = (*fReQnk)(1,0);
1109 Double_t dImQ1n = (*fImQnk)(0,0);
d66d46f7 1110 Double_t dImQ2n = (*fImQnk)(1,0);
489d5531 1111 // 3-particle azimuthal correlator <cos(n*(2.*phi1-phi2-phi3))>:
d66d46f7 1112 Double_t three2n1n1n = (pow(dReQ1n,2.)*dReQ2n + 2.*dReQ1n*dImQ1n*dImQ2n - pow(dImQ1n,2.)*dReQ2n
489d5531 1113 - 2.*(pow(dReQ1n,2.)+pow(dImQ1n,2.))
1114 - (pow(dReQ2n,2.)+pow(dImQ2n,2.))+2.*dMult)
d66d46f7 1115 / (dMult*(dMult-1.)*(dMult-2.));
1116 // Fill event-by-event histogram and all-events profile:
1117 f3pCorrelatorEBE->SetBinContent(1,three2n1n1n);
1118 f3pCorrelatorPro->Fill(0.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
5c078806 1119
1120 // 3-particle azimuthal correlator <cos(n*(2.*phi1-phi2-phi3))> vs multiplicity:
1121 if(dMult<fMinMultiplicity)
1122 {
1123 f3pCorrelatorVsMPro->Fill(0.5,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
1124 } else if(dMult>=fMinMultiplicity+fNoOfMultipicityBins*fMultipicityBinWidth)
1125 {
1126 f3pCorrelatorVsMPro->Fill(0.5+fNoOfMultipicityBins+1,three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
1127 } else
1128 {
1129 f3pCorrelatorVsMPro->Fill(1.5+(Int_t)((dMult-fMinMultiplicity)/fMultipicityBinWidth),three2n1n1n,dMult*(dMult-1.)*(dMult-2.));
1130 }
1131
d66d46f7 1132 } // end of if(!(fUsePhiWeights || fUsePtWeights || fUseEtaWeights))
1133
489d5531 1134 // b) Calculate 3-p correlator without using particle weights:
d66d46f7 1135 if(fUsePhiWeights || fUsePtWeights || fUseEtaWeights)
1136 {
1137
1138 } // end of if(fUsePhiWeights || fUsePtWeights || fUseEtaWeights)
1139
1140} // end of void AliFlowAnalysisWithMixedHarmonics::Calculate3pCorrelator()
1141
1142//================================================================================================================
1143
1144void AliFlowAnalysisWithMixedHarmonics::CalculateNonIsotropicTerms()
1145{
5c078806 1146 // Calculate non-isotropic terms which appear in the decomposition of 3-p correlator <cos[n(2phi1-phi2-phi3)]>.
d66d46f7 1147
5c078806 1148 // For detector with uniform acceptance all these terms vanish. These non-isotropic terms are stored in fNonIsotropicTermsPro.
1149 // Binning of fNonIsotropicTermsPro is organized as follows:
489d5531 1150 // 1st bin: <<cos(n*phi1)>>
d66d46f7 1151 // 2nd bin: <<sin(n*phi1)>>
489d5531 1152 // 3rd bin: <<cos(2n*phi1)>>
d66d46f7 1153 // 4th bin: <<sin(2n*phi1)>>
489d5531 1154 // 5th bin: <<cos(n*(phi1+phi2)>>
d66d46f7 1155 // 6th bin: <<sin(n*(phi1+phi2)>>
489d5531 1156 // 7th bin: <<cos(n*(2phi1-phi2)>>
d66d46f7 1157 // 8th bin: <<sin(n*(2phi1-phi2)>>
489d5531 1158 // 9th bin: <<cos(n*(phi1-phi2-phi3)>>
d66d46f7 1159 // 10th bin: <<sin(n*(phi1-phi2-phi3)>>
1160
5c078806 1161 // a) Calculate using particle weights;
1162 // b) Calculate without using particle weights.
1163
d66d46f7 1164 // a) Calculate using particle weights:
1165 if(!(fUsePhiWeights || fUsePtWeights || fUseEtaWeights))
1166 {
489d5531 1167 // Multiplicity (number of RPs):
1168 Double_t dMult = (*fSpk)(0,0);
1169 // Real and imaginary parts of non-weighted Q-vectors (Q_{n,0}) evaluated in harmonics n and 2n:
1170 Double_t dReQ1n = (*fReQnk)(0,0);
1171 Double_t dReQ2n = (*fReQnk)(1,0);
1172 Double_t dImQ1n = (*fImQnk)(0,0);
d66d46f7 1173 Double_t dImQ2n = (*fImQnk)(1,0);
489d5531 1174 // 1-particle terms:
d66d46f7 1175 Double_t cosP1n = 0.; // <cos(n*(phi1))>
1176 Double_t sinP1n = 0.; // <sin(n*(phi1))>
1177 Double_t cosP2n = 0.; // <cos(2n*(phi1))>
489d5531 1178 Double_t sinP2n = 0.; // <sin(2n*(phi1))>
1179 if(dMult>0)
1180 {
d66d46f7 1181 cosP1n = dReQ1n/dMult;
1182 sinP1n = dImQ1n/dMult;
1183 cosP2n = dReQ2n/dMult;
1184 sinP2n = dImQ2n/dMult;
489d5531 1185 // Single event avarages:
1186 fNonIsotropicTermsEBE->SetBinContent(1,cosP1n); // <cos(n*(phi1))>
1187 fNonIsotropicTermsEBE->SetBinContent(2,sinP1n); // <sin(n*(phi1))>
1188 fNonIsotropicTermsEBE->SetBinContent(3,cosP2n); // <cos(2n*(phi1))>
d66d46f7 1189 fNonIsotropicTermsEBE->SetBinContent(4,sinP2n); // <sin(2n*(phi1))>
489d5531 1190 // All-events avarages:
d66d46f7 1191 fNonIsotropicTermsPro->Fill(0.5,cosP1n,dMult); // <<cos(n*(phi1))>>
1192 fNonIsotropicTermsPro->Fill(1.5,sinP1n,dMult); // <<sin(n*(phi1))>>
1193 fNonIsotropicTermsPro->Fill(2.5,cosP2n,dMult); // <<cos(2n*(phi1))>>
489d5531 1194 fNonIsotropicTermsPro->Fill(3.5,sinP2n,dMult); // <<sin(2n*(phi1))>>
1195 }
1196 // 2-particle terms:
d66d46f7 1197 Double_t cosP1nP1n = 0.; // <cos(n*(phi1+phi2))>
1198 Double_t sinP1nP1n = 0.; // <sin(n*(phi1+phi2))>
1199 Double_t cosP2nM1n = 0.; // <cos(n*(2phi1-phi2))>
489d5531 1200 Double_t sinP2nM1n = 0.; // <sin(n*(2phi1-phi2))>
1201 if(dMult>1)
1202 {
d66d46f7 1203 cosP1nP1n = (pow(dReQ1n,2)-pow(dImQ1n,2)-dReQ2n)/(dMult*(dMult-1));
489d5531 1204 sinP1nP1n = (2.*dReQ1n*dImQ1n-dImQ2n)/(dMult*(dMult-1));
d66d46f7 1205 cosP2nM1n = (dReQ2n*dReQ1n+dImQ2n*dImQ1n-dReQ1n)/(dMult*(dMult-1));
489d5531 1206 sinP2nM1n = (dImQ2n*dReQ1n-dReQ2n*dImQ1n-dImQ1n)/(dMult*(dMult-1));
1207 // Single event avarages:
1208 fNonIsotropicTermsEBE->SetBinContent(5,cosP1nP1n); // <cos(n*(phi1+phi2))>
d66d46f7 1209 fNonIsotropicTermsEBE->SetBinContent(6,sinP1nP1n); // <sin(n*(phi1+phi2))>
489d5531 1210 fNonIsotropicTermsEBE->SetBinContent(7,cosP2nM1n); // <cos(n*(2phi1-phi2))>
1211 fNonIsotropicTermsEBE->SetBinContent(8,sinP2nM1n); // <sin(n*(2phi1-phi2))>
1212 // All-events avarages:
d66d46f7 1213 fNonIsotropicTermsPro->Fill(4.5,cosP1nP1n,dMult*(dMult-1.)); // <<cos(n*(phi1+phi2))>>
489d5531 1214 fNonIsotropicTermsPro->Fill(5.5,sinP1nP1n,dMult*(dMult-1.)); // <<sin(n*(phi1+phi2))>>
d66d46f7 1215 fNonIsotropicTermsPro->Fill(6.5,cosP2nM1n,dMult*(dMult-1.)); // <<cos(n*(2phi1-phi2))>>
489d5531 1216 fNonIsotropicTermsPro->Fill(7.5,sinP2nM1n,dMult*(dMult-1.)); // <<sin(n*(2phi1-phi2))>>
1217 }
1218
1219 // 3-particle:
1220 Double_t cosP1nM1nM1n = 0.; // <cos(n*(phi1-phi2-phi3))>
1221 Double_t sinP1nM1nM1n = 0.; // <sin(n*(phi1-phi2-phi3))>
1222 if(dMult>2)
1223 {
1224 cosP1nM1nM1n = (dReQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))-dReQ1n*dReQ2n-dImQ1n*dImQ2n-2.*(dMult-1)*dReQ1n)
d66d46f7 1225 / (dMult*(dMult-1)*(dMult-2));
489d5531 1226 sinP1nM1nM1n = (-dImQ1n*(pow(dReQ1n,2)+pow(dImQ1n,2))+dReQ1n*dImQ2n-dImQ1n*dReQ2n+2.*(dMult-1)*dImQ1n)
1227 / (dMult*(dMult-1)*(dMult-2));
1228 // Single event avarages:
d66d46f7 1229 fNonIsotropicTermsEBE->SetBinContent(9,cosP1nM1nM1n); // <cos(n*(phi1-phi2-phi3))>
489d5531 1230 fNonIsotropicTermsEBE->SetBinContent(10,sinP1nM1nM1n); // <sin(n*(phi1-phi2-phi3))>
1231 // All-events avarages:
d66d46f7 1232 fNonIsotropicTermsPro->Fill(8.5,cosP1nM1nM1n,dMult*(dMult-1.)*(dMult-2.)); // <<cos(n*(phi1-phi2-phi3))>>
489d5531 1233 fNonIsotropicTermsPro->Fill(9.5,sinP1nM1nM1n,dMult*(dMult-1.)*(dMult-2.)); // <<sin(n*(phi1-phi2-phi3))>>
d66d46f7 1234 }
1235 } // end of if(!(fUsePhiWeights || fUsePtWeights || fUseEtaWeights))
1236
489d5531 1237 // b) Calculate without using particle weights:
d66d46f7 1238 if(fUsePhiWeights || fUsePtWeights || fUseEtaWeights)
1239 {
1240
1241 } // end of if(fUsePhiWeights || fUsePtWeights || fUseEtaWeights)
1242
1243} // end of void AliFlowAnalysisWithMixedHarmonics::CalculateNonIsotropicTerms()
1244
5c078806 1245//================================================================================================================
1246
1247void AliFlowAnalysisWithMixedHarmonics::CalculateDifferential3pCorrelator()
1248{
1249 // Calculate differential 3-p azimuthal correlator cos[n(2phi1-psi2-psi3)] in terms of Q_{2n} and p_{n}.
1250
1251 // a) Calculate differential 3-p correlator without using particle weights;
1252 // b) Calculate differential 3-p correlator with using particle weights.
1253
1254 // a) Calculate differential 3-p correlator without using particle weights:
1255 if(!(fUsePhiWeights || fUsePtWeights || fUseEtaWeights))
1256 {
1257 // Multiplicity (number of RPs):
1258 Double_t dMult = (*fSpk)(0,0);
1259 // Real and imaginary parts of non-weighted Q-vectors (Q_{n,0}) evaluated in harmonic 2n:
1260 Double_t dReQ2n = (*fReQnk)(1,0);
1261 Double_t dImQ2n = (*fImQnk)(1,0);
1262 for(Int_t sd=0;sd<2;sd++) // [(p1+p2)/2,|p1-p2|]
1263 {
1264 // looping over all bins and calculating reduced correlations:
1265 for(Int_t b=1;b<=fnBinsPt;b++)
1266 {
1267 // real and imaginary parts of p_{n}:
1268 Double_t p1nRe = fRePEBE[sd]->GetBinContent(b)*fRePEBE[sd]->GetBinEntries(b);
1269 Double_t p1nIm = fImPEBE[sd]->GetBinContent(b)*fImPEBE[sd]->GetBinEntries(b);
1270 // number of pairs of POIs in particular (p1+p2)/2 or |p1-p2| bin:
1271 Double_t mp = fRePEBE[sd]->GetBinEntries(b);
1272 Double_t cosP2nphi1M1npsi2M1npsi2 = 0; // cos[n(2phi1-psi2-psi3)]
1273 if(mp*dMult>0.)
1274 {
1275 cosP2nphi1M1npsi2M1npsi2 = (p1nRe*dReQ2n+p1nIm*dImQ2n)/(mp*dMult);
1276 }
1277 f3pCorrelatorVsPtSumDiffPro[sd]->Fill(fPtMin+(b-1)*fPtBinWidth,cosP2nphi1M1npsi2M1npsi2,mp*dMult);
1278 } // end of for(Int_t b=1;b<=fnBinsPt;b++)
1279 } // end of for(Int_t sd=0;sd<2;sd++)
1280 } // end of if(!(fUsePhiWeights || fUsePtWeights || fUseEtaWeights))
1281
1282 // b) Calculate differential 3-p correlator by using particle weights:
1283 if(fUsePhiWeights || fUsePtWeights || fUseEtaWeights)
1284 {
1285
1286 } // end of if(fUsePhiWeights || fUsePtWeights || fUseEtaWeights)
1287
1288} // end of void AliFlowAnalysisWithMixedHarmonics::CalculateDifferential3pCorrelator()
1289
1290//================================================================================================================
1291