]>
Commit | Line | Data |
---|---|---|
9bed2723 | 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 *f | |
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 | /************************************** | |
17 | * analysis task for fitting * | |
18 | * q-distribution * | |
19 | * * | |
20 | * authors: Naomi van der Kolk * | |
21 | * (kolk@nikhef.nl) * | |
22 | * Raimond Snellings * | |
23 | * (snelling@nikhef.nl) * | |
24 | * Ante Bilandzic * | |
df23c5ae | 25 | * (abilandzic@gmail.com) * |
9bed2723 | 26 | * ***********************************/ |
27 | ||
2ed70edf | 28 | class TFile; |
2701c4bc | 29 | class TString; |
2ed70edf | 30 | class TList; |
31 | class AliAnalysisTaskSE; | |
32 | ||
9bed2723 | 33 | #include "Riostream.h" |
d53e4563 | 34 | #include "AliFlowEventSimple.h" |
9bed2723 | 35 | #include "AliAnalysisTaskFittingQDistribution.h" |
ce4a88f5 | 36 | #include "AliFlowAnalysisWithFittingQDistribution.h" |
53884472 | 37 | #include "TH2D.h" |
9bed2723 | 38 | |
3a7af7bd | 39 | using std::cout; |
40 | using std::endl; | |
9bed2723 | 41 | ClassImp(AliAnalysisTaskFittingQDistribution) |
42 | ||
43 | //================================================================================================================ | |
44 | ||
d53e4563 | 45 | AliAnalysisTaskFittingQDistribution::AliAnalysisTaskFittingQDistribution(const char *name, Bool_t useWeights): |
2ed70edf | 46 | AliAnalysisTaskSE(name), |
47 | fEvent(NULL), | |
48 | fFQD(NULL), | |
49 | fListHistos(NULL), | |
53884472 | 50 | fBookOnlyBasicCCH(kTRUE), |
2ed70edf | 51 | fUseWeights(useWeights), |
52 | fUsePhiWeights(kFALSE), | |
f0e0fbcd | 53 | fListWeights(NULL), |
fcd108a1 | 54 | fHarmonic(2), |
f0e0fbcd | 55 | fqMin(0.), |
53884472 | 56 | fqMax(100.), |
57 | fqNbins(10000), | |
58 | fStoreqDistributionVsMult(kFALSE), | |
59 | fqDistributionVsMult(NULL), | |
60 | fMinMult(0.), | |
61 | fMaxMult(10000.), | |
df23c5ae | 62 | fnBinsMult(1000), |
63 | fDoFit(kTRUE), | |
d9e6d8bb | 64 | fExactNoRPs(0), |
df23c5ae | 65 | fMultiplicityIs(AliFlowCommonConstants::kRP) |
2ed70edf | 66 | { |
d53e4563 | 67 | //constructor |
df23c5ae | 68 | //cout<<"AliAnalysisTaskFittingQDistribution::AliAnalysisTaskFittingQDistribution(const char *name, Bool_t useWeights)"<<endl; |
9bed2723 | 69 | |
d53e4563 | 70 | // Define input and output slots here |
2ed70edf | 71 | // Input slot #0 works with an AliFlowEventSimple |
d53e4563 | 72 | DefineInput(0, AliFlowEventSimple::Class()); |
73 | ||
2ed70edf | 74 | // Input slot #1 is needed for the weights input files |
75 | if(useWeights) | |
76 | { | |
77 | DefineInput(1, TList::Class()); | |
d53e4563 | 78 | } |
2ed70edf | 79 | // Output slot #0 is reserved |
80 | // Output slot #1 writes into a TList container | |
81 | DefineOutput(1, TList::Class()); | |
82 | } | |
9bed2723 | 83 | |
84 | AliAnalysisTaskFittingQDistribution::AliAnalysisTaskFittingQDistribution(): | |
2ed70edf | 85 | AliAnalysisTaskSE(), |
86 | fEvent(NULL), | |
87 | fFQD(NULL), | |
53884472 | 88 | fListHistos(NULL), |
89 | fBookOnlyBasicCCH(kFALSE), | |
2ed70edf | 90 | fUseWeights(kFALSE), |
91 | fUsePhiWeights(kFALSE), | |
f0e0fbcd | 92 | fListWeights(NULL), |
fcd108a1 | 93 | fHarmonic(0), |
f0e0fbcd | 94 | fqMin(0.), |
95 | fqMax(0.), | |
53884472 | 96 | fqNbins(0), |
97 | fStoreqDistributionVsMult(kFALSE), | |
98 | fqDistributionVsMult(NULL), | |
99 | fMinMult(0.), | |
100 | fMaxMult(0.), | |
df23c5ae | 101 | fnBinsMult(0), |
102 | fDoFit(kTRUE), | |
d9e6d8bb | 103 | fExactNoRPs(0), |
df23c5ae | 104 | fMultiplicityIs(AliFlowCommonConstants::kRP) |
2ed70edf | 105 | { |
106 | // Dummy constructor | |
df23c5ae | 107 | //cout<<"AliAnalysisTaskFittingQDistribution::AliAnalysisTaskFittingQDistribution()"<<endl; |
2ed70edf | 108 | } |
9bed2723 | 109 | |
110 | //================================================================================================================ | |
111 | ||
2ed70edf | 112 | void AliAnalysisTaskFittingQDistribution::UserCreateOutputObjects() |
9bed2723 | 113 | { |
2ed70edf | 114 | // Called at every worker node to initialize |
115 | cout<<"AliAnalysisTaskFittingQDistribution::UserCreateOutputObjects()"<<endl; | |
d53e4563 | 116 | |
2ed70edf | 117 | // Analyser: |
118 | fFQD = new AliFlowAnalysisWithFittingQDistribution(); | |
d53e4563 | 119 | |
53884472 | 120 | fFQD->SetBookOnlyBasicCCH(fBookOnlyBasicCCH); |
2ed70edf | 121 | // Particle weights: |
122 | if(fUseWeights) | |
123 | { | |
124 | // Pass the flags to class: | |
125 | if(fUsePhiWeights) fFQD->SetUsePhiWeights(fUsePhiWeights); | |
126 | // Get data from input slot #1 which is used for weights: | |
127 | if(GetNinputs()==2) | |
128 | { | |
129 | fListWeights = (TList*)GetInputData(1); | |
130 | } | |
131 | // Pass the list with weights to class: | |
132 | if(fListWeights) fFQD->SetWeightsList(fListWeights); | |
14db9c04 | 133 | } |
fcd108a1 | 134 | fFQD->SetHarmonic(fHarmonic); |
f0e0fbcd | 135 | // Settings for q-distribution: |
136 | fFQD->SetqMin(fqMin); | |
137 | fFQD->SetqMax(fqMax); | |
138 | fFQD->SetqNbins(fqNbins); | |
53884472 | 139 | fFQD->SetStoreqDistributionVsMult(fStoreqDistributionVsMult); |
140 | fFQD->SetqDistributionVsMult(fqDistributionVsMult); | |
141 | fFQD->SetMinMult(fMinMult); | |
142 | fFQD->SetMaxMult(fMaxMult); | |
143 | fFQD->SetnBinsMult(fnBinsMult); | |
df23c5ae | 144 | fFQD->SetDoFit(fDoFit); |
d9e6d8bb | 145 | fFQD->SetExactNoRPs(fExactNoRPs); |
df23c5ae | 146 | fFQD->SetMultiplicityIs(fMultiplicityIs); |
f0e0fbcd | 147 | |
2ed70edf | 148 | fFQD->Init(); |
d53e4563 | 149 | |
2ed70edf | 150 | if(fFQD->GetHistList()) |
151 | { | |
152 | fListHistos = fFQD->GetHistList(); | |
153 | //fListHistos->Print(); | |
154 | } else | |
155 | { | |
156 | Printf("ERROR: Could not retrieve histogram list (FQD, Task::UserCreateOutputObjects()) !!!!"); | |
157 | } | |
61e0c8c0 | 158 | |
159 | PostData(1,fListHistos); | |
2ed70edf | 160 | |
161 | } // end of void AliAnalysisTaskFittingQDistribution::UserCreateOutputObjects() | |
9bed2723 | 162 | |
163 | //================================================================================================================ | |
164 | ||
2ed70edf | 165 | void AliAnalysisTaskFittingQDistribution::UserExec(Option_t *) |
9bed2723 | 166 | { |
2ed70edf | 167 | // Main loop (called for each event): |
d53e4563 | 168 | fEvent = dynamic_cast<AliFlowEventSimple*>(GetInputData(0)); |
9bed2723 | 169 | |
2ed70edf | 170 | // Fitting q-distribution: |
171 | if(fEvent) | |
172 | { | |
173 | fFQD->Make(fEvent); | |
174 | } else | |
175 | { | |
176 | cout<<"WARNING: No input data (FQD, Task::UserExec()) !!!!"<<endl; | |
177 | } | |
178 | ||
179 | PostData(1,fListHistos); | |
9bed2723 | 180 | } |
181 | ||
182 | //================================================================================================================ | |
183 | ||
184 | void AliAnalysisTaskFittingQDistribution::Terminate(Option_t *) | |
185 | { | |
d53e4563 | 186 | //accessing the output list |
2ed70edf | 187 | fListHistos = (TList*)GetOutputData(1); |
4b2e3a73 | 188 | |
2ed70edf | 189 | fFQD = new AliFlowAnalysisWithFittingQDistribution(); |
fd46c3dd | 190 | |
191 | if(fListHistos) | |
192 | { | |
2ed70edf | 193 | fFQD->GetOutputHistograms(fListHistos); |
194 | fFQD->Finish(); | |
195 | PostData(1,fListHistos); | |
fd46c3dd | 196 | } else |
197 | { | |
2ed70edf | 198 | cout<<" WARNING: histogram list pointer is empty (FQD, Task::Terminate()) !!!!"<<endl; |
199 | cout<<endl; | |
fd46c3dd | 200 | } |
2ed70edf | 201 | |
202 | } // end of void AliAnalysisTaskFittingQDistribution::Terminate(Option_t *) | |
9bed2723 | 203 | |
4b2e3a73 | 204 | //================================================================================================================ |
9bed2723 | 205 | |
206 | ||
207 | ||
208 | ||
209 | ||
210 | ||
211 | ||
212 | ||
213 | ||
214 | ||
215 | ||
216 | ||
217 | ||
218 | ||
219 | ||
220 | ||
221 | ||
222 | ||
223 |