]>
Commit | Line | Data |
---|---|---|
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 | 25 | class 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 | ||
40 | ClassImp(AliAnalysisTaskLYZEventPlane) | |
41 | ||
42 | //________________________________________________________________________ | |
9808604e | 43 | AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane(const char *name) : |
22063257 | 44 | AliAnalysisTaskSE(name), |
9808604e | 45 | fEvent(NULL), |
d97a8fc5 | 46 | fLyzEp(NULL), |
47 | fLyz(NULL), | |
28ca24ad | 48 | fListHistos(NULL), |
9808604e | 49 | fSecondRunFile(NULL) |
f1d945a1 | 50 | { |
51 | // Constructor | |
52 | cout<<"AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane(const char *name)"<<endl; | |
53 | ||
54 | // Define input and output slots here | |
9808604e | 55 | // Input slot #0 works with an AliFlowEventSimple |
56 | DefineInput(0, AliFlowEventSimple::Class()); | |
f1d945a1 | 57 | DefineInput(1, TList::Class()); |
f1d945a1 | 58 | // Output slot #0 writes into a TList container |
22063257 | 59 | DefineOutput(1, TList::Class()); |
9808604e | 60 | |
f1d945a1 | 61 | } |
62 | ||
28ca24ad | 63 | //________________________________________________________________________ |
64 | AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane() : | |
22063257 | 65 | AliAnalysisTaskSE(), |
9808604e | 66 | fEvent(NULL), |
28ca24ad | 67 | fLyzEp(NULL), |
68 | fLyz(NULL), | |
28ca24ad | 69 | fListHistos(NULL), |
9808604e | 70 | fSecondRunFile(NULL) |
28ca24ad | 71 | { |
72 | // Constructor | |
73 | cout<<"AliAnalysisTaskLYZEventPlane::AliAnalysisTaskLYZEventPlane()"<<endl; | |
74 | } | |
75 | ||
76 | ||
77 | //________________________________________________________________________ | |
78 | AliAnalysisTaskLYZEventPlane::~AliAnalysisTaskLYZEventPlane() | |
79 | { | |
80 | //destructor | |
81 | ||
82 | } | |
83 | ||
f1d945a1 | 84 | //________________________________________________________________________ |
22063257 | 85 | void AliAnalysisTaskLYZEventPlane::UserCreateOutputObjects() |
f1d945a1 | 86 | { |
87 | // Called once | |
88 | cout<<"AliAnalysisTaskLYZEventPlane::CreateOutputObjects()"<<endl; | |
9808604e | 89 | |
f1d945a1 | 90 | //lee yang zeros event plane |
91 | fLyzEp = new AliFlowLYZEventPlane() ; | |
92 | //Analyser | |
93 | fLyz = new AliFlowAnalysisWithLYZEventPlane() ; | |
f1d945a1 | 94 | |
28ca24ad | 95 | // Get data from input slot |
9d062fe3 | 96 | TList* pSecondRunList = (TList*)GetInputData(1); |
97 | if (pSecondRunList) { | |
98 | fLyzEp -> SetSecondRunList(pSecondRunList); | |
99 | fLyz -> SetSecondRunList(pSecondRunList); | |
100 | } else { cout<<"No Second run List!"<<endl; exit(0); } | |
f1d945a1 | 101 | |
102 | fLyzEp-> Init(); | |
103 | fLyz-> Init(); | |
104 | ||
28ca24ad | 105 | if (fLyz->GetHistList()) { |
106 | fListHistos = fLyz->GetHistList(); | |
9808604e | 107 | //fListHistos->Print(); |
28ca24ad | 108 | } |
109 | else { cout<<"ERROR: Could not retrieve histogram list"<<endl;} | |
110 | ||
61e0c8c0 | 111 | PostData(1,fListHistos); |
f1d945a1 | 112 | |
113 | } | |
114 | ||
115 | //________________________________________________________________________ | |
22063257 | 116 | void AliAnalysisTaskLYZEventPlane::UserExec(Option_t *) |
f1d945a1 | 117 | { |
118 | // Main loop | |
119 | // Called for each event | |
28ca24ad | 120 | |
9808604e | 121 | fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0)); |
122 | if (fEvent) { | |
f1d945a1 | 123 | fLyz->Make(fEvent,fLyzEp); |
f1d945a1 | 124 | } |
9808604e | 125 | else { |
126 | cout << "Warning no input data!!!" << endl;} | |
0b7f49e9 | 127 | |
22063257 | 128 | PostData(1,fListHistos); |
9808604e | 129 | |
f1d945a1 | 130 | } |
131 | ||
132 | //________________________________________________________________________ | |
133 | void AliAnalysisTaskLYZEventPlane::Terminate(Option_t *) | |
134 | { | |
135 | // Called once at the end of the query | |
5104aa35 | 136 | AliFlowAnalysisWithLYZEventPlane* lyzTerm = new AliFlowAnalysisWithLYZEventPlane() ; |
22063257 | 137 | fListHistos = (TList*)GetOutputData(1); |
7b88dba1 | 138 | //cout << "histogram list in Terminate" << endl; |
fd46c3dd | 139 | if (fListHistos) { |
5104aa35 | 140 | lyzTerm -> GetOutputHistograms(fListHistos); |
141 | lyzTerm -> Finish(); | |
22063257 | 142 | PostData(1,fListHistos); |
fd46c3dd | 143 | //fListHistos->Print(); |
9d062fe3 | 144 | } else { cout << "histogram list pointer is empty" << endl;} |
28ca24ad | 145 | |
81bbfdbc | 146 | //cout<<".....finished LYZ EventPlane"<<endl; |
5104aa35 | 147 | delete lyzTerm; |
f1d945a1 | 148 | } |
af795c87 | 149 | |
150 |