AliPhysics  cdeda5a (cdeda5a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskMixedHarmonics.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 mixed harmomics *
18  * *
19  * authors: Naomi van der Kolk *
20  * (kolk@nikhef.nl) *
21  * Raimond Snellings *
22  * (snelling@nikhef.nl) *
23  * Ante Bilandzic *
24  * (anteb@nikhef.nl) *
25  * ***********************************/
26 
27 class TFile;
28 class TString;
29 class TList;
30 class AliAnalysisTaskSE;
31 
32 #include "Riostream.h"
33 #include "AliFlowEventSimple.h"
36 
37 using std::cout;
38 using std::endl;
40 
41 //================================================================================================================
42 
43 AliAnalysisTaskMixedHarmonics::AliAnalysisTaskMixedHarmonics(const char *name, Bool_t useParticleWeights):
44 AliAnalysisTaskSE(name),
45 fEvent(NULL),
46 fMH(NULL),
47 fListHistos(NULL),
48 fHarmonic(1),
49 fNoOfMultipicityBins(100),
50 fMultipicityBinWidth(1.),
51 fMinMultiplicity(3.),
52 fOppositeChargesPOI(kFALSE),
53 fEvaluateDifferential3pCorrelator(kFALSE),
54 fCorrectForDetectorEffects(kFALSE),
55 fPrintOnTheScreen(kTRUE),
56 fCalculateVsM(kFALSE),
57 fShowBinLabelsVsM(kFALSE),
58 fUseParticleWeights(useParticleWeights),
59 fUsePhiWeights(kFALSE),
60 fUsePtWeights(kFALSE),
61 fUseEtaWeights(kFALSE),
62 fWeightsList(NULL)
63 {
64  // constructor
65  cout<<"AliAnalysisTaskMixedHarmonics::AliAnalysisTaskMixedHarmonics(const char *name, Bool_t useParticleWeights)"<<endl;
66 
67  // Define input and output slots here
68  // Input slot #0 works with an AliFlowEventSimple
69  DefineInput(0, AliFlowEventSimple::Class());
70  // Input slot #1 is needed for the weights input file:
71  if(useParticleWeights)
72  {
73  DefineInput(1, TList::Class());
74  }
75  // Output slot #0 is reserved
76  // Output slot #1 writes into a TList container
77  DefineOutput(1, TList::Class());
78 }
79 
82 fEvent(NULL),
83 fMH(NULL),
84 fListHistos(NULL),
85 fHarmonic(0),
86 fNoOfMultipicityBins(0),
87 fMultipicityBinWidth(0),
88 fMinMultiplicity(0),
89 fOppositeChargesPOI(kFALSE),
90 fEvaluateDifferential3pCorrelator(kFALSE),
91 fCorrectForDetectorEffects(kFALSE),
92 fPrintOnTheScreen(kFALSE),
93 fCalculateVsM(kFALSE),
94 fShowBinLabelsVsM(kFALSE),
95 fUseParticleWeights(kFALSE),
96 fUsePhiWeights(kFALSE),
97 fUsePtWeights(kFALSE),
98 fUseEtaWeights(kFALSE),
99 fWeightsList(NULL)
100 {
101  // Dummy constructor
102  cout<<"AliAnalysisTaskMixedHarmonics::AliAnalysisTaskMixedHarmonics()"<<endl;
103 }
104 
105 //================================================================================================================
106 
108 {
109  // Called at every worker node to initialize
110  cout<<"AliAnalysisTaskMixedHarmonics::UserCreateOutputObjects()"<<endl;
111 
112  // Analyser:
114 
115  // Common:
127  {
128  // Pass the flags to class:
132  // Get data from input slot #1 which is used for weights:
133  if(GetNinputs()==2)
134  {
135  fWeightsList = (TList*)GetInputData(1);
136  }
137  // Pass the list with weights to class:
139  }
140 
141  fMH->Init();
142 
143  if(fMH->GetHistList())
144  {
146  // fListHistos->Print();
147  } else
148  {
149  Printf("ERROR: Could not retrieve histogram list (MH, Task::UserCreateOutputObjects()) !!!!");
150  }
151 
152  PostData(1,fListHistos);
153 
154 } // end of void AliAnalysisTaskMixedHarmonics::UserCreateOutputObjects()
155 
156 //================================================================================================================
157 
159 {
160  // main loop (called for each event)
161  fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
162 
163  // Mixed Harmonics:
164  if(fEvent)
165  {
166  fMH->Make(fEvent);
167  } else
168  {
169  cout<<"WARNING: No input data (MH, Task::UserExec()) !!!!"<<endl;
170  cout<<endl;
171  }
172 
173  PostData(1,fListHistos);
174 }
175 
176 //================================================================================================================
177 
179 {
180  //accessing the merged output list:
181  fListHistos = (TList*)GetOutputData(1);
182 
184 
185  if(fListHistos)
186  {
188  fMH->Finish();
189  PostData(1,fListHistos);
190  } else
191  {
192  cout<<" WARNING: histogram list pointer is empty (MH, Task::Terminate()) !!!!"<<endl;
193  cout<<endl;
194  }
195 
196 } // end of void AliAnalysisTaskMixedHarmonics::Terminate(Option_t *)
197 
198 
199 
200 
201 
202 
203 
204 
205 
206 
207 
208 
209 
210 
211 
212 
213 
214 
215 
216 
217 
virtual void GetOutputHistograms(TList *outputListHistos)
ClassImp(AliAnalysisTaskMixedHarmonics) AliAnalysisTaskMixedHarmonics
AliFlowAnalysisWithMixedHarmonics * fMH
virtual void Make(AliFlowEventSimple *anEvent)
virtual void UserExec(Option_t *option)
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53