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)
40 ClassImp(AliAnalysisTaskLYZEventPlane)
42 //________________________________________________________________________
43 AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane(const char *name) :
44 AliAnalysisTaskSE(name),
52 cout<<"AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane(const char *name)"<<endl;
54 // Define input and output slots here
55 // Input slot #0 works with an AliFlowEventSimple
56 DefineInput(0, AliFlowEventSimple::Class());
57 DefineInput(1, TList::Class());
58 // Output slot #0 writes into a TList container
59 DefineOutput(1, TList::Class());
63 //________________________________________________________________________
64 AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane() :
73 cout<<"AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane()"<<endl;
77 //________________________________________________________________________
78 AliAnalysisTaskLYZEventPlane::~AliAnalysisTaskLYZEventPlane()
84 //________________________________________________________________________
85 void AliAnalysisTaskLYZEventPlane::UserCreateOutputObjects()
88 cout<<"AliAnalysisTaskLYZEventPlane::CreateOutputObjects()"<<endl;
90 //lee yang zeros event plane
91 fLyzEp = new AliFlowLYZEventPlane() ;
93 fLyz = new AliFlowAnalysisWithLYZEventPlane() ;
95 // Get data from input slot
96 TList* pSecondRunList = (TList*)GetInputData(1);
98 fLyzEp -> SetSecondRunList(pSecondRunList);
99 fLyz -> SetSecondRunList(pSecondRunList);
100 } else { cout<<"No Second run List!"<<endl; exit(0); }
105 if (fLyz->GetHistList()) {
106 fListHistos = fLyz->GetHistList();
107 //fListHistos->Print();
109 else { cout<<"ERROR: Could not retrieve histogram list"<<endl;}
111 PostData(1,fListHistos);
115 //________________________________________________________________________
116 void AliAnalysisTaskLYZEventPlane::UserExec(Option_t *)
119 // Called for each event
121 fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
123 fLyz->Make(fEvent,fLyzEp);
126 cout << "Warning no input data!!!" << endl;}
128 PostData(1,fListHistos);
132 //________________________________________________________________________
133 void AliAnalysisTaskLYZEventPlane::Terminate(Option_t *)
135 // Called once at the end of the query
136 AliFlowAnalysisWithLYZEventPlane* lyzTerm = new AliFlowAnalysisWithLYZEventPlane() ;
137 fListHistos = (TList*)GetOutputData(1);
138 //cout << "histogram list in Terminate" << endl;
140 lyzTerm -> GetOutputHistograms(fListHistos);
142 PostData(1,fListHistos);
143 //fListHistos->Print();
144 } else { cout << "histogram list pointer is empty" << endl;}
146 //cout<<".....finished LYZ EventPlane"<<endl;