AliPhysics  e59a9ba (e59a9ba)
 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 fFlowQCDeltaEta(0.4),
115 fCenBinWidth(10.),
116 fDataSet(""),
117 fCorrWeight("TPCuVZuZDCu"),
118 fQVecList(NULL),
119 fCRCZDCCalibList(NULL),
120 fZDCESEList(NULL),
121 fCenWeightsHist(NULL),
122 fQAZDCCuts(kFALSE),
123 fMinMulZN(1),
124 fMaxDevZN(5.)
125 {
126  // constructor
127  AliDebug(2,"AliAnalysisTaskCRC::AliAnalysisTaskCRC(const char *name, Bool_t useParticleWeights)");
128 
129  // Define input and output slots here
130  // Input slot #0 works with an AliFlowEventSimple
131  DefineInput(0, AliFlowEventSimple::Class());
132 
133  // Output slot #0 is reserved
134  // Output slot #1 writes into a TList container
135  DefineOutput(1, TList::Class());
136 
137  // Event weights:
138  fMultiplicityWeight = new TString("combinations");
139 
140  // b) Initialize default min and max values of correlations:
141  // (Remark: The default values bellow were chosen for v2=5% and M=500)
142  fMinValueOfCorrelation[0] = -0.015; // <2>_min
143  fMaxValueOfCorrelation[0] = 0.03; // <2>_max
144  fMinValueOfCorrelation[1] = -0.6e-3; // <4>_min
145  fMaxValueOfCorrelation[1] = 0.07; // <4>_max
146  fMinValueOfCorrelation[2] = -0.08e-3; // <6>_min
147  fMaxValueOfCorrelation[2] = 0.015; // <6>_max
148  fMinValueOfCorrelation[3] = -20.e-6; // <8>_min
149  fMaxValueOfCorrelation[3] = 0.003; // <8>_max
150 
151  // c) Initialize default min and max values of correlation products:
152  // (Remark: The default values bellow were chosen for v2=5% and M=500)
153  fMinValueOfCorrelationProduct[0] = -15.e-6; // <2><4>_min
154  fMaxValueOfCorrelationProduct[0] = 0.02; // <2><4>_max
155 
156  // d) Initialize default min and max values of q-vector terms:
157  fMinValueOfQvectorTerms[0] = 0.;
158  fMaxValueOfQvectorTerms[0] = 30.;
159  fMinValueOfQvectorTerms[1] = 0.;
160  fMaxValueOfQvectorTerms[1] = 20.;
161  fMinValueOfQvectorTerms[2] = 0.;
162  fMaxValueOfQvectorTerms[2] = 200.;
163  fMinValueOfQvectorTerms[3] = -30.;
164  fMaxValueOfQvectorTerms[3] = 80.;
165 
166  for(Int_t c=0; c<10; c++) {
167  fPtWeightsHist[c] = NULL;
168  for(Int_t b=0; b<21; b++) {
169  for(Int_t k=0; k<2; k++) {
170  fEtaWeightsHist[c][b][k] = NULL;
171  }
172  }
173  }
174  for(Int_t c=0; c<2; c++) {
175  for(Int_t k=0; k<2; k++) {
176  fNvsCenCut[c][k] = NULL;
177  }
178  }
179 
180 }
181 
182 //================================================================================================================
183 
185 AliAnalysisTaskSE(),
186 fEvent(NULL),
187 fQC(NULL),
188 fListHistos(NULL),
189 fBookOnlyBasicCCH(kFALSE),
190 fFillMultipleControlHistograms(kFALSE),
191 fHarmonic(1),
192 fApplyCorrectionForNUA(kFALSE),
193 fApplyCorrectionForNUAVsM(kFALSE),
194 fPropagateErrorAlsoFromNIT(kFALSE),
195 fCalculateDiffFlow(kFALSE),
196 fCalculate2DDiffFlow(kFALSE),
197 fCalculateDiffFlowVsEta(kTRUE),
198 fStoreDistributions(kFALSE),
199 fCalculateCumulantsVsM(kFALSE),
200 fCalculateAllCorrelationsVsM(kFALSE),
201 fCalculateMixedHarmonics(kFALSE),
202 fCalculateMixedHarmonicsVsM(kFALSE),
203 fStoreControlHistograms(kFALSE),
204 fMinimumBiasReferenceFlow(kFALSE),
205 fForgetAboutCovariances(kFALSE),
206 fStoreVarious(kFALSE),
207 fExactNoRPs(0),
208 fUse2DHistograms(kFALSE),
209 fFillProfilesVsMUsingWeights(kTRUE),
210 fUseQvectorTerms(kFALSE),
211 fnBinsMult(0),
212 fMinMult(0.),
213 fMaxMult(0.),
214 fUseParticleWeights(kFALSE),
215 fUsePhiWeights(kFALSE),
216 fUsePtWeights(kFALSE),
217 fUseEtaWeights(kFALSE),
218 fUseTrackWeights(kFALSE),
219 fUsePhiEtaWeights(kFALSE),
220 fWeightsList(NULL),
221 fMultiplicityWeight(NULL),
222 fMultiplicityIs(AliFlowCommonConstants::kRP),
223 fnBinsForCorrelations(0),
224 fUseBootstrap(kFALSE),
225 fUseBootstrapVsM(kFALSE),
226 fnSubsamples(10),
227 fCalculateCRC(kTRUE),
228 fCalculateCRCPt(kFALSE),
229 fCalculateCME(kFALSE),
230 fCalculateCRC2(kFALSE),
231 fCalculateCRCVZ(kFALSE),
232 fCalculateCRCZDC(kFALSE),
233 fCalculateEbEFlow(kFALSE),
234 fCRC2nEtaBins(6),
235 fCalculateFlowQC(kFALSE),
236 fCalculateFlowZDC(kFALSE),
237 fCalculateFlowVZ(kFALSE),
238 fUseVZERO(kFALSE),
239 fUseZDC(kFALSE),
240 fRecenterZDC(kFALSE),
241 fDivSigma(kTRUE),
242 fInvertZDC(kFALSE),
243 fCRCTestSin(kFALSE),
244 fUseNUAforCRC(kFALSE),
245 fUseCRCRecenter(kFALSE),
246 fCRCEtaMin(0.),
247 fCRCEtaMax(0.),
248 fnCenBin(10),
249 fFlowQCCenBin(100),
250 fFlowQCDeltaEta(0.4),
251 fCenBinWidth(10.),
252 fDataSet(""),
253 fCorrWeight("TPCuVZuZDCu"),
254 fQVecList(NULL),
255 fCRCZDCCalibList(NULL),
256 fZDCESEList(NULL),
257 fCenWeightsHist(NULL),
258 fQAZDCCuts(kFALSE),
259 fMinMulZN(1),
260 fMaxDevZN(5.)
261 {
262  // Dummy constructor
263  AliDebug(2,"AliAnalysisTaskCRC::AliAnalysisTaskCRC()");
264 
265  // b) Initialize default min and max values of correlations:
266  // (Remark: The default values bellow were chosen for v2=5% and M=500)
267  fMinValueOfCorrelation[0] = -0.015; // <2>_min
268  fMaxValueOfCorrelation[0] = 0.03; // <2>_max
269  fMinValueOfCorrelation[1] = -0.6e-3; // <4>_min
270  fMaxValueOfCorrelation[1] = 0.07; // <4>_max
271  fMinValueOfCorrelation[2] = -0.08e-3; // <6>_min
272  fMaxValueOfCorrelation[2] = 0.015; // <6>_max
273  fMinValueOfCorrelation[3] = -20.e-6; // <8>_min
274  fMaxValueOfCorrelation[3] = 0.003; // <8>_max
275 
276  // c) Initialize default min and max values of correlation products:
277  // (Remark: The default values bellow were chosen for v2=5% and M=500)
278  fMinValueOfCorrelationProduct[0] = -15.e-6; // <2><4>_min
279  fMaxValueOfCorrelationProduct[0] = 0.02; // <2><4>_max
280 
281  // d) Initialize default min and max values of q-vector terms:
282  fMinValueOfQvectorTerms[0] = 0.;
283  fMaxValueOfQvectorTerms[0] = 30.;
284  fMinValueOfQvectorTerms[1] = 0.;
285  fMaxValueOfQvectorTerms[1] = 20.;
286  fMinValueOfQvectorTerms[2] = 0.;
287  fMaxValueOfQvectorTerms[2] = 200.;
288  fMinValueOfQvectorTerms[3] = -30.;
289  fMaxValueOfQvectorTerms[3] = 80.;
290 
291  for(Int_t c=0; c<10; c++) {
292  fPtWeightsHist[c] = NULL;
293  for(Int_t b=0; b<21; b++) {
294  for(Int_t k=0; k<2; k++) {
295  fEtaWeightsHist[c][b][k] = NULL;
296  }
297  }
298  }
299  for(Int_t c=0; c<2; c++) {
300  for(Int_t k=0; k<2; k++) {
301  fNvsCenCut[c][k] = NULL;
302  }
303  }
304 
305 }
306 
307 //==========================================================================================================
308 
310 {
311  // Called at every worker node to initialize
312  AliDebug(2,"AliAnalysisTaskCRC::UserCreateOutputObjects()");
313 
314  // Analyser:
315  fQC = new AliFlowAnalysisCRC("AliFlowAnalysisCRC",fnCenBin,fCenBinWidth);
316 
317  // Common:
336  if(fDataSet.EqualTo("2010")) fQC->SetDataSet(AliFlowAnalysisCRC::k2010);
337  if(fDataSet.EqualTo("2011")) fQC->SetDataSet(AliFlowAnalysisCRC::k2011);
338  if(fDataSet.EqualTo("2015")) fQC->SetDataSet(AliFlowAnalysisCRC::k2015);
372  // Multiparticle correlations vs multiplicity:
376  // Particle weights:
377  if(fUseParticleWeights) {
378  // Pass the flags to class:
384  // Pass the list with weights to class:
386  }
387  // Event weights:
388  if(!fMultiplicityWeight->Contains("combinations")) {
390  }
391  // Q Vector weights:
392  if(fUseCRCRecenter) {
394  }
395  if (fRecenterZDC) {
397  }
398  if (fQAZDCCuts) {
400  }
402  if(fUsePtWeights){
403  for(Int_t c=0; c<10; c++) {
405  }
406  }
407  if(fUseEtaWeights){
408  for(Int_t h=0; h<10; h++) {
409  for(Int_t b=0; b<21; b++) {
410  for(Int_t c=0; c<2; c++) {
411  if(fEtaWeightsHist[h][b][c]) fQC->SetEtaWeightsHist(fEtaWeightsHist[h][b][c],h,b,c);
412  }
413  }
414  }
415  }
416  if(fMinMulZN>1){
417  for(Int_t c=0; c<2; c++) {
418  for(Int_t k=0; k<2; k++) {
419  if(fNvsCenCut[c][k]) fQC->SetNvsCenCut(fNvsCenCut[c][k],c,k);
420  }
421  }
422  }
423 
429 
430  // Store phi distribution for one event to illustrate flow:
432 
433  // Initialize default min and max values of correlations:
434  for(Int_t ci=0;ci<4;ci++) {
437  }
438 
439  // Initialize default min and max values of correlation products:
440  for(Int_t cpi=0;cpi<1;cpi++) {
443  }
444 
445  // Initialize default min and max values of Q-vector terms:
446  for(Int_t ci=0;ci<4;ci++) {
449  }
450 
451  // Bootstrap:
455 
456  fQC->Init();
457 
458  if(fQC->GetHistList()) {
460  } else {
461  Printf("ERROR: Could not retrieve histogram list (QC, Task::UserCreateOutputObjects()) !!!!");
462  }
463 
464  PostData(1,fListHistos);
465 
466 } // end of void AliAnalysisTaskCRC::UserCreateOutputObjects()
467 
468 //================================================================================================================
469 
471 {
472  // main loop (called for each event)
473  fEvent = dynamic_cast<AliFlowEvent*>(GetInputData(0));
474 
475  // Q-cumulants
476  if(fEvent) {
478  fQC->Make(fEvent);
479  } else {
480  cout<<"WARNING: No input data (QC, Task::UserExec()) !!!!"<<endl;
481  cout<<endl;
482  }
483 
484  PostData(1,fListHistos);
485 }
486 
487 //================================================================================================================
488 
490 {
491  //accessing the merged output list:
492  fListHistos = (TList*)GetOutputData(1);
493 
494  fQC = new AliFlowAnalysisCRC("AliFlowAnalysisCRC",fnCenBin,fCenBinWidth);
495  if(fDataSet.EqualTo("2010")) fQC->SetDataSet(AliFlowAnalysisCRC::k2010);
496  if(fDataSet.EqualTo("2011")) fQC->SetDataSet(AliFlowAnalysisCRC::k2011);
497  if(fDataSet.EqualTo("2015")) fQC->SetDataSet(AliFlowAnalysisCRC::k2015);
498  fQC->SetRunList();
499 
500  if(fListHistos) {
502  fQC->Finish();
503  PostData(1,fListHistos);
504  } else {
505  cout<<" WARNING: histogram list pointer is empty (QC, Task::Terminate()) !!!!"<<endl;
506  cout<<endl;
507  }
508 
509 } // end of void AliAnalysisTaskCRC::Terminate(Option_t *)
510 
511 
512 
513 
514 
515 
516 
517 
518 
519 
520 
521 
522 
523 
524 
525 
526 
527 
528 
529 
530 
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 SetFlowQCDeltaEta(Double_t const TL)
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)