AliPhysics  5eaf189 (5eaf189)
AliAnalysisTaskMCEventPlane.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 #include "Riostream.h" //needed as include
17 #include "TProfile.h"
18 #include "TProfile2D.h"
19 #include "TList.h"
20 
21 
22 class AliAnalysisTaskSE;
23 #include "AliAnalysisManager.h"
24 #include "AliFlowEventSimple.h"
25 
26 
29 #include "AliFlowCommonHist.h"
31 
32 // AliAnalysisTaskMCEventPlane:
33 //
34 // analysis task for Monte Carlo Event Plane
35 //
36 // Author: Naomi van der Kolk (kolk@nikhef.nl)
37 
38 using std::endl;
39 using std::cout;
41 
42 //________________________________________________________________________
44  AliAnalysisTaskSE(name),
45  fEvent(NULL),
46  fMc(NULL),
47  fListHistos(NULL),
48  fHarmonic(2),
49  fEvaluateMixedHarmonics(kFALSE),
50  fnBinsMult(10000),
51  fMinMult(0.),
52  fMaxMult(10000.),
53  fNinCorrelator(2),
54  fMinCorrelator(2),
55  fXinPairAngle(0.5)
56 {
57  // Constructor
58  cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name)"<<endl;
59 
60  // Define input and output slots here
61  // Input slot #0 works with a TChain
62  DefineInput(0, AliFlowEventSimple::Class());
63  // Output slot #0 writes into a TList container
64  DefineOutput(1, TList::Class());
65 }
66 
67 //________________________________________________________________________
70  fEvent(NULL),
71  fMc(NULL),
72  fListHistos(NULL),
73  fHarmonic(0),
74  fEvaluateMixedHarmonics(kFALSE),
75  fnBinsMult(0),
76  fMinMult(0.0),
77  fMaxMult(0.0),
78  fNinCorrelator(0),
79  fMinCorrelator(0),
80  fXinPairAngle(0.0)
81 {
82  // Constructor
83  cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane()"<<endl;
84 
85 }
86 
87 //________________________________________________________________________
89 {
90 
91  //destructor
92 
93 }
94 
95 //________________________________________________________________________
97 {
98  // Called once
99  cout<<"AliAnalysisTaskMCEventPlane::CreateOutputObjects()"<<endl;
100 
101  //Analyser
103 
105 
106  // Setters for mixed harmonics study:
114 
115  // Initialized:
116  fMc-> Init();
117 
118  if (fMc->GetHistList()) {
119  //fMc->GetHistList()->Print();
121  //fListHistos->Print();
122  }
123  else {Printf("ERROR: Could not retrieve histogram list"); }
124 
125  PostData(1,fListHistos);
126 
127 }
128 
129 //________________________________________________________________________
131 {
132  // Main loop
133  // Called for each event
134 
135  fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
136  if (fEvent){
137  fMc->Make(fEvent);
138  }
139  else {
140  cout << "Warning no input data!!!" << endl;
141  }
142 
143  PostData(1,fListHistos);
144 }
145 
146 
147 //________________________________________________________________________
149 {
150  // Called once at the end of the query
152 
153  //Get output data
154  fListHistos = (TList*)GetOutputData(1);
155  if (fListHistos) {
157  fMcTerm->Finish();
158  PostData(1,fListHistos);
159  } else
160  {
161  cout << "histogram list pointer is empty" << endl;
162  }
163 }
164 
virtual void UserExec(Option_t *option)
void GetOutputHistograms(TList *outputListHistos)
AliFlowAnalysisWithMCEventPlane * fMc
const char Option_t
Definition: External.C:48