1 /*************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /**************************************
17 * analysis task for Q-cumulants *
19 * authors: Naomi van der Kolk *
22 * (snelling@nikhef.nl) *
25 * ***********************************/
29 class AliAnalysisTaskSE;
31 #include "Riostream.h"
32 #include "AliFlowEventSimple.h"
33 #include "AliAnalysisTaskQCumulants.h"
34 #include "AliFlowAnalysisWithQCumulants.h"
36 ClassImp(AliAnalysisTaskQCumulants)
38 //================================================================================================================
40 AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants(const char *name, Bool_t useParticleWeights):
41 AliAnalysisTaskSE(name),
45 fFillMultipleControlHistograms(kFALSE),
47 fApplyCorrectionForNUA(kFALSE),
48 fApplyCorrectionForNUAVsM(kFALSE),
49 fPropagateErrorAlsoFromNIT(kFALSE),
50 fCalculate2DFlow(kFALSE),
51 fStoreDistributions(kFALSE),
52 fCalculateCumulantsVsM(kFALSE),
53 fMinimumBiasReferenceFlow(kTRUE),
54 fForgetAboutCovariances(kFALSE),
55 fStorePhiDistributionForOneEvent(kFALSE),
59 fUseParticleWeights(useParticleWeights),
60 fUsePhiWeights(kFALSE),
61 fUsePtWeights(kFALSE),
62 fUseEtaWeights(kFALSE),
64 fMultiplicityWeight(NULL)
67 cout<<"AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants(const char *name, Bool_t useParticleWeights)"<<endl;
69 // Define input and output slots here
70 // Input slot #0 works with an AliFlowEventSimple
71 DefineInput(0, AliFlowEventSimple::Class());
72 // Input slot #1 is needed for the weights input file:
73 if(useParticleWeights)
75 DefineInput(1, TList::Class());
77 // Output slot #0 is reserved
78 // Output slot #1 writes into a TList container
79 DefineOutput(1, TList::Class());
82 fMultiplicityWeight = new TString("combinations");
84 // Store phi distribution for one event to illustrate flow:
85 for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max]
87 fPhiDistributionForOneEventSettings[p] = 0.;
92 AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants():
97 fFillMultipleControlHistograms(kFALSE),
99 fApplyCorrectionForNUA(kFALSE),
100 fApplyCorrectionForNUAVsM(kFALSE),
101 fPropagateErrorAlsoFromNIT(kFALSE),
102 fCalculate2DFlow(kFALSE),
103 fStoreDistributions(kFALSE),
104 fCalculateCumulantsVsM(kFALSE),
105 fMinimumBiasReferenceFlow(kFALSE),
106 fForgetAboutCovariances(kFALSE),
107 fStorePhiDistributionForOneEvent(kFALSE),
111 fUseParticleWeights(kFALSE),
112 fUsePhiWeights(kFALSE),
113 fUsePtWeights(kFALSE),
114 fUseEtaWeights(kFALSE),
116 fMultiplicityWeight(NULL)
119 cout<<"AliAnalysisTaskQCumulants::AliAnalysisTaskQCumulants()"<<endl;
121 // Store phi distribution for one event to illustrate flow:
122 for(Int_t p=0;p<4;p++) // [v_min,v_max,refMult_min,refMult_max]
124 fPhiDistributionForOneEventSettings[p] = 0.;
129 //================================================================================================================
131 void AliAnalysisTaskQCumulants::UserCreateOutputObjects()
133 // Called at every worker node to initialize
134 cout<<"AliAnalysisTaskQCumulants::UserCreateOutputObjects()"<<endl;
137 fQC = new AliFlowAnalysisWithQCumulants();
140 fQC->SetFillMultipleControlHistograms(fFillMultipleControlHistograms);
141 fQC->SetHarmonic(fHarmonic);
142 fQC->SetApplyCorrectionForNUA(fApplyCorrectionForNUA);
143 fQC->SetApplyCorrectionForNUAVsM(fApplyCorrectionForNUAVsM);
144 fQC->SetPropagateErrorAlsoFromNIT(fPropagateErrorAlsoFromNIT);
145 fQC->SetCalculate2DFlow(fCalculate2DFlow);
146 fQC->SetStoreDistributions(fStoreDistributions);
147 fQC->SetCalculateCumulantsVsM(fCalculateCumulantsVsM);
148 fQC->SetMinimumBiasReferenceFlow(fMinimumBiasReferenceFlow);
149 fQC->SetForgetAboutCovariances(fForgetAboutCovariances);
150 // Multiparticle correlations vs multiplicity:
151 fQC->SetnBinsMult(fnBinsMult);
152 fQC->SetMinMult(fMinMult);
153 fQC->SetMaxMult(fMaxMult);
155 if(fUseParticleWeights)
157 // Pass the flags to class:
158 if(fUsePhiWeights) fQC->SetUsePhiWeights(fUsePhiWeights);
159 if(fUsePtWeights) fQC->SetUsePtWeights(fUsePtWeights);
160 if(fUseEtaWeights) fQC->SetUseEtaWeights(fUseEtaWeights);
161 // Get data from input slot #1 which is used for weights:
164 fWeightsList = (TList*)GetInputData(1);
166 // Pass the list with weights to class:
167 if(fWeightsList) fQC->SetWeightsList(fWeightsList);
170 if(!(strcmp(fMultiplicityWeight->Data(),"combinations")==0)) // default is "combinations"
172 fQC->SetMultiplicityWeight(fMultiplicityWeight->Data());
175 // Store phi distribution for one event to illustrate flow:
176 fQC->SetStorePhiDistributionForOneEvent(fStorePhiDistributionForOneEvent);
177 for(Int_t i=0;i<4;i++)
179 fQC->SetPhiDistributionForOneEventSettings(fPhiDistributionForOneEventSettings[i],i);
184 if(fQC->GetHistList())
186 fListHistos = fQC->GetHistList();
187 // fListHistos->Print();
190 Printf("ERROR: Could not retrieve histogram list (QC, Task::UserCreateOutputObjects()) !!!!");
193 PostData(1,fListHistos);
195 } // end of void AliAnalysisTaskQCumulants::UserCreateOutputObjects()
197 //================================================================================================================
199 void AliAnalysisTaskQCumulants::UserExec(Option_t *)
201 // main loop (called for each event)
202 fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
210 cout<<"WARNING: No input data (QC, Task::UserExec()) !!!!"<<endl;
214 PostData(1,fListHistos);
217 //================================================================================================================
219 void AliAnalysisTaskQCumulants::Terminate(Option_t *)
221 //accessing the merged output list:
222 fListHistos = (TList*)GetOutputData(1);
224 fQC = new AliFlowAnalysisWithQCumulants();
228 fQC->GetOutputHistograms(fListHistos);
230 PostData(1,fListHistos);
233 cout<<" WARNING: histogram list pointer is empty (QC, Task::Terminate()) !!!!"<<endl;
237 } // end of void AliAnalysisTaskQCumulants::Terminate(Option_t *)