AliPhysics  d497547 (d497547)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskQCumulants.cxx
Go to the documentation of this file.
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  * 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  * *************************************/
26 
27 class TFile;
28 class TString;
29 class TList;
30 class AliAnalysisTaskSE;
31 
32 #include "Riostream.h"
33 #include "AliFlowEventSimple.h"
36 
37 #include "AliLog.h"
38 
39 using std::cout;
40 using std::endl;
42 
43 //================================================================================================================
44 
45 AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants(const char *name, Bool_t useParticleWeights):
46  AliAnalysisTaskSE(name),
47  fEvent(NULL),
48  fQC(NULL),
49  fListHistos(NULL),
50  fBookOnlyBasicCCH(kTRUE),
51  fFillMultipleControlHistograms(kFALSE),
52  fMaxCommonResultsHistogram(8),
53  fHarmonic(2),
54  fApplyCorrectionForNUA(kFALSE),
55  fApplyCorrectionForNUAVsM(kFALSE),
56  fPropagateErrorAlsoFromNIT(kFALSE),
57  fCalculateDiffFlow(kTRUE),
58  fCalculate2DDiffFlow(kFALSE),
59  fCalculateDiffFlowVsEta(kTRUE),
60  fStoreDistributions(kFALSE),
61  fCalculateCumulantsVsM(kFALSE),
62  fCalculateAllCorrelationsVsM(kFALSE),
63  fCalculateMixedHarmonics(kFALSE),
64  fCalculateMixedHarmonicsVsM(kFALSE),
65  fStoreControlHistograms(kFALSE),
66  fMinimumBiasReferenceFlow(kTRUE),
67  fForgetAboutCovariances(kFALSE),
68  fStorePhiDistributionForOneEvent(kFALSE),
69  fExactNoRPs(0),
70  fUse2DHistograms(kFALSE),
71  fFillProfilesVsMUsingWeights(kTRUE),
72  fUseQvectorTerms(kFALSE),
73  fnBinsMult(10000),
74  fMinMult(0.),
75  fMaxMult(10000.),
76  fUseParticleWeights(useParticleWeights),
77  fUsePhiWeights(kFALSE),
78  fUsePtWeights(kFALSE),
79  fUseEtaWeights(kFALSE),
80  fUseTrackWeights(kFALSE),
81  fWeightsList(NULL),
82  fMultiplicityWeight(NULL),
83  fMultiplicityIs(AliFlowCommonConstants::kRP),
84  fnBinsForCorrelations(10000),
85  fUseBootstrap(kFALSE),
86  fUseBootstrapVsM(kFALSE),
87  fnSubsamples(10)
88 {
89  // constructor
90  AliDebug(2,"AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants(const char *name, Bool_t useParticleWeights)");
91 
92  // Define input and output slots here
93  // Input slot #0 works with an AliFlowEventSimple
94  DefineInput(0, AliFlowEventSimple::Class());
95  // Input slot #1 is needed for the weights input file:
96  if(useParticleWeights)
97  {
98  DefineInput(1, TList::Class());
99  }
100  // Output slot #0 is reserved
101  // Output slot #1 writes into a TList container
102  DefineOutput(1, TList::Class());
103 
104  // Event weights:
105  fMultiplicityWeight = new TString("combinations");
106 
107  // Store phi distribution for one event to illustrate flow:
108  for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max]
109  {
110  fPhiDistributionForOneEventSettings[p] = 0.;
111  }
112 
113  // b) Initialize default min and max values of correlations:
114  // (Remark: The default values bellow were chosen for v2=5% and M=500)
115  fMinValueOfCorrelation[0] = -0.015; // <2>_min
116  fMaxValueOfCorrelation[0] = 0.03; // <2>_max
117  fMinValueOfCorrelation[1] = -0.6e-3; // <4>_min
118  fMaxValueOfCorrelation[1] = 0.07; // <4>_max
119  fMinValueOfCorrelation[2] = -0.08e-3; // <6>_min
120  fMaxValueOfCorrelation[2] = 0.015; // <6>_max
121  fMinValueOfCorrelation[3] = -20.e-6; // <8>_min
122  fMaxValueOfCorrelation[3] = 0.003; // <8>_max
123 
124  // c) Initialize default min and max values of correlation products:
125  // (Remark: The default values bellow were chosen for v2=5% and M=500)
126  fMinValueOfCorrelationProduct[0] = -15.e-6; // <2><4>_min
127  fMaxValueOfCorrelationProduct[0] = 0.02; // <2><4>_max
128 
129  // d) Initialize default min and max values of q-vector terms:
130  fMinValueOfQvectorTerms[0] = 0.;
131  fMaxValueOfQvectorTerms[0] = 30.;
132  fMinValueOfQvectorTerms[1] = 0.;
133  fMaxValueOfQvectorTerms[1] = 20.;
134  fMinValueOfQvectorTerms[2] = 0.;
135  fMaxValueOfQvectorTerms[2] = 200.;
136  fMinValueOfQvectorTerms[3] = -30.;
137  fMaxValueOfQvectorTerms[3] = 80.;
138 
139 }
140 
141 //================================================================================================================
142 
145  fEvent(NULL),
146  fQC(NULL),
147  fListHistos(NULL),
148  fBookOnlyBasicCCH(kFALSE),
149  fFillMultipleControlHistograms(kFALSE),
150  fMaxCommonResultsHistogram(0),
151  fHarmonic(0),
152  fApplyCorrectionForNUA(kFALSE),
153  fApplyCorrectionForNUAVsM(kFALSE),
154  fPropagateErrorAlsoFromNIT(kFALSE),
155  fCalculateDiffFlow(kFALSE),
156  fCalculate2DDiffFlow(kFALSE),
157  fCalculateDiffFlowVsEta(kTRUE),
158  fStoreDistributions(kFALSE),
159  fCalculateCumulantsVsM(kFALSE),
160  fCalculateAllCorrelationsVsM(kFALSE),
161  fCalculateMixedHarmonics(kFALSE),
162  fCalculateMixedHarmonicsVsM(kFALSE),
163  fStoreControlHistograms(kFALSE),
164  fMinimumBiasReferenceFlow(kFALSE),
165  fForgetAboutCovariances(kFALSE),
166  fStorePhiDistributionForOneEvent(kFALSE),
167  fExactNoRPs(0),
168  fUse2DHistograms(kFALSE),
169  fFillProfilesVsMUsingWeights(kTRUE),
170  fUseQvectorTerms(kFALSE),
171  fnBinsMult(0),
172  fMinMult(0.),
173  fMaxMult(0.),
174  fUseParticleWeights(kFALSE),
175  fUsePhiWeights(kFALSE),
176  fUsePtWeights(kFALSE),
177  fUseEtaWeights(kFALSE),
178  fUseTrackWeights(kFALSE),
179  fWeightsList(NULL),
180  fMultiplicityWeight(NULL),
181  fMultiplicityIs(AliFlowCommonConstants::kRP),
182  fnBinsForCorrelations(0),
183  fUseBootstrap(kFALSE),
184  fUseBootstrapVsM(kFALSE),
185  fnSubsamples(10)
186 
187 {
188  // Dummy constructor
189  AliDebug(2,"AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants()");
190 
191  // Store phi distribution for one event to illustrate flow:
192  for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max]
193  {
195  }
196 
197  // b) Initialize default min and max values of correlations:
198  // (Remark: The default values bellow were chosen for v2=5% and M=500)
199  fMinValueOfCorrelation[0] = -0.015; // <2>_min
200  fMaxValueOfCorrelation[0] = 0.03; // <2>_max
201  fMinValueOfCorrelation[1] = -0.6e-3; // <4>_min
202  fMaxValueOfCorrelation[1] = 0.07; // <4>_max
203  fMinValueOfCorrelation[2] = -0.08e-3; // <6>_min
204  fMaxValueOfCorrelation[2] = 0.015; // <6>_max
205  fMinValueOfCorrelation[3] = -20.e-6; // <8>_min
206  fMaxValueOfCorrelation[3] = 0.003; // <8>_max
207 
208  // c) Initialize default min and max values of correlation products:
209  // (Remark: The default values bellow were chosen for v2=5% and M=500)
210  fMinValueOfCorrelationProduct[0] = -15.e-6; // <2><4>_min
211  fMaxValueOfCorrelationProduct[0] = 0.02; // <2><4>_max
212 
213  // d) Initialize default min and max values of q-vector terms:
214  fMinValueOfQvectorTerms[0] = 0.;
215  fMaxValueOfQvectorTerms[0] = 30.;
216  fMinValueOfQvectorTerms[1] = 0.;
217  fMaxValueOfQvectorTerms[1] = 20.;
218  fMinValueOfQvectorTerms[2] = 0.;
219  fMaxValueOfQvectorTerms[2] = 200.;
220  fMinValueOfQvectorTerms[3] = -30.;
221  fMaxValueOfQvectorTerms[3] = 80.;
222 
223 }
224 
225 //================================================================================================================
226 
228 {
229  // Called at every worker node to initialize
230  AliDebug(2,"AliAnalysisTaskQCumulants::UserCreateOutputObjects()");
231 
232  // Analyser:
234 
235  // Common:
255  // Multiparticle correlations vs multiplicity:
259  // Particle weights:
261  {
262  // Pass the flags to class:
267  // Get data from input slot #1 which is used for weights:
268  if(GetNinputs()==2)
269  {
270  fWeightsList = (TList*)GetInputData(1);
271  }
272  // Pass the list with weights to class:
274  }
275  // Event weights:
276  if(!fMultiplicityWeight->Contains("combinations")) // default is "combinations"
277  {
279  }
280 
286 
287  // Store phi distribution for one event to illustrate flow:
289  for(Int_t i=0;i<4;i++)
290  {
292  }
293 
294  // Initialize default min and max values of correlations:
295  for(Int_t ci=0;ci<4;ci++)
296  {
299  }
300 
301  // Initialize default min and max values of correlation products:
302  for(Int_t cpi=0;cpi<1;cpi++) // TBI hardwired 1
303  {
306  }
307 
308  // Initialize default min and max values of Q-vector terms:
309  for(Int_t ci=0;ci<4;ci++)
310  {
313  }
314 
315  // Bootstrap:
319 
320  fQC->Init();
321 
322  if(fQC->GetHistList())
323  {
325  // fListHistos->Print();
326  } else
327  {
328  Printf("ERROR: Could not retrieve histogram list (QC, Task::UserCreateOutputObjects()) !!!!");
329  }
330 
331  PostData(1,fListHistos);
332 
333 } // end of void AliAnalysisTaskQCumulants::UserCreateOutputObjects()
334 
335 //================================================================================================================
336 
338 {
339  // main loop (called for each event)
340  fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
341 
342  // Q-cumulants
343  if(fEvent)
344  {
345  fQC->Make(fEvent);
346  } else
347  {
348  cout<<"WARNING: No input data (QC, Task::UserExec()) !!!!"<<endl;
349  cout<<endl;
350  }
351 
352  PostData(1,fListHistos);
353 }
354 
355 //================================================================================================================
356 
358 {
359  //accessing the merged output list:
360  fListHistos = (TList*)GetOutputData(1);
361 
363 
364  if(fListHistos)
365  {
367  fQC->Finish();
368  PostData(1,fListHistos);
369  } else
370  {
371  cout<<" WARNING: histogram list pointer is empty (QC, Task::Terminate()) !!!!"<<endl;
372  cout<<endl;
373  }
374 
375 } // end of void AliAnalysisTaskQCumulants::Terminate(Option_t *)
376 
377 
378 
379 
380 
381 
382 
383 
384 
385 
386 
387 
388 
389 
390 
391 
392 
393 
394 
395 
396 
void SetMinValueOfCorrelationProduct(Int_t const cpi, Double_t const minValue)
void SetApplyCorrectionForNUA(Bool_t const applyCorrectionForNUA)
void SetFillProfilesVsMUsingWeights(Bool_t const fpvmuw)
void SetFillMultipleControlHistograms(Bool_t const fmch)
void SetUseTrackWeights(Bool_t const uTrackW)
AliFlowCommonConstants::ERefMultSource fMultiplicityIs
void SetMaxValueOfQvectorTerms(Int_t const qvti, Double_t const maxValue)
void SetMultiplicityIs(AliFlowCommonConstants::ERefMultSource mi)
virtual void UserExec(Option_t *option)
void SetStoreDistributions(Bool_t const storeDistributions)
void SetMinValueOfQvectorTerms(Int_t const qvti, Double_t const minValue)
void SetBookOnlyBasicCCH(Bool_t const bobcch)
void SetMinimumBiasReferenceFlow(Bool_t const mmrf)
int Int_t
Definition: External.C:63
void SetMaxCommonResultsHistogram(Int_t const mcrh)
void SetCalculateAllCorrelationsVsM(Bool_t const cacvm)
void SetCalculate2DDiffFlow(Bool_t const c2ddf)
void SetPropagateErrorAlsoFromNIT(Bool_t const peafNIT)
void SetCalculateDiffFlowVsEta(Bool_t const cdfve)
void SetCalculateCumulantsVsM(Bool_t const ccvm)
void SetStorePhiDistributionForOneEvent(Bool_t const spdfoe)
void SetPhiDistributionForOneEventSettings(Double_t const pdfoes, Int_t const i)
void SetMaxValueOfCorrelation(Int_t const ci, Double_t const maxValue)
virtual void GetOutputHistograms(TList *outputListHistos)
void SetMaxValueOfCorrelationProduct(Int_t const cpi, Double_t const maxValue)
AliFlowAnalysisWithQCumulants * fQC
void SetMinValueOfCorrelation(Int_t const ci, Double_t const minValue)
virtual void Make(AliFlowEventSimple *anEvent)
virtual void Terminate(Option_t *)
void SetCalculateMixedHarmonicsVsM(Bool_t const cmhvm)
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
void SetMultiplicityWeight(const char *multiplicityWeight)
void SetApplyCorrectionForNUAVsM(Bool_t const applyCorrectionForNUAVsM)