]>
Commit | Line | Data |
---|---|---|
37d2f768 | 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. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /************************************ | |
17 | * flow analysis with multi-particle * | |
18 | * correlations * | |
19 | * * | |
20 | * author: Ante Bilandzic * | |
21 | * (abilandzic@gmail.com) * | |
22 | ************************************/ | |
23 | ||
24 | #define AliFlowAnalysisWithMultiparticleCorrelations_cxx | |
25 | ||
26 | #include "AliFlowAnalysisWithMultiparticleCorrelations.h" | |
27 | ||
28 | using std::endl; | |
29 | using std::cout; | |
30 | using std::flush; | |
31 | ||
32 | //================================================================================================================ | |
33 | ||
34 | ClassImp(AliFlowAnalysisWithMultiparticleCorrelations) | |
35 | ||
36 | AliFlowAnalysisWithMultiparticleCorrelations::AliFlowAnalysisWithMultiparticleCorrelations(): | |
37 | // 0.) Base: | |
38 | fHistList(NULL), | |
7ecb5af4 | 39 | fInternalFlagsPro(NULL), |
40 | fUseInternalFlags(kFALSE), | |
41 | fMinNoRPs(-44), | |
42 | fMaxNoRPs(-44), | |
43 | fExactNoRPs(-44), | |
37d2f768 | 44 | // 1.) Control histograms: |
45 | fControlHistogramsList(NULL), | |
7ecb5af4 | 46 | fControlHistogramsFlagsPro(NULL), |
9efbd2f5 | 47 | fFillControlHistograms(kFALSE), |
48 | fFillKinematicsHist(kFALSE), | |
49 | fFillMultDistributionsHist(kFALSE), | |
50 | fFillMultCorrelationsHist(kFALSE), | |
7ecb5af4 | 51 | // 2.) Q-vector: |
9efbd2f5 | 52 | fQvectorList(NULL), |
53 | fQvectorFlagsPro(NULL), | |
54 | fCalculateQvector(kFALSE), | |
7ecb5af4 | 55 | // 3.) Correlations: |
56 | fCorrelationsList(NULL), | |
57 | fCorrelationsFlagsPro(NULL), | |
6696a113 | 58 | fCalculateCorrelations(kFALSE), |
59 | fMaxHarmonic(6), // TBI this shall not be hardwired in the ideal world... | |
60 | fMaxCorrelator(8), | |
61 | fCalculateIsotropic(kFALSE), | |
62 | fCalculateSame(kFALSE), | |
63 | fSkipZeroHarmonics(kFALSE), | |
64 | fCalculateSameIsotropic(kFALSE), | |
65 | fCalculateAll(kFALSE), | |
66 | fDontGoBeyond(0), | |
7ecb5af4 | 67 | // 4.) Cumulants: |
68 | fCumulantsList(NULL), | |
69 | fCumulantsFlagsPro(NULL), | |
70 | f2pCumulantsPro(NULL), | |
9efbd2f5 | 71 | fCalculateCumulants(kFALSE), |
7ecb5af4 | 72 | // 5.) Weights: |
73 | fWeightsList(NULL), | |
74 | fWeightsFlagsPro(NULL), | |
75 | fUsePhiWeights(kFALSE), | |
76 | fUsePtWeights(kFALSE), | |
77 | fUseEtaWeights(kFALSE), | |
78 | fPhiWeightsHist(NULL), | |
79 | fPtWeightsHist(NULL), | |
80 | fEtaWeightsHist(NULL), | |
81 | // 6.) Nested loops: | |
82 | fNestedLoopsList(NULL), | |
83 | fNestedLoopsFlagsPro(NULL), | |
84 | fCrossCheckWithNestedLoops(kFALSE), | |
85 | fNestedLoopsResultsCosPro(NULL), | |
86 | fNestedLoopsResultsSinPro(NULL), | |
87 | // 7.) 'Standard candles': | |
88 | fStandardCandlesList(NULL), | |
89 | fStandardCandlesFlagsPro(NULL), | |
90 | fCalculateStandardCandles(kFALSE), | |
6d19c373 | 91 | fStandardCandlesHist(NULL), |
92 | fProductsPro2D(NULL) | |
37d2f768 | 93 | { |
94 | // Constructor. | |
95 | ||
96 | // a) Book grandmother of all lists; | |
97 | // b) Initialize all arrays. | |
98 | ||
99 | // a) Book grandmother of all lists: | |
100 | fHistList = new TList(); | |
101 | fHistList->SetName("cobjMPC"); | |
102 | fHistList->SetOwner(kTRUE); | |
103 | ||
104 | // b) Initialize all arrays: | |
105 | this->InitializeArraysForControlHistograms(); | |
7ecb5af4 | 106 | this->InitializeArraysForQvector(); |
107 | this->InitializeArraysForCorrelations(); | |
108 | ||
37d2f768 | 109 | } // end of AliFlowAnalysisWithMultiparticleCorrelations::AliFlowAnalysisWithMultiparticleCorrelations() |
110 | ||
111 | //================================================================================================================ | |
112 | ||
113 | AliFlowAnalysisWithMultiparticleCorrelations::~AliFlowAnalysisWithMultiparticleCorrelations() | |
114 | { | |
115 | // Destructor. | |
116 | ||
117 | delete fHistList; | |
118 | ||
119 | } // end of AliFlowAnalysisWithMultiparticleCorrelations::~AliFlowAnalysisWithMultiparticleCorrelations() | |
120 | ||
121 | //================================================================================================================ | |
122 | ||
123 | void AliFlowAnalysisWithMultiparticleCorrelations::Init() | |
124 | { | |
125 | // Well, this is method Init(). | |
126 | ||
127 | // a) Trick to avoid name clashes, part 1; | |
128 | // b) Cross-check the initial settings before starting this adventure; | |
129 | // c) Book all objects; | |
130 | // d) Set all flags; | |
131 | // *) Trick to avoid name clashes, part 2. | |
132 | ||
133 | // a) Trick to avoid name clashes, part 1: | |
134 | Bool_t oldHistAddStatus = TH1::AddDirectoryStatus(); | |
135 | TH1::AddDirectory(kFALSE); | |
136 | ||
137 | // b) Cross-check the initial settings before starting this adventure: | |
138 | this->CrossCheckSettings(); | |
139 | ||
140 | // c) Book all objects: | |
141 | this->BookAndNestAllLists(); | |
7ecb5af4 | 142 | this->BookEverythingForBase(); |
37d2f768 | 143 | this->BookEverythingForControlHistograms(); |
9efbd2f5 | 144 | this->BookEverythingForQvector(); |
7ecb5af4 | 145 | this->BookEverythingForWeights(); |
146 | this->BookEverythingForCorrelations(); | |
147 | this->BookEverythingForCumulants(); | |
148 | this->BookEverythingForNestedLoops(); | |
149 | this->BookEverythingForStandardCandles(); | |
37d2f768 | 150 | |
151 | // d) Set all flags: | |
152 | // ... | |
153 | ||
154 | // *) Trick to avoid name clashes, part 2: | |
155 | TH1::AddDirectory(oldHistAddStatus); | |
156 | ||
157 | } // end of void AliFlowAnalysisWithMultiparticleCorrelations::Init() | |
158 | ||
159 | //================================================================================================================ | |
160 | ||
161 | void AliFlowAnalysisWithMultiparticleCorrelations::Make(AliFlowEventSimple *anEvent) | |
162 | { | |
163 | // Running over data only in this method. | |
164 | ||
7ecb5af4 | 165 | // a) Cross-check internal flags; |
6d19c373 | 166 | // b) Cross-check all pointers used in this method; |
167 | // c) Fill control histograms; | |
168 | // d) Fill Q-vector components; | |
169 | // e) Calculate multi-particle correlations from Q-vector components; | |
170 | // f) Calculate products of multi-particle correlations (needed for error propagation of SCs); | |
171 | // g) Calculate e-b-e cumulants; | |
172 | // h) Reset Q-vector components; | |
173 | // i) Cross-check results with nested loops. | |
7ecb5af4 | 174 | |
175 | // a) Cross-check internal flags: | |
176 | if(fUseInternalFlags){if(!this->CrossCheckInternalFlags(anEvent)){return;}} | |
177 | ||
6d19c373 | 178 | // b) Cross-check all pointers used in this method: |
179 | this->CrossCheckPointersUsedInMake(); | |
180 | ||
181 | // c) Fill control histograms: | |
7ecb5af4 | 182 | if(fFillControlHistograms){this->FillControlHistograms(anEvent);} |
37d2f768 | 183 | |
6d19c373 | 184 | // d) Fill Q-vector components: |
9efbd2f5 | 185 | if(fCalculateQvector){this->FillQvector(anEvent);} |
7ecb5af4 | 186 | |
6d19c373 | 187 | // e) Calculate multi-particle correlations from Q-vector components: |
6696a113 | 188 | if(fCalculateCorrelations){this->CalculateCorrelations(anEvent);} |
7ecb5af4 | 189 | |
6d19c373 | 190 | // f) Calculate products of multi-particle correlations (needed for error propagation of SCs): |
191 | if(fCalculateStandardCandles){this->CalculateProductsOfCorrelations(anEvent);} | |
192 | ||
193 | // g) Calculate e-b-e cumulants: | |
7ecb5af4 | 194 | if(fCalculateCumulants){this->CalculateCumulants();} |
195 | ||
6d19c373 | 196 | // h) Reset Q-vector components: |
9efbd2f5 | 197 | if(fCalculateQvector){this->ResetQvector();} |
7ecb5af4 | 198 | |
6d19c373 | 199 | // i) Cross-check results with nested loops: |
7ecb5af4 | 200 | if(fCrossCheckWithNestedLoops){this->CrossCheckWithNestedLoops(anEvent);} |
201 | ||
37d2f768 | 202 | } // end of AliFlowAnalysisWithMultiparticleCorrelations::Make(AliFlowEventSimple *anEvent) |
203 | ||
204 | //======================================================================================================================= | |
205 | ||
206 | void AliFlowAnalysisWithMultiparticleCorrelations::Finish() | |
207 | { | |
7ecb5af4 | 208 | // Closing the curtains. |
209 | ||
6696a113 | 210 | // a) Cross-check pointers used in this method; |
7ecb5af4 | 211 | // b) Calculate 'standard candles'. |
7ecb5af4 | 212 | // ... |
6696a113 | 213 | |
214 | // a) Cross-check pointers used in this method: | |
215 | this->CrossCheckPointersUsedInFinish(); | |
7ecb5af4 | 216 | |
217 | // b) Calculate 'standard candles': | |
218 | if(fCalculateStandardCandles){this->CalculateStandardCandles();} | |
219 | ||
37d2f768 | 220 | // ... |
6d19c373 | 221 | printf("\n ... Closing the curtains ... \n\n"); |
37d2f768 | 222 | |
223 | } // end of AliFlowAnalysisWithMultiparticleCorrelations::Finish() | |
224 | ||
225 | //======================================================================================================================= | |
226 | ||
6696a113 | 227 | void AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckPointersUsedInFinish() |
228 | { | |
229 | // Cross-check all pointers used in method Finish(). | |
230 | ||
6d19c373 | 231 | // a) Correlations; |
232 | // b) 'Standard candles'. | |
233 | ||
234 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckPointersUsedInFinish()"; | |
235 | ||
236 | // a) Correlations: | |
237 | if(fCalculateCorrelations) | |
6696a113 | 238 | { |
6d19c373 | 239 | for(Int_t cs=0;cs<2;cs++) |
240 | { | |
241 | for(Int_t c=0;c<fMaxCorrelator;c++) | |
242 | { | |
243 | if(!fCorrelationsPro[cs][c]){Fatal(sMethodName.Data(),"fCorrelationsPro[%d][%d] is NULL, for one reason or another...",cs,c);} | |
244 | } | |
245 | } | |
246 | } // if(fCalculateCorrelations) | |
247 | ||
248 | // b) 'Standard candles': | |
249 | if(fCalculateStandardCandles) | |
250 | { | |
251 | if(!fStandardCandlesHist){Fatal(sMethodName.Data(),"fStandardCandlesHist is NULL, for one reason or another...");} | |
252 | if(!fProductsPro2D){Fatal(sMethodName.Data(),"fProductsPro2D is NULL, for one reason or another...");} | |
253 | } // if(fCalculateStandardCandles) | |
6696a113 | 254 | |
255 | } // void AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckPointersUsedInFinish() | |
256 | ||
257 | //======================================================================================================================= | |
258 | ||
6d19c373 | 259 | void AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckPointersUsedInMake() |
260 | { | |
261 | // Cross-check all pointers used in method Make(). | |
262 | ||
263 | // a) Correlations; | |
264 | // b) 'Standard candles'. | |
265 | ||
266 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckPointersUsedInMake()"; | |
267 | ||
268 | // a) Correlations: | |
269 | if(fCalculateCorrelations) | |
270 | { | |
271 | for(Int_t cs=0;cs<2;cs++) | |
272 | { | |
273 | for(Int_t c=0;c<fMaxCorrelator;c++) | |
274 | { | |
275 | if(!fCorrelationsPro[cs][c]){Fatal(sMethodName.Data(),"fCorrelationsPro[%d][%d] is NULL, for one reason or another...",cs,c);} | |
276 | } | |
277 | } | |
278 | } // if(fCalculateCorrelations) | |
279 | ||
280 | // b) 'Standard candles': | |
281 | if(fCalculateStandardCandles) | |
282 | { | |
283 | if(!fProductsPro2D){Fatal(sMethodName.Data(),"fProductsPro2D is NULL, for one reason or another...");} | |
284 | } // if(fCalculateStandardCandles) | |
285 | ||
286 | } // void AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckPointersUsedInMake() | |
287 | ||
288 | //======================================================================================================================= | |
289 | ||
7ecb5af4 | 290 | void AliFlowAnalysisWithMultiparticleCorrelations::CalculateStandardCandles() |
291 | { | |
9efbd2f5 | 292 | // Calculate 'standard candles'. |
293 | ||
6d19c373 | 294 | // 'Standard candle' (SC) is defined in terms of average (all-event!) correlations as follows: |
295 | // SC(-n1,-n2,n2,n1) = <<Cos(-n1,-n2,n2,n1)>> - <<Cos(-n1,n1)>>*<<Cos(-n2,n2)>>, n1 > n2. | |
296 | ||
9efbd2f5 | 297 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::CalculateStandardCandles()"; |
298 | ||
6d19c373 | 299 | Int_t nBins2p = fCorrelationsPro[0][1]->GetXaxis()->GetNbins(); |
300 | Int_t nBins4p = fCorrelationsPro[0][3]->GetXaxis()->GetNbins(); | |
301 | Int_t nBins2D = fProductsPro2D->GetXaxis()->GetNbins(); | |
302 | Int_t nBinsSC = fStandardCandlesHist->GetXaxis()->GetNbins(); | |
303 | Double_t dSCn1n2n2n1 = 0.; // SC(-n1,-n2,n2,n1) | |
304 | Double_t dSCn1n2n2n1Err = 0.; // stat. error of SC(-n1,-n2,n2,n1) | |
305 | Double_t dCovCosn2n2Cosn1n1 = 0.; // Cov[<Cos(-n2,n2)>*<Cos(-n1,n1)>] | |
306 | Double_t dCovCosn1n2n2n1Cosn1n1 = 0.; // Cov[<Cos(-n1,-n2,n2,n1)>]*<Cos(-n1,n1)> | |
307 | Double_t dCovCosn1n2n2n1Cosn2n2 = 0.; // Cov[<Cos(-n1,-n2,n2,n1)>*<Cos(-n2,n2)>] | |
308 | Int_t binNo = 1; // for fStandardCandlesHist | |
7ecb5af4 | 309 | |
6d19c373 | 310 | for(Int_t n1=-fMaxHarmonic;n1<=-2;n1++) |
311 | { | |
312 | Double_t dCosn1n1 = 0.; // <<Cos(-n1,n1)>> | |
313 | Double_t dCosn1n1Err = 0.; // stat. error of <<Cos(-n1,n1)>> | |
314 | Double_t dCosn1n1SumW = 0.; // total sum of weights for <Cos(-n1,n1)> | |
315 | TString sn1n1 = Form("(%d,%d)",n1,-1*n1); // pattern (-n1,n1) | |
316 | for(Int_t bin2p=1;bin2p<=nBins2p;bin2p++) | |
317 | { | |
318 | TString binLabel2p = fCorrelationsPro[0][1]->GetXaxis()->GetBinLabel(bin2p); | |
319 | if(!binLabel2p.CompareTo("")){break;} // TBI this is a little bit shaky... | |
320 | if(binLabel2p.EndsWith(sn1n1.Data())) // TBI this is a little bit shaky as well... | |
321 | { | |
322 | dCosn1n1 = fCorrelationsPro[0][1]->GetBinContent(bin2p); | |
323 | dCosn1n1Err = fCorrelationsPro[0][1]->GetBinError(bin2p); | |
324 | dCosn1n1SumW = fCorrelationsPro[0][1]->GetBinEntries(bin2p); | |
325 | } // if(binLabel2p.EndsWith(sn1n1.Data())) | |
326 | } // for(Int_t bin2p=1;bin2p<=nBins2p;bin2p++) | |
327 | ||
328 | for(Int_t n2=n1+1;n2<=-1;n2++) | |
329 | { | |
330 | Double_t dCosn2n2 = 0.; // <<Cos(-n2,n2)>> | |
331 | Double_t dCosn2n2Err = 0.; // stat. error of <<Cos(-n2,n2)>> | |
332 | Double_t dCosn2n2SumW = 0.; // total sum of weights for <Cos(-n2,n2)> | |
333 | TString sn2n2 = Form("(%d,%d)",n2,-1*n2); // pattern (-n2,n2) | |
334 | for(Int_t bin2p=1;bin2p<=nBins2p;bin2p++) | |
335 | { | |
336 | TString binLabel2p = fCorrelationsPro[0][1]->GetXaxis()->GetBinLabel(bin2p); | |
337 | if(!binLabel2p.CompareTo("")){break;} // TBI this is a little bit shaky... | |
338 | if(binLabel2p.EndsWith(sn2n2.Data())) // TBI this is a little bit shaky as well... | |
339 | { | |
340 | dCosn2n2 = fCorrelationsPro[0][1]->GetBinContent(bin2p); | |
341 | dCosn2n2Err = fCorrelationsPro[0][1]->GetBinError(bin2p); | |
342 | dCosn2n2SumW = fCorrelationsPro[0][1]->GetBinEntries(bin2p); | |
343 | } // if(binLabel2p.EndsWith(sn2n2.Data())) | |
344 | } // for(Int_t bin2p=1;bin2p<=nBins2p;bin2p++) | |
345 | Double_t dCosn1n2n2n1 = 0.; // <<Cos(-n1,-n2,n2,n1)>> | |
346 | Double_t dCosn1n2n2n1Err = 0.; // stat. error of <<Cos(-n1,-n2,n2,n1)>> | |
347 | Double_t dCosn1n2n2n1SumW = 0.; // total sum of weights for <Cos(-n1,-n2,n2,n1)> | |
348 | TString sn1n2n2n1 = Form("(%d,%d,%d,%d)",n1,n2,-1*n2,-1*n1); // pattern (-n1,-n2,n2,n1) | |
349 | for(Int_t bin4p=1;bin4p<=nBins4p;bin4p++) | |
350 | { | |
351 | TString binLabel4p = fCorrelationsPro[0][3]->GetXaxis()->GetBinLabel(bin4p); | |
352 | if(!binLabel4p.CompareTo("")){break;} // TBI this is a little bit shaky... | |
353 | if(binLabel4p.EndsWith(sn1n2n2n1.Data())) // TBI this is a little bit shaky as well... | |
354 | { | |
355 | dCosn1n2n2n1 = fCorrelationsPro[0][3]->GetBinContent(bin4p); | |
356 | dCosn1n2n2n1Err = fCorrelationsPro[0][3]->GetBinError(bin4p); | |
357 | dCosn1n2n2n1SumW = fCorrelationsPro[0][3]->GetBinEntries(bin4p); | |
358 | } // if(binLabel4p.EndsWith(sn1n2n2n1.Data())) | |
359 | } // for(Int_t bin4p=1;bin4p<=nBins4p;bin4p++) | |
360 | ||
361 | // Get the needed products, and calculate covariances for error propagation: | |
362 | for(Int_t bx=2;bx<=nBins2D;bx++) | |
363 | { | |
364 | if(!(TString(fProductsPro2D->GetXaxis()->GetBinLabel(bx)).Contains(sn1n1.Data()) | |
365 | || TString(fProductsPro2D->GetXaxis()->GetBinLabel(bx)).Contains(sn2n2.Data()) | |
366 | || TString(fProductsPro2D->GetXaxis()->GetBinLabel(bx)).Contains(sn1n2n2n1.Data()))){continue;} | |
367 | for(Int_t by=1;by<bx;by++) | |
368 | { | |
369 | if(!(TString(fProductsPro2D->GetYaxis()->GetBinLabel(by)).Contains(sn1n1.Data()) | |
370 | || TString(fProductsPro2D->GetYaxis()->GetBinLabel(by)).Contains(sn2n2.Data()) | |
371 | || TString(fProductsPro2D->GetYaxis()->GetBinLabel(by)).Contains(sn1n2n2n1.Data()))){continue;} | |
372 | // Cov[<Cos(-n2,n2)>*<Cos(-n1,n1)>]: | |
373 | if(TString(fProductsPro2D->GetXaxis()->GetBinLabel(bx)).Contains(sn2n2.Data()) | |
374 | && TString(fProductsPro2D->GetYaxis()->GetBinLabel(by)).Contains(sn1n1.Data())) | |
375 | { | |
376 | if(dCosn2n2SumW > 0. && dCosn1n1SumW > 0.) | |
377 | { | |
378 | dCovCosn2n2Cosn1n1 = (fProductsPro2D->GetBinEntries(fProductsPro2D->GetBin(bx,by))/(dCosn2n2SumW*dCosn1n1SumW)) | |
379 | * (fProductsPro2D->GetBinContent(fProductsPro2D->GetBin(bx,by))-dCosn2n2*dCosn1n1); | |
380 | } else{Fatal(sMethodName.Data(),"dCosn2n2SumW > 0. && dCosn1n1SumW > 0.");} | |
381 | } | |
382 | // Cov[<Cos(-n1,-n2,n2,n1)>*<Cos(-n2,n2)>]; | |
383 | else if(TString(fProductsPro2D->GetXaxis()->GetBinLabel(bx)).Contains(sn1n2n2n1.Data()) | |
384 | && TString(fProductsPro2D->GetYaxis()->GetBinLabel(by)).Contains(sn2n2.Data())) | |
385 | { | |
386 | if(dCosn1n2n2n1SumW > 0. && dCosn2n2SumW > 0.) | |
387 | { | |
388 | dCovCosn1n2n2n1Cosn2n2 = (fProductsPro2D->GetBinEntries(fProductsPro2D->GetBin(bx,by))/(dCosn2n2SumW*dCosn1n2n2n1SumW)) | |
389 | * (fProductsPro2D->GetBinContent(fProductsPro2D->GetBin(bx,by))-dCosn1n2n2n1*dCosn2n2); | |
390 | } else{Fatal(sMethodName.Data(),"dCosn1n2n2n1SumW > 0. && dCosn2n2SumW > 0.");} | |
391 | } | |
392 | // Cov[<Cos(-n1,-n2,n2,n1)>*<Cos(-n1,n1)>]: | |
393 | else if(TString(fProductsPro2D->GetXaxis()->GetBinLabel(bx)).Contains(sn1n2n2n1.Data()) | |
394 | && TString(fProductsPro2D->GetYaxis()->GetBinLabel(by)).Contains(sn1n1.Data())) | |
395 | { | |
396 | if(dCosn1n2n2n1SumW > 0. && dCosn1n1SumW > 0.) | |
397 | { | |
398 | dCovCosn1n2n2n1Cosn1n1 = (fProductsPro2D->GetBinEntries(fProductsPro2D->GetBin(bx,by))/(dCosn1n1SumW*dCosn1n2n2n1SumW)) | |
399 | * (fProductsPro2D->GetBinContent(fProductsPro2D->GetBin(bx,by))-dCosn1n2n2n1*dCosn1n1); | |
400 | } else{Fatal(sMethodName.Data(),"if(dCosn1n2n2n1Cosn1n1SumW > 0. && dCosn1n1SumW > 0.)");} | |
401 | } | |
402 | } // for(Int_t by=1;by<bx;by++) | |
403 | } // for(Int_t bx=2;bx<=nBins2D;bx++) | |
404 | // Finally, calculate and store SCs: | |
405 | dSCn1n2n2n1 = dCosn1n2n2n1 - dCosn1n1*dCosn2n2; | |
406 | dSCn1n2n2n1Err = pow(dCosn1n1,2.)*pow(dCosn2n2Err,2.) + pow(dCosn2n2,2.)*pow(dCosn1n1Err,2.) + pow(dCosn1n2n2n1Err,2.) | |
407 | + 2.*dCosn1n1*dCosn2n2*dCovCosn2n2Cosn1n1 | |
408 | - 2.*dCosn1n1*dCovCosn1n2n2n1Cosn2n2 | |
409 | - 2.*dCosn2n2*dCovCosn1n2n2n1Cosn1n1; // note that this is still error^2 | |
410 | fStandardCandlesHist->SetBinContent(binNo,dSCn1n2n2n1); | |
411 | if(dSCn1n2n2n1Err>0.){fStandardCandlesHist->SetBinError(binNo,pow(dSCn1n2n2n1Err,0.5));} | |
412 | else{Warning(sMethodName.Data(),"if(dSCn1n2n2n1Err>0.)");} | |
413 | binNo++; | |
414 | } // for(Int_t n2=n1+1;n2<=-1;n2++) | |
415 | } // for(Int_t n1=-fMaxHarmonic;n1<=-2;n1++) | |
416 | ||
417 | if(nBinsSC != binNo-1){Fatal(sMethodName.Data(),"nBinsSC != binNo-1");} // just in case... | |
7ecb5af4 | 418 | |
419 | } // void AliFlowAnalysisWithMultiparticleCorrelations::CalculateStandardCandles() | |
420 | ||
421 | //======================================================================================================================= | |
422 | ||
423 | void AliFlowAnalysisWithMultiparticleCorrelations::InitializeArraysForCorrelations() | |
424 | { | |
425 | // Initialize all arrays for correlations. | |
426 | ||
6696a113 | 427 | for(Int_t cs=0;cs<2;cs++) // [0=cos,1=sin] |
7ecb5af4 | 428 | { |
6696a113 | 429 | for(Int_t c=0;c<8;c++) // [1p,2p,...,8p] |
430 | { | |
431 | fCorrelationsPro[cs][c] = NULL; | |
432 | } | |
7ecb5af4 | 433 | } |
434 | ||
435 | } // void AliFlowAnalysisWithMultiparticleCorrelations::InitializeArraysForCorrelations() | |
436 | ||
437 | //======================================================================================================================= | |
438 | ||
6696a113 | 439 | void AliFlowAnalysisWithMultiparticleCorrelations::CalculateCorrelations(AliFlowEventSimple *anEvent) |
7ecb5af4 | 440 | { |
441 | // Calculate multi-particle correlations from Q-vector components. | |
442 | ||
6696a113 | 443 | // Fill ... TBI this can be implemented better, most likely... |
7ecb5af4 | 444 | |
6d19c373 | 445 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::CalculateCorrelations()"; |
6696a113 | 446 | if(!anEvent){Fatal(sMethodName.Data(),"anEvent is apparently doing crazy things...");} // TBI |
6d19c373 | 447 | |
6696a113 | 448 | Double_t dMultRP = anEvent->GetNumberOfRPs(); // TBI shall I promote this variable into data member? |
7ecb5af4 | 449 | |
6696a113 | 450 | Int_t binNo[8]; for(Int_t c=0;c<8;c++){binNo[c]=1;} |
451 | // 1-p: | |
452 | for(Int_t n1=-fMaxHarmonic;n1<=fMaxHarmonic;n1++) | |
7ecb5af4 | 453 | { |
6696a113 | 454 | if(fSkipZeroHarmonics && 0==n1){continue;} |
455 | if(fCalculateAll) | |
7ecb5af4 | 456 | { |
6696a113 | 457 | TComplex oneN = One(n1); // numerator |
458 | Double_t oneD = One(0).Re(); // denominator | |
459 | Double_t oneW = oneD; // weight TBI add other possibilities here for the weight | |
460 | if(oneD>0. && dMultRP>=1) | |
461 | { | |
462 | fCorrelationsPro[0][0]->Fill(binNo[0]-.5,oneN.Re()/oneD,oneW); | |
463 | fCorrelationsPro[1][0]->Fill(binNo[0]++-.5,oneN.Im()/oneD,oneW); | |
464 | } else {Warning(sMethodName.Data(),"if(oneD>0. && dMultRP>=1) ");} | |
465 | } | |
466 | if(1==fDontGoBeyond){continue;} | |
467 | // 2-p: | |
468 | for(Int_t n2=n1;n2<=fMaxHarmonic;n2++) | |
7ecb5af4 | 469 | { |
6696a113 | 470 | if(fSkipZeroHarmonics && 0==n2){continue;} |
471 | if(fCalculateAll | |
472 | || (fCalculateIsotropic && 0==n1+n2) | |
473 | || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2)) | |
474 | || (fCalculateSameIsotropic && 0==n1+n2 && TMath::Abs(n1)==TMath::Abs(n2))) | |
475 | { | |
476 | TComplex twoN = Two(n1,n2); // numerator | |
477 | Double_t twoD = Two(0,0).Re(); // denominator | |
478 | Double_t twoW = twoD; // weight TBI add other possibilities here for the weight | |
479 | if(twoD>0. && dMultRP>=2) | |
480 | { | |
481 | fCorrelationsPro[0][1]->Fill(binNo[1]-.5,twoN.Re()/twoD,twoW);; | |
482 | fCorrelationsPro[1][1]->Fill(binNo[1]++-.5,twoN.Im()/twoD,twoW);; | |
483 | } else {Warning(sMethodName.Data(),"twoD>0. &&d MultRP>=2");} | |
484 | } | |
485 | if(2==fDontGoBeyond){continue;} | |
486 | // 3-p: | |
487 | for(Int_t n3=n2;n3<=fMaxHarmonic;n3++) | |
488 | { | |
489 | if(fSkipZeroHarmonics && 0==n3){continue;} | |
490 | if(fCalculateAll | |
491 | || (fCalculateIsotropic && 0==n1+n2+n3) | |
492 | || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3)) | |
493 | || (fCalculateSameIsotropic && 0==n1+n2+n3 && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3))) | |
494 | { | |
495 | TComplex threeN = Three(n1,n2,n3); // numerator | |
496 | Double_t threeD = Three(0,0,0).Re(); // denominator | |
497 | Double_t threeW = threeD; // weight TBI add other possibilities here for the weight | |
498 | if(threeD>0. && dMultRP>=3) | |
499 | { | |
500 | fCorrelationsPro[0][2]->Fill(binNo[2]-.5,threeN.Re()/threeD,threeW); | |
501 | fCorrelationsPro[1][2]->Fill(binNo[2]++-.5,threeN.Im()/threeD,threeW); | |
502 | } else {Warning(sMethodName.Data(),"threeD>0. && dMultRP>=3");} | |
503 | } | |
504 | if(3==fDontGoBeyond){continue;} | |
505 | // 4-p: | |
506 | for(Int_t n4=n3;n4<=fMaxHarmonic;n4++) | |
507 | { | |
508 | if(fSkipZeroHarmonics && 0==n4){continue;} | |
509 | if(fCalculateAll | |
510 | || (fCalculateIsotropic && 0==n1+n2+n3+n4) | |
511 | || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) | |
512 | && TMath::Abs(n1)==TMath::Abs(n4)) | |
513 | || (fCalculateSameIsotropic && 0==n1+n2+n3+n4 && TMath::Abs(n1)==TMath::Abs(n2) | |
514 | && TMath::Abs(n1)==TMath::Abs(n3) && TMath::Abs(n1)==TMath::Abs(n4))) | |
515 | { | |
516 | TComplex fourN = Four(n1,n2,n3,n4); // numerator | |
517 | Double_t fourD = Four(0,0,0,0).Re(); // denominator | |
518 | Double_t fourW = fourD; // weight TBI add other possibilities here for the weight | |
519 | if(fourD>0. && dMultRP>=4) | |
520 | { | |
521 | fCorrelationsPro[0][3]->Fill(binNo[3]-.5,fourN.Re()/fourD,fourW); | |
522 | fCorrelationsPro[1][3]->Fill(binNo[3]++-.5,fourN.Im()/fourD,fourW); | |
523 | } else {Warning(sMethodName.Data(),"fourD>0. && dMultRP>=4");} | |
524 | } | |
525 | if(4==fDontGoBeyond){continue;} | |
526 | // 5-p: | |
527 | for(Int_t n5=n4;n5<=fMaxHarmonic;n5++) | |
528 | { | |
529 | if(fSkipZeroHarmonics && 0==n5){continue;} | |
530 | if(fCalculateAll | |
531 | || (fCalculateIsotropic && 0==n1+n2+n3+n4+n5) | |
532 | || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) | |
533 | && TMath::Abs(n1)==TMath::Abs(n4) && TMath::Abs(n1)==TMath::Abs(n5)) | |
534 | || (fCalculateSameIsotropic && 0==n1+n2+n3+n4+n5 && TMath::Abs(n1)==TMath::Abs(n2) | |
535 | && TMath::Abs(n1)==TMath::Abs(n3) && TMath::Abs(n1)==TMath::Abs(n4) && TMath::Abs(n1)==TMath::Abs(n5))) | |
536 | { | |
537 | TComplex fiveN = Five(n1,n2,n3,n4,n5); // numerator | |
538 | Double_t fiveD = Five(0,0,0,0,0).Re(); // denominator | |
539 | Double_t fiveW = fiveD; // weight TBI add other possibilities here for the weight | |
540 | if(fiveD>0. && dMultRP>=5) | |
541 | { | |
542 | fCorrelationsPro[0][4]->Fill(binNo[4]-.5,fiveN.Re()/fiveD,fiveW); | |
543 | fCorrelationsPro[1][4]->Fill(binNo[4]++-.5,fiveN.Im()/fiveD,fiveW); | |
544 | } else {Warning(sMethodName.Data(),"fiveD>0. && dMultRP>=5");} | |
545 | } | |
546 | if(5==fDontGoBeyond){continue;} | |
547 | // 6-p: | |
548 | for(Int_t n6=n5;n6<=fMaxHarmonic;n6++) | |
549 | { | |
550 | if(fSkipZeroHarmonics && 0==n6){continue;} | |
551 | if(fCalculateAll | |
552 | || (fCalculateIsotropic && 0==n1+n2+n3+n4+n5+n6) | |
553 | || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) | |
554 | && TMath::Abs(n1)==TMath::Abs(n4) && TMath::Abs(n1)==TMath::Abs(n5) && TMath::Abs(n1)==TMath::Abs(n6)) | |
555 | || (fCalculateSameIsotropic && 0==n1+n2+n3+n4+n5+n6 && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) | |
556 | && TMath::Abs(n1)==TMath::Abs(n4) && TMath::Abs(n1)==TMath::Abs(n5) && TMath::Abs(n1)==TMath::Abs(n6))) | |
557 | { | |
558 | TComplex sixN = Six(n1,n2,n3,n4,n5,n6); // numerator | |
559 | Double_t sixD = Six(0,0,0,0,0,0).Re(); // denominator | |
560 | Double_t sixW = sixD; // weight TBI add other possibilities here for the weight | |
561 | if(sixD>0. && dMultRP>=6) | |
562 | { | |
563 | fCorrelationsPro[0][5]->Fill(binNo[5]-.5,sixN.Re()/sixD,sixW); | |
564 | fCorrelationsPro[1][5]->Fill(binNo[5]++-.5,sixN.Im()/sixD,sixW); | |
565 | } else {Warning(sMethodName.Data(),"sixD>0. && dMultRP>=6");} | |
566 | } | |
567 | if(6==fDontGoBeyond){continue;} | |
568 | // 7-p: | |
569 | for(Int_t n7=n6;n7<=fMaxHarmonic;n7++) | |
570 | { | |
571 | if(fSkipZeroHarmonics && 0==n7){continue;} | |
572 | if(fCalculateAll | |
573 | || (fCalculateIsotropic && 0==n1+n2+n3+n4+n5+n6+n7) | |
574 | || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) && TMath::Abs(n1)==TMath::Abs(n4) | |
575 | && TMath::Abs(n1)==TMath::Abs(n5) && TMath::Abs(n1)==TMath::Abs(n6) && TMath::Abs(n1)==TMath::Abs(n7)) | |
576 | || (fCalculateSameIsotropic && 0==n1+n2+n3+n4+n5+n6+n7 && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) | |
577 | && TMath::Abs(n1)==TMath::Abs(n4) && TMath::Abs(n1)==TMath::Abs(n5) && TMath::Abs(n1)==TMath::Abs(n6) | |
578 | && TMath::Abs(n1)==TMath::Abs(n7))) | |
579 | { | |
580 | TComplex sevenN = Seven(n1,n2,n3,n4,n5,n6,n7); // numerator | |
581 | Double_t sevenD = Seven(0,0,0,0,0,0,0).Re(); // denominator | |
582 | Double_t sevenW = sevenD; // weight TBI add other possibilities here for the weight | |
583 | if(sevenD>0. && dMultRP>=7) | |
584 | { | |
585 | fCorrelationsPro[0][6]->Fill(binNo[6]-.5,sevenN.Re()/sevenD,sevenW); | |
586 | fCorrelationsPro[1][6]->Fill(binNo[6]++-.5,sevenN.Im()/sevenD,sevenW); | |
587 | } else {Warning(sMethodName.Data(),"sevenD>0. && dMultRP>=7");} | |
588 | } | |
589 | if(7==fDontGoBeyond){continue;} | |
590 | // 8-p: | |
591 | for(Int_t n8=n7;n8<=fMaxHarmonic;n8++) | |
592 | { | |
593 | if(fSkipZeroHarmonics && 0==n8){continue;} | |
594 | if(fCalculateAll | |
595 | || (fCalculateIsotropic && 0==n1+n2+n3+n4+n5+n6+n7+n8) | |
596 | || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) && TMath::Abs(n1)==TMath::Abs(n4) | |
597 | && TMath::Abs(n1)==TMath::Abs(n5) && TMath::Abs(n1)==TMath::Abs(n6) && TMath::Abs(n1)==TMath::Abs(n7) | |
598 | && TMath::Abs(n1)==TMath::Abs(n8)) | |
599 | || (fCalculateSameIsotropic && 0==n1+n2+n3+n4+n5+n6+n7+n8 && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) | |
600 | && TMath::Abs(n1)==TMath::Abs(n4) && TMath::Abs(n1)==TMath::Abs(n5) && TMath::Abs(n1)==TMath::Abs(n6) | |
601 | && TMath::Abs(n1)==TMath::Abs(n7) && TMath::Abs(n1)==TMath::Abs(n8))) | |
602 | { | |
603 | TComplex eightN = Eight(n1,n2,n3,n4,n5,n6,n7,n8); // numerator | |
604 | Double_t eightD = Eight(0,0,0,0,0,0,0,0).Re(); // denominator | |
605 | Double_t eightW = eightD; // weight TBI add other possibilities here for the weight | |
606 | if(eightD>0. && dMultRP>=8) | |
607 | { | |
608 | fCorrelationsPro[0][7]->Fill(binNo[7]-.5,eightN.Re()/eightD,eightW); | |
609 | fCorrelationsPro[1][7]->Fill(binNo[7]++-.5,eightN.Im()/eightD,eightW); | |
610 | } | |
611 | } | |
612 | } // for(Int_t n8=n7;n8<=fMaxHarmonic;n8++) | |
613 | } // for(Int_t n7=n6;n7<=fMaxHarmonic;n7++) | |
614 | } // for(Int_t n6=n5;n6<=fMaxHarmonic;n6++) | |
615 | } // for(Int_t n5=n4;n5<=fMaxHarmonic;n5++) | |
616 | } // for(Int_t n4=n3;n4<=fMaxHarmonic;n4++) | |
617 | } // for(Int_t n3=n2;n3<=fMaxHarmonic;n3++) | |
618 | } // for(Int_t n2=n1;n2<=fMaxHarmonic;n2++) | |
619 | } // for(Int_t n1=-fMaxHarmonic;n1<=fMaxHarmonic;n1++) | |
620 | ||
621 | } // void AliFlowAnalysisWithMultiparticleCorrelations::CalculateCorrelations(AliFlowEventSimple *anEvent) | |
7ecb5af4 | 622 | |
623 | //======================================================================================================================= | |
624 | ||
6d19c373 | 625 | Double_t AliFlowAnalysisWithMultiparticleCorrelations::CastStringToCorrelation(const char *string, Bool_t numerator) |
626 | { | |
627 | // Cast string of the generic form Cos/Sin(-n_1,-n_2,...,n_{k-1},n_k) in the corresponding correlation value. | |
628 | // If you issue a call to this method with setting numerator = kFALSE, then you are getting back for free | |
629 | // the corresponding denumerator (a.k.a. weight 'number of combinations'). | |
630 | ||
631 | // TBI: | |
632 | // a) add protection against cases a la: | |
633 | // string = Cos(-3,-4,5,6,5,6-3) | |
634 | // method = Six(-3,-4,5,6,5,-3).Re() | |
635 | // b) cross-check with nested loops this method | |
636 | ||
637 | Double_t dValue = 0.; // return value | |
638 | ||
639 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::CastStringToCorrelation(const char *string, Bool_t numerator)"; | |
640 | ||
641 | if(!(TString(string).BeginsWith("Cos") || TString(string).BeginsWith("Sin"))) | |
642 | { | |
643 | cout<<Form("And the fatal string is... '%s'. Congratulations!!",string)<<endl; | |
644 | Fatal(sMethodName.Data(),"!(TString(string).BeginsWith(..."); | |
645 | } | |
646 | ||
647 | Bool_t bRealPart = kTRUE; | |
648 | if(TString(string).BeginsWith("Sin")){bRealPart = kFALSE;} | |
649 | ||
650 | Int_t n[8] = {0,0,0,0,0,0,0,0}; // harmonics, supporting up to 8p correlations | |
651 | UInt_t whichCorr = 0; | |
652 | for(Int_t t=0;t<=TString(string).Length();t++) | |
653 | { | |
654 | if(TString(string[t]).EqualTo(",") || TString(string[t]).EqualTo(")")) // TBI this is just ugly | |
655 | { | |
656 | n[whichCorr] = string[t-1] - '0'; | |
657 | if(TString(string[t-2]).EqualTo("-")){n[whichCorr] = -1*n[whichCorr];} | |
658 | if(!(TString(string[t-2]).EqualTo("-") | |
659 | || TString(string[t-2]).EqualTo(",") | |
660 | || TString(string[t-2]).EqualTo("("))) // TBI relax this eventually to allow two-digits harmonics | |
661 | { | |
662 | cout<<Form("And the fatal string is... '%s'. Congratulations!!",string)<<endl; | |
663 | Fatal(sMethodName.Data(),"!(TString(string[t-2]).EqualTo(..."); | |
664 | } | |
665 | whichCorr++; | |
666 | if(whichCorr>=9){Fatal(sMethodName.Data(),"whichCorr>=9");} // not supporting corr. beyond 8p | |
667 | } // if(TString(string[t]).EqualTo(",") || TString(string[t]).EqualTo(")")) // TBI this is just ugly | |
668 | } // for(UInt_t t=0;t<=TString(string).Length();t++) | |
669 | ||
670 | switch(whichCorr) | |
671 | { | |
672 | case 1: | |
673 | if(!numerator){dValue = One(0).Re();} | |
674 | else if(bRealPart){dValue = One(n[0]).Re();} | |
675 | else{dValue = One(n[0]).Im();} | |
676 | break; | |
677 | ||
678 | case 2: | |
679 | if(!numerator){dValue = Two(0,0).Re();} | |
680 | else if(bRealPart){dValue = Two(n[0],n[1]).Re();} | |
681 | else{dValue = Two(n[0],n[1]).Im();} | |
682 | break; | |
683 | ||
684 | case 3: | |
685 | if(!numerator){dValue = Three(0,0,0).Re();} | |
686 | else if(bRealPart){dValue = Three(n[0],n[1],n[2]).Re();} | |
687 | else{dValue = Three(n[0],n[1],n[2]).Im();} | |
688 | break; | |
689 | ||
690 | case 4: | |
691 | if(!numerator){dValue = Four(0,0,0,0).Re();} | |
692 | else if(bRealPart){dValue = Four(n[0],n[1],n[2],n[3]).Re();} | |
693 | else{dValue = Four(n[0],n[1],n[2],n[3]).Im();} | |
694 | break; | |
695 | ||
696 | case 5: | |
697 | if(!numerator){dValue = Five(0,0,0,0,0).Re();} | |
698 | else if(bRealPart){dValue = Five(n[0],n[1],n[2],n[3],n[4]).Re();} | |
699 | else{dValue = Five(n[0],n[1],n[2],n[3],n[4]).Im();} | |
700 | break; | |
701 | ||
702 | case 6: | |
703 | if(!numerator){dValue = Six(0,0,0,0,0,0).Re();} | |
704 | else if(bRealPart){dValue = Six(n[0],n[1],n[2],n[3],n[4],n[5]).Re();} | |
705 | else{dValue = Six(n[0],n[1],n[2],n[3],n[4],n[5]).Im();} | |
706 | break; | |
707 | ||
708 | case 7: | |
709 | if(!numerator){dValue = Seven(0,0,0,0,0,0,0).Re();} | |
710 | else if(bRealPart){dValue = Seven(n[0],n[1],n[2],n[3],n[4],n[5],n[6]).Re();} | |
711 | else{dValue = Seven(n[0],n[1],n[2],n[3],n[4],n[5],n[6]).Im();} | |
712 | break; | |
713 | ||
714 | case 8: | |
715 | if(!numerator){dValue = Eight(0,0,0,0,0,0,0,0).Re();} | |
716 | else if(bRealPart){dValue = Eight(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]).Re();} | |
717 | else{dValue = Eight(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]).Im();} | |
718 | break; | |
719 | ||
720 | default: | |
721 | cout<<Form("And the fatal 'whichCorr' value is... %d. Congratulations!!",whichCorr)<<endl; | |
722 | Fatal(sMethodName.Data(),"switch(whichCorr)"); | |
723 | } // switch(whichCorr) | |
724 | ||
725 | return dValue; | |
726 | ||
727 | } // Double_t AliFlowAnalysisWithMultiparticleCorrelations::CastStringToCorrelation(const char *string, Bool_t numerator) | |
728 | ||
729 | //======================================================================================================================= | |
730 | ||
731 | void AliFlowAnalysisWithMultiparticleCorrelations::CalculateProductsOfCorrelations(AliFlowEventSimple *anEvent) | |
732 | { | |
733 | // Calculate products of multi-particle correlations (needed for error propagation of SCs). | |
734 | ||
735 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::CalculateProductsOfCorrelations()"; | |
736 | if(!anEvent){Fatal(sMethodName.Data(),"Sorry, 'anEvent' is on holidays.");} | |
737 | ||
738 | Int_t nBins = fProductsPro2D->GetXaxis()->GetNbins(); | |
739 | for(Int_t bx=2;bx<=nBins;bx++) | |
740 | { | |
741 | for(Int_t by=1;by<bx;by++) | |
742 | { | |
743 | const char *binLabelX = fProductsPro2D->GetXaxis()->GetBinLabel(bx); | |
744 | const char *binLabelY = fProductsPro2D->GetYaxis()->GetBinLabel(by); | |
745 | Double_t numX = this->CastStringToCorrelation(binLabelX,kTRUE); // numerator | |
746 | Double_t denX = this->CastStringToCorrelation(binLabelX,kFALSE); // denominator | |
747 | Double_t wX = denX; // weight TBI add support for other options | |
748 | Double_t numY = this->CastStringToCorrelation(binLabelY,kTRUE); // numerator | |
749 | Double_t denY = this->CastStringToCorrelation(binLabelY,kFALSE); // denominator | |
750 | Double_t wY = denY; // weight TBI add support for other options | |
751 | if(TMath::Abs(denX) > 0. && TMath::Abs(denY) > 0.) | |
752 | { | |
753 | fProductsPro2D->Fill(bx-0.5,by-0.5,(numX/denX)*(numY/denY),wX*wY); | |
754 | } | |
755 | else{Fatal(sMethodName.Data(),"if(TMath::Abs(denX) > 0. && TMath::Abs(denY) > 0.)");} | |
756 | } // for(Int_t by=1;by<bx;by++) | |
757 | } // for(Int_t bx=2;bx<=nbins;bx++) | |
758 | ||
759 | } // void AliFlowAnalysisWithMultiparticleCorrelations::CalculateProductsOfCorrelations(AliFlowEventSimple *anEvent) | |
760 | ||
761 | //======================================================================================================================= | |
762 | ||
7ecb5af4 | 763 | void AliFlowAnalysisWithMultiparticleCorrelations::CalculateCumulants() |
764 | { | |
765 | // Calculate e-b-e cumulants from Q-vector components. | |
766 | ||
767 | // 2-p. | |
768 | ||
769 | // 2-p: | |
770 | for(Int_t ci=1;ci<=6;ci++) | |
771 | { | |
772 | Double_t twoNum = Two(ci,-ci).Re(); // numerator TBI | |
773 | Double_t twoDen = Two(0,0).Re(); // denominator TBI | |
774 | ||
775 | TComplex oneFirstNum = One(ci); // numerator TBI | |
776 | Double_t oneFirstDen = One(0).Re(); // denominator TBI | |
777 | ||
778 | TComplex oneSecondNum = One(-ci); // numerator TBI | |
779 | Double_t oneSecondDen = One(0).Re(); // denominator TBI | |
780 | ||
781 | if(TMath::Abs(twoDen)>0 && TMath::Abs(oneFirstDen*oneSecondDen) > 0) // protection against zero TBI | |
782 | { | |
783 | Double_t cumulant = twoNum/twoDen - (oneFirstNum*oneSecondNum).Re()/(oneFirstDen*oneSecondDen); | |
784 | f2pCumulantsPro->Fill(ci-0.5,cumulant,1.); // TBI add choices for the weights | |
785 | } | |
786 | } // for(Int_t ci=1;ci<=6;ci++) | |
787 | ||
788 | } // void AliFlowAnalysisWithMultiparticleCorrelations::CalculateCumulants() | |
789 | ||
790 | //======================================================================================================================= | |
791 | ||
792 | void AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckWithNestedLoops(AliFlowEventSimple *anEvent) | |
793 | { | |
794 | // Cross-check results for multi-particle correlations with nested loops. | |
795 | ||
796 | // TBI add few comments here, there and over there | |
797 | // TBI this method is rather messy :'( | |
798 | ||
9efbd2f5 | 799 | Int_t h1 = (Int_t)fNestedLoopsFlagsPro->GetBinContent(2); |
800 | Int_t h2 = (Int_t)fNestedLoopsFlagsPro->GetBinContent(3); | |
801 | Int_t h3 = (Int_t)fNestedLoopsFlagsPro->GetBinContent(4); | |
802 | Int_t h4 = (Int_t)fNestedLoopsFlagsPro->GetBinContent(5); | |
803 | Int_t h5 = (Int_t)fNestedLoopsFlagsPro->GetBinContent(6); | |
804 | Int_t h6 = (Int_t)fNestedLoopsFlagsPro->GetBinContent(7); | |
805 | Int_t h7 = (Int_t)fNestedLoopsFlagsPro->GetBinContent(8); | |
806 | Int_t h8 = (Int_t)fNestedLoopsFlagsPro->GetBinContent(9); | |
7ecb5af4 | 807 | |
808 | this->ResetQvector(); | |
809 | this->FillQvector(anEvent); | |
810 | ||
811 | fNestedLoopsResultsCosPro->Fill(1.5,One(h1).Re()/One(0).Re(),One(0).Re()); | |
812 | fNestedLoopsResultsSinPro->Fill(1.5,One(h1).Im()/One(0).Re(),One(0).Re()); | |
813 | fNestedLoopsResultsCosPro->Fill(3.5,Two(h1,h2).Re()/Two(0,0).Re(),Two(0,0).Re()); | |
814 | fNestedLoopsResultsSinPro->Fill(3.5,Two(h1,h2).Im()/Two(0,0).Re(),Two(0,0).Re()); | |
815 | fNestedLoopsResultsCosPro->Fill(5.5,Three(h1,h2,h3).Re()/Three(0,0,0).Re(),Three(0,0,0).Re()); | |
816 | fNestedLoopsResultsSinPro->Fill(5.5,Three(h1,h2,h3).Im()/Three(0,0,0).Re(),Three(0,0,0).Re()); | |
817 | fNestedLoopsResultsCosPro->Fill(7.5,Four(h1,h2,h3,h4).Re()/Four(0,0,0,0).Re(),Four(0,0,0,0).Re()); | |
818 | fNestedLoopsResultsSinPro->Fill(7.5,Four(h1,h2,h3,h4).Im()/Four(0,0,0,0).Re(),Four(0,0,0,0).Re()); | |
819 | fNestedLoopsResultsCosPro->Fill(9.5,Five(h1,h2,h3,h4,h5).Re()/Five(0,0,0,0,0).Re(),Five(0,0,0,0,0).Re()); | |
820 | fNestedLoopsResultsSinPro->Fill(9.5,Five(h1,h2,h3,h4,h5).Im()/Five(0,0,0,0,0).Re(),Five(0,0,0,0,0).Re()); | |
821 | fNestedLoopsResultsCosPro->Fill(11.5,Six(h1,h2,h3,h4,h5,h6).Re()/Six(0,0,0,0,0,0).Re(),Six(0,0,0,0,0,0).Re()); | |
822 | fNestedLoopsResultsSinPro->Fill(11.5,Six(h1,h2,h3,h4,h5,h6).Im()/Six(0,0,0,0,0,0).Re(),Six(0,0,0,0,0,0).Re()); | |
823 | //fNestedLoopsResultsCosPro->Fill(13.5,Seven(h1,h2,h3,h4,h5,h6,h7).Re()/Seven(0,0,0,0,0,0,0).Re(),Seven(0,0,0,0,0,0,0).Re()); | |
824 | //fNestedLoopsResultsSinPro->Fill(13.5,Seven(h1,h2,h3,h4,h5,h6,h7).Im()/Seven(0,0,0,0,0,0,0).Re(),Seven(0,0,0,0,0,0,0).Re()); | |
825 | //fNestedLoopsResultsCosPro->Fill(15.5,Eight(h1,h2,h3,h4,h5,h6,h7,h8).Re()/Eight(0,0,0,0,0,0,0,0).Re(),Eight(0,0,0,0,0,0,0,0).Re()); | |
826 | //fNestedLoopsResultsSinPro->Fill(15.5,Eight(h1,h2,h3,h4,h5,h6,h7,h8).Im()/Eight(0,0,0,0,0,0,0,0).Re(),Eight(0,0,0,0,0,0,0,0).Re()); | |
827 | ||
828 | Int_t nPrim = anEvent->NumberOfTracks(); | |
6696a113 | 829 | Double_t dMultRP = anEvent->GetNumberOfRPs(); // TBI shall I promote this variable into data member? |
7ecb5af4 | 830 | AliFlowTrackSimple *aftsTrack = NULL; |
831 | Double_t dPhi1=0.,dPhi2=0.,dPhi3=0.,dPhi4=0.,dPhi5=0.,dPhi6=0.,dPhi7=0.,dPhi8=0.; | |
832 | Double_t wPhi1=1.,wPhi2=1.,wPhi3=1.,wPhi4=1.,wPhi5=1.,wPhi6=1.,wPhi7=1.,wPhi8=1.; | |
833 | ||
834 | // 1-particle stuff: TBI | |
6696a113 | 835 | if(dMultRP>=1) |
7ecb5af4 | 836 | { |
837 | for(Int_t i1=0;i1<nPrim;i1++) | |
838 | { | |
839 | aftsTrack = anEvent->GetTrack(i1); | |
840 | if(!(aftsTrack->InRPSelection())){continue;} | |
841 | dPhi1 = aftsTrack->Phi(); | |
842 | if(fUsePhiWeights){wPhi1 = PhiWeight(dPhi1);} | |
843 | // Fill: | |
844 | fNestedLoopsResultsCosPro->Fill(0.5,TMath::Cos(h1*dPhi1),wPhi1); | |
845 | fNestedLoopsResultsSinPro->Fill(0.5,TMath::Sin(h1*dPhi1),wPhi1); | |
846 | } // end of for(Int_t i1=0;i1<nPrim;i1++) | |
847 | } // end of if(nPrim>=1) | |
848 | ||
849 | // 2-particle correlations: | |
6696a113 | 850 | if(dMultRP>=2) |
7ecb5af4 | 851 | { |
852 | for(Int_t i1=0;i1<nPrim;i1++) | |
853 | { | |
854 | aftsTrack = anEvent->GetTrack(i1); | |
855 | if(!(aftsTrack->InRPSelection())){continue;} | |
856 | dPhi1 = aftsTrack->Phi(); | |
857 | if(fUsePhiWeights){wPhi1 = PhiWeight(dPhi1);} | |
858 | for(Int_t i2=0;i2<nPrim;i2++) | |
859 | { | |
860 | if(i2==i1){continue;} | |
861 | aftsTrack = anEvent->GetTrack(i2); | |
862 | if(!(aftsTrack->InRPSelection())){continue;} | |
863 | dPhi2 = aftsTrack->Phi(); | |
864 | if(fUsePhiWeights){wPhi2 = PhiWeight(dPhi2);} | |
865 | // Fill: | |
866 | fNestedLoopsResultsCosPro->Fill(2.5,TMath::Cos(h1*dPhi1+h2*dPhi2),wPhi1*wPhi2); | |
867 | fNestedLoopsResultsSinPro->Fill(2.5,TMath::Sin(h1*dPhi1+h2*dPhi2),wPhi1*wPhi2); | |
868 | } // end of for(Int_t i2=0;i2<nPrim;i2++) | |
869 | } // end of for(Int_t i1=0;i1<nPrim;i1++) | |
870 | } // end of if(nPrim>=2) | |
871 | ||
872 | // 3-particle correlations: | |
6696a113 | 873 | if(dMultRP>=3) |
7ecb5af4 | 874 | { |
875 | for(Int_t i1=0;i1<nPrim;i1++) | |
876 | { | |
877 | aftsTrack=anEvent->GetTrack(i1); | |
878 | if(!(aftsTrack->InRPSelection())){continue;} | |
879 | dPhi1=aftsTrack->Phi(); | |
880 | if(fUsePhiWeights){wPhi1 = PhiWeight(dPhi1);} | |
881 | for(Int_t i2=0;i2<nPrim;i2++) | |
882 | { | |
883 | if(i2==i1){continue;} | |
884 | aftsTrack=anEvent->GetTrack(i2); | |
885 | if(!(aftsTrack->InRPSelection())){continue;} | |
886 | dPhi2=aftsTrack->Phi(); | |
887 | if(fUsePhiWeights){wPhi2 = PhiWeight(dPhi2);} | |
888 | for(Int_t i3=0;i3<nPrim;i3++) | |
889 | { | |
890 | if(i3==i1||i3==i2){continue;} | |
891 | aftsTrack=anEvent->GetTrack(i3); | |
892 | if(!(aftsTrack->InRPSelection())){continue;} | |
893 | dPhi3=aftsTrack->Phi(); | |
894 | if(fUsePhiWeights){wPhi3 = PhiWeight(dPhi3);} | |
895 | // Fill: | |
896 | fNestedLoopsResultsCosPro->Fill(4.5,TMath::Cos(h1*dPhi1+h2*dPhi2+h3*dPhi3),wPhi1*wPhi2*wPhi3); | |
897 | fNestedLoopsResultsSinPro->Fill(4.5,TMath::Sin(h1*dPhi1+h2*dPhi2+h3*dPhi3),wPhi1*wPhi2*wPhi3); | |
898 | } // end of for(Int_t i3=0;i3<nPrim;i3++) | |
899 | } // end of for(Int_t i2=0;i2<nPrim;i2++) | |
900 | } // end of for(Int_t i1=0;i1<nPrim;i1++) | |
901 | } // end of if(nPrim>=3) | |
902 | ||
903 | // 4-particle correlations: | |
6696a113 | 904 | if(dMultRP>=4) |
7ecb5af4 | 905 | { |
906 | for(Int_t i1=0;i1<nPrim;i1++) | |
907 | { | |
908 | aftsTrack=anEvent->GetTrack(i1); | |
909 | if(!(aftsTrack->InRPSelection())){continue;} | |
910 | dPhi1=aftsTrack->Phi(); | |
911 | if(fUsePhiWeights){wPhi1 = PhiWeight(dPhi1);} | |
912 | for(Int_t i2=0;i2<nPrim;i2++) | |
913 | { | |
914 | if(i2==i1){continue;} | |
915 | aftsTrack=anEvent->GetTrack(i2); | |
916 | if(!(aftsTrack->InRPSelection())){continue;} | |
917 | dPhi2=aftsTrack->Phi(); | |
918 | if(fUsePhiWeights){wPhi2 = PhiWeight(dPhi2);} | |
919 | for(Int_t i3=0;i3<nPrim;i3++) | |
920 | { | |
921 | if(i3==i1||i3==i2){continue;} | |
922 | aftsTrack=anEvent->GetTrack(i3); | |
923 | if(!(aftsTrack->InRPSelection())){continue;} | |
924 | dPhi3=aftsTrack->Phi(); | |
925 | if(fUsePhiWeights){wPhi3 = PhiWeight(dPhi3);} | |
926 | for(Int_t i4=0;i4<nPrim;i4++) | |
927 | { | |
928 | if(i4==i1||i4==i2||i4==i3){continue;} | |
929 | aftsTrack=anEvent->GetTrack(i4); | |
930 | if(!(aftsTrack->InRPSelection())){continue;} | |
931 | dPhi4=aftsTrack->Phi(); | |
932 | if(fUsePhiWeights){wPhi4 = PhiWeight(dPhi4);} | |
933 | // Fill: | |
934 | fNestedLoopsResultsCosPro->Fill(6.5,TMath::Cos(h1*dPhi1+h2*dPhi2+h3*dPhi3+h4*dPhi4),wPhi1*wPhi2*wPhi3*wPhi4); | |
935 | fNestedLoopsResultsSinPro->Fill(6.5,TMath::Sin(h1*dPhi1+h2*dPhi2+h3*dPhi3+h4*dPhi4),wPhi1*wPhi2*wPhi3*wPhi4); | |
936 | } // end of for(Int_t i4=0;i4<nPrim;i4++) | |
937 | } // end of for(Int_t i3=0;i3<nPrim;i3++) | |
938 | } // end of for(Int_t i2=0;i2<nPrim;i2++) | |
939 | } // end of for(Int_t i1=0;i1<nPrim;i1++) | |
940 | } // end of if(nPrim>=) | |
941 | ||
942 | // 5-particle correlations: | |
6696a113 | 943 | if(dMultRP>=5) |
7ecb5af4 | 944 | { |
945 | for(Int_t i1=0;i1<nPrim;i1++) | |
946 | { | |
947 | aftsTrack=anEvent->GetTrack(i1); | |
948 | if(!(aftsTrack->InRPSelection())){continue;} | |
949 | dPhi1=aftsTrack->Phi(); | |
950 | if(fUsePhiWeights){wPhi1 = PhiWeight(dPhi1);} | |
951 | for(Int_t i2=0;i2<nPrim;i2++) | |
952 | { | |
953 | if(i2==i1){continue;} | |
954 | aftsTrack=anEvent->GetTrack(i2); | |
955 | if(!(aftsTrack->InRPSelection())){continue;} | |
956 | dPhi2=aftsTrack->Phi(); | |
957 | if(fUsePhiWeights){wPhi2 = PhiWeight(dPhi2);} | |
958 | for(Int_t i3=0;i3<nPrim;i3++) | |
959 | { | |
960 | if(i3==i1||i3==i2){continue;} | |
961 | aftsTrack=anEvent->GetTrack(i3); | |
962 | if(!(aftsTrack->InRPSelection())){continue;} | |
963 | dPhi3=aftsTrack->Phi(); | |
964 | if(fUsePhiWeights){wPhi3 = PhiWeight(dPhi3);} | |
965 | for(Int_t i4=0;i4<nPrim;i4++) | |
966 | { | |
967 | if(i4==i1||i4==i2||i4==i3){continue;} | |
968 | aftsTrack=anEvent->GetTrack(i4); | |
969 | if(!(aftsTrack->InRPSelection())){continue;} | |
970 | dPhi4=aftsTrack->Phi(); | |
971 | if(fUsePhiWeights){wPhi4 = PhiWeight(dPhi4);} | |
972 | for(Int_t i5=0;i5<nPrim;i5++) | |
973 | { | |
974 | if(i5==i1||i5==i2||i5==i3||i5==i4){continue;} | |
975 | aftsTrack=anEvent->GetTrack(i5); | |
976 | if(!(aftsTrack->InRPSelection())){continue;} | |
977 | dPhi5=aftsTrack->Phi(); | |
978 | if(fUsePhiWeights){wPhi5 = PhiWeight(dPhi5);} | |
979 | // Fill: | |
980 | fNestedLoopsResultsCosPro->Fill(8.5,TMath::Cos(h1*dPhi1+h2*dPhi2+h3*dPhi3+h4*dPhi4+h5*dPhi5),wPhi1*wPhi2*wPhi3*wPhi4*wPhi5); | |
981 | fNestedLoopsResultsSinPro->Fill(8.5,TMath::Sin(h1*dPhi1+h2*dPhi2+h3*dPhi3+h4*dPhi4+h5*dPhi5),wPhi1*wPhi2*wPhi3*wPhi4*wPhi5); | |
982 | } // end of for(Int_t i5=0;i5<nPrim;i5++) | |
983 | } // end of for(Int_t i4=0;i4<nPrim;i4++) | |
984 | } // end of for(Int_t i3=0;i3<nPrim;i3++) | |
985 | } // end of for(Int_t i2=0;i2<nPrim;i2++) | |
986 | } // end of for(Int_t i1=0;i1<nPrim;i1++) | |
987 | } // end of if(nPrim>=5) | |
988 | ||
989 | // 6-particle correlations: | |
6696a113 | 990 | if(dMultRP>=6) |
7ecb5af4 | 991 | { |
992 | for(Int_t i1=0;i1<nPrim;i1++) | |
993 | { | |
994 | aftsTrack=anEvent->GetTrack(i1); | |
995 | if(!(aftsTrack->InRPSelection())){continue;} | |
996 | dPhi1=aftsTrack->Phi(); | |
997 | if(fUsePhiWeights){wPhi1 = PhiWeight(dPhi1);} | |
998 | for(Int_t i2=0;i2<nPrim;i2++) | |
999 | { | |
1000 | if(i2==i1){continue;} | |
1001 | aftsTrack=anEvent->GetTrack(i2); | |
1002 | if(!(aftsTrack->InRPSelection())){continue;} | |
1003 | dPhi2=aftsTrack->Phi(); | |
1004 | if(fUsePhiWeights){wPhi2 = PhiWeight(dPhi2);} | |
1005 | for(Int_t i3=0;i3<nPrim;i3++) | |
1006 | { | |
1007 | if(i3==i1||i3==i2){continue;} | |
1008 | aftsTrack=anEvent->GetTrack(i3); | |
1009 | if(!(aftsTrack->InRPSelection())){continue;} | |
1010 | dPhi3=aftsTrack->Phi(); | |
1011 | if(fUsePhiWeights){wPhi3 = PhiWeight(dPhi3);} | |
1012 | for(Int_t i4=0;i4<nPrim;i4++) | |
1013 | { | |
1014 | if(i4==i1||i4==i2||i4==i3){continue;} | |
1015 | aftsTrack=anEvent->GetTrack(i4); | |
1016 | if(!(aftsTrack->InRPSelection())){continue;} | |
1017 | dPhi4=aftsTrack->Phi(); | |
1018 | if(fUsePhiWeights){wPhi4 = PhiWeight(dPhi4);} | |
1019 | for(Int_t i5=0;i5<nPrim;i5++) | |
1020 | { | |
1021 | if(i5==i1||i5==i2||i5==i3||i5==i4){continue;} | |
1022 | aftsTrack=anEvent->GetTrack(i5); | |
1023 | if(!(aftsTrack->InRPSelection())){continue;} | |
1024 | dPhi5=aftsTrack->Phi(); | |
1025 | if(fUsePhiWeights){wPhi5=PhiWeight(dPhi5);} | |
1026 | for(Int_t i6=0;i6<nPrim;i6++) | |
1027 | { | |
1028 | if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5){continue;} | |
1029 | aftsTrack=anEvent->GetTrack(i6); | |
1030 | if(!(aftsTrack->InRPSelection())){continue;} | |
1031 | dPhi6=aftsTrack->Phi(); | |
1032 | if(fUsePhiWeights){wPhi6=PhiWeight(dPhi6);} | |
1033 | // Fill: | |
1034 | fNestedLoopsResultsCosPro->Fill(10.5,TMath::Cos(h1*dPhi1+h2*dPhi2+h3*dPhi3+h4*dPhi4+h5*dPhi5+h6*dPhi6),wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6); | |
1035 | fNestedLoopsResultsSinPro->Fill(10.5,TMath::Sin(h1*dPhi1+h2*dPhi2+h3*dPhi3+h4*dPhi4+h5*dPhi5+h6*dPhi6),wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6); | |
1036 | } // end of for(Int_t i6=0;i6<nPrim;i6++) | |
1037 | } // end of for(Int_t i5=0;i5<nPrim;i5++) | |
1038 | } // end of for(Int_t i4=0;i4<nPrim;i4++) | |
1039 | } // end of for(Int_t i3=0;i3<nPrim;i3++) | |
1040 | } // end of for(Int_t i2=0;i2<nPrim;i2++) | |
1041 | } // end of for(Int_t i1=0;i1<nPrim;i1++) | |
1042 | } // end of if(nPrim>=6) | |
1043 | ||
1044 | // 7-particle correlations: | |
6696a113 | 1045 | if(dMultRP>=7) |
7ecb5af4 | 1046 | { |
1047 | for(Int_t i1=0;i1<nPrim;i1++) | |
1048 | { | |
1049 | aftsTrack=anEvent->GetTrack(i1); | |
1050 | if(!(aftsTrack->InRPSelection())){continue;} | |
1051 | dPhi1=aftsTrack->Phi(); | |
1052 | if(fUsePhiWeights){wPhi1=PhiWeight(dPhi1);} | |
1053 | for(Int_t i2=0;i2<nPrim;i2++) | |
1054 | { | |
1055 | if(i2==i1){continue;} | |
1056 | aftsTrack=anEvent->GetTrack(i2); | |
1057 | if(!(aftsTrack->InRPSelection())){continue;} | |
1058 | dPhi2=aftsTrack->Phi(); | |
1059 | if(fUsePhiWeights){wPhi2=PhiWeight(dPhi2);} | |
1060 | for(Int_t i3=0;i3<nPrim;i3++) | |
1061 | { | |
1062 | if(i3==i1||i3==i2){continue;} | |
1063 | aftsTrack=anEvent->GetTrack(i3); | |
1064 | if(!(aftsTrack->InRPSelection())){continue;} | |
1065 | dPhi3=aftsTrack->Phi(); | |
1066 | if(fUsePhiWeights){wPhi3=PhiWeight(dPhi3);} | |
1067 | for(Int_t i4=0;i4<nPrim;i4++) | |
1068 | { | |
1069 | if(i4==i1||i4==i2||i4==i3){continue;} | |
1070 | aftsTrack=anEvent->GetTrack(i4); | |
1071 | if(!(aftsTrack->InRPSelection())){continue;} | |
1072 | dPhi4=aftsTrack->Phi(); | |
1073 | if(fUsePhiWeights){wPhi4=PhiWeight(dPhi4);} | |
1074 | for(Int_t i5=0;i5<nPrim;i5++) | |
1075 | { | |
1076 | if(i5==i1||i5==i2||i5==i3||i5==i4){continue;} | |
1077 | aftsTrack=anEvent->GetTrack(i5); | |
1078 | if(!(aftsTrack->InRPSelection())){continue;} | |
1079 | dPhi5=aftsTrack->Phi(); | |
1080 | if(fUsePhiWeights){wPhi5=PhiWeight(dPhi5);} | |
1081 | for(Int_t i6=0;i6<nPrim;i6++) | |
1082 | { | |
1083 | if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5){continue;} | |
1084 | aftsTrack=anEvent->GetTrack(i6); | |
1085 | if(!(aftsTrack->InRPSelection())){continue;} | |
1086 | dPhi6=aftsTrack->Phi(); | |
1087 | if(fUsePhiWeights){wPhi6=PhiWeight(dPhi6);} | |
1088 | for(Int_t i7=0;i7<nPrim;i7++) | |
1089 | { | |
1090 | if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6){continue;} | |
1091 | aftsTrack=anEvent->GetTrack(i7); | |
1092 | if(!(aftsTrack->InRPSelection())){continue;} | |
1093 | dPhi7=aftsTrack->Phi(); | |
1094 | if(fUsePhiWeights){wPhi7=PhiWeight(dPhi7);} | |
1095 | // Fill: | |
1096 | fNestedLoopsResultsCosPro->Fill(12.5,TMath::Cos(h1*dPhi1+h2*dPhi2+h3*dPhi3+h4*dPhi4+h5*dPhi5+h6*dPhi6+h7*dPhi7),wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6*wPhi7); | |
1097 | fNestedLoopsResultsSinPro->Fill(12.5,TMath::Sin(h1*dPhi1+h2*dPhi2+h3*dPhi3+h4*dPhi4+h5*dPhi5+h6*dPhi6+h7*dPhi7),wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6*wPhi7); | |
1098 | } // end of for(Int_t i7=0;i7<nPrim;i7++) | |
1099 | } // end of for(Int_t i6=0;i6<nPrim;i6++) | |
1100 | } // end of for(Int_t i5=0;i5<nPrim;i5++) | |
1101 | } // end of for(Int_t i4=0;i4<nPrim;i4++) | |
1102 | } // end of for(Int_t i3=0;i3<nPrim;i3++) | |
1103 | } // end of for(Int_t i2=0;i2<nPrim;i2++) | |
1104 | } // end of for(Int_t i1=0;i1<nPrim;i1++) | |
1105 | } // end of if(nPrim>=7) | |
1106 | ||
1107 | // 8-particle correlations: | |
6696a113 | 1108 | if(dMultRP>=8) |
7ecb5af4 | 1109 | { |
1110 | for(Int_t i1=0;i1<nPrim;i1++) | |
1111 | { | |
1112 | aftsTrack=anEvent->GetTrack(i1); | |
1113 | if(!(aftsTrack->InRPSelection())){continue;} | |
1114 | dPhi1=aftsTrack->Phi(); | |
1115 | if(fUsePhiWeights){wPhi1=PhiWeight(dPhi1);} | |
1116 | for(Int_t i2=0;i2<nPrim;i2++) | |
1117 | { | |
1118 | if(i2==i1){continue;} | |
1119 | aftsTrack=anEvent->GetTrack(i2); | |
1120 | if(!(aftsTrack->InRPSelection())){continue;} | |
1121 | dPhi2=aftsTrack->Phi(); | |
1122 | if(fUsePhiWeights){wPhi2=PhiWeight(dPhi2);} | |
1123 | for(Int_t i3=0;i3<nPrim;i3++) | |
1124 | { | |
1125 | if(i3==i1||i3==i2){continue;} | |
1126 | aftsTrack=anEvent->GetTrack(i3); | |
1127 | if(!(aftsTrack->InRPSelection())){continue;} | |
1128 | dPhi3=aftsTrack->Phi(); | |
1129 | if(fUsePhiWeights){wPhi3=PhiWeight(dPhi3);} | |
1130 | for(Int_t i4=0;i4<nPrim;i4++) | |
1131 | { | |
1132 | if(i4==i1||i4==i2||i4==i3){continue;} | |
1133 | aftsTrack=anEvent->GetTrack(i4); | |
1134 | if(!(aftsTrack->InRPSelection())){continue;} | |
1135 | dPhi4=aftsTrack->Phi(); | |
1136 | if(fUsePhiWeights){wPhi4=PhiWeight(dPhi4);} | |
1137 | for(Int_t i5=0;i5<nPrim;i5++) | |
1138 | { | |
1139 | if(i5==i1||i5==i2||i5==i3||i5==i4){continue;} | |
1140 | aftsTrack=anEvent->GetTrack(i5); | |
1141 | if(!(aftsTrack->InRPSelection())){continue;} | |
1142 | dPhi5=aftsTrack->Phi(); | |
1143 | if(fUsePhiWeights){wPhi5=PhiWeight(dPhi5);} | |
1144 | for(Int_t i6=0;i6<nPrim;i6++) | |
1145 | { | |
1146 | if(i6==i1||i6==i2||i6==i3||i6==i4||i6==i5){continue;} | |
1147 | aftsTrack=anEvent->GetTrack(i6); | |
1148 | if(!(aftsTrack->InRPSelection())){continue;} | |
1149 | dPhi6=aftsTrack->Phi(); | |
1150 | if(fUsePhiWeights){wPhi6=PhiWeight(dPhi6);} | |
1151 | for(Int_t i7=0;i7<nPrim;i7++) | |
1152 | { | |
1153 | if(i7==i1||i7==i2||i7==i3||i7==i4||i7==i5||i7==i6){continue;} | |
1154 | aftsTrack=anEvent->GetTrack(i7); | |
1155 | if(!(aftsTrack->InRPSelection())){continue;} | |
1156 | dPhi7=aftsTrack->Phi(); | |
1157 | if(fUsePhiWeights){wPhi7=PhiWeight(dPhi7);} | |
1158 | for(Int_t i8=0;i8<nPrim;i8++) | |
1159 | { | |
1160 | if(i8==i1||i8==i2||i8==i3||i8==i4||i8==i5||i8==i6||i8==i7){continue;} | |
1161 | aftsTrack=anEvent->GetTrack(i8); | |
1162 | if(!(aftsTrack->InRPSelection())){continue;} | |
1163 | dPhi8=aftsTrack->Phi(); | |
1164 | if(fUsePhiWeights){wPhi8=PhiWeight(dPhi8);} | |
1165 | // Fill: | |
1166 | fNestedLoopsResultsCosPro->Fill(14.5,TMath::Cos(h1*dPhi1+h2*dPhi2+h3*dPhi3+h4*dPhi4+h5*dPhi5+h6*dPhi6+h7*dPhi7+h8*dPhi8),wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6*wPhi7*wPhi8); | |
1167 | fNestedLoopsResultsSinPro->Fill(14.5,TMath::Sin(h1*dPhi1+h2*dPhi2+h3*dPhi3+h4*dPhi4+h5*dPhi5+h6*dPhi6+h7*dPhi7+h8*dPhi8),wPhi1*wPhi2*wPhi3*wPhi4*wPhi5*wPhi6*wPhi7*wPhi8); | |
1168 | } // end of for(Int_t i8=0;i8<nPrim;i8++) | |
1169 | } // end of for(Int_t i7=0;i7<nPrim;i7++) | |
1170 | } // end of for(Int_t i6=0;i6<nPrim;i6++) | |
1171 | } // end of for(Int_t i5=0;i5<nPrim;i5++) | |
1172 | } // end of for(Int_t i4=0;i4<nPrim;i4++) | |
1173 | } // end of for(Int_t i3=0;i3<nPrim;i3++) | |
1174 | } // end of for(Int_t i2=0;i2<nPrim;i2++) | |
1175 | } // end of for(Int_t i1=0;i1<nPrim;i1++) | |
1176 | } // end of if(nPrim>=8) | |
1177 | ||
1178 | // *) Printout: TBI move somewhere else | |
1179 | printf("\n cosine:"); | |
1180 | printf("\n 1-p => Q-vector: %.12f",fNestedLoopsResultsCosPro->GetBinContent(2)); | |
1181 | printf("\n 1-p => Nested loops: %.12f",fNestedLoopsResultsCosPro->GetBinContent(1)); | |
1182 | printf("\n 2-p => Q-vector: %.12f",fNestedLoopsResultsCosPro->GetBinContent(4)); | |
1183 | printf("\n 2-p => Nested loops: %.12f",fNestedLoopsResultsCosPro->GetBinContent(3)); | |
1184 | printf("\n 3-p => Q-vector: %.12f",fNestedLoopsResultsCosPro->GetBinContent(6)); | |
1185 | printf("\n 3-p => Nested loops: %.12f",fNestedLoopsResultsCosPro->GetBinContent(5)); | |
1186 | printf("\n 4-p => Q-vector: %.12f",fNestedLoopsResultsCosPro->GetBinContent(8)); | |
1187 | printf("\n 4-p => Nested loops: %.12f",fNestedLoopsResultsCosPro->GetBinContent(7)); | |
1188 | printf("\n 5-p => Q-vector: %.12f",fNestedLoopsResultsCosPro->GetBinContent(10)); | |
1189 | printf("\n 5-p => Nested loops: %.12f",fNestedLoopsResultsCosPro->GetBinContent(9)); | |
1190 | printf("\n 6-p => Q-vector: %.12f",fNestedLoopsResultsCosPro->GetBinContent(12)); | |
1191 | printf("\n 6-p => Nested loops: %.12f",fNestedLoopsResultsCosPro->GetBinContent(11)); | |
1192 | printf("\n 7-p => Q-vector: %.12f",fNestedLoopsResultsCosPro->GetBinContent(14)); | |
1193 | printf("\n 7-p => Nested loops: %.12f",fNestedLoopsResultsCosPro->GetBinContent(13)); | |
1194 | printf("\n 8-p => Q-vector: %.12f",fNestedLoopsResultsCosPro->GetBinContent(16)); | |
1195 | printf("\n 8-p => Nested loops: %.12f",fNestedLoopsResultsCosPro->GetBinContent(15)); | |
1196 | ||
1197 | printf("\n\n sinus:"); | |
1198 | printf("\n 1-p => Q-vector: %.12f",fNestedLoopsResultsSinPro->GetBinContent(2)); | |
1199 | printf("\n 1-p => Nested loops: %.12f",fNestedLoopsResultsSinPro->GetBinContent(1)); | |
1200 | printf("\n 2-p => Q-vector: %.12f",fNestedLoopsResultsSinPro->GetBinContent(4)); | |
1201 | printf("\n 2-p => Nested loops: %.12f",fNestedLoopsResultsSinPro->GetBinContent(3)); | |
1202 | printf("\n 3-p => Q-vector: %.12f",fNestedLoopsResultsSinPro->GetBinContent(6)); | |
1203 | printf("\n 3-p => Nested loops: %.12f",fNestedLoopsResultsSinPro->GetBinContent(5)); | |
1204 | printf("\n 4-p => Q-vector: %.12f",fNestedLoopsResultsSinPro->GetBinContent(8)); | |
1205 | printf("\n 4-p => Nested loops: %.12f",fNestedLoopsResultsSinPro->GetBinContent(7)); | |
1206 | printf("\n 5-p => Q-vector: %.12f",fNestedLoopsResultsSinPro->GetBinContent(10)); | |
1207 | printf("\n 5-p => Nested loops: %.12f",fNestedLoopsResultsSinPro->GetBinContent(9)); | |
1208 | printf("\n 6-p => Q-vector: %.12f",fNestedLoopsResultsSinPro->GetBinContent(12)); | |
1209 | printf("\n 6-p => Nested loops: %.12f",fNestedLoopsResultsSinPro->GetBinContent(11)); | |
1210 | printf("\n 7-p => Q-vector: %.12f",fNestedLoopsResultsSinPro->GetBinContent(14)); | |
1211 | printf("\n 7-p => Nested loops: %.12f",fNestedLoopsResultsSinPro->GetBinContent(13)); | |
1212 | printf("\n 8-p => Q-vector: %.12f",fNestedLoopsResultsSinPro->GetBinContent(16)); | |
1213 | printf("\n 8-p => Nested loops: %.12f",fNestedLoopsResultsSinPro->GetBinContent(15)); | |
1214 | ||
1215 | printf("\n\n"); | |
1216 | ||
1217 | } // void AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckWithNestedLoops(AliFlowEventSimple *anEvent) | |
1218 | ||
1219 | //======================================================================================================================= | |
1220 | ||
1221 | void AliFlowAnalysisWithMultiparticleCorrelations::FillQvector(AliFlowEventSimple *anEvent) | |
1222 | { | |
1223 | // Fill Q-vector components. | |
1224 | ||
1225 | Int_t nTracks = anEvent->NumberOfTracks(); // TBI shall I promote this to data member? | |
1226 | Double_t dPhi = 0., wPhi = 1.; // azimuthal angle and corresponding phi weight | |
1227 | Double_t dPt = 0., wPt = 1.; // transverse momentum and corresponding pT weight | |
1228 | Double_t dEta = 0., wEta = 1.; // pseudorapidity and corresponding eta weight | |
1229 | Double_t wToPowerP = 1.; // weight raised to power p | |
1230 | for(Int_t t=0;t<nTracks;t++) // loop over all tracks | |
1231 | { | |
1232 | AliFlowTrackSimple *pTrack = anEvent->GetTrack(t); | |
1233 | if(!pTrack){printf("\n AAAARGH: pTrack is NULL in MPC::FillQvector(...) !!!!"); continue;} | |
1234 | if(pTrack && pTrack->InRPSelection()) // fill Q-vector components only with reference particles | |
1235 | { | |
1236 | dPhi = pTrack->Phi(); // azimuthal angle | |
1237 | if(fUsePhiWeights){wPhi = PhiWeight(dPhi);} // corresponding phi weight | |
1238 | //if(dPhi < 0.){dPhi += TMath::TwoPi();} TBI | |
1239 | //if(dPhi > TMath::TwoPi()){dPhi -= TMath::TwoPi();} TBI | |
1240 | dPt = pTrack->Pt(); | |
1241 | if(fUsePtWeights){wPt = PtWeight(dPt);} // corresponding pT weight | |
1242 | dEta = pTrack->Eta(); | |
1243 | if(fUseEtaWeights){wEta = EtaWeight(dEta);} // corresponding eta weight | |
1244 | // Calculate Q-vector components: | |
6696a113 | 1245 | for(Int_t h=0;h<fMaxHarmonic*fMaxCorrelator+1;h++) |
7ecb5af4 | 1246 | { |
6696a113 | 1247 | for(Int_t p=0;p<fMaxCorrelator+1;p++) |
7ecb5af4 | 1248 | { |
1249 | if(fUsePhiWeights||fUsePtWeights||fUseEtaWeights){wToPowerP = pow(wPhi*wPt*wEta,p);} // TBI should I do something with the normalization of the product wPhi*wPt*wEta | |
1250 | fQvector[h][p] += TComplex(wToPowerP*TMath::Cos(h*dPhi),wToPowerP*TMath::Sin(h*dPhi)); | |
6696a113 | 1251 | } // for(Int_t p=0;p<fMaxCorrelator+1;p++) |
1252 | } // for(Int_t h=0;h<fMaxHarmonic*fMaxCorrelator+1;h++) | |
7ecb5af4 | 1253 | } // if(pTrack && pTrack->InRPSelection()) // fill Q-vector components only with reference particles |
1254 | } // for(Int_t t=0;t<nTracks;t++) // loop over all tracks | |
1255 | ||
1256 | } // void AliFlowAnalysisWithMultiparticleCorrelations::FillQvector(AliFlowEventSimple *anEvent) | |
1257 | ||
1258 | //======================================================================================================================= | |
1259 | ||
37d2f768 | 1260 | void AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckSettings() |
1261 | { | |
1262 | // Cross-check all initial settings in this method. | |
1263 | ||
6696a113 | 1264 | // a) Few cross-checks for control histograms; |
6d19c373 | 1265 | // b) Few cross-checks for flags for correlations; |
1266 | // c) 'Standard candles'. | |
6696a113 | 1267 | |
1268 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckSettings()"; | |
1269 | ||
1270 | // a) Few cross-checks for control histograms: TBI the lines below are not really what they are supposed to be... | |
1271 | /* | |
1272 | if(fFillKinematicsHist && !fFillControlHistograms){Fatal(sMethodName.Data(),"fFillKinematicsHist && !fFillControlHistograms");} | |
1273 | if(fFillMultDistributionsHist && !fFillControlHistograms){Fatal(sMethodName.Data(),"fFillMultDistributionsHist && !fFillControlHistograms");} | |
1274 | if(fFillMultCorrelationsHist && !fFillControlHistograms){Fatal(sMethodName.Data(),"fFillMultCorrelationsHist && !fFillControlHistograms");} | |
1275 | */ | |
1276 | ||
1277 | // b) Few cross-checks for flags for correlations: // TBI the lines bellow can be civilized | |
1278 | Int_t iSum = (Int_t)fCalculateIsotropic + (Int_t)fCalculateSame + (Int_t)fCalculateSameIsotropic; | |
1279 | if(iSum>1){Fatal(sMethodName.Data(),"iSum is doing crazy things...");} | |
37d2f768 | 1280 | |
6d19c373 | 1281 | // c) 'Standard candles': |
1282 | if(fCalculateStandardCandles && !fCalculateCorrelations) | |
1283 | { | |
1284 | Fatal(sMethodName.Data(),"fCalculateStandardCandles && !fCalculateCorrelations"); | |
1285 | } | |
1286 | ||
37d2f768 | 1287 | } // end of void AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckSettings() |
1288 | ||
1289 | //======================================================================================================================= | |
1290 | ||
1291 | void AliFlowAnalysisWithMultiparticleCorrelations::BookAndNestAllLists() | |
1292 | { | |
1293 | // Book and nest all lists nested in the base list fHistList. | |
1294 | ||
1295 | // a) Book and nest lists for control histograms; | |
9efbd2f5 | 1296 | // b) Book and nest lists for Q-vector; |
7ecb5af4 | 1297 | // c) Book and nest lists for correlations; |
1298 | // d) Book and nest lists for cumulants; | |
9efbd2f5 | 1299 | // e) Book and nest lists for weights; |
1300 | // f) Book and nest lists for nested loops; | |
1301 | // g) Book and nest lists for 'standard candles'. | |
37d2f768 | 1302 | |
1303 | // a) Book and nest lists for control histograms: | |
1304 | fControlHistogramsList = new TList(); | |
1305 | fControlHistogramsList->SetName("Control Histograms"); | |
1306 | fControlHistogramsList->SetOwner(kTRUE); | |
1307 | fHistList->Add(fControlHistogramsList); | |
1308 | ||
9efbd2f5 | 1309 | // b) Book and nest lists for Q-vector: |
1310 | fQvectorList = new TList(); | |
1311 | fQvectorList->SetName("Q-vector"); | |
1312 | fQvectorList->SetOwner(kTRUE); | |
1313 | fHistList->Add(fQvectorList); | |
7ecb5af4 | 1314 | |
1315 | // c) Book and nest lists for correlations: | |
1316 | fCorrelationsList = new TList(); | |
1317 | fCorrelationsList->SetName("Correlations"); | |
1318 | fCorrelationsList->SetOwner(kTRUE); | |
1319 | fHistList->Add(fCorrelationsList); | |
1320 | ||
1321 | // d) Book and nest lists for cumulants: | |
1322 | fCumulantsList = new TList(); | |
1323 | fCumulantsList->SetName("Cumulants"); | |
1324 | fCumulantsList->SetOwner(kTRUE); | |
1325 | fHistList->Add(fCumulantsList); | |
1326 | ||
9efbd2f5 | 1327 | // e) Book and nest lists for weights: |
1328 | fWeightsList = new TList(); | |
1329 | fWeightsList->SetName("Weights"); | |
1330 | fWeightsList->SetOwner(kTRUE); | |
1331 | fHistList->Add(fWeightsList); | |
1332 | ||
1333 | // f) Book and nest lists for nested loops: | |
7ecb5af4 | 1334 | fNestedLoopsList = new TList(); |
1335 | fNestedLoopsList->SetName("Nested Loops"); | |
1336 | fNestedLoopsList->SetOwner(kTRUE); | |
1337 | fHistList->Add(fNestedLoopsList); | |
1338 | ||
9efbd2f5 | 1339 | // g) Book and nest lists for 'standard candles': |
7ecb5af4 | 1340 | fStandardCandlesList = new TList(); |
1341 | fStandardCandlesList->SetName("Standard Candles"); | |
1342 | fStandardCandlesList->SetOwner(kTRUE); | |
1343 | fHistList->Add(fStandardCandlesList); | |
1344 | ||
37d2f768 | 1345 | } // end of void AliFlowAnalysisWithMultiparticleCorrelations::BookAndNestAllLists() |
1346 | ||
1347 | //======================================================================================================================= | |
1348 | ||
1349 | void AliFlowAnalysisWithMultiparticleCorrelations::WriteHistograms(TString outputFileName) | |
1350 | { | |
1351 | // Store the final results in output file <outputFileName>.root. | |
1352 | ||
1353 | TFile *output = new TFile(outputFileName.Data(),"RECREATE"); | |
1354 | fHistList->Write(fHistList->GetName(),TObject::kSingleKey); | |
1355 | ||
1356 | delete output; | |
1357 | ||
1358 | } // end of void AliFlowAnalysisWithMultiparticleCorrelations::WriteHistograms(TString outputFileName) | |
1359 | ||
1360 | //======================================================================================================================= | |
1361 | ||
1362 | void AliFlowAnalysisWithMultiparticleCorrelations::WriteHistograms(TDirectoryFile *outputFileName) | |
1363 | { | |
1364 | // Store the final results in output file <outputFileName>.root. | |
1365 | ||
1366 | outputFileName->Add(fHistList); | |
1367 | outputFileName->Write(outputFileName->GetName(),TObject::kSingleKey); | |
1368 | ||
1369 | } // end of void AliFlowAnalysisWithMultiparticleCorrelations::WriteHistograms(TDirectoryFile *outputFileName) | |
1370 | ||
1371 | //======================================================================================================================= | |
1372 | ||
1373 | void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForControlHistograms() | |
1374 | { | |
1375 | // Book all the stuff for control histograms. | |
1376 | ||
1377 | // a) Book the profile holding all the flags for control histograms; | |
1378 | // b) Book all control histograms; | |
1379 | // b0) Book TH1D *fKinematicsHist[2][3]; | |
1380 | // b1) Book TH1D *fMultDistributionsHist[3]; | |
1381 | // b2) Book TH2D *fMultCorrelationsHist[3]. | |
1382 | ||
1383 | // a) Book the profile holding all the flags for control histograms: TBI stil incomplete | |
6696a113 | 1384 | fControlHistogramsFlagsPro = new TProfile("fControlHistogramsFlagsPro","Flags and settings for control histograms",4,0,4); |
37d2f768 | 1385 | fControlHistogramsFlagsPro->SetTickLength(-0.01,"Y"); |
1386 | fControlHistogramsFlagsPro->SetMarkerStyle(25); | |
1387 | fControlHistogramsFlagsPro->SetLabelSize(0.04); | |
1388 | fControlHistogramsFlagsPro->SetLabelOffset(0.02,"Y"); | |
1389 | fControlHistogramsFlagsPro->SetStats(kFALSE); | |
7ecb5af4 | 1390 | fControlHistogramsFlagsPro->SetFillColor(kGray); |
1391 | fControlHistogramsFlagsPro->SetLineColor(kBlack); | |
1392 | fControlHistogramsFlagsPro->GetXaxis()->SetBinLabel(1,"fFillControlHistograms"); fControlHistogramsFlagsPro->Fill(0.5,fFillControlHistograms); | |
6696a113 | 1393 | fControlHistogramsFlagsPro->GetXaxis()->SetBinLabel(2,"fFillKinematicsHist"); fControlHistogramsFlagsPro->Fill(1.5,fFillKinematicsHist); |
1394 | fControlHistogramsFlagsPro->GetXaxis()->SetBinLabel(3,"fFillMultDistributionsHist"); fControlHistogramsFlagsPro->Fill(2.5,fFillMultDistributionsHist); | |
1395 | fControlHistogramsFlagsPro->GetXaxis()->SetBinLabel(4,"fFillMultCorrelationsHist"); fControlHistogramsFlagsPro->Fill(3.5,fFillMultCorrelationsHist); | |
37d2f768 | 1396 | fControlHistogramsList->Add(fControlHistogramsFlagsPro); |
1397 | ||
6696a113 | 1398 | if(!fFillControlHistograms){return;} // TBI is this safe? Well, perhaps it is if I can't implement it better... |
7ecb5af4 | 1399 | |
37d2f768 | 1400 | // b) Book all control histograms: // TBI add setters for all these values |
1401 | // b0) Book TH1D *fKinematicsHist[2][3]: | |
1402 | Int_t nBins[2][3] = {{360,1000,1000},{360,1000,1000}}; // [RP,POI][phi,pt,eta] | |
1403 | Double_t min[2][3] = {{0.,0.,-1.},{0.,0.,-1.}}; // [RP,POI][phi,pt,eta] | |
1404 | Double_t max[2][3] = {{TMath::TwoPi(),10.,1.},{TMath::TwoPi(),10.,1.}}; // [RP,POI][phi,pt,eta] | |
1405 | TString name[2][3] = {{"RP,phi","RP,pt","RP,eta"},{"POI,phi","POI,pt","POI,eta"}}; // [RP,POI][phi,pt,eta] | |
1406 | TString title[2] = {"Reference particles (RP)","Particles of interest (POI)"}; // [RP,POI] | |
1407 | Int_t lineColor[2] = {kBlue,kRed}; // [RP,POI] | |
1408 | Int_t fillColor[2] = {kBlue-10,kRed-10}; // [RP,POI] | |
1409 | TString xAxisTitle[3] = {"#phi","p_{T}","#eta"}; // [phi,pt,eta] | |
1410 | for(Int_t rp=0;rp<2;rp++) // [RP,POI] | |
1411 | { | |
1412 | for(Int_t ppe=0;ppe<3;ppe++) // [phi,pt,eta] | |
1413 | { | |
1414 | fKinematicsHist[rp][ppe] = new TH1D(name[rp][ppe].Data(),title[rp].Data(),nBins[rp][ppe],min[rp][ppe],max[rp][ppe]); | |
1415 | fKinematicsHist[rp][ppe]->GetXaxis()->SetTitle(xAxisTitle[ppe].Data()); | |
1416 | fKinematicsHist[rp][ppe]->SetLineColor(lineColor[rp]); | |
1417 | fKinematicsHist[rp][ppe]->SetFillColor(fillColor[rp]); | |
7ecb5af4 | 1418 | fKinematicsHist[rp][ppe]->SetMinimum(0.); |
6696a113 | 1419 | if(fFillKinematicsHist){fControlHistogramsList->Add(fKinematicsHist[rp][ppe]);} |
37d2f768 | 1420 | } |
1421 | } | |
1422 | ||
1423 | // b1) Book TH1D *fMultDistributionsHist[3]: // TBI add setters for all these values | |
1424 | Int_t nBinsMult[3] = {3000,3000,3000}; // [RP,POI,reference multiplicity] | |
1425 | Double_t minMult[3] = {0.,0.,0.}; // [RP,POI,reference multiplicity] | |
1426 | Double_t maxMult[3] = {3000.,3000.,3000.}; // [RP,POI,reference multiplicity] | |
1427 | TString nameMult[3] = {"Multiplicity (RP)","Multiplicity (POI)","Multiplicity (REF)"}; // [RP,POI,reference multiplicity] | |
1428 | TString titleMult[3] = {"Reference particles (RP)","Particles of interest (POI)",""}; // [RP,POI,reference multiplicity] | |
1429 | Int_t lineColorMult[3] = {kBlue,kRed,kGreen+2}; // [RP,POI,reference multiplicity] | |
1430 | Int_t fillColorMult[3] = {kBlue-10,kRed-10,kGreen-10}; // [RP,POI,reference multiplicity] | |
1431 | TString xAxisTitleMult[3] = {"Multiplicity (RP)","Multiplicity (POI)","Multiplicity (REF)"}; // [phi,pt,eta] | |
1432 | for(Int_t rprm=0;rprm<3;rprm++) // [RP,POI,reference multiplicity] | |
1433 | { | |
1434 | fMultDistributionsHist[rprm] = new TH1D(nameMult[rprm].Data(),titleMult[rprm].Data(),nBinsMult[rprm],minMult[rprm],maxMult[rprm]); | |
1435 | fMultDistributionsHist[rprm]->GetXaxis()->SetTitle(xAxisTitleMult[rprm].Data()); | |
1436 | fMultDistributionsHist[rprm]->SetLineColor(lineColorMult[rprm]); | |
1437 | fMultDistributionsHist[rprm]->SetFillColor(fillColorMult[rprm]); | |
6696a113 | 1438 | if(fFillMultDistributionsHist){fControlHistogramsList->Add(fMultDistributionsHist[rprm]);} |
37d2f768 | 1439 | } // for(Int_t rprm=0;rprm<3;rprm++) // [RP,POI,reference multiplicity] |
1440 | ||
7ecb5af4 | 1441 | // b2) Book TH2D *fMultCorrelationsHist[3]: TBI too large objects to store in this way, perhaps, |
37d2f768 | 1442 | // ... |
1443 | fMultCorrelationsHist[0] = new TH2D("Multiplicity (RP vs. POI)","Multiplicity (RP vs. POI)",nBinsMult[0],minMult[0],maxMult[0],nBinsMult[1],minMult[1],maxMult[1]); | |
1444 | fMultCorrelationsHist[0]->GetXaxis()->SetTitle(xAxisTitleMult[0].Data()); | |
1445 | fMultCorrelationsHist[0]->GetYaxis()->SetTitle(xAxisTitleMult[1].Data()); | |
6696a113 | 1446 | if(fFillMultCorrelationsHist){fControlHistogramsList->Add(fMultCorrelationsHist[0]);} |
37d2f768 | 1447 | |
1448 | // ... | |
1449 | fMultCorrelationsHist[1] = new TH2D("Multiplicity (RP vs. REF)","Multiplicity (RP vs. REF)",nBinsMult[0],minMult[0],maxMult[0],nBinsMult[2],minMult[2],maxMult[2]); | |
1450 | fMultCorrelationsHist[1]->GetXaxis()->SetTitle(xAxisTitleMult[0].Data()); | |
1451 | fMultCorrelationsHist[1]->GetYaxis()->SetTitle(xAxisTitleMult[2].Data()); | |
6696a113 | 1452 | if(fFillMultCorrelationsHist){fControlHistogramsList->Add(fMultCorrelationsHist[1]);} |
37d2f768 | 1453 | |
1454 | // ... | |
1455 | fMultCorrelationsHist[2] = new TH2D("Multiplicity (POI vs. REF)","Multiplicity (POI vs. REF)",nBinsMult[1],minMult[1],maxMult[1],nBinsMult[2],minMult[2],maxMult[2]); | |
1456 | fMultCorrelationsHist[2]->GetXaxis()->SetTitle(xAxisTitleMult[1].Data()); | |
1457 | fMultCorrelationsHist[2]->GetYaxis()->SetTitle(xAxisTitleMult[2].Data()); | |
6696a113 | 1458 | if(fFillMultCorrelationsHist){fControlHistogramsList->Add(fMultCorrelationsHist[2]);} |
37d2f768 | 1459 | |
1460 | } // void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForControlHistograms() | |
1461 | ||
1462 | //======================================================================================================================= | |
1463 | ||
1464 | void AliFlowAnalysisWithMultiparticleCorrelations::FillControlHistograms(AliFlowEventSimple *anEvent) | |
1465 | { | |
1466 | // Fill control histograms. | |
37d2f768 | 1467 | // a) Fill TH1D *fKinematicsHist[2][3]; |
1468 | // b) Fill TH1D *fMultDistributionsHist[3]; | |
1469 | // c) Fill TH2D *fMultCorrelationsHist[3]. | |
1470 | ||
1471 | // a) Fill TH1D *fKinematicsHist[2][3]: | |
6696a113 | 1472 | if(fFillKinematicsHist) |
37d2f768 | 1473 | { |
6696a113 | 1474 | Int_t nTracks = anEvent->NumberOfTracks(); // TBI shall I promote this to data member? |
1475 | for(Int_t t=0;t<nTracks;t++) // loop over all tracks | |
37d2f768 | 1476 | { |
6696a113 | 1477 | AliFlowTrackSimple *pTrack = anEvent->GetTrack(t); |
1478 | if(!pTrack){printf("\n AAAARGH: pTrack is NULL in MPC::FCH() !!!!");continue;} | |
1479 | if(pTrack) | |
37d2f768 | 1480 | { |
6696a113 | 1481 | Double_t dPhi = pTrack->Phi(); |
1482 | //if(dPhi < 0.){dPhi += TMath::TwoPi();} TBI | |
1483 | //if(dPhi > TMath::TwoPi()){dPhi -= TMath::TwoPi();} TBI | |
1484 | Double_t dPt = pTrack->Pt(); | |
1485 | Double_t dEta = pTrack->Eta(); | |
1486 | Double_t dPhiPtEta[3] = {dPhi,dPt,dEta}; | |
1487 | for(Int_t rp=0;rp<2;rp++) // [RP,POI] | |
37d2f768 | 1488 | { |
6696a113 | 1489 | for(Int_t ppe=0;ppe<3;ppe++) // [phi,pt,eta] |
1490 | { | |
1491 | if((0==rp && pTrack->InRPSelection()) || (1==rp && pTrack->InPOISelection())) // TBI | |
1492 | { | |
1493 | fKinematicsHist[rp][ppe]->Fill(dPhiPtEta[ppe]); | |
1494 | } | |
1495 | } // for(Int_t ppe=0;ppe<3;ppe++) // [phi,pt,eta] | |
1496 | } // for(Int_t rp=0;rp<2;rp++) // [RP,POI] | |
1497 | } // if(pTrack) | |
1498 | } // for(Int_t t=0;t<nTracks;t++) // loop over all tracks | |
1499 | } // if(fFillKinematicsHist) | |
37d2f768 | 1500 | |
1501 | // b) Fill TH1D *fMultDistributionsHist[3]: | |
1502 | Double_t dMultRP = anEvent->GetNumberOfRPs(); // TBI shall I promote these 3 variables into data members? | |
1503 | Double_t dMultPOI = anEvent->GetNumberOfPOIs(); | |
1504 | Double_t dMultREF = anEvent->GetReferenceMultiplicity(); | |
1505 | Double_t dMult[3] = {dMultRP,dMultPOI,dMultREF}; | |
1506 | for(Int_t rprm=0;rprm<3;rprm++) // [RP,POI,reference multiplicity] | |
1507 | { | |
6696a113 | 1508 | if(fFillMultDistributionsHist){fMultDistributionsHist[rprm]->Fill(dMult[rprm]);} |
37d2f768 | 1509 | } |
1510 | ||
1511 | // c) Fill TH2D *fMultCorrelationsHist[3]: | |
6696a113 | 1512 | if(fFillMultCorrelationsHist) |
1513 | { | |
1514 | fMultCorrelationsHist[0]->Fill((Int_t)dMultRP,(Int_t)dMultPOI); // RP vs. POI | |
1515 | fMultCorrelationsHist[1]->Fill((Int_t)dMultRP,(Int_t)dMultREF); // RP vs. refMult | |
1516 | fMultCorrelationsHist[2]->Fill((Int_t)dMultPOI,(Int_t)dMultREF); // POI vs. refMult | |
1517 | } // if(fFillMultCorrelationsHist) | |
37d2f768 | 1518 | |
1519 | } // void AliFlowAnalysisWithMultiparticleCorrelations::FillControlHistograms(AliFlowEventSimple *anEvent) | |
1520 | ||
1521 | //======================================================================================================================= | |
1522 | ||
1523 | void AliFlowAnalysisWithMultiparticleCorrelations::InitializeArraysForControlHistograms() | |
1524 | { | |
1525 | // Initialize all arrays for control histograms. | |
1526 | ||
1527 | // a) Initialize TH1D *fKinematicsHist[2][3]; | |
1528 | // b) Initialize TH1D *fMultDistributionsHist[3]; | |
1529 | // c) Initialize TH2D *fMultCorrelationsHist[3]. | |
1530 | ||
1531 | // a) Initialize TH1D *fKinematicsHist[2][3]: | |
1532 | for(Int_t rp=0;rp<2;rp++) // [RP,POI] | |
1533 | { | |
1534 | for(Int_t ppe=0;ppe<3;ppe++) // [phi,pt,eta] | |
1535 | { | |
1536 | fKinematicsHist[rp][ppe] = NULL; | |
1537 | } | |
1538 | } | |
1539 | ||
1540 | // b) Initialize TH1D *fMultDistributionsHist[3]: | |
1541 | for(Int_t rprm=0;rprm<3;rprm++) // [RP,POI,reference multiplicity] | |
1542 | { | |
1543 | fMultDistributionsHist[rprm] = NULL; | |
1544 | } | |
1545 | ||
1546 | // c) Initialize TH2D *fMultCorrelationsHist[3]: | |
1547 | for(Int_t r=0;r<3;r++) // [RP vs. POI, RP vs. refMult, POI vs. refMult] | |
1548 | { | |
1549 | fMultCorrelationsHist[r] = NULL; | |
1550 | } | |
1551 | ||
1552 | } // void AliFlowAnalysisWithMultiparticleCorrelations::InitializeArraysForControlHistograms() | |
1553 | ||
1554 | //======================================================================================================================= | |
1555 | ||
9efbd2f5 | 1556 | void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForQvector() |
1557 | { | |
1558 | // Book all the stuff for Q-vector. | |
1559 | ||
1560 | // a) Book the profile holding all the flags for Q-vector; | |
1561 | // ... | |
1562 | ||
1563 | // a) Book the profile holding all the flags for Q-vector: | |
1564 | fQvectorFlagsPro = new TProfile("fQvectorFlagsPro","Flags for Q-vector",1,0,1); | |
1565 | fQvectorFlagsPro->SetTickLength(-0.01,"Y"); | |
1566 | fQvectorFlagsPro->SetMarkerStyle(25); | |
1567 | fQvectorFlagsPro->SetLabelSize(0.03); | |
1568 | fQvectorFlagsPro->SetLabelOffset(0.02,"Y"); | |
1569 | fQvectorFlagsPro->SetStats(kFALSE); | |
1570 | fQvectorFlagsPro->SetFillColor(kGray); | |
1571 | fQvectorFlagsPro->SetLineColor(kBlack); | |
1572 | fQvectorFlagsPro->GetXaxis()->SetBinLabel(1,"fCalculateQvector"); fQvectorFlagsPro->Fill(0.5,fCalculateQvector); | |
1573 | fQvectorList->Add(fQvectorFlagsPro); | |
1574 | ||
1575 | if(!fCalculateQvector){return;} // TBI is this safe enough? | |
1576 | ||
1577 | // ... | |
1578 | ||
1579 | } // void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForQvector() | |
1580 | ||
1581 | //======================================================================================================================= | |
1582 | ||
7ecb5af4 | 1583 | void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForCorrelations() |
1584 | { | |
1585 | // Book all the stuff for correlations. | |
1586 | ||
1587 | // TBI this method can be implemented in a much more civilised way. | |
1588 | ||
1589 | // a) Book the profile holding all the flags for correlations; | |
6696a113 | 1590 | // b) Book TProfile *fCorrelationsPro[2][8] ([0=cos,1=sin][1p,2p,...,8p]). |
7ecb5af4 | 1591 | |
1592 | // a) Book the profile holding all the flags for correlations: | |
6696a113 | 1593 | fCorrelationsFlagsPro = new TProfile("fCorrelationsFlagsPro","Flags for correlations",9,0,9); |
7ecb5af4 | 1594 | fCorrelationsFlagsPro->SetTickLength(-0.01,"Y"); |
1595 | fCorrelationsFlagsPro->SetMarkerStyle(25); | |
1596 | fCorrelationsFlagsPro->SetLabelSize(0.03); | |
1597 | fCorrelationsFlagsPro->SetLabelOffset(0.02,"Y"); | |
1598 | fCorrelationsFlagsPro->SetStats(kFALSE); | |
1599 | fCorrelationsFlagsPro->SetFillColor(kGray); | |
1600 | fCorrelationsFlagsPro->SetLineColor(kBlack); | |
1601 | fCorrelationsFlagsPro->GetXaxis()->SetBinLabel(1,"fCalculateCorrelations"); fCorrelationsFlagsPro->Fill(0.5,fCalculateCorrelations); | |
1602 | fCorrelationsFlagsPro->GetXaxis()->SetBinLabel(2,"fMaxHarmonic"); fCorrelationsFlagsPro->Fill(1.5,fMaxHarmonic); | |
1603 | fCorrelationsFlagsPro->GetXaxis()->SetBinLabel(3,"fMaxCorrelator"); fCorrelationsFlagsPro->Fill(2.5,fMaxCorrelator); | |
6696a113 | 1604 | fCorrelationsFlagsPro->GetXaxis()->SetBinLabel(4,"fCalculateIsotropic"); fCorrelationsFlagsPro->Fill(3.5,fCalculateIsotropic); |
1605 | fCorrelationsFlagsPro->GetXaxis()->SetBinLabel(5,"fCalculateSame"); fCorrelationsFlagsPro->Fill(4.5,fCalculateSame); | |
1606 | fCorrelationsFlagsPro->GetXaxis()->SetBinLabel(6,"fSkipZeroHarmonics"); fCorrelationsFlagsPro->Fill(5.5,fSkipZeroHarmonics); | |
1607 | fCorrelationsFlagsPro->GetXaxis()->SetBinLabel(7,"fCalculateSameIsotropic"); fCorrelationsFlagsPro->Fill(6.5,fCalculateSameIsotropic); | |
1608 | fCorrelationsFlagsPro->GetXaxis()->SetBinLabel(8,"fCalculateAll"); fCorrelationsFlagsPro->Fill(7.5,fCalculateAll); | |
1609 | fCorrelationsFlagsPro->GetXaxis()->SetBinLabel(9,"fDontGoBeyond"); fCorrelationsFlagsPro->Fill(8.5,fDontGoBeyond); | |
7ecb5af4 | 1610 | fCorrelationsList->Add(fCorrelationsFlagsPro); |
1611 | ||
1612 | if(!fCalculateCorrelations){return;} // TBI is this safe enough? | |
1613 | ||
6696a113 | 1614 | // b) Book TProfile *fCorrelationsPro[2][8] ([0=cos,1=sin][1p,2p,...,8p]): |
1615 | TString sCosSin[2] = {"Cos","Sin"}; | |
1616 | Int_t markerColor[2] = {kBlue,kRed}; | |
1617 | Int_t markerStyle[2] = {kFullSquare,kFullSquare}; | |
1618 | Int_t nBins[8] = {1,1,1,1,1,1,1,1}; // TBI hardwired 8, shall be fMaxCorrelator | |
1619 | Int_t nBinsTitle[8] = {1,1,1,1,1,1,1,1}; // TBI hardwired 8, shall be fMaxCorrelator | |
1620 | Int_t nToBeFilled[8] = {0,0,0,0,0,0,0,0}; // TBI hardwired 8, shall be fMaxCorrelator | |
1621 | for(Int_t c=0;c<fMaxCorrelator;c++) // [1p,2p,...,8p] | |
7ecb5af4 | 1622 | { |
6696a113 | 1623 | // Implementing \binom{n+k-1}{k}, which is the resulting number of sets obtained |
1624 | // after sampling n starting elements into k subsets, repetitions allowed. | |
1625 | // In my case, n=2*fMaxHarmonic+1, k=c+1, hence: | |
9efbd2f5 | 1626 | nBins[c] = (Int_t)(TMath::Factorial(2*fMaxHarmonic+1+c+1-1) |
1627 | / (TMath::Factorial(2*fMaxHarmonic+1-1)*TMath::Factorial(c+1))); | |
6696a113 | 1628 | nBinsTitle[c] = nBins[c]; |
1629 | if(c==fDontGoBeyond){nBins[c]=1;} // TBI a bit of spaghetti here... | |
1630 | } // for(Int_t c=0;c<8;c++) // [1p,2p,...,8p] | |
1631 | for(Int_t cs=0;cs<2;cs++) // [0=cos,1=sin] | |
1632 | { | |
1633 | for(Int_t c=0;c<fMaxCorrelator;c++) // [1p,2p,...,8p] | |
1634 | { | |
1635 | fCorrelationsPro[cs][c] = new TProfile(Form("%dpCorrelations%s",c+1,sCosSin[cs].Data()),"",nBins[c],0.,1.*nBins[c]); | |
1636 | fCorrelationsPro[cs][c]->Sumw2(); | |
1637 | fCorrelationsPro[cs][c]->SetStats(kFALSE); | |
1638 | fCorrelationsPro[cs][c]->SetMarkerColor(markerColor[cs]); | |
1639 | fCorrelationsPro[cs][c]->SetMarkerStyle(markerStyle[cs]); | |
1640 | fCorrelationsList->Add(fCorrelationsPro[cs][c]); | |
1641 | } // for(Int_t c=0;c<8;c++) // [1p,2p,...,8p] | |
1642 | } // for(Int_t cs=0;cs<2;cs++) // [0=cos,1=sin] | |
1643 | // Set all bin labels: TBI this can be implemented better, most likely... | |
1644 | Int_t binNo[8]; for(Int_t c=0;c<fMaxCorrelator;c++){binNo[c]=1;} // TBI hardwired 8, shall be fMaxCorrelator | |
1645 | for(Int_t n1=-fMaxHarmonic;n1<=fMaxHarmonic;n1++) | |
7ecb5af4 | 1646 | { |
6696a113 | 1647 | if(fSkipZeroHarmonics && 0==n1){continue;} |
1648 | if(fCalculateAll) | |
1649 | { | |
1650 | fCorrelationsPro[0][0]->GetXaxis()->SetBinLabel(binNo[0],Form("Cos(%d)",n1)); | |
1651 | fCorrelationsPro[1][0]->GetXaxis()->SetBinLabel(binNo[0]++,Form("Sin(%d)",n1)); | |
1652 | nToBeFilled[0]++; | |
1653 | } | |
1654 | if(1==fDontGoBeyond){continue;} | |
1655 | for(Int_t n2=n1;n2<=fMaxHarmonic;n2++) | |
1656 | { | |
1657 | if(fSkipZeroHarmonics && 0==n2){continue;} | |
1658 | if(fCalculateAll || (fCalculateIsotropic && 0==n1+n2) || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2)) | |
1659 | || (fCalculateSameIsotropic && 0==n1+n2 && TMath::Abs(n1)==TMath::Abs(n2))) | |
1660 | { | |
1661 | fCorrelationsPro[0][1]->GetXaxis()->SetBinLabel(binNo[1],Form("Cos(%d,%d)",n1,n2)); | |
1662 | fCorrelationsPro[1][1]->GetXaxis()->SetBinLabel(binNo[1]++,Form("Sin(%d,%d)",n1,n2)); | |
1663 | nToBeFilled[1]++; | |
1664 | } | |
1665 | if(2==fDontGoBeyond){continue;} | |
1666 | for(Int_t n3=n2;n3<=fMaxHarmonic;n3++) | |
1667 | { | |
1668 | if(fSkipZeroHarmonics && 0==n3){continue;} | |
1669 | if(fCalculateAll || (fCalculateIsotropic && 0==n1+n2+n3) || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3)) | |
1670 | || (fCalculateSameIsotropic && 0==n1+n2+n3 && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3))) | |
1671 | { | |
1672 | fCorrelationsPro[0][2]->GetXaxis()->SetBinLabel(binNo[2],Form("Cos(%d,%d,%d)",n1,n2,n3)); | |
1673 | fCorrelationsPro[1][2]->GetXaxis()->SetBinLabel(binNo[2]++,Form("Sin(%d,%d,%d)",n1,n2,n3)); | |
1674 | nToBeFilled[2]++; | |
1675 | } | |
1676 | if(3==fDontGoBeyond){continue;} | |
1677 | for(Int_t n4=n3;n4<=fMaxHarmonic;n4++) | |
1678 | { | |
1679 | if(fSkipZeroHarmonics && 0==n4){continue;} | |
1680 | if(fCalculateAll || (fCalculateIsotropic && 0==n1+n2+n3+n4) || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) && TMath::Abs(n1)==TMath::Abs(n4)) | |
1681 | || (fCalculateSameIsotropic && 0==n1+n2+n3+n4 && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) && TMath::Abs(n1)==TMath::Abs(n4))) | |
1682 | { | |
1683 | fCorrelationsPro[0][3]->GetXaxis()->SetBinLabel(binNo[3],Form("Cos(%d,%d,%d,%d)",n1,n2,n3,n4)); | |
1684 | fCorrelationsPro[1][3]->GetXaxis()->SetBinLabel(binNo[3]++,Form("Sin(%d,%d,%d,%d)",n1,n2,n3,n4)); | |
1685 | nToBeFilled[3]++; | |
1686 | } | |
1687 | if(4==fDontGoBeyond){continue;} | |
1688 | for(Int_t n5=n4;n5<=fMaxHarmonic;n5++) | |
1689 | { | |
1690 | if(fSkipZeroHarmonics && 0==n5){continue;} | |
1691 | if(fCalculateAll || (fCalculateIsotropic && 0==n1+n2+n3+n4+n5) | |
1692 | || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) && TMath::Abs(n1)==TMath::Abs(n4) && TMath::Abs(n1)==TMath::Abs(n5)) | |
1693 | || (fCalculateSameIsotropic && 0==n1+n2+n3+n4+n5 && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) && TMath::Abs(n1)==TMath::Abs(n4) && TMath::Abs(n1)==TMath::Abs(n5))) | |
1694 | { | |
1695 | fCorrelationsPro[0][4]->GetXaxis()->SetBinLabel(binNo[4],Form("Cos(%d,%d,%d,%d,%d)",n1,n2,n3,n4,n5)); | |
1696 | fCorrelationsPro[1][4]->GetXaxis()->SetBinLabel(binNo[4]++,Form("Sin(%d,%d,%d,%d,%d)",n1,n2,n3,n4,n5)); | |
1697 | nToBeFilled[4]++; | |
1698 | } | |
1699 | if(5==fDontGoBeyond){continue;} | |
1700 | for(Int_t n6=n5;n6<=fMaxHarmonic;n6++) | |
1701 | { | |
1702 | if(fSkipZeroHarmonics && 0==n6){continue;} | |
1703 | if(fCalculateAll || (fCalculateIsotropic && 0==n1+n2+n3+n4+n5+n6) | |
1704 | || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) && TMath::Abs(n1)==TMath::Abs(n4) | |
1705 | && TMath::Abs(n1)==TMath::Abs(n5) && TMath::Abs(n1)==TMath::Abs(n6)) | |
1706 | || (fCalculateSameIsotropic && 0==n1+n2+n3+n4+n5+n6 && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) | |
1707 | && TMath::Abs(n1)==TMath::Abs(n4) && TMath::Abs(n1)==TMath::Abs(n5) && TMath::Abs(n1)==TMath::Abs(n6))) | |
1708 | { | |
1709 | fCorrelationsPro[0][5]->GetXaxis()->SetBinLabel(binNo[5],Form("Cos(%d,%d,%d,%d,%d,%d)",n1,n2,n3,n4,n5,n6)); | |
1710 | fCorrelationsPro[1][5]->GetXaxis()->SetBinLabel(binNo[5]++,Form("Sin(%d,%d,%d,%d,%d,%d)",n1,n2,n3,n4,n5,n6)); | |
1711 | nToBeFilled[5]++; | |
1712 | } | |
1713 | if(6==fDontGoBeyond){continue;} | |
1714 | for(Int_t n7=n6;n7<=fMaxHarmonic;n7++) | |
1715 | { | |
1716 | if(fSkipZeroHarmonics && 0==n7){continue;} | |
1717 | if(fCalculateAll || (fCalculateIsotropic && 0==n1+n2+n3+n4+n5+n6+n7) | |
1718 | || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) && TMath::Abs(n1)==TMath::Abs(n4) | |
1719 | && TMath::Abs(n1)==TMath::Abs(n5) && TMath::Abs(n1)==TMath::Abs(n6) && TMath::Abs(n1)==TMath::Abs(n7)) | |
1720 | || (fCalculateSameIsotropic && 0==n1+n2+n3+n4+n5+n6+n7 && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) && TMath::Abs(n1)==TMath::Abs(n4) | |
1721 | && TMath::Abs(n1)==TMath::Abs(n5) && TMath::Abs(n1)==TMath::Abs(n6) && TMath::Abs(n1)==TMath::Abs(n7))) | |
1722 | { | |
1723 | fCorrelationsPro[0][6]->GetXaxis()->SetBinLabel(binNo[6],Form("Cos(%d,%d,%d,%d,%d,%d,%d)",n1,n2,n3,n4,n5,n6,n7)); | |
1724 | fCorrelationsPro[1][6]->GetXaxis()->SetBinLabel(binNo[6]++,Form("Sin(%d,%d,%d,%d,%d,%d,%d)",n1,n2,n3,n4,n5,n6,n7)); | |
1725 | nToBeFilled[6]++; | |
1726 | } | |
1727 | if(7==fDontGoBeyond){continue;} | |
1728 | for(Int_t n8=n7;n8<=fMaxHarmonic;n8++) | |
1729 | { | |
1730 | if(fSkipZeroHarmonics && 0==n8){continue;} | |
1731 | if(fCalculateAll || (fCalculateIsotropic && 0==n1+n2+n3+n4+n5+n6+n7+n8) | |
1732 | || (fCalculateSame && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) && TMath::Abs(n1)==TMath::Abs(n4) | |
1733 | && TMath::Abs(n1)==TMath::Abs(n5) && TMath::Abs(n1)==TMath::Abs(n6) && TMath::Abs(n1)==TMath::Abs(n7) && TMath::Abs(n1)==TMath::Abs(n8)) | |
1734 | || (fCalculateSameIsotropic && 0==n1+n2+n3+n4+n5+n6+n7+n8 && TMath::Abs(n1)==TMath::Abs(n2) && TMath::Abs(n1)==TMath::Abs(n3) | |
1735 | && TMath::Abs(n1)==TMath::Abs(n4) && TMath::Abs(n1)==TMath::Abs(n5) && TMath::Abs(n1)==TMath::Abs(n6) && TMath::Abs(n1)==TMath::Abs(n7) | |
1736 | && TMath::Abs(n1)==TMath::Abs(n8))) | |
1737 | { | |
1738 | fCorrelationsPro[0][7]->GetXaxis()->SetBinLabel(binNo[7],Form("Cos(%d,%d,%d,%d,%d,%d,%d,%d)",n1,n2,n3,n4,n5,n6,n7,n8)); | |
1739 | fCorrelationsPro[1][7]->GetXaxis()->SetBinLabel(binNo[7]++,Form("Sin(%d,%d,%d,%d,%d,%d,%d,%d)",n1,n2,n3,n4,n5,n6,n7,n8)); | |
1740 | nToBeFilled[7]++; | |
1741 | } | |
1742 | } // for(Int_t n8=n7;n8<=fMaxHarmonic;n8++) | |
1743 | } // for(Int_t n7=n6;n7<=fMaxHarmonic;n7++) | |
1744 | } // for(Int_t n6=n5;n6<=fMaxHarmonic;n6++) | |
1745 | } // for(Int_t n5=n4;n5<=fMaxHarmonic;n5++) | |
1746 | } // for(Int_t n4=n3;n4<=fMaxHarmonic;n4++) | |
1747 | } // for(Int_t n3=n2;n3<=fMaxHarmonic;n3++) | |
1748 | } // for(Int_t n2=n1;n2<=fMaxHarmonic;n2++) | |
1749 | } // for(Int_t n1=-fMaxHarmonic;n1<=fMaxHarmonic;n1++) | |
1750 | ||
1751 | for(Int_t cs=0;cs<2;cs++) // [0=cos,1=sin] | |
1752 | { | |
1753 | for(Int_t c=0;c<fMaxCorrelator;c++) // [1p,2p,...,8p] | |
1754 | { | |
1755 | fCorrelationsPro[cs][c]->SetTitle(Form("%d-p correlations, %s terms, %d/%d in total",c+1,sCosSin[cs].Data(),nToBeFilled[c],nBinsTitle[c])); | |
1756 | fCorrelationsPro[cs][c]->GetXaxis()->SetRangeUser(0.,fCorrelationsPro[cs][c]->GetBinLowEdge(nToBeFilled[c]+1)); | |
1757 | } | |
7ecb5af4 | 1758 | } |
7ecb5af4 | 1759 | |
1760 | } // end of void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForCorrelations() | |
1761 | ||
1762 | //======================================================================================================================= | |
1763 | ||
1764 | void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForCumulants() | |
1765 | { | |
1766 | // Book all the stuff for cumualants. | |
1767 | ||
1768 | // a) Book the profile holding all the flags for cumulants; | |
1769 | // b) 2p // TBI | |
1770 | ||
1771 | // a) Book the profile holding all the flags for cumulants: | |
1772 | fCumulantsFlagsPro = new TProfile("fCumulantsFlagsPro","Flags for cumulants",1,0,1); | |
1773 | fCumulantsFlagsPro->SetTickLength(-0.01,"Y"); | |
1774 | fCumulantsFlagsPro->SetMarkerStyle(25); | |
1775 | fCumulantsFlagsPro->SetLabelSize(0.03); | |
1776 | fCumulantsFlagsPro->SetLabelOffset(0.02,"Y"); | |
1777 | fCumulantsFlagsPro->SetStats(kFALSE); | |
1778 | fCumulantsFlagsPro->SetFillColor(kGray); | |
1779 | fCumulantsFlagsPro->SetLineColor(kBlack); | |
1780 | fCumulantsFlagsPro->GetXaxis()->SetBinLabel(1,"fCalculateCumulants"); fCumulantsFlagsPro->Fill(0.5,fCalculateCumulants); | |
1781 | fCumulantsList->Add(fCumulantsFlagsPro); | |
1782 | ||
1783 | if(!fCalculateCumulants){return;} // TBI is this safe enough? | |
1784 | ||
1785 | // b) 2p // TBI | |
1786 | f2pCumulantsPro = new TProfile("f2pCumulantsPro","2-p cumulants",6,0.,6.); | |
1787 | f2pCumulantsPro->SetTickLength(-0.01,"Y"); | |
1788 | f2pCumulantsPro->SetMarkerStyle(25); | |
1789 | f2pCumulantsPro->SetLabelSize(0.04); | |
1790 | f2pCumulantsPro->SetLabelOffset(0.02,"Y"); | |
1791 | f2pCumulantsPro->SetStats(kFALSE); | |
1792 | f2pCumulantsPro->Sumw2(); | |
1793 | for(Int_t ci=1;ci<=6;ci++) // correlation index | |
1794 | { | |
1795 | f2pCumulantsPro->GetXaxis()->SetBinLabel(ci,Form("#LT#LT2#GT#GT_{C:%d,%d}",ci,ci)); // TBI | |
1796 | } | |
1797 | fCumulantsList->Add(f2pCumulantsPro); | |
1798 | ||
1799 | } // end of void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForCorrelations() | |
1800 | ||
1801 | //======================================================================================================================= | |
1802 | ||
1803 | void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForNestedLoops() | |
1804 | { | |
1805 | // Book all the stuff for nested loops. | |
1806 | ||
6696a113 | 1807 | // TBI this method is just ugly, who implemented it like this... |
1808 | ||
7ecb5af4 | 1809 | // a) Set default harmonic values; |
1810 | // b) Book the profile holding all the flags for nested loops; | |
1811 | // c) Book the profile holding all results for nested loops (cosine); | |
1812 | // d) Book the profile holding all results for nested loops (sinus). | |
1813 | ||
6696a113 | 1814 | // a) Set default harmonic values: |
1815 | //delete gRandom; // TBI this is not safe here, | |
1816 | //gRandom = new TRandom3(0); | |
9efbd2f5 | 1817 | Int_t h1 = (Int_t)pow(-1.,1.*gRandom->Integer(fMaxHarmonic+1))*gRandom->Integer(fMaxHarmonic+1); // TBI reimplement all these lines eventually |
1818 | Int_t h2 = (Int_t)pow(-1.,1.*gRandom->Integer(fMaxHarmonic+1))*gRandom->Integer(fMaxHarmonic+1); | |
1819 | Int_t h3 = (Int_t)pow(-1.,1.*gRandom->Integer(fMaxHarmonic+1))*gRandom->Integer(fMaxHarmonic+1); | |
1820 | Int_t h4 = (Int_t)pow(-1.,1.*gRandom->Integer(fMaxHarmonic+1))*gRandom->Integer(fMaxHarmonic+1); | |
1821 | Int_t h5 = (Int_t)pow(-1.,1.*gRandom->Integer(fMaxHarmonic+1))*gRandom->Integer(fMaxHarmonic+1); | |
1822 | Int_t h6 = (Int_t)pow(-1.,1.*gRandom->Integer(fMaxHarmonic+1))*gRandom->Integer(fMaxHarmonic+1); | |
1823 | Int_t h7 = (Int_t)pow(-1.,1.*gRandom->Integer(fMaxHarmonic+1))*gRandom->Integer(fMaxHarmonic+1); | |
1824 | Int_t h8 = (Int_t)pow(-1.,1.*gRandom->Integer(fMaxHarmonic+1))*gRandom->Integer(fMaxHarmonic+1); | |
6696a113 | 1825 | |
7ecb5af4 | 1826 | // REMARK: This values can be overriden in a steering macro via |
1827 | // mpc->GetNestedLoopsFlagsPro()->SetBinContent(<binNo>,<value>); | |
1828 | ||
1829 | // b) Book the profile holding all the flags for nested loops: | |
1830 | fNestedLoopsFlagsPro = new TProfile("fNestedLoopsFlagsPro","Flags for nested loops",9,0,9); | |
1831 | fNestedLoopsFlagsPro->SetTickLength(-0.01,"Y"); | |
1832 | fNestedLoopsFlagsPro->SetMarkerStyle(25); | |
1833 | fNestedLoopsFlagsPro->SetLabelSize(0.03); | |
1834 | fNestedLoopsFlagsPro->SetLabelOffset(0.02,"Y"); | |
1835 | fNestedLoopsFlagsPro->SetStats(kFALSE); | |
1836 | fNestedLoopsFlagsPro->SetFillColor(kGray); | |
1837 | fNestedLoopsFlagsPro->SetLineColor(kBlack); | |
1838 | fNestedLoopsFlagsPro->GetXaxis()->SetBinLabel(1,"fCrossCheckWithNestedLoops"); fNestedLoopsFlagsPro->Fill(0.5,fCrossCheckWithNestedLoops); | |
1839 | fNestedLoopsFlagsPro->GetXaxis()->SetBinLabel(2,"h_{1}"); fNestedLoopsFlagsPro->Fill(1.5,h1); | |
1840 | fNestedLoopsFlagsPro->GetXaxis()->SetBinLabel(3,"h_{2}"); fNestedLoopsFlagsPro->Fill(2.5,h2); | |
1841 | fNestedLoopsFlagsPro->GetXaxis()->SetBinLabel(4,"h_{3}"); fNestedLoopsFlagsPro->Fill(3.5,h3); | |
1842 | fNestedLoopsFlagsPro->GetXaxis()->SetBinLabel(5,"h_{4}"); fNestedLoopsFlagsPro->Fill(4.5,h4); | |
1843 | fNestedLoopsFlagsPro->GetXaxis()->SetBinLabel(6,"h_{5}"); fNestedLoopsFlagsPro->Fill(5.5,h5); | |
1844 | fNestedLoopsFlagsPro->GetXaxis()->SetBinLabel(7,"h_{6}"); fNestedLoopsFlagsPro->Fill(6.5,h6); | |
1845 | fNestedLoopsFlagsPro->GetXaxis()->SetBinLabel(8,"h_{7}"); fNestedLoopsFlagsPro->Fill(7.5,h7); | |
1846 | fNestedLoopsFlagsPro->GetXaxis()->SetBinLabel(9,"h_{8}"); fNestedLoopsFlagsPro->Fill(8.5,h8); | |
1847 | fNestedLoopsList->Add(fNestedLoopsFlagsPro); | |
1848 | ||
1849 | if(!fCrossCheckWithNestedLoops){return;} // TBI is this safe like this? | |
1850 | ||
1851 | // c) Book the profile holding all results for nested loops (cosine): | |
1852 | fNestedLoopsResultsCosPro = new TProfile("fNestedLoopsResultsCosPro","Nested loops results (cosine)",16,0,16); | |
1853 | fNestedLoopsResultsCosPro->SetTickLength(-0.01,"Y"); | |
1854 | fNestedLoopsResultsCosPro->SetMarkerStyle(25); | |
1855 | fNestedLoopsResultsCosPro->SetLabelSize(0.02); | |
1856 | fNestedLoopsResultsCosPro->SetLabelOffset(0.02,"Y"); | |
1857 | fNestedLoopsResultsCosPro->SetStats(kFALSE); | |
1858 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(1,Form("N: 1p(%d)",h1)); | |
1859 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(2,Form("Q: 1p(%d)",h1)); | |
1860 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(3,Form("N: 2p(%d,%d)",h1,h2)); | |
1861 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(4,Form("Q: 2p(%d,%d)",h1,h2)); | |
1862 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(5,Form("N: 3p(%d,%d,%d)",h1,h2,h3)); | |
1863 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(6,Form("Q: 3p(%d,%d,%d)",h1,h2,h3)); | |
1864 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(7,Form("N: 4p(%d,%d,%d,%d)",h1,h2,h3,h4)); | |
1865 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(8,Form("Q: 4p(%d,%d,%d,%d)",h1,h2,h3,h4)); | |
1866 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(9,Form("N: 5p(%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5)); | |
1867 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(10,Form("Q: 5p(%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5)); | |
1868 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(11,Form("N: 6p(%d,%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5,h6)); | |
1869 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(12,Form("Q: 6p(%d,%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5,h6)); | |
1870 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(13,Form("N: 7p(%d,%d,%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5,h6,h7)); | |
1871 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(14,Form("Q: 7p(%d,%d,%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5,h6,h7)); | |
1872 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(15,Form("N: 8p(%d,%d,%d,%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5,h6,h7,h8)); | |
1873 | fNestedLoopsResultsCosPro->GetXaxis()->SetBinLabel(16,Form("Q: 8p(%d,%d,%d,%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5,h6,h7,h8)); | |
1874 | fNestedLoopsList->Add(fNestedLoopsResultsCosPro); | |
1875 | ||
1876 | // d) Book the profile holding all results for nested loops (sinus): | |
1877 | fNestedLoopsResultsSinPro = new TProfile("fNestedLoopsResultsSinPro","Nested loops results (sinus)",16,0,16); | |
1878 | fNestedLoopsResultsSinPro->SetTickLength(-0.01,"Y"); | |
1879 | fNestedLoopsResultsSinPro->SetMarkerStyle(25); | |
1880 | fNestedLoopsResultsSinPro->SetLabelSize(0.02); | |
1881 | fNestedLoopsResultsSinPro->SetLabelOffset(0.02,"Y"); | |
1882 | fNestedLoopsResultsSinPro->SetStats(kFALSE); | |
1883 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(1,Form("N: 1p(%d)",h1)); | |
1884 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(2,Form("Q: 1p(%d)",h1)); | |
1885 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(3,Form("N: 2p(%d,%d)",h1,h2)); | |
1886 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(4,Form("Q: 2p(%d,%d)",h1,h2)); | |
1887 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(5,Form("N: 3p(%d,%d,%d)",h1,h2,h3)); | |
1888 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(6,Form("Q: 3p(%d,%d,%d)",h1,h2,h3)); | |
1889 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(7,Form("N: 4p(%d,%d,%d,%d)",h1,h2,h3,h4)); | |
1890 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(8,Form("Q: 4p(%d,%d,%d,%d)",h1,h2,h3,h4)); | |
1891 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(9,Form("N: 5p(%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5)); | |
1892 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(10,Form("Q: 5p(%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5)); | |
1893 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(11,Form("N: 6p(%d,%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5,h6)); | |
1894 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(12,Form("Q: 6p(%d,%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5,h6)); | |
1895 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(13,Form("N: 7p(%d,%d,%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5,h6,h7)); | |
1896 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(14,Form("Q: 7p(%d,%d,%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5,h6,h7)); | |
1897 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(15,Form("N: 8p(%d,%d,%d,%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5,h6,h7,h8)); | |
1898 | fNestedLoopsResultsSinPro->GetXaxis()->SetBinLabel(16,Form("Q: 8p(%d,%d,%d,%d,%d,%d,%d,%d)",h1,h2,h3,h4,h5,h6,h7,h8)); | |
1899 | fNestedLoopsList->Add(fNestedLoopsResultsSinPro); | |
1900 | ||
1901 | } // void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForNestedLoops() | |
1902 | ||
1903 | //======================================================================================================================= | |
1904 | ||
1905 | void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForStandardCandles() | |
1906 | { | |
1907 | // Book all the stuff for 'standard candles'. | |
1908 | ||
1909 | // a) Book the profile holding all the flags for 'standard candles'; | |
6d19c373 | 1910 | // b) Book the histogram holding all results for 'standard candles'; |
1911 | // c) Book 2D profile holding products of correlations (needed for error propagation). | |
7ecb5af4 | 1912 | |
9efbd2f5 | 1913 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForStandardCandles()"; |
1914 | ||
7ecb5af4 | 1915 | // a) Book the profile holding all the flags for 'standard candles': |
1916 | fStandardCandlesFlagsPro = new TProfile("fStandardCandlesFlagsPro","Flags for standard candles",1,0,1); | |
1917 | fStandardCandlesFlagsPro->SetTickLength(-0.01,"Y"); | |
1918 | fStandardCandlesFlagsPro->SetMarkerStyle(25); | |
1919 | fStandardCandlesFlagsPro->SetLabelSize(0.03); | |
1920 | fStandardCandlesFlagsPro->SetLabelOffset(0.02,"Y"); | |
1921 | fStandardCandlesFlagsPro->SetStats(kFALSE); | |
1922 | fStandardCandlesFlagsPro->SetFillColor(kGray); | |
1923 | fStandardCandlesFlagsPro->SetLineColor(kBlack); | |
1924 | fStandardCandlesFlagsPro->GetXaxis()->SetBinLabel(1,"fCalculateStandardCandles"); fStandardCandlesFlagsPro->Fill(0.5,fCalculateStandardCandles); | |
1925 | fStandardCandlesList->Add(fStandardCandlesFlagsPro); | |
1926 | ||
1927 | if(!fCalculateStandardCandles){return;} // TBI is this safe like this? | |
1928 | ||
1929 | // b) Book the histogram holding all results for 'standard candles': | |
9efbd2f5 | 1930 | Int_t nBins = fMaxHarmonic*(fMaxHarmonic-1)/2; |
6d19c373 | 1931 | fStandardCandlesHist = new TH1D("fStandardCandlesHist","'Standard candles'",nBins,0.,1.*nBins); |
7ecb5af4 | 1932 | fStandardCandlesHist->SetStats(kFALSE); |
6d19c373 | 1933 | fStandardCandlesHist->SetMarkerStyle(kFullSquare); |
1934 | fStandardCandlesHist->SetMarkerColor(kBlue); | |
1935 | fStandardCandlesHist->SetLineColor(kBlue); | |
9efbd2f5 | 1936 | Int_t binNo = 1; |
1937 | for(Int_t n1=-fMaxHarmonic;n1<=-2;n1++) | |
1938 | { | |
1939 | for(Int_t n2=n1+1;n2<=-1;n2++) | |
1940 | { | |
1941 | fStandardCandlesHist->GetXaxis()->SetBinLabel(binNo++,Form("SC(%d,%d,%d,%d)",n1,n2,-1*n2,-1*n1)); | |
1942 | } | |
1943 | } | |
1944 | if(binNo-1 != nBins){Fatal(sMethodName.Data(),"Well, binNo-1 != nBins ... :'( ");} | |
7ecb5af4 | 1945 | fStandardCandlesList->Add(fStandardCandlesHist); |
1946 | ||
6d19c373 | 1947 | // c) Book 2D profile holding products of correlations (needed for error propagation): |
1948 | Int_t nBins2p = fCorrelationsPro[0][1]->GetXaxis()->GetNbins(), nBins2pFilled = 0; | |
1949 | Int_t nBins4p = fCorrelationsPro[0][3]->GetXaxis()->GetNbins(), nBins4pFilled = 0; | |
1950 | for(Int_t b=1;b<=nBins2p;b++) | |
1951 | { | |
1952 | TString binLabel2p = fCorrelationsPro[0][1]->GetXaxis()->GetBinLabel(b); | |
1953 | if(!binLabel2p.CompareTo("")){break;} | |
1954 | nBins2pFilled++; | |
1955 | } | |
1956 | for(Int_t b=1;b<=nBins4p;b++) | |
1957 | { | |
1958 | TString binLabel4p = fCorrelationsPro[0][3]->GetXaxis()->GetBinLabel(b); | |
1959 | if(!binLabel4p.CompareTo("")){break;} | |
1960 | nBins4pFilled++; | |
1961 | } | |
1962 | Int_t nBins2D = nBins2pFilled + nBins4pFilled; | |
1963 | if(0==nBins2D){Fatal(sMethodName.Data(),"0==nBins2D");} // well, just in case... | |
1964 | fProductsPro2D = new TProfile2D("fProductsPro2D","Products of correlations",nBins2D,0.,nBins2D,nBins2D,0.,nBins2D); | |
1965 | fProductsPro2D->SetStats(kFALSE); | |
1966 | fProductsPro2D->Sumw2(); | |
1967 | for(Int_t b=1;b<=nBins2D;b++) | |
1968 | { | |
1969 | TString binLabel = ""; | |
1970 | if(b>=1 && b<=nBins2pFilled) | |
1971 | { | |
1972 | binLabel = fCorrelationsPro[0][1]->GetXaxis()->GetBinLabel(b); | |
1973 | } | |
1974 | else if(b>nBins2pFilled && b<=nBins4pFilled+nBins2pFilled) // TBI landmine ? | |
1975 | { | |
1976 | binLabel = fCorrelationsPro[0][3]->GetXaxis()->GetBinLabel(b-nBins2pFilled); // TBI another landmine ? | |
1977 | } | |
1978 | fProductsPro2D->GetXaxis()->SetBinLabel(b,binLabel.Data()); | |
1979 | fProductsPro2D->GetYaxis()->SetBinLabel(b,binLabel.Data()); | |
1980 | } // for(Int_t b=1;b<=nBins2D;b++) | |
1981 | fStandardCandlesList->Add(fProductsPro2D); | |
1982 | ||
7ecb5af4 | 1983 | } // end of void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForStandardCandles() |
1984 | ||
1985 | //======================================================================================================================= | |
1986 | ||
37d2f768 | 1987 | void AliFlowAnalysisWithMultiparticleCorrelations::GetOutputHistograms(TList *histList) |
1988 | { | |
7ecb5af4 | 1989 | // Get pointers for everything and everywhere from the base list "fHistList". |
1990 | ||
1991 | // a) Get pointer for base list fHistList; | |
1992 | // b) Get pointer for profile holding internal flags and, well, set again all flags; | |
1993 | // c) Get pointers for control histograms; | |
9efbd2f5 | 1994 | // d) Get pointers for Q-vector; |
1995 | // e) Get pointers for correlations; | |
1996 | // f) Get pointers for 'standard candles'. | |
7ecb5af4 | 1997 | |
6696a113 | 1998 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::GetOutputHistograms(TList *histList)"; |
1999 | ||
7ecb5af4 | 2000 | // a) Get pointer for base list fHistList and profile holding internal flags; |
2001 | fHistList = histList; | |
9efbd2f5 | 2002 | if(!fHistList){Fatal(sMethodName.Data(),"fHistList is malicious today...");} |
7ecb5af4 | 2003 | |
2004 | // b) Get pointer for profile holding internal flags and, well, set again all flags: | |
2005 | fInternalFlagsPro = dynamic_cast<TProfile*>(fHistList->FindObject("fInternalFlagsPro")); | |
6696a113 | 2006 | if(!fInternalFlagsPro){Fatal(sMethodName.Data(),"fInternalFlagsPro");} |
7ecb5af4 | 2007 | fUseInternalFlags = fInternalFlagsPro->GetBinContent(1); |
9efbd2f5 | 2008 | fMinNoRPs = (Int_t)fInternalFlagsPro->GetBinContent(2); |
2009 | fMaxNoRPs = (Int_t)fInternalFlagsPro->GetBinContent(3); | |
2010 | fExactNoRPs = (Int_t)fInternalFlagsPro->GetBinContent(4); | |
7ecb5af4 | 2011 | |
2012 | // c) Get pointers for control histograms: | |
2013 | this->GetPointersForControlHistograms(); | |
2014 | ||
9efbd2f5 | 2015 | // d) Get pointers for Q-vector: |
2016 | this->GetPointersForQvector(); | |
2017 | ||
2018 | // e) Get pointers for correlations: | |
7ecb5af4 | 2019 | this->GetPointersForCorrelations(); |
2020 | ||
9efbd2f5 | 2021 | // f) Get pointers for 'standard candles': |
7ecb5af4 | 2022 | this->GetPointersForStandardCandles(); |
2023 | ||
2024 | } // void AliFlowAnalysisWithMultiparticleCorrelations::GetOutputHistograms(TList *histList) | |
2025 | ||
2026 | //======================================================================================================================= | |
2027 | ||
9efbd2f5 | 2028 | void AliFlowAnalysisWithMultiparticleCorrelations::GetPointersForQvector() |
2029 | { | |
2030 | // Get pointers for Q-vector objects. | |
2031 | ||
2032 | // a) Get pointer for fQvectorList; TBI | |
2033 | // b) Get pointer for fQvectorFlagsPro; TBI | |
2034 | // c) Set again all flags; TBI | |
2035 | ||
2036 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::GetPointersForQvector()"; | |
2037 | ||
2038 | // a) Get pointer for fQvectorList: TBI | |
2039 | fQvectorList = dynamic_cast<TList*>(fHistList->FindObject("Q-vector")); | |
2040 | if(!fQvectorList){Fatal(sMethodName.Data(),"fQvectorList");} | |
2041 | ||
2042 | // b) Get pointer for fQvectorFlagsPro: TBI | |
2043 | fQvectorFlagsPro = dynamic_cast<TProfile*>(fQvectorList->FindObject("fQvectorFlagsPro")); | |
2044 | if(!fQvectorFlagsPro){Fatal(sMethodName.Data(),"fQvectorFlagsPro");} | |
2045 | ||
2046 | // c) Set again all flags: TBI | |
2047 | fCalculateQvector = (Bool_t)fQvectorFlagsPro->GetBinContent(1); | |
2048 | ||
2049 | if(!fCalculateQvector){return;} // TBI is this safe enough | |
2050 | ||
2051 | } // void AliFlowAnalysisWithMultiparticleCorrelations::GetPointersForQvector() | |
2052 | ||
2053 | //======================================================================================================================= | |
2054 | ||
7ecb5af4 | 2055 | void AliFlowAnalysisWithMultiparticleCorrelations::GetPointersForStandardCandles() |
2056 | { | |
2057 | // Get pointers for 'standard candles'. | |
2058 | ||
2059 | // a) Get pointer for fStandardCandlesList; TBI | |
2060 | // b) Get pointer for fStandardCandlesFlagsPro; TBI | |
2061 | // c) Set again all flags; TBI | |
2062 | // d) Get pointer TH1D *fStandardCandlesHist; TBI | |
6d19c373 | 2063 | // e) Get pointer TProfile2D *fProductsPro2D. TBI |
7ecb5af4 | 2064 | |
6696a113 | 2065 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::GetPointersForStandardCandles()"; |
2066 | ||
7ecb5af4 | 2067 | // a) Get pointer for fStandardCandlesList: TBI |
2068 | fStandardCandlesList = dynamic_cast<TList*>(fHistList->FindObject("Standard Candles")); | |
6696a113 | 2069 | if(!fStandardCandlesList){Fatal(sMethodName.Data(),"fStandardCandlesList");} |
7ecb5af4 | 2070 | |
2071 | // b) Get pointer for fStandardCandlesFlagsPro: TBI | |
2072 | fStandardCandlesFlagsPro = dynamic_cast<TProfile*>(fStandardCandlesList->FindObject("fStandardCandlesFlagsPro")); | |
6696a113 | 2073 | if(!fStandardCandlesFlagsPro){Fatal(sMethodName.Data(),"fStandardCandlesFlagsPro");} |
7ecb5af4 | 2074 | |
2075 | // c) Set again all flags: TBI | |
2076 | fCalculateStandardCandles = fStandardCandlesFlagsPro->GetBinContent(1); | |
2077 | ||
2078 | if(!fCalculateStandardCandles){return;} // TBI is this safe enough | |
2079 | ||
6d19c373 | 2080 | // d) Get pointer TH1D *fStandardCandlesHist: TBI |
7ecb5af4 | 2081 | fStandardCandlesHist = dynamic_cast<TH1D*>(fStandardCandlesList->FindObject("fStandardCandlesHist")); |
6d19c373 | 2082 | |
2083 | // e) Get pointer TProfile2D *fProductsPro2D: TBI | |
2084 | fProductsPro2D = dynamic_cast<TProfile2D*>(fStandardCandlesList->FindObject("fProductsPro2D")); | |
7ecb5af4 | 2085 | |
2086 | } // void AliFlowAnalysisWithMultiparticleCorrelations::GetPointersForStandardCandles() | |
2087 | ||
2088 | //======================================================================================================================= | |
2089 | ||
2090 | void AliFlowAnalysisWithMultiparticleCorrelations::GetPointersForControlHistograms() | |
2091 | { | |
2092 | // Get pointers for control histograms. | |
2093 | ||
2094 | // a) Get pointer for fControlHistogramsList; TBI | |
2095 | // b) Get pointer for fControlHistogramsFlagsPro; TBI | |
2096 | // c) Set again all flags; TBI | |
2097 | // d) Get pointers to TH1D *fKinematicsHist[2][3]; TBI | |
2098 | // e) Get pointers to TH1D *fMultDistributionsHist[3]; TBI | |
2099 | // f) Get pointers to TH2D *fMultCorrelationsHist[3]. TBI | |
2100 | ||
6696a113 | 2101 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::GetPointersForControlHistograms()"; |
2102 | ||
7ecb5af4 | 2103 | // a) Get pointer for fControlHistogramsList: TBI |
2104 | fControlHistogramsList = dynamic_cast<TList*>(fHistList->FindObject("Control Histograms")); | |
6696a113 | 2105 | if(!fControlHistogramsList){Fatal(sMethodName.Data(),"fControlHistogramsList");} |
7ecb5af4 | 2106 | |
2107 | // b) Get pointer for fControlHistogramsFlagsPro: TBI | |
2108 | fControlHistogramsFlagsPro = dynamic_cast<TProfile*>(fControlHistogramsList->FindObject("fControlHistogramsFlagsPro")); | |
6696a113 | 2109 | if(!fControlHistogramsFlagsPro){Fatal(sMethodName.Data(),"fControlHistogramsFlagsPro");} |
37d2f768 | 2110 | |
6696a113 | 2111 | // c) Set again all flags: |
7ecb5af4 | 2112 | fFillControlHistograms = fControlHistogramsFlagsPro->GetBinContent(1); |
6696a113 | 2113 | fFillKinematicsHist = fControlHistogramsFlagsPro->GetBinContent(2); |
2114 | fFillMultDistributionsHist = fControlHistogramsFlagsPro->GetBinContent(3); | |
2115 | fFillMultCorrelationsHist = fControlHistogramsFlagsPro->GetBinContent(4); | |
7ecb5af4 | 2116 | |
2117 | if(!fFillControlHistograms){return;} // TBI is this safe enough | |
2118 | ||
2119 | // d) Get pointers to fKinematicsHist[2][3]: TBI | |
2120 | TString name[2][3] = {{"RP,phi","RP,pt","RP,eta"},{"POI,phi","POI,pt","POI,eta"}}; // [RP,POI][phi,pt,eta] | |
2121 | for(Int_t rp=0;rp<2;rp++) // [RP,POI] | |
2122 | { | |
2123 | for(Int_t ppe=0;ppe<3;ppe++) // [phi,pt,eta] | |
37d2f768 | 2124 | { |
7ecb5af4 | 2125 | fKinematicsHist[rp][ppe] = dynamic_cast<TH1D*>(fControlHistogramsList->FindObject(name[rp][ppe].Data())); |
6696a113 | 2126 | if(!fKinematicsHist[rp][ppe] && fFillKinematicsHist){Fatal(sMethodName.Data(),"%s",name[rp][ppe].Data());} // TBI |
37d2f768 | 2127 | } |
7ecb5af4 | 2128 | } |
2129 | ||
2130 | // e) Get pointers to TH1D *fMultDistributionsHist[3]: | |
2131 | TString nameMult[3] = {"Multiplicity (RP)","Multiplicity (POI)","Multiplicity (REF)"}; // [RP,POI,reference multiplicity] | |
2132 | for(Int_t rprm=0;rprm<3;rprm++) // [RP,POI,reference multiplicity] | |
2133 | { | |
2134 | fMultDistributionsHist[rprm] = dynamic_cast<TH1D*>(fControlHistogramsList->FindObject(nameMult[rprm].Data())); | |
6696a113 | 2135 | if(!fMultDistributionsHist[rprm] && fFillMultDistributionsHist){Fatal(sMethodName.Data(),"%s",nameMult[rprm].Data());} // TBI |
7ecb5af4 | 2136 | } // for(Int_t rprm=0;rprm<3;rprm++) // [RP,POI,reference multiplicity] |
2137 | ||
2138 | // f) Get pointers to TH2D *fMultCorrelationsHist[3]: TBI automatize the things here... | |
2139 | fMultCorrelationsHist[0] = dynamic_cast<TH2D*>(fControlHistogramsList->FindObject("Multiplicity (RP vs. POI)")); | |
6696a113 | 2140 | if(!fMultCorrelationsHist[0] && fFillMultCorrelationsHist){Fatal(sMethodName.Data(),"Multiplicity (RP vs. POI)");} // TBI |
7ecb5af4 | 2141 | fMultCorrelationsHist[1] = dynamic_cast<TH2D*>(fControlHistogramsList->FindObject("Multiplicity (RP vs. REF)")); |
6696a113 | 2142 | if(!fMultCorrelationsHist[1] && fFillMultCorrelationsHist){Fatal(sMethodName.Data(),"Multiplicity (RP vs. REF)");} // TBI |
7ecb5af4 | 2143 | fMultCorrelationsHist[2] = dynamic_cast<TH2D*>(fControlHistogramsList->FindObject("Multiplicity (POI vs. REF)")); |
6696a113 | 2144 | if(!fMultCorrelationsHist[2] && fFillMultCorrelationsHist){Fatal(sMethodName.Data(),"Multiplicity (POI vs. REF)");} // TBI |
7ecb5af4 | 2145 | |
2146 | } // void AliFlowAnalysisWithMultiparticleCorrelations::GetPointersForControlHistograms() | |
2147 | ||
2148 | //======================================================================================================================= | |
2149 | ||
2150 | void AliFlowAnalysisWithMultiparticleCorrelations::GetPointersForCorrelations() | |
2151 | { | |
2152 | // Get pointers for correlations. | |
2153 | ||
2154 | // a) Get pointer for fCorrelationsList; TBI | |
2155 | // b) Get pointer for fCorrelationsFlagsPro; TBI | |
2156 | // c) Set again all flags; TBI | |
6696a113 | 2157 | // d) Get pointers to TProfile *fCorrelationsPro[2][8]. |
2158 | ||
2159 | TString sMethodName = "AliFlowAnalysisWithMultiparticleCorrelations::GetPointersForCorrelations()"; | |
7ecb5af4 | 2160 | |
2161 | // a) Get pointer for fCorrelationsList: TBI | |
2162 | fCorrelationsList = dynamic_cast<TList*>(fHistList->FindObject("Correlations")); | |
6696a113 | 2163 | if(!fCorrelationsList){Fatal(sMethodName.Data(),"fCorrelationsList");} |
7ecb5af4 | 2164 | |
2165 | // b) Get pointer for fCorrelationsFlagsPro: TBI | |
2166 | fCorrelationsFlagsPro = dynamic_cast<TProfile*>(fCorrelationsList->FindObject("fCorrelationsFlagsPro")); | |
2167 | ||
6696a113 | 2168 | if(!fCorrelationsFlagsPro){Fatal(sMethodName.Data(),"fCorrelationsFlagsPro");} |
7ecb5af4 | 2169 | |
2170 | // c) Set again all flags: | |
2171 | fCalculateCorrelations = fCorrelationsFlagsPro->GetBinContent(1); | |
9efbd2f5 | 2172 | fMaxHarmonic = (Int_t)fCorrelationsFlagsPro->GetBinContent(2); |
2173 | fMaxCorrelator = (Int_t)fCorrelationsFlagsPro->GetBinContent(3); | |
6696a113 | 2174 | fCalculateIsotropic = fCorrelationsFlagsPro->GetBinContent(4); |
2175 | fCalculateSame = fCorrelationsFlagsPro->GetBinContent(5); | |
2176 | fSkipZeroHarmonics = fCorrelationsFlagsPro->GetBinContent(6); | |
2177 | fCalculateSameIsotropic = fCorrelationsFlagsPro->GetBinContent(7); | |
2178 | fCalculateAll = fCorrelationsFlagsPro->GetBinContent(8); | |
9efbd2f5 | 2179 | fDontGoBeyond = (Int_t)fCorrelationsFlagsPro->GetBinContent(9); |
7ecb5af4 | 2180 | |
6696a113 | 2181 | if(!fCalculateCorrelations){return;} // TBI is this safe enough, that is the question... |
7ecb5af4 | 2182 | |
9efbd2f5 | 2183 | // d) Get pointers to TProfile *fCorrelationsPro[2][8]: |
2184 | TString sCosSin[2] = {"Cos","Sin"}; | |
2185 | for(Int_t cs=0;cs<2;cs++) | |
7ecb5af4 | 2186 | { |
9efbd2f5 | 2187 | for(Int_t c=0;c<fMaxCorrelator;c++) |
2188 | { | |
2189 | fCorrelationsPro[cs][c] = dynamic_cast<TProfile*>(fCorrelationsList->FindObject(Form("%dpCorrelations%s",c+1,sCosSin[cs].Data()))); | |
2190 | if(!fCorrelationsPro[cs][c]){Fatal(sMethodName.Data(),"%dpCorrelations%s",c+1,sCosSin[cs].Data());} | |
2191 | } | |
7ecb5af4 | 2192 | } |
2193 | ||
2194 | } // void AliFlowAnalysisWithMultiparticleCorrelations::GetPointersForCorrelations() | |
37d2f768 | 2195 | |
2196 | //======================================================================================================================= | |
2197 | ||
7ecb5af4 | 2198 | void AliFlowAnalysisWithMultiparticleCorrelations::InitializeArraysForQvector() |
2199 | { | |
2200 | // Initialize all arrays for Q-vector. | |
2201 | ||
6696a113 | 2202 | for(Int_t h=0;h<fMaxHarmonic*fMaxCorrelator+1;h++) |
7ecb5af4 | 2203 | { |
6696a113 | 2204 | for(Int_t p=0;p<fMaxCorrelator+1;p++) |
7ecb5af4 | 2205 | { |
2206 | fQvector[h][p] = TComplex(0.,0.); | |
2207 | } | |
2208 | } | |
2209 | ||
2210 | } // void AliFlowAnalysisWithMultiparticleCorrelations::InitializeArraysForQvector() | |
2211 | ||
2212 | //======================================================================================================================= | |
2213 | ||
2214 | void AliFlowAnalysisWithMultiparticleCorrelations::ResetQvector() | |
2215 | { | |
2216 | // Reset all Q-vector components to zero before starting a new event. | |
2217 | ||
6696a113 | 2218 | for(Int_t h=0;h<fMaxHarmonic*fMaxCorrelator+1;h++) |
7ecb5af4 | 2219 | { |
6696a113 | 2220 | for(Int_t p=0;p<fMaxCorrelator+1;p++) |
7ecb5af4 | 2221 | { |
2222 | fQvector[h][p] = TComplex(0.,0.); | |
6696a113 | 2223 | } |
2224 | } | |
7ecb5af4 | 2225 | |
2226 | } // void AliFlowAnalysisWithMultiparticleCorrelations::ResetQvector() | |
2227 | ||
2228 | //======================================================================================================================= | |
2229 | ||
2230 | TComplex AliFlowAnalysisWithMultiparticleCorrelations::Q(Int_t n, Int_t p) | |
2231 | { | |
2232 | // Using the fact that Q{-n,p} = Q{n,p}^*. | |
2233 | ||
2234 | if(n>=0){return fQvector[n][p];} | |
2235 | return TComplex::Conjugate(fQvector[-n][p]); | |
2236 | ||
2237 | } // TComplex AliFlowAnalysisWithMultiparticleCorrelations::Q(Int_t n, Int_t p) | |
2238 | ||
2239 | //======================================================================================================================= | |
2240 | ||
2241 | TComplex AliFlowAnalysisWithMultiparticleCorrelations::One(Int_t n1) | |
2242 | { | |
2243 | // Generic expression <exp[i(n1*phi1)]>. TBI comment | |
2244 | ||
2245 | TComplex one = Q(n1,1); | |
2246 | ||
2247 | return one; | |
2248 | ||
2249 | } // TComplex AliFlowAnalysisWithMultiparticleCorrelations::One(Int_t n1) | |
2250 | ||
2251 | //======================================================================================================================= | |
2252 | ||
2253 | TComplex AliFlowAnalysisWithMultiparticleCorrelations::Two(Int_t n1, Int_t n2) | |
2254 | { | |
2255 | // Generic two-particle correlation <exp[i(n1*phi1+n2*phi2)]>. | |
2256 | ||
2257 | TComplex two = Q(n1,1)*Q(n2,1)-Q(n1+n2,2); | |
2258 | ||
2259 | return two; | |
2260 | ||
2261 | } // TComplex AliFlowAnalysisWithMultiparticleCorrelations::Two(Int_t n1, Int_t n2) | |
2262 | ||
2263 | //======================================================================================================================= | |
2264 | ||
2265 | TComplex AliFlowAnalysisWithMultiparticleCorrelations::Three(Int_t n1, Int_t n2, Int_t n3) | |
2266 | { | |
2267 | // Generic three-particle correlation <exp[i(n1*phi1+n2*phi2+n3*phi3)]>. | |
2268 | ||
2269 | TComplex three = Q(n1,1)*Q(n2,1)*Q(n3,1)-Q(n1+n2,2)*Q(n3,1)-Q(n2,1)*Q(n1+n3,2) | |
2270 | - Q(n1,1)*Q(n2+n3,2)+2.*Q(n1+n2+n3,3); | |
2271 | ||
2272 | return three; | |
2273 | ||
2274 | } // TComplex AliFlowAnalysisWithMultiparticleCorrelations::Three(Int_t n1, Int_t n2, Int_t n3) | |
2275 | ||
2276 | //======================================================================================================================= | |
2277 | ||
2278 | TComplex AliFlowAnalysisWithMultiparticleCorrelations::Four(Int_t n1, Int_t n2, Int_t n3, Int_t n4) | |
2279 | { | |
2280 | // Generic four-particle correlation <exp[i(n1*phi1+n2*phi2+n3*phi3+n4*phi4)]>. | |
2281 | ||
2282 | TComplex four = Q(n1,1)*Q(n2,1)*Q(n3,1)*Q(n4,1)-Q(n1+n2,2)*Q(n3,1)*Q(n4,1)-Q(n2,1)*Q(n1+n3,2)*Q(n4,1) | |
2283 | - Q(n1,1)*Q(n2+n3,2)*Q(n4,1)+2.*Q(n1+n2+n3,3)*Q(n4,1)-Q(n2,1)*Q(n3,1)*Q(n1+n4,2) | |
2284 | + Q(n2+n3,2)*Q(n1+n4,2)-Q(n1,1)*Q(n3,1)*Q(n2+n4,2)+Q(n1+n3,2)*Q(n2+n4,2) | |
2285 | + 2.*Q(n3,1)*Q(n1+n2+n4,3)-Q(n1,1)*Q(n2,1)*Q(n3+n4,2)+Q(n1+n2,2)*Q(n3+n4,2) | |
2286 | + 2.*Q(n2,1)*Q(n1+n3+n4,3)+2.*Q(n1,1)*Q(n2+n3+n4,3)-6.*Q(n1+n2+n3+n4,4); | |
2287 | ||
2288 | return four; | |
2289 | ||
2290 | } // TComplex AliFlowAnalysisWithMultiparticleCorrelations::Four(Int_t n1, Int_t n2, Int_t n3, Int_t n4) | |
2291 | ||
2292 | //======================================================================================================================= | |
2293 | ||
2294 | TComplex AliFlowAnalysisWithMultiparticleCorrelations::Five(Int_t n1, Int_t n2, Int_t n3, Int_t n4, Int_t n5) | |
2295 | { | |
2296 | // Generic five-particle correlation <exp[i(n1*phi1+n2*phi2+n3*phi3+n4*phi4+n5*phi5)]>. | |
2297 | ||
2298 | TComplex five = Q(n1,1)*Q(n2,1)*Q(n3,1)*Q(n4,1)*Q(n5,1)-Q(n1+n2,2)*Q(n3,1)*Q(n4,1)*Q(n5,1) | |
2299 | - Q(n2,1)*Q(n1+n3,2)*Q(n4,1)*Q(n5,1)-Q(n1,1)*Q(n2+n3,2)*Q(n4,1)*Q(n5,1) | |
2300 | + 2.*Q(n1+n2+n3,3)*Q(n4,1)*Q(n5,1)-Q(n2,1)*Q(n3,1)*Q(n1+n4,2)*Q(n5,1) | |
2301 | + Q(n2+n3,2)*Q(n1+n4,2)*Q(n5,1)-Q(n1,1)*Q(n3,1)*Q(n2+n4,2)*Q(n5,1) | |
2302 | + Q(n1+n3,2)*Q(n2+n4,2)*Q(n5,1)+2.*Q(n3,1)*Q(n1+n2+n4,3)*Q(n5,1) | |
2303 | - Q(n1,1)*Q(n2,1)*Q(n3+n4,2)*Q(n5,1)+Q(n1+n2,2)*Q(n3+n4,2)*Q(n5,1) | |
2304 | + 2.*Q(n2,1)*Q(n1+n3+n4,3)*Q(n5,1)+2.*Q(n1,1)*Q(n2+n3+n4,3)*Q(n5,1) | |
2305 | - 6.*Q(n1+n2+n3+n4,4)*Q(n5,1)-Q(n2,1)*Q(n3,1)*Q(n4,1)*Q(n1+n5,2) | |
2306 | + Q(n2+n3,2)*Q(n4,1)*Q(n1+n5,2)+Q(n3,1)*Q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2.*Q(n1+n3,2)*Q(n2+n4+n5,3) | |
2321 | - 6.*Q(n3,1)*Q(n1+n2+n4+n5,4)+2.*Q(n1,1)*Q(n2,1)*Q(n3+n4+n5,3) | |
2322 | - 2.*Q(n1+n2,2)*Q(n3+n4+n5,3)-6.*Q(n2,1)*Q(n1+n3+n4+n5,4) | |
2323 | - 6.*Q(n1,1)*Q(n2+n3+n4+n5,4)+24.*Q(n1+n2+n3+n4+n5,5); | |
2324 | ||
2325 | return five; | |
2326 | ||
2327 | } // TComplex AliFlowAnalysisWithMultiparticleCorrelations::Five(Int_t n1, Int_t n2, Int_t n3, Int_t n4, Int_t n5) | |
2328 | ||
2329 | //======================================================================================================================= | |
2330 | ||
2331 | TComplex AliFlowAnalysisWithMultiparticleCorrelations::Six(Int_t n1, Int_t n2, Int_t n3, Int_t n4, Int_t n5, Int_t n6) | |
2332 | { | |
2333 | // Generic six-particle correlation <exp[i(n1*phi1+n2*phi2+n3*phi3+n4*phi4+n5*phi5+n6*phi6)]>. | |
2334 | ||
2335 | TComplex six = Q(n1,1)*Q(n2,1)*Q(n3,1)*Q(n4,1)*Q(n5,1)*Q(n6,1)-Q(n1+n2,2)*Q(n3,1)*Q(n4,1)*Q(n5,1)*Q(n6,1) | |
2336 | - Q(n2,1)*Q(n1+n3,2)*Q(n4,1)*Q(n5,1)*Q(n6,1)-Q(n1,1)*Q(n2+n3,2)*Q(n4,1)*Q(n5,1)*Q(n6,1) | |
2337 | + 2.*Q(n1+n2+n3,3)*Q(n4,1)*Q(n5,1)*Q(n6,1)-Q(n2,1)*Q(n3,1)*Q(n1+n4,2)*Q(n5,1)*Q(n6,1) | |
2338 | + Q(n2+n3,2)*Q(n1+n4,2)*Q(n5,1)*Q(n6,1)-Q(n1,1)*Q(n3,1)*Q(n2+n4,2)*Q(n5,1)*Q(n6,1) | |
2339 | + Q(n1+n3,2)*Q(n2+n4,2)*Q(n5,1)*Q(n6,1)+2.*Q(n3,1)*Q(n1+n2+n4,3)*Q(n5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1,1)*Q(n2,1)*Q(n3+n4+n5+n6,4)+6.*Q(n1+n2,2)*Q(n3+n4+n5+n6,4) | |
2435 | + 24.*Q(n2,1)*Q(n1+n3+n4+n5+n6,5)+24.*Q(n1,1)*Q(n2+n3+n4+n5+n6,5) | |
2436 | - 120.*Q(n1+n2+n3+n4+n5+n6,6); | |
2437 | ||
2438 | return six; | |
2439 | ||
2440 | } // TComplex AliFlowAnalysisWithMultiparticleCorrelations::Six(Int_t n1, Int_t n2, Int_t n3, Int_t n4, Int_t n5, Int_t n6) | |
2441 | ||
2442 | //======================================================================================================================= | |
2443 | ||
2444 | TComplex AliFlowAnalysisWithMultiparticleCorrelations::Seven(Int_t n1, Int_t n2, Int_t n3, Int_t n4, Int_t n5, Int_t n6, Int_t n7) | |
2445 | { | |
2446 | // Generic seven-particle correlation <exp[i(n1*phi1+n2*phi2+n3*phi3+n4*phi4+n5*phi5+n6*phi6+n7*phi7)]>. | |
2447 | ||
6696a113 | 2448 | TComplex seven = 0.*Q(n1-n2+n2-n3+n4-n5+n6-n7,1) + TComplex(1.,1.); // TBI implement the actual Eq. |
7ecb5af4 | 2449 | |
2450 | return seven; | |
2451 | ||
2452 | } // end of TComplex AliFlowAnalysisWithMultiparticleCorrelations::Seven(Int_t n1, Int_t n2, Int_t n3, Int_t n4, Int_t n5, Int_t n6, Int_t n7) | |
2453 | ||
2454 | //======================================================================================================================= | |
2455 | ||
2456 | TComplex AliFlowAnalysisWithMultiparticleCorrelations::Eight(Int_t n1, Int_t n2, Int_t n3, Int_t n4, Int_t n5, Int_t n6, Int_t n7, Int_t n8) | |
2457 | { | |
2458 | // Generic eight-particle correlation <exp[i(n1*phi1+n2*phi2+n3*phi3+n4*phi4+n5*phi5+n6*phi6+n7*phi7+n8*phi8)]>. | |
2459 | ||
6696a113 | 2460 | TComplex eight = 0.*Q(n1-n2+n2-n3+n4-n5+n6-n7+n8,1) + TComplex(1.,1.); // TBI implement the actual Eq. |
7ecb5af4 | 2461 | |
2462 | return eight; | |
2463 | ||
2464 | } // end of TComplex AliFlowAnalysisWithMultiparticleCorrelations::Eight(Int_t n1, Int_t n2, Int_t n3, Int_t n4, Int_t n5, Int_t n6, Int_t n7, Int_t n8) | |
2465 | ||
2466 | //======================================================================================================================= | |
2467 | ||
2468 | void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForWeights() | |
2469 | { | |
2470 | // Book all objects for calculations with weights. | |
2471 | ||
2472 | // a) Book profile to hold all flags for weights; | |
2473 | // b) Store histograms holding phi, pt and eta weights. | |
2474 | ||
2475 | // a) Book profile to hold all flags for weights: | |
2476 | fWeightsFlagsPro = new TProfile("fWeightsFlagsPro","0 = weight not used, 1 = weight used ",3,0,3); | |
2477 | fWeightsFlagsPro->SetLabelSize(0.06); | |
2478 | fWeightsFlagsPro->SetStats(kFALSE); | |
2479 | fWeightsFlagsPro->SetFillColor(kGray); | |
2480 | fWeightsFlagsPro->SetLineColor(kBlack); | |
2481 | fWeightsFlagsPro->GetXaxis()->SetBinLabel(1,"w_{#phi}"); fWeightsFlagsPro->Fill(0.5,fUsePhiWeights); | |
2482 | fWeightsFlagsPro->GetXaxis()->SetBinLabel(2,"w_{p_{T}}"); fWeightsFlagsPro->Fill(1.5,fUsePtWeights); | |
2483 | fWeightsFlagsPro->GetXaxis()->SetBinLabel(3,"w_{#eta}"); fWeightsFlagsPro->Fill(2.5,fUseEtaWeights); | |
2484 | fWeightsList->Add(fWeightsFlagsPro); | |
2485 | ||
2486 | // b) Store histograms holding phi, pt and eta weights: | |
2487 | // REMARK: It is assumed that these histos are accessed from external file "weights.root" | |
2488 | if(fPhiWeightsHist){fWeightsList->Add(fPhiWeightsHist);} | |
2489 | if(fPtWeightsHist){fWeightsList->Add(fPtWeightsHist);} | |
2490 | if(fEtaWeightsHist){fWeightsList->Add(fEtaWeightsHist);} | |
2491 | ||
2492 | } // void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForWeights() | |
2493 | ||
2494 | //======================================================================================================================= | |
2495 | ||
2496 | Double_t AliFlowAnalysisWithMultiparticleCorrelations::PhiWeight(const Double_t &dPhi) | |
2497 | { | |
2498 | // Determine phi weight for a given phi. | |
2499 | ||
6696a113 | 2500 | if(!fPhiWeightsHist){Fatal("AliFlowAnalysisWithMultiparticleCorrelations::PhiWeight(const Double_t &dPhi)","fPhiWeightsHist");} |
7ecb5af4 | 2501 | |
2502 | Double_t wPhi = fPhiWeightsHist->GetBinContent(fPhiWeightsHist->FindBin(dPhi)); | |
2503 | ||
2504 | return wPhi; | |
2505 | ||
2506 | } // Double_t AliFlowAnalysisWithMultiparticleCorrelations::PhiWeight(const Double_t &dPhi) | |
2507 | ||
2508 | //======================================================================================================================= | |
2509 | ||
2510 | Double_t AliFlowAnalysisWithMultiparticleCorrelations::PtWeight(const Double_t &dPt) | |
2511 | { | |
2512 | // Determine pt weight for a given pt. | |
2513 | ||
6696a113 | 2514 | if(!fPtWeightsHist){Fatal("AliFlowAnalysisWithMultiparticleCorrelations::PtWeight(const Double_t &dPt)","fPtWeightsHist");} |
7ecb5af4 | 2515 | |
2516 | Double_t wPt = fPtWeightsHist->GetBinContent(fPtWeightsHist->FindBin(dPt)); | |
2517 | ||
2518 | return wPt; | |
2519 | ||
2520 | } // Double_t AliFlowAnalysisWithMultiparticleCorrelations::PtWeight(const Double_t &dPt) | |
2521 | ||
2522 | //======================================================================================================================= | |
2523 | ||
2524 | Double_t AliFlowAnalysisWithMultiparticleCorrelations::EtaWeight(const Double_t &dEta) | |
2525 | { | |
2526 | // Determine eta weight for a given eta. | |
2527 | ||
6696a113 | 2528 | if(!fEtaWeightsHist){Fatal("AliFlowAnalysisWithMultiparticleCorrelations::EtaWeight(const Double_t &dEta)","fEtaWeightsHist");} |
7ecb5af4 | 2529 | |
2530 | Double_t wEta = fEtaWeightsHist->GetBinContent(fEtaWeightsHist->FindBin(dEta)); | |
2531 | ||
2532 | return wEta; | |
2533 | ||
2534 | } // Double_t AliFlowAnalysisWithMultiparticleCorrelations::EtaWeight(const Double_t &dEta) | |
2535 | ||
2536 | //======================================================================================================================= | |
2537 | ||
2538 | void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForBase() | |
2539 | { | |
2540 | // Book all base objects. | |
2541 | ||
2542 | fInternalFlagsPro = new TProfile("fInternalFlagsPro","Internal flags and settings",4,0,4); | |
2543 | fInternalFlagsPro->SetLabelSize(0.05); | |
2544 | fInternalFlagsPro->SetStats(kFALSE); | |
2545 | fInternalFlagsPro->SetFillColor(kGray); | |
2546 | fInternalFlagsPro->SetLineColor(kBlack); | |
2547 | fInternalFlagsPro->GetXaxis()->SetBinLabel(1,"fUseInternalFlags"); fInternalFlagsPro->Fill(0.5,fUseInternalFlags); | |
2548 | fInternalFlagsPro->GetXaxis()->SetBinLabel(2,"fMinNoRPs"); fInternalFlagsPro->Fill(1.5,fMinNoRPs); | |
2549 | fInternalFlagsPro->GetXaxis()->SetBinLabel(3,"fMaxNoRPs"); fInternalFlagsPro->Fill(2.5,fMaxNoRPs); | |
2550 | fInternalFlagsPro->GetXaxis()->SetBinLabel(4,"fExactNoRPs"); fInternalFlagsPro->Fill(3.5,fExactNoRPs); | |
2551 | fHistList->Add(fInternalFlagsPro); | |
2552 | ||
2553 | } // void AliFlowAnalysisWithMultiparticleCorrelations::BookEverythingForBase() | |
2554 | ||
2555 | //======================================================================================================================= | |
2556 | ||
2557 | Bool_t AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckInternalFlags(AliFlowEventSimple *anEvent) | |
2558 | { | |
2559 | // Cross-check in this method wether "anEvent" passes internal flags. | |
2560 | ||
2561 | // a) Cross-check min. and max. number of RPs. | |
2562 | // b) Cross-check... | |
2563 | ||
2564 | Bool_t bPassesInternalFlags = kTRUE; | |
2565 | ||
2566 | // a) Cross-check min. and max. number of RPs: | |
2567 | fMinNoRPs <= anEvent->GetNumberOfRPs() && anEvent->GetNumberOfRPs() < fMaxNoRPs ? 1 : bPassesInternalFlags = kFALSE; // TBI can I leave 1 like this? | |
2568 | ||
2569 | // ... | |
2570 | ||
2571 | return bPassesInternalFlags; | |
2572 | ||
2573 | } // Bool_t AliFlowAnalysisWithMultiparticleCorrelations::CrossCheckInternalFlags(AliFlowEventSimple *anEvent) | |
2574 | ||
2575 | //======================================================================================================================= | |
37d2f768 | 2576 | |
2577 |