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 **************************************************************************/
16 #include "Riostream.h" //needed as include
23 class AliAnalysisTaskSE;
24 #include "AliAnalysisManager.h"
25 #include "AliFlowEventSimple.h"
26 #include "AliFlowLYZConstants.h"
27 #include "AliAnalysisTaskLeeYangZeros.h"
28 #include "AliFlowCommonHist.h"
29 #include "AliFlowCommonHistResults.h"
30 #include "AliFlowLYZHist1.h"
31 #include "AliFlowLYZHist2.h"
32 #include "AliFlowAnalysisWithLeeYangZeros.h"
34 // AliAnalysisTaskLeeYangZeros:
35 // analysis task for Lee Yang Zeros method
36 // Author: Naomi van der Kolk (kolk@nikhef.nl)
38 ClassImp(AliAnalysisTaskLeeYangZeros)
40 //________________________________________________________________________
41 AliAnalysisTaskLeeYangZeros::AliAnalysisTaskLeeYangZeros(const char *name, Bool_t firstrun) :
42 AliAnalysisTaskSE(name),
47 fFirstRunLYZ(firstrun), //set boolean for firstrun to initial value
48 fUseSumLYZ(kTRUE) //set boolean for use sum to initial value
51 cout<<"AliAnalysisTaskLeeYangZeros::AliAnalysisTaskLeeYangZeros(const char *name)"<<endl;
53 // Define input and output slots here
54 // Input slot #0 works with a TChain
55 DefineInput(0, AliFlowEventSimple::Class());
56 if (!firstrun) DefineInput(1, TList::Class()); //for second loop
57 // Output slot #0 writes into a TList container
58 DefineOutput(1, TList::Class());
62 //________________________________________________________________________
63 AliAnalysisTaskLeeYangZeros::AliAnalysisTaskLeeYangZeros() :
69 fFirstRunLYZ(kTRUE), //set boolean for firstrun to initial value
70 fUseSumLYZ(kTRUE) //set boolean for use sum to initial value
73 cout<<"AliAnalysisTaskLeeYangZeros::AliAnalysisTaskLeeYangZeros()"<<endl;
77 //________________________________________________________________________
78 AliAnalysisTaskLeeYangZeros::~AliAnalysisTaskLeeYangZeros()
85 //________________________________________________________________________
86 void AliAnalysisTaskLeeYangZeros::UserCreateOutputObjects()
89 cout<<"AliAnalysisTaskLeeYangZeros::CreateOutputObjects()"<<endl;
93 fLyz = new AliFlowAnalysisWithLeeYangZeros() ;
94 fLyz -> SetFirstRun(GetFirstRunLYZ()); //set first run true or false
95 fLyz -> SetUseSum(GetUseSumLYZ()); //set use sum true or false
97 // Get data from input slot 1
98 if (GetNinputs() == 2) { //if there are two input slots
99 TList* pFirstRunList = (TList*)GetInputData(1);
101 fLyz -> SetFirstRunList(pFirstRunList);
102 } else { cout<<"No first run List!"<<endl; exit(0); }
107 if (fLyz->GetHistList()) {
108 fListHistos = fLyz->GetHistList();
109 // fListHistos->Print();
111 else {Printf("ERROR: Could not retrieve histogram list"); }
113 PostData(1,fListHistos);
117 //________________________________________________________________________
118 void AliAnalysisTaskLeeYangZeros::UserExec(Option_t *)
121 // Called for each event
123 fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
128 cout << "Warning no input data!!!" << endl; }
130 PostData(1,fListHistos);
134 //________________________________________________________________________
135 void AliAnalysisTaskLeeYangZeros::Terminate(Option_t *)
137 // Called once at the end of the query
139 AliFlowAnalysisWithLeeYangZeros* fLyzTerm = new AliFlowAnalysisWithLeeYangZeros() ;
140 fLyzTerm -> SetFirstRun(GetFirstRunLYZ()); //set first run true or false
141 fLyzTerm -> SetUseSum(GetUseSumLYZ()); //set use sum true or false
143 fListHistos = (TList*)GetOutputData(1);
147 fLyzTerm -> GetOutputHistograms(fListHistos);
148 fLyzTerm -> Finish();
149 PostData(1,fListHistos);
152 cout << "histogram list pointer in Lee-Yang Zeros is empty in AliAnalysisTaskLYZ::Terminate ()" << endl;