1 ////////////////////////////////////////////////////////////////////////////////
3 // AliFemtoModelCorrFctnNonIdDR - correlation function for non-identical //
4 // particles which uses k* as a function variable. Stores the correlation //
5 // function separately for positive and negative signs of k* projections into //
6 // out, side and long directions, enabling the calculations of double ratios //
7 // Uses pair weight to simulate the model correlation function. //
9 ////////////////////////////////////////////////////////////////////////////////
11 #include "AliFemtoModelCorrFctnNonIdDR.h"
12 #include "AliFemtoModelManager.h"
13 //#include "AliFemtoHisto.h"
17 ClassImp(AliFemtoModelCorrFctnNonIdDR)
20 //____________________________
21 AliFemtoModelCorrFctnNonIdDR::AliFemtoModelCorrFctnNonIdDR(char* title, const int& nbins, const float& QinvLo, const float& QinvHi):
22 AliFemtoModelCorrFctn(title, nbins, QinvLo, QinvHi),
42 // Default constructor
45 // set up true numerators
46 snprintf(bufname, 200, "NumTOutP%s", title);
47 fNumTOutP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
48 snprintf(bufname, 200, "NumTOutN%s", title);
49 fNumTOutN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
50 snprintf(bufname, 200, "NumTSideP%s", title);
51 fNumTSideP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
52 snprintf(bufname, 200, "NumTSideN%s", title);
53 fNumTSideN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
54 snprintf(bufname, 200, "NumTLongP%s", title);
55 fNumTLongP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
56 snprintf(bufname, 200, "NumTLongN%s", title);
57 fNumTLongN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
59 // set up fake numerators
60 snprintf(bufname, 200, "NumFOutP%s", title);
61 fNumFOutP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
62 snprintf(bufname, 200, "NumFOutN%s", title);
63 fNumFOutN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
64 snprintf(bufname, 200, "NumFSideP%s", title);
65 fNumFSideP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
66 snprintf(bufname, 200, "NumFSideN%s", title);
67 fNumFSideN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
68 snprintf(bufname, 200, "NumFLongP%s", title);
69 fNumFLongP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
70 snprintf(bufname, 200, "NumFLongN%s", title);
71 fNumFLongN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
73 // set up denominators
74 snprintf(bufname, 200, "DenOutP%s", title);
75 fDenOutP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
76 snprintf(bufname, 200, "DenOutN%s", title);
77 fDenOutN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
78 snprintf(bufname, 200, "DenSideP%s", title);
79 fDenSideP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
80 snprintf(bufname, 200, "DenSideN%s", title);
81 fDenSideN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
82 snprintf(bufname, 200, "DenLongP%s", title);
83 fDenLongP = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
84 snprintf(bufname, 200, "DenLongN%s", title);
85 fDenLongN = new TH1D(bufname,title,nbins,QinvLo,QinvHi);
87 // to enable error bar calculation...
108 //____________________________
109 AliFemtoModelCorrFctnNonIdDR::AliFemtoModelCorrFctnNonIdDR(const AliFemtoModelCorrFctnNonIdDR& aCorrFctn) :
110 AliFemtoModelCorrFctn(),
131 if (aCorrFctn.fNumTOutP)
132 fNumTOutP = new TH1D(*aCorrFctn.fNumTOutP);
133 if (aCorrFctn.fNumTOutN)
134 fNumTOutN = new TH1D(*aCorrFctn.fNumTOutN);
135 if (aCorrFctn.fNumTSideP)
136 fNumTSideP = new TH1D(*aCorrFctn.fNumTSideP);
137 if (aCorrFctn.fNumTSideN)
138 fNumTSideN = new TH1D(*aCorrFctn.fNumTSideN);
139 if (aCorrFctn.fNumTLongP)
140 fNumTLongP = new TH1D(*aCorrFctn.fNumTLongP);
141 if (aCorrFctn.fNumTLongN)
142 fNumTLongN = new TH1D(*aCorrFctn.fNumTLongN);
144 if (aCorrFctn.fNumFOutP)
145 fNumFOutP = new TH1D(*aCorrFctn.fNumFOutP);
146 if (aCorrFctn.fNumFOutN)
147 fNumFOutN = new TH1D(*aCorrFctn.fNumFOutN);
148 if (aCorrFctn.fNumFSideP)
149 fNumFSideP = new TH1D(*aCorrFctn.fNumFSideP);
150 if (aCorrFctn.fNumFSideN)
151 fNumFSideN = new TH1D(*aCorrFctn.fNumFSideN);
152 if (aCorrFctn.fNumFLongP)
153 fNumFLongP = new TH1D(*aCorrFctn.fNumFLongP);
154 if (aCorrFctn.fNumFLongN)
155 fNumFLongN = new TH1D(*aCorrFctn.fNumFLongN);
157 if (aCorrFctn.fDenOutP)
158 fDenOutP = new TH1D(*aCorrFctn.fDenOutP);
159 if (aCorrFctn.fDenOutN)
160 fDenOutN = new TH1D(*aCorrFctn.fDenOutN);
161 if (aCorrFctn.fDenSideP)
162 fDenSideP = new TH1D(*aCorrFctn.fDenSideP);
163 if (aCorrFctn.fDenSideN)
164 fDenSideN = new TH1D(*aCorrFctn.fDenSideN);
165 if (aCorrFctn.fDenLongP)
166 fDenLongP = new TH1D(*aCorrFctn.fDenLongP);
167 if (aCorrFctn.fDenLongN)
168 fDenLongN = new TH1D(*aCorrFctn.fDenLongN);
170 //____________________________
171 AliFemtoModelCorrFctnNonIdDR::~AliFemtoModelCorrFctnNonIdDR(){
192 //_________________________
193 AliFemtoModelCorrFctnNonIdDR& AliFemtoModelCorrFctnNonIdDR::operator=(const AliFemtoModelCorrFctnNonIdDR& aCorrFctn)
195 // assignment operator
196 if (this == &aCorrFctn)
199 if (aCorrFctn.fNumTOutP)
200 fNumTOutP = new TH1D(*aCorrFctn.fNumTOutP);
201 if (aCorrFctn.fNumTOutN)
202 fNumTOutN = new TH1D(*aCorrFctn.fNumTOutN);
203 if (aCorrFctn.fNumTSideP)
204 fNumTSideP = new TH1D(*aCorrFctn.fNumTSideP);
205 if (aCorrFctn.fNumTSideN)
206 fNumTSideN = new TH1D(*aCorrFctn.fNumTSideN);
207 if (aCorrFctn.fNumTLongP)
208 fNumTLongP = new TH1D(*aCorrFctn.fNumTLongP);
209 if (aCorrFctn.fNumTLongN)
210 fNumTLongN = new TH1D(*aCorrFctn.fNumTLongN);
212 if (aCorrFctn.fNumFOutP)
213 fNumFOutP = new TH1D(*aCorrFctn.fNumFOutP);
214 if (aCorrFctn.fNumFOutN)
215 fNumFOutN = new TH1D(*aCorrFctn.fNumFOutN);
216 if (aCorrFctn.fNumFSideP)
217 fNumFSideP = new TH1D(*aCorrFctn.fNumFSideP);
218 if (aCorrFctn.fNumFSideN)
219 fNumFSideN = new TH1D(*aCorrFctn.fNumFSideN);
220 if (aCorrFctn.fNumFLongP)
221 fNumFLongP = new TH1D(*aCorrFctn.fNumFLongP);
222 if (aCorrFctn.fNumFLongN)
223 fNumFLongN = new TH1D(*aCorrFctn.fNumFLongN);
225 if (aCorrFctn.fDenOutP)
226 fDenOutP = new TH1D(*aCorrFctn.fDenOutP);
227 if (aCorrFctn.fDenOutN)
228 fDenOutN = new TH1D(*aCorrFctn.fDenOutN);
229 if (aCorrFctn.fDenSideP)
230 fDenSideP = new TH1D(*aCorrFctn.fDenSideP);
231 if (aCorrFctn.fDenSideN)
232 fDenSideN = new TH1D(*aCorrFctn.fDenSideN);
233 if (aCorrFctn.fDenLongP)
234 fDenLongP = new TH1D(*aCorrFctn.fDenLongP);
235 if (aCorrFctn.fDenLongN)
236 fDenLongN = new TH1D(*aCorrFctn.fDenLongN);
241 //_________________________
242 void AliFemtoModelCorrFctnNonIdDR::Finish(){
243 // here is where we should normalize, fit, etc...
244 // we should NOT Draw() the histos (as I had done it below),
245 // since we want to insulate ourselves from root at this level
246 // of the code. Do it instead at root command line with browser.
247 // fNumerator->Draw();
248 //fDenominator->Draw();
250 // fRatio->Divide(fNumerator,fDenominator,1.0,1.0);
254 //____________________________
255 AliFemtoString AliFemtoModelCorrFctnNonIdDR::Report(){
257 string stemp = "Non-identical particles Model Correlation Function Report:\n";
259 snprintf(ctemp , 100, "Number of entries in numerators:\t%E\n",fNumTOutP->GetEntries()+fNumTOutN->GetEntries());
261 snprintf(ctemp , 100, "Number of entries in denominators:\t%E\n",fDenOutP->GetEntries()+fDenOutN->GetEntries());
263 // stemp += mCoulombWeight->Report();
264 AliFemtoString returnThis = stemp;
267 //____________________________
268 void AliFemtoModelCorrFctnNonIdDR::AddRealPair(AliFemtoPair* pair){
270 double tKStar = pair->KStar();
271 Double_t weight = fManager->GetWeight(pair);
273 if (pair->KOut()>0.0)
274 fNumTOutP->Fill(tKStar, weight);
276 fNumTOutN->Fill(tKStar, weight);
278 if (pair->KSide()>0.0)
279 fNumTSideP->Fill(tKStar, weight);
281 fNumTSideN->Fill(tKStar, weight);
283 if (pair->KLong()>0.0)
284 fNumTLongP->Fill(tKStar, weight);
286 fNumTLongN->Fill(tKStar, weight);
289 //____________________________
290 void AliFemtoModelCorrFctnNonIdDR::AddMixedPair(AliFemtoPair* pair){
291 // add mixed (background) pair
292 double tKStar = pair->KStar();
293 Double_t weight = fManager->GetWeight(pair);
295 if (pair->KOut()>0.0)
296 fNumFOutP->Fill(tKStar, weight);
298 fNumFOutN->Fill(tKStar, weight);
300 if (pair->KSide()>0.0)
301 fNumFSideP->Fill(tKStar, weight);
303 fNumFSideN->Fill(tKStar, weight);
305 if (pair->KLong()>0.0)
306 fNumFLongP->Fill(tKStar, weight);
308 fNumFLongN->Fill(tKStar, weight);
310 if (pair->KOut()>0.0)
311 fDenOutP->Fill(tKStar);
313 fDenOutN->Fill(tKStar);
315 if (pair->KSide()>0.0)
316 fDenSideP->Fill(tKStar);
318 fDenSideN->Fill(tKStar);
320 if (pair->KLong()>0.0)
321 fDenLongP->Fill(tKStar);
323 fDenLongN->Fill(tKStar);
325 //____________________________
326 void AliFemtoModelCorrFctnNonIdDR::Write(){
348 TList* AliFemtoModelCorrFctnNonIdDR::GetOutputList()
350 // Prepare the list of objects to be written to the output
351 TList *tOutputList = new TList();
353 tOutputList->Add(fNumTOutP);
354 tOutputList->Add(fNumTOutN);
355 tOutputList->Add(fNumTSideP);
356 tOutputList->Add(fNumTSideN);
357 tOutputList->Add(fNumTLongP);
358 tOutputList->Add(fNumTLongN);
359 tOutputList->Add(fNumFOutP);
360 tOutputList->Add(fNumFOutN);
361 tOutputList->Add(fNumFSideP);
362 tOutputList->Add(fNumFSideN);
363 tOutputList->Add(fNumFLongP);
364 tOutputList->Add(fNumFLongN);
365 tOutputList->Add(fDenOutP);
366 tOutputList->Add(fDenOutN);
367 tOutputList->Add(fDenSideP);
368 tOutputList->Add(fDenSideN);
369 tOutputList->Add(fDenLongP);
370 tOutputList->Add(fDenLongN);
375 //_______________________
376 AliFemtoModelCorrFctn* AliFemtoModelCorrFctnNonIdDR::Clone()
379 AliFemtoModelCorrFctnNonIdDR *tCopy = new AliFemtoModelCorrFctnNonIdDR(*this);