AliPhysics  3f43add (3f43add)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskCRC.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 CRC *
18  * *
19  * author: Jacopo Margutti *
20  * (margutti@nikhef.nl) *
21  * ******************************/
22 
23 class TFile;
24 class TString;
25 class TList;
26 class AliAnalysisTaskSE;
27 
28 #include "Riostream.h"
29 #include "AliAODEvent.h"
30 #include "AliAODHeader.h"
31 #include "AliCentrality.h"
32 #include "AliFlowVector.h"
33 #include "AliFlowEvent.h"
34 #include "AliFlowEventSimple.h"
35 #include "AliAnalysisTaskCRC.h"
36 #include "AliFlowAnalysisCRC.h"
37 #include "AliLog.h"
38 
39 class AliFlowVector;
40 class TVector;
41 
42 using std::cout;
43 using std::endl;
45 
46 //================================================================================================================
47 
48 AliAnalysisTaskCRC::AliAnalysisTaskCRC(const char *name, Bool_t useParticleWeights):
49 AliAnalysisTaskSE(name),
50 fEvent(NULL),
51 fQC(NULL),
52 fListHistos(NULL),
53 fBookOnlyBasicCCH(kTRUE),
54 fFillMultipleControlHistograms(kFALSE),
55 fHarmonic(1),
56 fApplyCorrectionForNUA(kFALSE),
57 fApplyCorrectionForNUAVsM(kFALSE),
58 fPropagateErrorAlsoFromNIT(kFALSE),
59 fCalculateDiffFlow(kTRUE),
60 fCalculate2DDiffFlow(kFALSE),
61 fCalculateDiffFlowVsEta(kTRUE),
62 fStoreDistributions(kFALSE),
63 fCalculateCumulantsVsM(kFALSE),
64 fCalculateAllCorrelationsVsM(kFALSE),
65 fCalculateMixedHarmonics(kFALSE),
66 fCalculateMixedHarmonicsVsM(kFALSE),
67 fStoreControlHistograms(kFALSE),
68 fMinimumBiasReferenceFlow(kTRUE),
69 fForgetAboutCovariances(kFALSE),
70 fStoreVarious(kFALSE),
71 fExactNoRPs(0),
72 fUse2DHistograms(kFALSE),
73 fFillProfilesVsMUsingWeights(kTRUE),
74 fUseQvectorTerms(kFALSE),
75 fnBinsMult(10000),
76 fMinMult(0.),
77 fMaxMult(10000.),
78 fUseParticleWeights(useParticleWeights),
79 fUsePhiWeights(kFALSE),
80 fUsePtWeights(kFALSE),
81 fUseEtaWeights(kFALSE),
82 fUseTrackWeights(kFALSE),
83 fUsePhiEtaWeights(kFALSE),
84 fWeightsList(NULL),
85 fMultiplicityWeight(NULL),
86 fMultiplicityIs(AliFlowCommonConstants::kRP),
87 fnBinsForCorrelations(10000),
88 fUseBootstrap(kFALSE),
89 fUseBootstrapVsM(kFALSE),
90 fnSubsamples(10),
91 fCalculateCRC(kTRUE),
92 fCalculateCRCPt(kFALSE),
93 fCalculateCME(kFALSE),
94 fCalculateCRC2(kFALSE),
95 fCalculateCRCVZ(kFALSE),
96 fCalculateCRCZDC(kFALSE),
97 fCalculateEbEFlow(kFALSE),
98 fCRC2nEtaBins(6),
99 fCalculateFlowQC(kFALSE),
100 fCalculateFlowZDC(kFALSE),
101 fCalculateFlowVZ(kFALSE),
102 fUseVZERO(kFALSE),
103 fUseZDC(kFALSE),
104 fRecenterZDC(kFALSE),
105 fDivSigma(kTRUE),
106 fInvertZDC(kFALSE),
107 fCRCTestSin(kFALSE),
108 fUseNUAforCRC(kFALSE),
109 fUseCRCRecenter(kFALSE),
110 fCRCEtaMin(0.),
111 fCRCEtaMax(0.),
112 fnCenBin(10),
113 fFlowQCCenBin(100),
114 fCenBinWidth(10.),
115 fDataSet(""),
116 fCorrWeight("TPCuVZuZDCu"),
117 fQVecList(NULL),
118 fCRCZDCCalibList(NULL),
119 fZDCESEList(NULL),
120 fCenWeightsHist(NULL),
121 fQAZDCCuts(kFALSE),
122 fMinMulZN(1),
123 fMaxDevZN(5.)
124 {
125  // constructor
126  AliDebug(2,"AliAnalysisTaskCRC::AliAnalysisTaskCRC(const char *name, Bool_t useParticleWeights)");
127 
128  // Define input and output slots here
129  // Input slot #0 works with an AliFlowEventSimple
130  DefineInput(0, AliFlowEventSimple::Class());
131 
132  // Output slot #0 is reserved
133  // Output slot #1 writes into a TList container
134  DefineOutput(1, TList::Class());
135 
136  // Event weights:
137  fMultiplicityWeight = new TString("combinations");
138 
139  // b) Initialize default min and max values of correlations:
140  // (Remark: The default values bellow were chosen for v2=5% and M=500)
141  fMinValueOfCorrelation[0] = -0.015; // <2>_min
142  fMaxValueOfCorrelation[0] = 0.03; // <2>_max
143  fMinValueOfCorrelation[1] = -0.6e-3; // <4>_min
144  fMaxValueOfCorrelation[1] = 0.07; // <4>_max
145  fMinValueOfCorrelation[2] = -0.08e-3; // <6>_min
146  fMaxValueOfCorrelation[2] = 0.015; // <6>_max
147  fMinValueOfCorrelation[3] = -20.e-6; // <8>_min
148  fMaxValueOfCorrelation[3] = 0.003; // <8>_max
149 
150  // c) Initialize default min and max values of correlation products:
151  // (Remark: The default values bellow were chosen for v2=5% and M=500)
152  fMinValueOfCorrelationProduct[0] = -15.e-6; // <2><4>_min
153  fMaxValueOfCorrelationProduct[0] = 0.02; // <2><4>_max
154 
155  // d) Initialize default min and max values of q-vector terms:
156  fMinValueOfQvectorTerms[0] = 0.;
157  fMaxValueOfQvectorTerms[0] = 30.;
158  fMinValueOfQvectorTerms[1] = 0.;
159  fMaxValueOfQvectorTerms[1] = 20.;
160  fMinValueOfQvectorTerms[2] = 0.;
161  fMaxValueOfQvectorTerms[2] = 200.;
162  fMinValueOfQvectorTerms[3] = -30.;
163  fMaxValueOfQvectorTerms[3] = 80.;
164 
165  for(Int_t c=0; c<10; c++) {
166  fPtWeightsHist[c] = NULL;
167  for(Int_t b=0; b<21; b++) {
168  for(Int_t k=0; k<2; k++) {
169  fEtaWeightsHist[c][b][k] = NULL;
170  }
171  }
172  }
173  for(Int_t c=0; c<2; c++) {
174  for(Int_t k=0; k<2; k++) {
175  fNvsCenCut[c][k] = NULL;
176  }
177  }
178 
179 }
180 
181 //================================================================================================================
182 
184 AliAnalysisTaskSE(),
185 fEvent(NULL),
186 fQC(NULL),
187 fListHistos(NULL),
188 fBookOnlyBasicCCH(kFALSE),
189 fFillMultipleControlHistograms(kFALSE),
190 fHarmonic(1),
191 fApplyCorrectionForNUA(kFALSE),
192 fApplyCorrectionForNUAVsM(kFALSE),
193 fPropagateErrorAlsoFromNIT(kFALSE),
194 fCalculateDiffFlow(kFALSE),
195 fCalculate2DDiffFlow(kFALSE),
196 fCalculateDiffFlowVsEta(kTRUE),
197 fStoreDistributions(kFALSE),
198 fCalculateCumulantsVsM(kFALSE),
199 fCalculateAllCorrelationsVsM(kFALSE),
200 fCalculateMixedHarmonics(kFALSE),
201 fCalculateMixedHarmonicsVsM(kFALSE),
202 fStoreControlHistograms(kFALSE),
203 fMinimumBiasReferenceFlow(kFALSE),
204 fForgetAboutCovariances(kFALSE),
205 fStoreVarious(kFALSE),
206 fExactNoRPs(0),
207 fUse2DHistograms(kFALSE),
208 fFillProfilesVsMUsingWeights(kTRUE),
209 fUseQvectorTerms(kFALSE),
210 fnBinsMult(0),
211 fMinMult(0.),
212 fMaxMult(0.),
213 fUseParticleWeights(kFALSE),
214 fUsePhiWeights(kFALSE),
215 fUsePtWeights(kFALSE),
216 fUseEtaWeights(kFALSE),
217 fUseTrackWeights(kFALSE),
218 fUsePhiEtaWeights(kFALSE),
219 fWeightsList(NULL),
220 fMultiplicityWeight(NULL),
221 fMultiplicityIs(AliFlowCommonConstants::kRP),
222 fnBinsForCorrelations(0),
223 fUseBootstrap(kFALSE),
224 fUseBootstrapVsM(kFALSE),
225 fnSubsamples(10),
226 fCalculateCRC(kTRUE),
227 fCalculateCRCPt(kFALSE),
228 fCalculateCME(kFALSE),
229 fCalculateCRC2(kFALSE),
230 fCalculateCRCVZ(kFALSE),
231 fCalculateCRCZDC(kFALSE),
232 fCalculateEbEFlow(kFALSE),
233 fCRC2nEtaBins(6),
234 fCalculateFlowQC(kFALSE),
235 fCalculateFlowZDC(kFALSE),
236 fCalculateFlowVZ(kFALSE),
237 fUseVZERO(kFALSE),
238 fUseZDC(kFALSE),
239 fRecenterZDC(kFALSE),
240 fDivSigma(kTRUE),
241 fInvertZDC(kFALSE),
242 fCRCTestSin(kFALSE),
243 fUseNUAforCRC(kFALSE),
244 fUseCRCRecenter(kFALSE),
245 fCRCEtaMin(0.),
246 fCRCEtaMax(0.),
247 fnCenBin(10),
248 fFlowQCCenBin(100),
249 fCenBinWidth(10.),
250 fDataSet(""),
251 fCorrWeight("TPCuVZuZDCu"),
252 fQVecList(NULL),
253 fCRCZDCCalibList(NULL),
254 fZDCESEList(NULL),
255 fCenWeightsHist(NULL),
256 fQAZDCCuts(kFALSE),
257 fMinMulZN(1),
258 fMaxDevZN(5.)
259 {
260  // Dummy constructor
261  AliDebug(2,"AliAnalysisTaskCRC::AliAnalysisTaskCRC()");
262 
263  // b) Initialize default min and max values of correlations:
264  // (Remark: The default values bellow were chosen for v2=5% and M=500)
265  fMinValueOfCorrelation[0] = -0.015; // <2>_min
266  fMaxValueOfCorrelation[0] = 0.03; // <2>_max
267  fMinValueOfCorrelation[1] = -0.6e-3; // <4>_min
268  fMaxValueOfCorrelation[1] = 0.07; // <4>_max
269  fMinValueOfCorrelation[2] = -0.08e-3; // <6>_min
270  fMaxValueOfCorrelation[2] = 0.015; // <6>_max
271  fMinValueOfCorrelation[3] = -20.e-6; // <8>_min
272  fMaxValueOfCorrelation[3] = 0.003; // <8>_max
273 
274  // c) Initialize default min and max values of correlation products:
275  // (Remark: The default values bellow were chosen for v2=5% and M=500)
276  fMinValueOfCorrelationProduct[0] = -15.e-6; // <2><4>_min
277  fMaxValueOfCorrelationProduct[0] = 0.02; // <2><4>_max
278 
279  // d) Initialize default min and max values of q-vector terms:
280  fMinValueOfQvectorTerms[0] = 0.;
281  fMaxValueOfQvectorTerms[0] = 30.;
282  fMinValueOfQvectorTerms[1] = 0.;
283  fMaxValueOfQvectorTerms[1] = 20.;
284  fMinValueOfQvectorTerms[2] = 0.;
285  fMaxValueOfQvectorTerms[2] = 200.;
286  fMinValueOfQvectorTerms[3] = -30.;
287  fMaxValueOfQvectorTerms[3] = 80.;
288 
289  for(Int_t c=0; c<10; c++) {
290  fPtWeightsHist[c] = NULL;
291  for(Int_t b=0; b<21; b++) {
292  for(Int_t k=0; k<2; k++) {
293  fEtaWeightsHist[c][b][k] = NULL;
294  }
295  }
296  }
297  for(Int_t c=0; c<2; c++) {
298  for(Int_t k=0; k<2; k++) {
299  fNvsCenCut[c][k] = NULL;
300  }
301  }
302 
303 }
304 
305 //==========================================================================================================
306 
308 {
309  // Called at every worker node to initialize
310  AliDebug(2,"AliAnalysisTaskCRC::UserCreateOutputObjects()");
311 
312  // Analyser:
313  fQC = new AliFlowAnalysisCRC("AliFlowAnalysisCRC",fnCenBin,fCenBinWidth);
314 
315  // Common:
334  if(fDataSet.EqualTo("2010")) fQC->SetDataSet(AliFlowAnalysisCRC::k2010);
335  if(fDataSet.EqualTo("2011")) fQC->SetDataSet(AliFlowAnalysisCRC::k2011);
336  if(fDataSet.EqualTo("2015")) fQC->SetDataSet(AliFlowAnalysisCRC::k2015);
369  // Multiparticle correlations vs multiplicity:
373  // Particle weights:
374  if(fUseParticleWeights) {
375  // Pass the flags to class:
381  // Pass the list with weights to class:
383  }
384  // Event weights:
385  if(!fMultiplicityWeight->Contains("combinations")) {
387  }
388  // Q Vector weights:
389  if(fUseCRCRecenter) {
391  }
392  if (fRecenterZDC) {
394  }
395  if (fQAZDCCuts) {
397  }
399  if(fUsePtWeights){
400  for(Int_t c=0; c<10; c++) {
402  }
403  }
404  if(fUseEtaWeights){
405  for(Int_t h=0; h<10; h++) {
406  for(Int_t b=0; b<21; b++) {
407  for(Int_t c=0; c<2; c++) {
408  if(fEtaWeightsHist[h][b][c]) fQC->SetEtaWeightsHist(fEtaWeightsHist[h][b][c],h,b,c);
409  }
410  }
411  }
412  }
413  if(fMinMulZN>1){
414  for(Int_t c=0; c<2; c++) {
415  for(Int_t k=0; k<2; k++) {
416  if(fNvsCenCut[c][k]) fQC->SetNvsCenCut(fNvsCenCut[c][k],c,k);
417  }
418  }
419  }
420 
426 
427  // Store phi distribution for one event to illustrate flow:
429 
430  // Initialize default min and max values of correlations:
431  for(Int_t ci=0;ci<4;ci++) {
434  }
435 
436  // Initialize default min and max values of correlation products:
437  for(Int_t cpi=0;cpi<1;cpi++) {
440  }
441 
442  // Initialize default min and max values of Q-vector terms:
443  for(Int_t ci=0;ci<4;ci++) {
446  }
447 
448  // Bootstrap:
452 
453  fQC->Init();
454 
455  if(fQC->GetHistList()) {
457  } else {
458  Printf("ERROR: Could not retrieve histogram list (QC, Task::UserCreateOutputObjects()) !!!!");
459  }
460 
461  PostData(1,fListHistos);
462 
463 } // end of void AliAnalysisTaskCRC::UserCreateOutputObjects()
464 
465 //================================================================================================================
466 
468 {
469  // main loop (called for each event)
470  fEvent = dynamic_cast<AliFlowEvent*>(GetInputData(0));
471 
472  // Q-cumulants
473  if(fEvent) {
475  fQC->Make(fEvent);
476  } else {
477  cout<<"WARNING: No input data (QC, Task::UserExec()) !!!!"<<endl;
478  cout<<endl;
479  }
480 
481  PostData(1,fListHistos);
482 }
483 
484 //================================================================================================================
485 
487 {
488  //accessing the merged output list:
489  fListHistos = (TList*)GetOutputData(1);
490 
491  fQC = new AliFlowAnalysisCRC("AliFlowAnalysisCRC",fnCenBin,fCenBinWidth);
492  if(fDataSet.EqualTo("2010")) fQC->SetDataSet(AliFlowAnalysisCRC::k2010);
493  if(fDataSet.EqualTo("2011")) fQC->SetDataSet(AliFlowAnalysisCRC::k2011);
494  if(fDataSet.EqualTo("2015")) fQC->SetDataSet(AliFlowAnalysisCRC::k2015);
495  fQC->SetRunList();
496 
497  if(fListHistos) {
499  fQC->Finish();
500  PostData(1,fListHistos);
501  } else {
502  cout<<" WARNING: histogram list pointer is empty (QC, Task::Terminate()) !!!!"<<endl;
503  cout<<endl;
504  }
505 
506 } // end of void AliAnalysisTaskCRC::Terminate(Option_t *)
507 
508 
509 
510 
511 
512 
513 
514 
515 
516 
517 
518 
519 
520 
521 
522 
523 
524 
525 
526 
527 
TList * GetHistList() const
void SetTestSin(Bool_t const cCRC)
virtual void UserExec(Option_t *option)
void SetUseQvectorTerms(Bool_t const uqvt)
void SetNvsCenCut(TH1D *const n, Int_t c, Int_t h)
virtual void UserCreateOutputObjects()
void SetUseTrackWeights(Bool_t const uTrackW)
void SetCalculateAllCorrelationsVsM(Bool_t const cacvm)
void SetDataSet(DataSet set)
AliFlowAnalysisCRC * fQC
void SetUseBootstrap(Bool_t const ub)
void SetCorrWeightVZ(CorrelationWeights weights)
void SetRecenterZDC(Bool_t const cCRC)
void SetBookOnlyBasicCCH(Bool_t const bobcch)
void SetCalculateFlowVZ(Bool_t const cCRC)
void SetApplyCorrectionForNUA(Bool_t const applyCorrectionForNUA)
void SetUsePhiEtaWeights(Bool_t const uPhiEtaW)
void SetCRCQVecWeightsList(TList *const wlist)
void SetZDCESEList(TList *const kList)
void SetUseZDC(Bool_t const cCRC)
void SetInvertZDC(Bool_t const cCRC)
void SetMinMulZN(Int_t weights)
void SetUsePhiWeights(Bool_t const uPhiW)
Bool_t fQAZDCCuts
ZDC mult cuts.
void SetQAZDCCuts(Bool_t const cCRC)
void SetnBinsForCorrelations(Int_t const nb)
void SetUseVZERO(Bool_t const cCRC)
void SetDivSigma(Bool_t const cCRC)
void SetCorrWeightTPC(CorrelationWeights weights)
void SetCalculateCRCVZ(Bool_t const cCRC)
void SetForgetAboutCovariances(Bool_t const fac)
void SetCalculateCRC2(Bool_t const cCRC)
void SetMinValueOfCorrelation(Int_t const ci, Double_t const minValue)
void SetStoreControlHistograms(Bool_t const sch)
void SetFillMultipleControlHistograms(Bool_t const fmch)
void SetCalculateCRC(Bool_t const cCRC)
void SetMaxValueOfCorrelation(Int_t const ci, Double_t const maxValue)
void SetnBinsMult(Int_t const nbm)
void SetNUAforCRC(Bool_t const cCRC)
void SetCalculateFlowQC(Bool_t const cCRC)
virtual void Make(AliFlowEventSimple *anEvent)
void SetMinValueOfCorrelationProduct(Int_t const cpi, Double_t const minValue)
void SetCorrWeightZDC(CorrelationWeights weights)
void SetCalculateFlowZDC(Bool_t const cCRC)
void SetRunNumber(Int_t const n)
Double_t fMinValueOfCorrelationProduct[1]
virtual void Terminate(Option_t *)
void SetCalculateDiffFlow(Bool_t const cdf)
void SetCalculateEbEFlow(Bool_t const cCRC)
void SetFillProfilesVsMUsingWeights(Bool_t const fpvmuw)
void SetPtWeightsHist(TH1D *const n, Int_t c)
Double_t fMinValueOfCorrelation[4]
Double_t fMaxValueOfCorrelation[4]
void SetMinValueOfQvectorTerms(Int_t const qvti, Double_t const minValue)
void SetCalculateCumulantsVsM(Bool_t const ccvm)
Double_t fMinValueOfQvectorTerms[4]
Double_t fMaxValueOfQvectorTerms[4]
void SetPropagateErrorAlsoFromNIT(Bool_t const peafNIT)
void SetCalculateCME(Bool_t const cCRC)
void SetExactNoRPs(Int_t const enr)
void SetCalculateCRCZDC(Bool_t const cCRC)
void SetnSubsamples(Int_t const ns)
void SetCalculateCRCPt(Bool_t const cCRC)
void SetCalculate2DDiffFlow(Bool_t const c2ddf)
void SetStoreVarious(Bool_t const spdfoe)
void SetMaxMult(Double_t const maxm)
void SetCRCEtaRange(Double_t const etamin, Double_t const etamax)
void SetMultiplicityWeight(const char *multiplicityWeight)
TH1D * fEtaWeightsHist[10][21][2]
void SetUseBootstrapVsM(Bool_t const ubVsM)
void SetUse2DHistograms(Bool_t const u2dh)
Double_t fMaxValueOfCorrelationProduct[1]
void SetWeightsList(TList *const wlist)
void SetCalculateMixedHarmonicsVsM(Bool_t const cmhvm)
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
AliFlowCommonConstants::ERefMultSource fMultiplicityIs
void SetMinMult(Double_t const minm)
void SetUseEtaWeights(Bool_t const uEtaW)
void SetStoreDistributions(Bool_t const storeDistributions)
virtual void GetOutputHistograms(TList *outputListHistos)
void SetCalculateDiffFlowVsEta(Bool_t const cdfve)
void SetUsePtWeights(Bool_t const uPtW)
void SetMultiplicityIs(AliFlowCommonConstants::ERefMultSource mi)
void SetHarmonic(Int_t const harmonic)
void SetMaxValueOfCorrelationProduct(Int_t const cpi, Double_t const maxValue)
void SetMinimumBiasReferenceFlow(Bool_t const mmrf)
void SetCalculateMixedHarmonics(Bool_t const cmh)
void SetEtaWeightsHist(TH1D *const n, Int_t h, Int_t b, Int_t c)
void SetMaxDevZN(Float_t weights)
void SetMaxValueOfQvectorTerms(Int_t const qvti, Double_t const maxValue)
void SetApplyCorrectionForNUAVsM(Bool_t const applyCorrectionForNUAVsM)
void SetCRCZDCCalibList(TList *const wlist)
void SetFlowQCCenBin(Int_t const TL)
void SetUseCRCRecenter(Bool_t const cCRC)
void SetCRC2nEtaBins(Int_t NB)
void SetCenWeightsHist(TH1D *const n)