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