]>
Commit | Line | Data |
---|---|---|
37d2f768 | 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 flow analysis with * | |
18 | * multi-particle correlations * | |
19 | * * | |
20 | * author: Ante Bilandzic * | |
21 | * (abilandzic@gmail.com) * | |
22 | ***************************************/ | |
23 | ||
24 | #include "Riostream.h" | |
25 | #include "AliFlowEventSimple.h" | |
26 | #include "AliAnalysisTaskMultiparticleCorrelations.h" | |
27 | #include "AliFlowAnalysisWithMultiparticleCorrelations.h" | |
28 | #include "AliLog.h" | |
29 | ||
30 | using std::cout; | |
31 | using std::endl; | |
32 | ||
33 | ClassImp(AliAnalysisTaskMultiparticleCorrelations) | |
34 | ||
35 | //================================================================================================================ | |
36 | ||
37 | AliAnalysisTaskMultiparticleCorrelations::AliAnalysisTaskMultiparticleCorrelations(const char *name, Bool_t useParticleWeights): | |
38 | AliAnalysisTaskSE(name), | |
39 | fEvent(NULL), | |
40 | fMPC(NULL), | |
7ecb5af4 | 41 | fHistList(NULL), |
6696a113 | 42 | fUseInternalFlags(kFALSE), |
7ecb5af4 | 43 | fMinNoRPs(-44), |
44 | fMaxNoRPs(-44), | |
45 | fExactNoRPs(-44), | |
9efbd2f5 | 46 | fFillControlHistograms(kFALSE), |
47 | fFillKinematicsHist(kFALSE), | |
48 | fFillMultDistributionsHist(kFALSE), | |
49 | fFillMultCorrelationsHist(kFALSE), | |
50 | fCalculateQvector(kFALSE), | |
7ecb5af4 | 51 | fPhiWeightsHist(NULL), |
52 | fPtWeightsHist(NULL), | |
53 | fEtaWeightsHist(NULL), | |
6696a113 | 54 | fCalculateCorrelations(kFALSE), |
55 | fCalculateIsotropic(kFALSE), | |
56 | fCalculateSame(kFALSE), | |
57 | fSkipZeroHarmonics(kFALSE), | |
58 | fCalculateSameIsotropic(kFALSE), | |
59 | fCalculateAll(kFALSE), | |
60 | fDontGoBeyond(0), | |
9efbd2f5 | 61 | fCalculateCumulants(kFALSE), |
7ecb5af4 | 62 | fCrossCheckWithNestedLoops(kFALSE), |
63 | fCalculateStandardCandles(kFALSE) | |
37d2f768 | 64 | { |
65 | // Constructor. | |
66 | ||
67 | AliDebug(2,"AliAnalysisTaskMultiparticleCorrelations::AliAnalysisTaskMultiparticleCorrelations(const char *name, Bool_t useParticleWeights)"); | |
68 | ||
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) | |
74 | { | |
75 | DefineInput(1, TList::Class()); | |
76 | } | |
77 | // Output slot #0 is reserved | |
78 | // Output slot #1 writes into a TList container | |
79 | DefineOutput(1, TList::Class()); | |
80 | ||
81 | // ... | |
82 | ||
83 | } // AliAnalysisTaskMultiparticleCorrelations::AliAnalysisTaskMultiparticleCorrelations(const char *name, Bool_t useParticleWeights): | |
84 | ||
85 | //================================================================================================================ | |
86 | ||
87 | AliAnalysisTaskMultiparticleCorrelations::AliAnalysisTaskMultiparticleCorrelations(): | |
88 | AliAnalysisTaskSE(), | |
89 | fEvent(NULL), | |
90 | fMPC(NULL), | |
7ecb5af4 | 91 | fHistList(NULL), |
6696a113 | 92 | fUseInternalFlags(kFALSE), |
7ecb5af4 | 93 | fMinNoRPs(-44), |
94 | fMaxNoRPs(-44), | |
95 | fExactNoRPs(-44), | |
96 | fFillControlHistograms(kFALSE), | |
9efbd2f5 | 97 | fFillKinematicsHist(kFALSE), |
98 | fFillMultDistributionsHist(kFALSE), | |
99 | fFillMultCorrelationsHist(kFALSE), | |
100 | fCalculateQvector(kFALSE), | |
7ecb5af4 | 101 | fPhiWeightsHist(NULL), |
102 | fPtWeightsHist(NULL), | |
103 | fEtaWeightsHist(NULL), | |
104 | fCalculateCorrelations(kFALSE), | |
6696a113 | 105 | fCalculateIsotropic(kFALSE), |
106 | fCalculateSame(kFALSE), | |
107 | fSkipZeroHarmonics(kFALSE), | |
108 | fCalculateSameIsotropic(kFALSE), | |
109 | fCalculateAll(kFALSE), | |
110 | fDontGoBeyond(0), | |
7ecb5af4 | 111 | fCalculateCumulants(kFALSE), |
112 | fCrossCheckWithNestedLoops(kFALSE), | |
113 | fCalculateStandardCandles(kFALSE) | |
37d2f768 | 114 | { |
115 | // Dummy constructor. | |
116 | ||
117 | AliDebug(2,"AliAnalysisTaskMultiparticleCorrelations::AliAnalysisTaskMultiparticleCorrelations()"); | |
118 | ||
119 | // ... | |
120 | ||
121 | } // AliAnalysisTaskMultiparticleCorrelations::AliAnalysisTaskMultiparticleCorrelations(): | |
122 | ||
123 | //================================================================================================================ | |
124 | ||
125 | void AliAnalysisTaskMultiparticleCorrelations::UserCreateOutputObjects() | |
126 | { | |
127 | // Called at every worker node to initialize. | |
128 | ||
129 | AliDebug(2,"AliAnalysisTaskMultiparticleCorrelations::UserCreateOutputObjects()"); | |
130 | ||
131 | // Analyser: | |
132 | fMPC = new AliFlowAnalysisWithMultiparticleCorrelations(); | |
133 | ||
134 | // Setters: | |
6696a113 | 135 | if(fUseInternalFlags){fMPC->SetMinNoRPs(fMinNoRPs);} |
136 | if(fUseInternalFlags){fMPC->SetMaxNoRPs(fMaxNoRPs);} | |
137 | if(fUseInternalFlags){fMPC->SetExactNoRPs(fExactNoRPs);} | |
7ecb5af4 | 138 | fMPC->SetFillControlHistograms(fFillControlHistograms); |
6696a113 | 139 | fMPC->SetFillKinematicsHist(fFillKinematicsHist); |
140 | fMPC->SetFillMultDistributionsHist(fFillMultDistributionsHist); | |
141 | fMPC->SetFillMultCorrelationsHist(fFillMultCorrelationsHist); | |
9efbd2f5 | 142 | fMPC->SetCalculateQvector(fCalculateQvector); |
7ecb5af4 | 143 | if(fPhiWeightsHist){fMPC->SetPhiWeightsHist(fPhiWeightsHist);} // TBI is this safe enough? |
144 | if(fPtWeightsHist){fMPC->SetPtWeightsHist(fPtWeightsHist);} // TBI is this safe enough? | |
145 | if(fEtaWeightsHist){fMPC->SetEtaWeightsHist(fEtaWeightsHist);} // TBI is this safe enough? | |
146 | fMPC->SetCalculateCorrelations(fCalculateCorrelations); | |
6696a113 | 147 | fMPC->SetCalculateIsotropic(fCalculateIsotropic); |
148 | fMPC->SetCalculateSame(fCalculateSame); | |
149 | fMPC->SetSkipZeroHarmonics(fSkipZeroHarmonics); | |
150 | fMPC->SetCalculateSameIsotropic(fCalculateSameIsotropic); | |
151 | fMPC->SetCalculateAll(fCalculateAll); | |
152 | fMPC->SetDontGoBeyond(fDontGoBeyond); | |
7ecb5af4 | 153 | fMPC->SetCalculateCumulants(fCalculateCumulants); |
154 | fMPC->SetCrossCheckWithNestedLoops(fCrossCheckWithNestedLoops); | |
155 | fMPC->SetCalculateStandardCandles(fCalculateStandardCandles); | |
37d2f768 | 156 | |
157 | // Initialize: | |
158 | fMPC->Init(); | |
159 | if(fMPC->GetHistList()) | |
160 | { | |
161 | fHistList = fMPC->GetHistList(); | |
162 | // fHistList->Print(); | |
163 | } else | |
164 | { | |
165 | Printf("ERROR: Could not retrieve histogram list (MPC, Task::UserCreateOutputObjects()) !!!!"); | |
166 | } | |
167 | ||
168 | PostData(1,fHistList); | |
169 | ||
170 | } // void AliAnalysisTaskMultiparticleCorrelations::UserCreateOutputObjects() | |
171 | ||
172 | //================================================================================================================ | |
173 | ||
174 | void AliAnalysisTaskMultiparticleCorrelations::UserExec(Option_t *) | |
175 | { | |
176 | // Main loop (called for each event). | |
177 | ||
178 | fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0)); | |
179 | ||
180 | // It's time for multi-particle correlations: | |
181 | if(fEvent) | |
182 | { | |
183 | fMPC->Make(fEvent); | |
184 | } else | |
185 | { | |
186 | cout<<" WARNING: No input data (MPC, Task::UserExec()) !!!!"<<endl; | |
187 | cout<<endl; | |
188 | } | |
189 | ||
190 | PostData(1,fHistList); | |
191 | ||
192 | } // void AliAnalysisTaskMultiparticleCorrelations::UserExec(Option_t *) | |
193 | ||
194 | //================================================================================================================ | |
195 | ||
196 | void AliAnalysisTaskMultiparticleCorrelations::Terminate(Option_t *) | |
197 | { | |
198 | // Accessing the merged output list. | |
199 | ||
200 | fHistList = (TList*)GetOutputData(1); | |
201 | ||
202 | fMPC = new AliFlowAnalysisWithMultiparticleCorrelations(); | |
203 | ||
204 | if(fHistList) | |
205 | { | |
206 | fMPC->GetOutputHistograms(fHistList); | |
207 | fMPC->Finish(); | |
208 | PostData(1,fHistList); | |
209 | } else | |
210 | { | |
211 | cout<<" WARNING: fHistList is NULL (MPC, Task::Terminate()) !!!!"<<endl; | |
212 | cout<<endl; | |
213 | } | |
214 | ||
215 | } // end of void AliAnalysisTaskMultiparticleCorrelations::Terminate(Option_t *) | |
216 | ||
217 | //================================================================================================================ | |
218 |