]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/FLOW/Tasks/AliAnalysisTaskLYZEventPlane.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWG / FLOW / Tasks / AliAnalysisTaskLYZEventPlane.cxx
CommitLineData
f1d945a1 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
5d4c6d39 16#include <stdlib.h>
17
f1d945a1 18#include "Riostream.h" //needed as include
19#include "TChain.h"
20#include "TTree.h"
9d062fe3 21#include "TProfile.h"
f1d945a1 22#include "TFile.h"
28ca24ad 23#include "TList.h"
f1d945a1 24
22063257 25class AliAnalysisTaskSE;
f1d945a1 26#include "AliAnalysisManager.h"
9808604e 27#include "AliFlowEventSimple.h"
f1d945a1 28#include "AliAnalysisTaskLYZEventPlane.h"
9d062fe3 29#include "AliFlowCommonHist.h"
30#include "AliFlowCommonHistResults.h"
f1d945a1 31#include "AliFlowLYZEventPlane.h"
32#include "AliFlowAnalysisWithLYZEventPlane.h"
33
34// AliAnalysisTaskLYZEventPlane:
35//
36// analysis task for Lee Yang Zeros Event Plane
37//
38// Author: Naomi van der Kolk (kolk@nikhef.nl)
39
3a7af7bd 40using std::cout;
41using std::endl;
f1d945a1 42ClassImp(AliAnalysisTaskLYZEventPlane)
43
44//________________________________________________________________________
9808604e 45AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane(const char *name) :
22063257 46 AliAnalysisTaskSE(name),
9808604e 47 fEvent(NULL),
d97a8fc5 48 fLyzEp(NULL),
49 fLyz(NULL),
28ca24ad 50 fListHistos(NULL),
9808604e 51 fSecondRunFile(NULL)
f1d945a1 52{
53 // Constructor
54 cout<<"AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane(const char *name)"<<endl;
55
56 // Define input and output slots here
9808604e 57 // Input slot #0 works with an AliFlowEventSimple
58 DefineInput(0, AliFlowEventSimple::Class());
f1d945a1 59 DefineInput(1, TList::Class());
f1d945a1 60 // Output slot #0 writes into a TList container
22063257 61 DefineOutput(1, TList::Class());
9808604e 62
f1d945a1 63}
64
28ca24ad 65//________________________________________________________________________
66AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane() :
22063257 67 AliAnalysisTaskSE(),
9808604e 68 fEvent(NULL),
28ca24ad 69 fLyzEp(NULL),
70 fLyz(NULL),
28ca24ad 71 fListHistos(NULL),
9808604e 72 fSecondRunFile(NULL)
28ca24ad 73{
74 // Constructor
75 cout<<"AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane()"<<endl;
76}
77
78
79//________________________________________________________________________
80AliAnalysisTaskLYZEventPlane::~AliAnalysisTaskLYZEventPlane()
81{
82 //destructor
83
84}
85
f1d945a1 86//________________________________________________________________________
22063257 87void AliAnalysisTaskLYZEventPlane::UserCreateOutputObjects()
f1d945a1 88{
89 // Called once
90 cout<<"AliAnalysisTaskLYZEventPlane::CreateOutputObjects()"<<endl;
9808604e 91
f1d945a1 92 //lee yang zeros event plane
93 fLyzEp = new AliFlowLYZEventPlane() ;
94 //Analyser
95 fLyz = new AliFlowAnalysisWithLYZEventPlane() ;
f1d945a1 96
28ca24ad 97 // Get data from input slot
9d062fe3 98 TList* pSecondRunList = (TList*)GetInputData(1);
99 if (pSecondRunList) {
100 fLyzEp -> SetSecondRunList(pSecondRunList);
101 fLyz -> SetSecondRunList(pSecondRunList);
102 } else { cout<<"No Second run List!"<<endl; exit(0); }
f1d945a1 103
104 fLyzEp-> Init();
105 fLyz-> Init();
106
28ca24ad 107 if (fLyz->GetHistList()) {
108 fListHistos = fLyz->GetHistList();
9808604e 109 //fListHistos->Print();
28ca24ad 110 }
111 else { cout<<"ERROR: Could not retrieve histogram list"<<endl;}
112
61e0c8c0 113 PostData(1,fListHistos);
f1d945a1 114
115}
116
117//________________________________________________________________________
22063257 118void AliAnalysisTaskLYZEventPlane::UserExec(Option_t *)
f1d945a1 119{
120 // Main loop
121 // Called for each event
28ca24ad 122
9808604e 123 fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
124 if (fEvent) {
f1d945a1 125 fLyz->Make(fEvent,fLyzEp);
f1d945a1 126 }
9808604e 127 else {
128 cout << "Warning no input data!!!" << endl;}
0b7f49e9 129
22063257 130 PostData(1,fListHistos);
9808604e 131
f1d945a1 132}
133
134//________________________________________________________________________
135void AliAnalysisTaskLYZEventPlane::Terminate(Option_t *)
136{
137 // Called once at the end of the query
5104aa35 138 AliFlowAnalysisWithLYZEventPlane* lyzTerm = new AliFlowAnalysisWithLYZEventPlane() ;
22063257 139 fListHistos = (TList*)GetOutputData(1);
7b88dba1 140 //cout << "histogram list in Terminate" << endl;
fd46c3dd 141 if (fListHistos) {
5104aa35 142 lyzTerm -> GetOutputHistograms(fListHistos);
143 lyzTerm -> Finish();
22063257 144 PostData(1,fListHistos);
fd46c3dd 145 //fListHistos->Print();
9d062fe3 146 } else { cout << "histogram list pointer is empty" << endl;}
28ca24ad 147
81bbfdbc 148 //cout<<".....finished LYZ EventPlane"<<endl;
5104aa35 149 delete lyzTerm;
f1d945a1 150}
af795c87 151
152