]>
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 | ||
16 | #include "Riostream.h" //needed as include | |
9d062fe3 | 17 | #include "TProfile.h" |
9cc9e6cc | 18 | #include "TProfile2D.h" |
f1d945a1 | 19 | #include "TList.h" |
20 | ||
21 | ||
22063257 | 22 | class AliAnalysisTaskSE; |
f1d945a1 | 23 | #include "AliAnalysisManager.h" |
d7671632 | 24 | #include "AliFlowEventSimple.h" |
f1d945a1 | 25 | |
f1d945a1 | 26 | |
27 | #include "AliAnalysisTaskMCEventPlane.h" | |
d7671632 | 28 | #include "AliFlowAnalysisWithMCEventPlane.h" |
9d062fe3 | 29 | #include "AliFlowCommonHist.h" |
30 | #include "AliFlowCommonHistResults.h" | |
f1d945a1 | 31 | |
32 | // AliAnalysisTaskMCEventPlane: | |
33 | // | |
34 | // analysis task for Monte Carlo Event Plane | |
35 | // | |
36 | // Author: Naomi van der Kolk (kolk@nikhef.nl) | |
37 | ||
3a7af7bd | 38 | using std::endl; |
39 | using std::cout; | |
f1d945a1 | 40 | ClassImp(AliAnalysisTaskMCEventPlane) |
41 | ||
42 | //________________________________________________________________________ | |
d7671632 | 43 | AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name) : |
22063257 | 44 | AliAnalysisTaskSE(name), |
d7671632 | 45 | fEvent(NULL), |
46 | fMc(NULL), | |
4740c6b8 | 47 | fListHistos(NULL), |
ed5ad7ce | 48 | fHarmonic(2), |
dfb33a36 | 49 | fEvaluateMixedHarmonics(kFALSE), |
4740c6b8 | 50 | fnBinsMult(10000), |
51 | fMinMult(0.), | |
52 | fMaxMult(10000.), | |
53 | fNinCorrelator(2), | |
54 | fMinCorrelator(2), | |
55 | fXinPairAngle(0.5) | |
f1d945a1 | 56 | { |
57 | // Constructor | |
58 | cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane(const char *name)"<<endl; | |
59 | ||
60 | // Define input and output slots here | |
61 | // Input slot #0 works with a TChain | |
d7671632 | 62 | DefineInput(0, AliFlowEventSimple::Class()); |
f1d945a1 | 63 | // Output slot #0 writes into a TList container |
22063257 | 64 | DefineOutput(1, TList::Class()); |
f1d945a1 | 65 | } |
66 | ||
28ca24ad | 67 | //________________________________________________________________________ |
68 | AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane() : | |
22063257 | 69 | AliAnalysisTaskSE(), |
d7671632 | 70 | fEvent(NULL), |
71 | fMc(NULL), | |
4740c6b8 | 72 | fListHistos(NULL), |
ed5ad7ce | 73 | fHarmonic(0), |
4740c6b8 | 74 | fEvaluateMixedHarmonics(kFALSE), |
75 | fnBinsMult(0), | |
76 | fMinMult(0.0), | |
77 | fMaxMult(0.0), | |
78 | fNinCorrelator(0), | |
79 | fMinCorrelator(0), | |
80 | fXinPairAngle(0.0) | |
28ca24ad | 81 | { |
82 | // Constructor | |
83 | cout<<"AliAnalysisTaskMCEventPlane::AliAnalysisTaskMCEventPlane()"<<endl; | |
84 | ||
85 | } | |
86 | ||
87 | //________________________________________________________________________ | |
88 | AliAnalysisTaskMCEventPlane::~AliAnalysisTaskMCEventPlane() | |
89 | { | |
90 | ||
91 | //destructor | |
92 | ||
93 | } | |
94 | ||
f1d945a1 | 95 | //________________________________________________________________________ |
22063257 | 96 | void AliAnalysisTaskMCEventPlane::UserCreateOutputObjects() |
f1d945a1 | 97 | { |
98 | // Called once | |
99 | cout<<"AliAnalysisTaskMCEventPlane::CreateOutputObjects()"<<endl; | |
100 | ||
f1d945a1 | 101 | //Analyser |
102 | fMc = new AliFlowAnalysisWithMCEventPlane() ; | |
4740c6b8 | 103 | |
ed5ad7ce | 104 | fMc->SetHarmonic(fHarmonic); |
105 | ||
4740c6b8 | 106 | // Setters for mixed harmonics study: |
107 | fMc->SetEvaluateMixedHarmonics(fEvaluateMixedHarmonics); | |
108 | fMc->SetNinCorrelator(fNinCorrelator); | |
109 | fMc->SetMinCorrelator(fMinCorrelator); | |
110 | fMc->SetXinPairAngle(fXinPairAngle); | |
111 | fMc->SetnBinsMult(fnBinsMult); | |
112 | fMc->SetMinMult(fMinMult); | |
113 | fMc->SetMaxMult(fMaxMult); | |
114 | ||
115 | // Initialized: | |
f1d945a1 | 116 | fMc-> Init(); |
117 | ||
28ca24ad | 118 | if (fMc->GetHistList()) { |
9d062fe3 | 119 | //fMc->GetHistList()->Print(); |
7b88dba1 | 120 | fListHistos = fMc->GetHistList(); |
121 | //fListHistos->Print(); | |
28ca24ad | 122 | } |
123 | else {Printf("ERROR: Could not retrieve histogram list"); } | |
f1d945a1 | 124 | |
61e0c8c0 | 125 | PostData(1,fListHistos); |
126 | ||
f1d945a1 | 127 | } |
128 | ||
129 | //________________________________________________________________________ | |
22063257 | 130 | void AliAnalysisTaskMCEventPlane::UserExec(Option_t *) |
f1d945a1 | 131 | { |
132 | // Main loop | |
133 | // Called for each event | |
134 | ||
d7671632 | 135 | fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0)); |
136 | if (fEvent){ | |
137 | fMc->Make(fEvent); | |
f1d945a1 | 138 | } |
d7671632 | 139 | else { |
140 | cout << "Warning no input data!!!" << endl; | |
f1d945a1 | 141 | } |
142 | ||
22063257 | 143 | PostData(1,fListHistos); |
f1d945a1 | 144 | } |
145 | ||
9d062fe3 | 146 | |
f1d945a1 | 147 | //________________________________________________________________________ |
148 | void AliAnalysisTaskMCEventPlane::Terminate(Option_t *) | |
149 | { | |
150 | // Called once at the end of the query | |
9d062fe3 | 151 | AliFlowAnalysisWithMCEventPlane* fMcTerm = new AliFlowAnalysisWithMCEventPlane() ; |
152 | ||
153 | //Get output data | |
22063257 | 154 | fListHistos = (TList*)GetOutputData(1); |
9d062fe3 | 155 | if (fListHistos) { |
22063257 | 156 | fMcTerm->GetOutputHistograms(fListHistos); |
157 | fMcTerm->Finish(); | |
158 | PostData(1,fListHistos); | |
159 | } else | |
160 | { | |
161 | cout << "histogram list pointer is empty" << endl; | |
162 | } | |
f1d945a1 | 163 | } |
d7671632 | 164 |