]>
Commit | Line | Data |
---|---|---|
bc92c0cb | 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 | * * | |
52021ae2 | 7 | * Permission to use, copy, modify and distribute this software and its * |
bc92c0cb | 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 | ||
a6547379 | 16 | /*************************************** |
17 | * analysis task for Q-cumulants * | |
18 | * * | |
19 | * authors: Naomi van der Kolk * | |
20 | * (kolk@nikhef.nl) * | |
21 | * Raimond Snellings * | |
22 | * (snelling@nikhef.nl) * | |
23 | * Ante Bilandzic * | |
24 | * (abilandzic@gmail.com.nl) * | |
25 | * *************************************/ | |
bc92c0cb | 26 | |
2ed70edf | 27 | class TFile; |
2701c4bc | 28 | class TString; |
2ed70edf | 29 | class TList; |
30 | class AliAnalysisTaskSE; | |
31 | ||
bc92c0cb | 32 | #include "Riostream.h" |
7183fe85 | 33 | #include "AliFlowEventSimple.h" |
bc92c0cb | 34 | #include "AliAnalysisTaskQCumulants.h" |
bc92c0cb | 35 | #include "AliFlowAnalysisWithQCumulants.h" |
bc92c0cb | 36 | |
cea49479 | 37 | #include "AliLog.h" |
38 | ||
3a7af7bd | 39 | using std::cout; |
40 | using std::endl; | |
bc92c0cb | 41 | ClassImp(AliAnalysisTaskQCumulants) |
42 | ||
43 | //================================================================================================================ | |
44 | ||
2ed70edf | 45 | AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants(const char *name, Bool_t useParticleWeights): |
46 | AliAnalysisTaskSE(name), | |
7183fe85 | 47 | fEvent(NULL), |
2ed70edf | 48 | fQC(NULL), |
77515452 | 49 | fListHistos(NULL), |
53884472 | 50 | fBookOnlyBasicCCH(kTRUE), |
dd442cd2 | 51 | fFillMultipleControlHistograms(kFALSE), |
2ed70edf | 52 | fHarmonic(2), |
050c0a54 | 53 | fApplyCorrectionForNUA(kFALSE), |
54 | fApplyCorrectionForNUAVsM(kFALSE), | |
b77b6434 | 55 | fPropagateErrorAlsoFromNIT(kFALSE), |
1268c371 | 56 | fCalculateDiffFlow(kTRUE), |
57 | fCalculate2DDiffFlow(kFALSE), | |
62e36168 | 58 | fCalculateDiffFlowVsEta(kTRUE), |
2ed70edf | 59 | fStoreDistributions(kFALSE), |
dd442cd2 | 60 | fCalculateCumulantsVsM(kFALSE), |
3435cacb | 61 | fCalculateAllCorrelationsVsM(kFALSE), |
8f0fcf13 | 62 | fCalculateMixedHarmonics(kFALSE), |
63 | fCalculateMixedHarmonicsVsM(kFALSE), | |
df23c5ae | 64 | fStoreControlHistograms(kFALSE), |
050c0a54 | 65 | fMinimumBiasReferenceFlow(kTRUE), |
e5834fcb | 66 | fForgetAboutCovariances(kFALSE), |
67 | fStorePhiDistributionForOneEvent(kFALSE), | |
d9e6d8bb | 68 | fExactNoRPs(0), |
1db7eced | 69 | fUse2DHistograms(kFALSE), |
70 | fFillProfilesVsMUsingWeights(kTRUE), | |
71 | fUseQvectorTerms(kFALSE), | |
067e9bc8 | 72 | fnBinsMult(10000), |
73 | fMinMult(0.), | |
74 | fMaxMult(10000.), | |
2ed70edf | 75 | fUseParticleWeights(useParticleWeights), |
e04e4ec5 | 76 | fUsePhiWeights(kFALSE), |
77 | fUsePtWeights(kFALSE), | |
78 | fUseEtaWeights(kFALSE), | |
403e3389 | 79 | fUseTrackWeights(kFALSE), |
2ed70edf | 80 | fWeightsList(NULL), |
df23c5ae | 81 | fMultiplicityWeight(NULL), |
1db7eced | 82 | fMultiplicityIs(AliFlowCommonConstants::kRP), |
a6547379 | 83 | fnBinsForCorrelations(10000), |
84 | fUseBootstrap(kFALSE), | |
85 | fUseBootstrapVsM(kFALSE), | |
86 | fnSubsamples(10) | |
bc92c0cb | 87 | { |
7183fe85 | 88 | // constructor |
df23c5ae | 89 | AliDebug(2,"AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants(const char *name, Bool_t useParticleWeights)"); |
bc92c0cb | 90 | |
91 | // Define input and output slots here | |
2ed70edf | 92 | // Input slot #0 works with an AliFlowEventSimple |
93 | DefineInput(0, AliFlowEventSimple::Class()); | |
94 | // Input slot #1 is needed for the weights input file: | |
95 | if(useParticleWeights) | |
e04e4ec5 | 96 | { |
97 | DefineInput(1, TList::Class()); | |
2ed70edf | 98 | } |
99 | // Output slot #0 is reserved | |
100 | // Output slot #1 writes into a TList container | |
101 | DefineOutput(1, TList::Class()); | |
e04e4ec5 | 102 | |
2ed70edf | 103 | // Event weights: |
104 | fMultiplicityWeight = new TString("combinations"); | |
e5834fcb | 105 | |
106 | // Store phi distribution for one event to illustrate flow: | |
107 | for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max] | |
108 | { | |
109 | fPhiDistributionForOneEventSettings[p] = 0.; | |
110 | } | |
d9e6d8bb | 111 | |
a6547379 | 112 | // b) Initialize default min and max values of correlations: |
d9e6d8bb | 113 | // (Remark: The default values bellow were chosen for v2=5% and M=500) |
a6547379 | 114 | fMinValueOfCorrelation[0] = -0.015; // <2>_min |
115 | fMaxValueOfCorrelation[0] = 0.03; // <2>_max | |
116 | fMinValueOfCorrelation[1] = -0.6e-3; // <4>_min | |
117 | fMaxValueOfCorrelation[1] = 0.07; // <4>_max | |
118 | fMinValueOfCorrelation[2] = -0.08e-3; // <6>_min | |
119 | fMaxValueOfCorrelation[2] = 0.015; // <6>_max | |
120 | fMinValueOfCorrelation[3] = -20.e-6; // <8>_min | |
121 | fMaxValueOfCorrelation[3] = 0.003; // <8>_max | |
1db7eced | 122 | |
a6547379 | 123 | // c) Initialize default min and max values of correlation products: |
1db7eced | 124 | // (Remark: The default values bellow were chosen for v2=5% and M=500) |
a6547379 | 125 | fMinValueOfCorrelationProduct[0] = -15.e-6; // <2><4>_min |
126 | fMaxValueOfCorrelationProduct[0] = 0.02; // <2><4>_max | |
127 | ||
128 | // d) Initialize default min and max values of q-vector terms: | |
129 | fMinValueOfQvectorTerms[0] = 0.; | |
130 | fMaxValueOfQvectorTerms[0] = 30.; | |
131 | fMinValueOfQvectorTerms[1] = 0.; | |
132 | fMaxValueOfQvectorTerms[1] = 20.; | |
133 | fMinValueOfQvectorTerms[2] = 0.; | |
134 | fMaxValueOfQvectorTerms[2] = 200.; | |
135 | fMinValueOfQvectorTerms[3] = -30.; | |
136 | fMaxValueOfQvectorTerms[3] = 80.; | |
d9e6d8bb | 137 | |
bc92c0cb | 138 | } |
139 | ||
d9e6d8bb | 140 | //================================================================================================================ |
141 | ||
bc92c0cb | 142 | AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants(): |
2ed70edf | 143 | AliAnalysisTaskSE(), |
7183fe85 | 144 | fEvent(NULL), |
2ed70edf | 145 | fQC(NULL), |
7183fe85 | 146 | fListHistos(NULL), |
62d19320 | 147 | fBookOnlyBasicCCH(kFALSE), |
dd442cd2 | 148 | fFillMultipleControlHistograms(kFALSE), |
2ed70edf | 149 | fHarmonic(0), |
150 | fApplyCorrectionForNUA(kFALSE), | |
050c0a54 | 151 | fApplyCorrectionForNUAVsM(kFALSE), |
b77b6434 | 152 | fPropagateErrorAlsoFromNIT(kFALSE), |
1268c371 | 153 | fCalculateDiffFlow(kFALSE), |
154 | fCalculate2DDiffFlow(kFALSE), | |
62e36168 | 155 | fCalculateDiffFlowVsEta(kTRUE), |
2ed70edf | 156 | fStoreDistributions(kFALSE), |
b3dacf6b | 157 | fCalculateCumulantsVsM(kFALSE), |
3842bdcd | 158 | fCalculateAllCorrelationsVsM(kFALSE), |
8f0fcf13 | 159 | fCalculateMixedHarmonics(kFALSE), |
160 | fCalculateMixedHarmonicsVsM(kFALSE), | |
df23c5ae | 161 | fStoreControlHistograms(kFALSE), |
0dd3b008 | 162 | fMinimumBiasReferenceFlow(kFALSE), |
8e1cefdd | 163 | fForgetAboutCovariances(kFALSE), |
e5834fcb | 164 | fStorePhiDistributionForOneEvent(kFALSE), |
d9e6d8bb | 165 | fExactNoRPs(0), |
1db7eced | 166 | fUse2DHistograms(kFALSE), |
167 | fFillProfilesVsMUsingWeights(kTRUE), | |
168 | fUseQvectorTerms(kFALSE), | |
067e9bc8 | 169 | fnBinsMult(0), |
170 | fMinMult(0.), | |
171 | fMaxMult(0.), | |
2ed70edf | 172 | fUseParticleWeights(kFALSE), |
e04e4ec5 | 173 | fUsePhiWeights(kFALSE), |
174 | fUsePtWeights(kFALSE), | |
175 | fUseEtaWeights(kFALSE), | |
403e3389 | 176 | fUseTrackWeights(kFALSE), |
2ed70edf | 177 | fWeightsList(NULL), |
df23c5ae | 178 | fMultiplicityWeight(NULL), |
1db7eced | 179 | fMultiplicityIs(AliFlowCommonConstants::kRP), |
a6547379 | 180 | fnBinsForCorrelations(0), |
181 | fUseBootstrap(kFALSE), | |
182 | fUseBootstrapVsM(kFALSE), | |
183 | fnSubsamples(10) | |
184 | ||
bc92c0cb | 185 | { |
2ed70edf | 186 | // Dummy constructor |
cea49479 | 187 | AliDebug(2,"AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants()"); |
e5834fcb | 188 | |
189 | // Store phi distribution for one event to illustrate flow: | |
190 | for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max] | |
191 | { | |
192 | fPhiDistributionForOneEventSettings[p] = 0.; | |
193 | } | |
194 | ||
a6547379 | 195 | // b) Initialize default min and max values of correlations: |
d9e6d8bb | 196 | // (Remark: The default values bellow were chosen for v2=5% and M=500) |
a6547379 | 197 | fMinValueOfCorrelation[0] = -0.015; // <2>_min |
198 | fMaxValueOfCorrelation[0] = 0.03; // <2>_max | |
199 | fMinValueOfCorrelation[1] = -0.6e-3; // <4>_min | |
200 | fMaxValueOfCorrelation[1] = 0.07; // <4>_max | |
201 | fMinValueOfCorrelation[2] = -0.08e-3; // <6>_min | |
202 | fMaxValueOfCorrelation[2] = 0.015; // <6>_max | |
203 | fMinValueOfCorrelation[3] = -20.e-6; // <8>_min | |
204 | fMaxValueOfCorrelation[3] = 0.003; // <8>_max | |
d9e6d8bb | 205 | |
a6547379 | 206 | // c) Initialize default min and max values of correlation products: |
1db7eced | 207 | // (Remark: The default values bellow were chosen for v2=5% and M=500) |
a6547379 | 208 | fMinValueOfCorrelationProduct[0] = -15.e-6; // <2><4>_min |
209 | fMaxValueOfCorrelationProduct[0] = 0.02; // <2><4>_max | |
210 | ||
211 | // d) Initialize default min and max values of q-vector terms: | |
212 | fMinValueOfQvectorTerms[0] = 0.; | |
213 | fMaxValueOfQvectorTerms[0] = 30.; | |
214 | fMinValueOfQvectorTerms[1] = 0.; | |
215 | fMaxValueOfQvectorTerms[1] = 20.; | |
216 | fMinValueOfQvectorTerms[2] = 0.; | |
217 | fMaxValueOfQvectorTerms[2] = 200.; | |
218 | fMinValueOfQvectorTerms[3] = -30.; | |
219 | fMaxValueOfQvectorTerms[3] = 80.; | |
1db7eced | 220 | |
bc92c0cb | 221 | } |
222 | ||
223 | //================================================================================================================ | |
224 | ||
2ed70edf | 225 | void AliAnalysisTaskQCumulants::UserCreateOutputObjects() |
bc92c0cb | 226 | { |
2ed70edf | 227 | // Called at every worker node to initialize |
cea49479 | 228 | AliDebug(2,"AliAnalysisTaskQCumulants::UserCreateOutputObjects()"); |
bc92c0cb | 229 | |
2ed70edf | 230 | // Analyser: |
231 | fQC = new AliFlowAnalysisWithQCumulants(); | |
e04e4ec5 | 232 | |
2ed70edf | 233 | // Common: |
62d19320 | 234 | fQC->SetBookOnlyBasicCCH(fBookOnlyBasicCCH); |
dd442cd2 | 235 | fQC->SetFillMultipleControlHistograms(fFillMultipleControlHistograms); |
2ed70edf | 236 | fQC->SetHarmonic(fHarmonic); |
237 | fQC->SetApplyCorrectionForNUA(fApplyCorrectionForNUA); | |
050c0a54 | 238 | fQC->SetApplyCorrectionForNUAVsM(fApplyCorrectionForNUAVsM); |
b77b6434 | 239 | fQC->SetPropagateErrorAlsoFromNIT(fPropagateErrorAlsoFromNIT); |
1268c371 | 240 | fQC->SetCalculateDiffFlow(fCalculateDiffFlow); |
241 | fQC->SetCalculate2DDiffFlow(fCalculate2DDiffFlow); | |
62e36168 | 242 | fQC->SetCalculateDiffFlowVsEta(fCalculateDiffFlowVsEta); |
2ed70edf | 243 | fQC->SetStoreDistributions(fStoreDistributions); |
b3dacf6b | 244 | fQC->SetCalculateCumulantsVsM(fCalculateCumulantsVsM); |
3435cacb | 245 | fQC->SetCalculateAllCorrelationsVsM(fCalculateAllCorrelationsVsM); |
8f0fcf13 | 246 | fQC->SetCalculateMixedHarmonics(fCalculateMixedHarmonics); |
247 | fQC->SetCalculateMixedHarmonicsVsM(fCalculateMixedHarmonicsVsM); | |
df23c5ae | 248 | fQC->SetStoreControlHistograms(fStoreControlHistograms); |
0dd3b008 | 249 | fQC->SetMinimumBiasReferenceFlow(fMinimumBiasReferenceFlow); |
8e1cefdd | 250 | fQC->SetForgetAboutCovariances(fForgetAboutCovariances); |
d9e6d8bb | 251 | fQC->SetExactNoRPs(fExactNoRPs); |
b3dacf6b | 252 | // Multiparticle correlations vs multiplicity: |
067e9bc8 | 253 | fQC->SetnBinsMult(fnBinsMult); |
254 | fQC->SetMinMult(fMinMult); | |
255 | fQC->SetMaxMult(fMaxMult); | |
2ed70edf | 256 | // Particle weights: |
257 | if(fUseParticleWeights) | |
e04e4ec5 | 258 | { |
2ed70edf | 259 | // Pass the flags to class: |
403e3389 | 260 | if(fUsePhiWeights){fQC->SetUsePhiWeights(fUsePhiWeights);} |
261 | if(fUsePtWeights){fQC->SetUsePtWeights(fUsePtWeights);} | |
262 | if(fUseEtaWeights){fQC->SetUseEtaWeights(fUseEtaWeights);} | |
263 | if(fUseTrackWeights){fQC->SetUseTrackWeights(fUseTrackWeights);} | |
2ed70edf | 264 | // Get data from input slot #1 which is used for weights: |
e04e4ec5 | 265 | if(GetNinputs()==2) |
266 | { | |
2ed70edf | 267 | fWeightsList = (TList*)GetInputData(1); |
e04e4ec5 | 268 | } |
2ed70edf | 269 | // Pass the list with weights to class: |
270 | if(fWeightsList) fQC->SetWeightsList(fWeightsList); | |
e04e4ec5 | 271 | } |
2ed70edf | 272 | // Event weights: |
df23c5ae | 273 | if(!fMultiplicityWeight->Contains("combinations")) // default is "combinations" |
bc92c0cb | 274 | { |
2ed70edf | 275 | fQC->SetMultiplicityWeight(fMultiplicityWeight->Data()); |
bc92c0cb | 276 | } |
e04e4ec5 | 277 | |
df23c5ae | 278 | fQC->SetMultiplicityIs(fMultiplicityIs); |
1db7eced | 279 | fQC->SetnBinsForCorrelations(fnBinsForCorrelations); |
280 | fQC->SetUse2DHistograms(fUse2DHistograms); | |
281 | fQC->SetFillProfilesVsMUsingWeights(fFillProfilesVsMUsingWeights); | |
282 | fQC->SetUseQvectorTerms(fUseQvectorTerms); | |
df23c5ae | 283 | |
e5834fcb | 284 | // Store phi distribution for one event to illustrate flow: |
285 | fQC->SetStorePhiDistributionForOneEvent(fStorePhiDistributionForOneEvent); | |
286 | for(Int_t i=0;i<4;i++) | |
287 | { | |
288 | fQC->SetPhiDistributionForOneEventSettings(fPhiDistributionForOneEventSettings[i],i); | |
289 | } | |
d9e6d8bb | 290 | |
291 | // Initialize default min and max values of correlations: | |
292 | for(Int_t ci=0;ci<4;ci++) | |
293 | { | |
294 | fQC->SetMinValueOfCorrelation(ci,fMinValueOfCorrelation[ci]); | |
295 | fQC->SetMaxValueOfCorrelation(ci,fMaxValueOfCorrelation[ci]); | |
296 | } | |
297 | ||
1db7eced | 298 | // Initialize default min and max values of correlation products: |
299 | for(Int_t cpi=0;cpi<1;cpi++) // TBI hardwired 1 | |
300 | { | |
301 | fQC->SetMinValueOfCorrelationProduct(cpi,fMinValueOfCorrelationProduct[cpi]); | |
302 | fQC->SetMaxValueOfCorrelationProduct(cpi,fMaxValueOfCorrelationProduct[cpi]); | |
303 | } | |
304 | ||
a6547379 | 305 | // Initialize default min and max values of Q-vector terms: |
306 | for(Int_t ci=0;ci<4;ci++) | |
307 | { | |
308 | fQC->SetMinValueOfQvectorTerms(ci,fMinValueOfQvectorTerms[ci]); | |
309 | fQC->SetMaxValueOfQvectorTerms(ci,fMaxValueOfQvectorTerms[ci]); | |
310 | } | |
311 | ||
312 | // Bootstrap: | |
313 | fQC->SetUseBootstrap(fUseBootstrap); | |
314 | fQC->SetUseBootstrapVsM(fUseBootstrapVsM); | |
315 | fQC->SetnSubsamples(fnSubsamples); | |
316 | ||
2ed70edf | 317 | fQC->Init(); |
bc92c0cb | 318 | |
2ed70edf | 319 | if(fQC->GetHistList()) |
320 | { | |
321 | fListHistos = fQC->GetHistList(); | |
322 | // fListHistos->Print(); | |
323 | } else | |
324 | { | |
325 | Printf("ERROR: Could not retrieve histogram list (QC, Task::UserCreateOutputObjects()) !!!!"); | |
326 | } | |
61e0c8c0 | 327 | |
328 | PostData(1,fListHistos); | |
329 | ||
2ed70edf | 330 | } // end of void AliAnalysisTaskQCumulants::UserCreateOutputObjects() |
bc92c0cb | 331 | |
332 | //================================================================================================================ | |
333 | ||
2ed70edf | 334 | void AliAnalysisTaskQCumulants::UserExec(Option_t *) |
bc92c0cb | 335 | { |
2ed70edf | 336 | // main loop (called for each event) |
7183fe85 | 337 | fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0)); |
338 | ||
339 | // Q-cumulants | |
340 | if(fEvent) | |
341 | { | |
2ed70edf | 342 | fQC->Make(fEvent); |
343 | } else | |
344 | { | |
345 | cout<<"WARNING: No input data (QC, Task::UserExec()) !!!!"<<endl; | |
346 | cout<<endl; | |
347 | } | |
bc92c0cb | 348 | |
2ed70edf | 349 | PostData(1,fListHistos); |
bc92c0cb | 350 | } |
351 | ||
352 | //================================================================================================================ | |
353 | ||
354 | void AliAnalysisTaskQCumulants::Terminate(Option_t *) | |
8842fb2b | 355 | { |
2ed70edf | 356 | //accessing the merged output list: |
357 | fListHistos = (TList*)GetOutputData(1); | |
77515452 | 358 | |
2ed70edf | 359 | fQC = new AliFlowAnalysisWithQCumulants(); |
8842fb2b | 360 | |
2ed70edf | 361 | if(fListHistos) |
fd46c3dd | 362 | { |
2ed70edf | 363 | fQC->GetOutputHistograms(fListHistos); |
364 | fQC->Finish(); | |
365 | PostData(1,fListHistos); | |
366 | } else | |
367 | { | |
368 | cout<<" WARNING: histogram list pointer is empty (QC, Task::Terminate()) !!!!"<<endl; | |
369 | cout<<endl; | |
370 | } | |
371 | ||
372 | } // end of void AliAnalysisTaskQCumulants::Terminate(Option_t *) | |
bc92c0cb | 373 | |
374 | ||
375 | ||
376 | ||
377 | ||
378 | ||
379 | ||
380 | ||
381 | ||
382 | ||
383 | ||
384 | ||
385 | ||
386 | ||
387 | ||
388 | ||
389 | ||
390 | ||
391 | ||
392 | ||
393 |