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 **************************************************************************/
18 #include "Riostream.h" //needed as include
25 class AliAnalysisTaskSE;
26 #include "AliAnalysisManager.h"
27 #include "AliFlowEventSimple.h"
28 #include "AliAnalysisTaskLYZEventPlane.h"
29 #include "AliFlowCommonHist.h"
30 #include "AliFlowCommonHistResults.h"
31 #include "AliFlowLYZEventPlane.h"
32 #include "AliFlowAnalysisWithLYZEventPlane.h"
34 // AliAnalysisTaskLYZEventPlane:
36 // analysis task for Lee Yang Zeros Event Plane
38 // Author: Naomi van der Kolk (kolk@nikhef.nl)
42 ClassImp(AliAnalysisTaskLYZEventPlane)
44 //________________________________________________________________________
45 AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane(const char *name) :
46 AliAnalysisTaskSE(name),
54 cout<<"AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane(const char *name)"<<endl;
56 // Define input and output slots here
57 // Input slot #0 works with an AliFlowEventSimple
58 DefineInput(0, AliFlowEventSimple::Class());
59 DefineInput(1, TList::Class());
60 // Output slot #0 writes into a TList container
61 DefineOutput(1, TList::Class());
65 //________________________________________________________________________
66 AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane() :
75 cout<<"AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane()"<<endl;
79 //________________________________________________________________________
80 AliAnalysisTaskLYZEventPlane::~AliAnalysisTaskLYZEventPlane()
86 //________________________________________________________________________
87 void AliAnalysisTaskLYZEventPlane::UserCreateOutputObjects()
90 cout<<"AliAnalysisTaskLYZEventPlane::CreateOutputObjects()"<<endl;
92 //lee yang zeros event plane
93 fLyzEp = new AliFlowLYZEventPlane() ;
95 fLyz = new AliFlowAnalysisWithLYZEventPlane() ;
97 // Get data from input slot
98 TList* pSecondRunList = (TList*)GetInputData(1);
100 fLyzEp -> SetSecondRunList(pSecondRunList);
101 fLyz -> SetSecondRunList(pSecondRunList);
102 } else { cout<<"No Second run List!"<<endl; exit(0); }
107 if (fLyz->GetHistList()) {
108 fListHistos = fLyz->GetHistList();
109 //fListHistos->Print();
111 else { cout<<"ERROR: Could not retrieve histogram list"<<endl;}
113 PostData(1,fListHistos);
117 //________________________________________________________________________
118 void AliAnalysisTaskLYZEventPlane::UserExec(Option_t *)
121 // Called for each event
123 fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
125 fLyz->Make(fEvent,fLyzEp);
128 cout << "Warning no input data!!!" << endl;}
130 PostData(1,fListHistos);
134 //________________________________________________________________________
135 void AliAnalysisTaskLYZEventPlane::Terminate(Option_t *)
137 // Called once at the end of the query
138 AliFlowAnalysisWithLYZEventPlane* lyzTerm = new AliFlowAnalysisWithLYZEventPlane() ;
139 fListHistos = (TList*)GetOutputData(1);
140 //cout << "histogram list in Terminate" << endl;
142 lyzTerm -> GetOutputHistograms(fListHistos);
144 PostData(1,fListHistos);
145 //fListHistos->Print();
146 } else { cout << "histogram list pointer is empty" << endl;}
148 //cout<<".....finished LYZ EventPlane"<<endl;