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