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 AliAnalysisTask;
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 AliAnalysisTask(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(0, TList::Class());
62 //________________________________________________________________________
63 AliAnalysisTaskLeeYangZeros::AliAnalysisTaskLeeYangZeros() :
68 fFirstRunLYZ(kTRUE), //set boolean for firstrun to initial value
69 fUseSumLYZ(kTRUE) //set boolean for use sum to initial value
72 cout<<"AliAnalysisTaskLeeYangZeros::AliAnalysisTaskLeeYangZeros()"<<endl;
76 //________________________________________________________________________
77 AliAnalysisTaskLeeYangZeros::~AliAnalysisTaskLeeYangZeros()
84 //________________________________________________________________________
85 void AliAnalysisTaskLeeYangZeros::ConnectInputData(Option_t *)
87 // Connect ESD or AOD here
89 cout<<"AliAnalysisTaskLeeYangZeros::ConnectInputData(Option_t *)"<<endl;
93 //________________________________________________________________________
94 void AliAnalysisTaskLeeYangZeros::CreateOutputObjects()
97 cout<<"AliAnalysisTaskLeeYangZeros::CreateOutputObjects()"<<endl;
101 fLyz = new AliFlowAnalysisWithLeeYangZeros() ;
102 fLyz -> SetFirstRun(GetFirstRunLYZ()); //set first run true or false
103 fLyz -> SetUseSum(GetUseSumLYZ()); //set use sum true or false
105 // Get data from input slot 1
106 if (GetNinputs() == 2) { //if there are two input slots
107 TList* pFirstRunList = (TList*)GetInputData(1);
109 fLyz -> SetFirstRunList(pFirstRunList);
110 } else { cout<<"No first run List!"<<endl; exit(0); }
115 if (fLyz->GetHistList()) {
116 fListHistos = fLyz->GetHistList();
117 // fListHistos->Print();
119 else {Printf("ERROR: Could not retrieve histogram list"); }
123 //________________________________________________________________________
124 void AliAnalysisTaskLeeYangZeros::Exec(Option_t *)
127 // Called for each event
129 fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0));
134 cout << "Warning no input data!!!" << endl; }
136 PostData(0,fListHistos); //here for CAF
140 //________________________________________________________________________
141 void AliAnalysisTaskLeeYangZeros::Terminate(Option_t *)
143 // Called once at the end of the query
145 AliFlowAnalysisWithLeeYangZeros* fLyzTerm = new AliFlowAnalysisWithLeeYangZeros() ;
146 fLyzTerm -> SetFirstRun(GetFirstRunLYZ()); //set first run true or false
147 fLyzTerm -> SetUseSum(GetUseSumLYZ()); //set use sum true or false
149 fListHistos = (TList*)GetOutputData(0);
153 fLyzTerm -> GetOutputHistograms(fListHistos);
154 fLyzTerm -> Finish();
155 PostData(0,fListHistos);
158 cout << "histogram list pointer in Lee-Yang Zeros is empty in AliAnalysisTaskLYZ::Terminate ()" << endl;
161 //cout<<".....finished"<<endl;