1 ////////////////////////////////////////////////////////////////////////////////
3 /// alifemtomodelcorrfctnsource - the class for correlation function which ///
4 /// uses the model framework and weight generation and saves the generated ///
5 /// emission source ///
6 /// Authors: Adam Kisiel, kisiel@mps.ohio-state.edu ///
8 ////////////////////////////////////////////////////////////////////////////////
10 ClassImp(AliFemtoModelCorrFctnSource, 1)
13 #include "AliFemtoModelGausLCMSFreezeOutGenerator.h"
14 #include "AliFemtoModelHiddenInfo.h"
15 #include "AliFemtoModelCorrFctnSource.h"
16 #include "AliFemtoKTPairCut.h"
17 #include "AliFemtoAnalysisReactionPlane.h"
19 //_______________________
20 AliFemtoModelCorrFctnSource::AliFemtoModelCorrFctnSource():
21 AliFemtoModelCorrFctn(),
31 // default constructor
33 char title[100] = "CFSource";
34 snprintf(buf , 100, "%sOut", title);
35 fHistROut = new TH1D(buf,buf,100,-50.0,50.0);
36 snprintf(buf , 100, "%sSide", title);
37 fHistRSide = new TH1D(buf,buf,100,-50.0,50.0);
38 snprintf(buf , 100, "%sLong", title);
39 fHistRLong = new TH1D(buf,buf,100,-50.0,50.0);
40 snprintf(buf , 100, "%sInv", title);
41 fHistRStar = new TH1D(buf,buf,100,-50.0,50.0);
42 snprintf(buf , 100, "%sdNdR", title);
43 fHistdNdR = new TH1D(buf,buf,100,-50.0,50.0);
45 snprintf(buf , 100, "%sNWS", title);
46 fHistNumWS = new TH2D(buf,buf,50,0.0,0.5,100,0.0,2.0);
47 snprintf(buf , 100, "%sDWS", title);
48 fHistDenWS = new TH2D(buf,buf,50,0.0,0.5,100,0.0,2.0);
56 //_______________________
57 AliFemtoModelCorrFctnSource::AliFemtoModelCorrFctnSource(const char *title, Int_t aNbins, Double_t aQinvLo, Double_t aQinvHi):
58 AliFemtoModelCorrFctn(title, aNbins, aQinvLo, aQinvHi),
70 snprintf(buf , 100, "%sOut", title);
71 fHistROut = new TH1D(buf,buf,100,-50.0,50.0);
72 snprintf(buf , 100, "%sSide", title);
73 fHistRSide = new TH1D(buf,buf,100,-50.0,50.0);
74 snprintf(buf , 100, "%sLong", title);
75 fHistRLong = new TH1D(buf,buf,100,-50.0,50.0);
76 snprintf(buf , 100, "%sInv", title);
77 fHistRStar = new TH1D(buf,buf,100,-50.0,50.0);
78 snprintf(buf , 100, "%sdNdR", title);
79 fHistdNdR = new TH1D(buf,buf,100,-50.0,50.0);
81 snprintf(buf , 100, "%sNWS", title);
82 fHistNumWS = new TH2D(buf,buf,50,0.0,0.5,100,0.0,2.0);
83 snprintf(buf , 100, "%sDWS", title);
84 fHistDenWS = new TH2D(buf,buf,50,0.0,0.5,100,0.0,2.0);
92 //_______________________
93 AliFemtoModelCorrFctnSource::AliFemtoModelCorrFctnSource(const AliFemtoModelCorrFctnSource& aCorrFctn):
94 AliFemtoModelCorrFctn(aCorrFctn),
105 fHistROut = new TH1D (*aCorrFctn.fHistROut);
106 fHistRSide = new TH1D(*aCorrFctn.fHistRSide);
107 fHistRLong = new TH1D(*aCorrFctn.fHistRLong);
108 fHistRStar = new TH1D(*aCorrFctn.fHistRStar);
109 fHistdNdR = new TH1D(*aCorrFctn.fHistdNdR);
110 fHistNumWS = new TH2D(*aCorrFctn.fHistNumWS);
111 fHistDenWS = new TH2D(*aCorrFctn.fHistDenWS);
113 fUseRPSelection = aCorrFctn.fUseRPSelection;
115 //_______________________
116 AliFemtoModelCorrFctnSource::~AliFemtoModelCorrFctnSource()
119 if (fHistROut) delete fHistROut;
120 if (fHistRSide) delete fHistRSide;
121 if (fHistRLong) delete fHistRLong;
122 if (fHistRStar) delete fHistRStar;
123 if (fHistdNdR) delete fHistdNdR;
124 if (fHistNumWS) delete fHistNumWS;
125 if (fHistDenWS) delete fHistDenWS;
126 if (fNumeratorTrue) delete fNumeratorTrue;
127 if (fNumeratorFake) delete fNumeratorFake;
128 if (fDenominator) delete fDenominator;
131 //_______________________
132 AliFemtoModelCorrFctnSource& AliFemtoModelCorrFctnSource::operator=(const AliFemtoModelCorrFctnSource& aCorrFctn)
134 // assignment operator
135 if (this == &aCorrFctn)
137 if (aCorrFctn.fHistROut)
138 fHistROut = new TH1D (*aCorrFctn.fHistROut);
140 if (aCorrFctn.fHistRSide)
141 fHistRSide = new TH1D(*aCorrFctn.fHistRSide);
143 if (aCorrFctn.fHistRLong)
144 fHistRLong = new TH1D(*aCorrFctn.fHistRLong);
146 if (aCorrFctn.fHistRStar)
147 fHistRStar = new TH1D(*aCorrFctn.fHistRStar);
149 if (aCorrFctn.fHistdNdR)
150 fHistdNdR = new TH1D(*aCorrFctn.fHistdNdR);
152 if (aCorrFctn.fHistNumWS)
153 fHistNumWS = new TH2D(*aCorrFctn.fHistNumWS);
155 if (aCorrFctn.fHistDenWS)
156 fHistDenWS = new TH2D(*aCorrFctn.fHistDenWS);
159 fUseRPSelection = aCorrFctn.fUseRPSelection;
163 //_______________________
164 AliFemtoString AliFemtoModelCorrFctnSource::Report()
167 AliFemtoString tStr = "AliFemtoModelCorrFctnSource report";
172 //_______________________
173 void AliFemtoModelCorrFctnSource::AddRealPair(AliFemtoPair* aPair)
175 // add real (effect) pair
177 // if (!(fPairCut->Pass(aPair))) return;
180 if (fUseRPSelection) {
181 AliFemtoKTPairCut *ktc = dynamic_cast<AliFemtoKTPairCut *>(fPairCut);
183 cout << "RP aware cut requested, but not connected to the CF" << endl;
184 if (!(fPairCut->Pass(aPair))) return;
187 AliFemtoAnalysisReactionPlane *arp = dynamic_cast<AliFemtoAnalysisReactionPlane *> (HbtAnalysis());
189 cout << "RP aware cut requested, but not connected to the CF" << endl;
190 if (!(fPairCut->Pass(aPair))) return;
192 else if (!(ktc->Pass(aPair, arp->GetCurrentReactionPlane()))) return;
196 if (!(fPairCut->Pass(aPair))) return;
199 AliFemtoModelCorrFctn::AddRealPair(aPair);
202 //_______________________
203 void AliFemtoModelCorrFctnSource::AddMixedPair(AliFemtoPair* aPair)
205 // add mixed (background) pair
207 // if (!(fPairCut->Pass(aPair))) return;
210 if (fUseRPSelection) {
211 AliFemtoKTPairCut *ktc = dynamic_cast<AliFemtoKTPairCut *>(fPairCut);
213 cout << "RP aware cut requested, but not connected to the CF" << endl;
214 if (!(fPairCut->Pass(aPair))) return;
217 AliFemtoAnalysisReactionPlane *arp = dynamic_cast<AliFemtoAnalysisReactionPlane *> (HbtAnalysis());
219 cout << "RP aware cut requested, but not connected to the CF" << endl;
220 if (!(fPairCut->Pass(aPair))) return;
222 else if (!(ktc->Pass(aPair, arp->GetCurrentReactionPlane()))) return;
226 if (!(fPairCut->Pass(aPair))) return;
229 AliFemtoModelCorrFctn::AddMixedPair(aPair);
230 // save the generated positions
231 if (aPair->KStar() < 0.2) {
232 fHistROut->Fill (fManager->GetWeightGenerator()->GetRStarOut());
233 fHistRSide->Fill(fManager->GetWeightGenerator()->GetRStarSide());
234 fHistRLong->Fill(fManager->GetWeightGenerator()->GetRStarLong());
235 fHistRStar->Fill(fManager->GetWeightGenerator()->GetRStar());
236 fHistdNdR->Fill (fManager->GetWeightGenerator()->GetRStar(),1.0/(fManager->GetWeightGenerator()->GetRStar()*fManager->GetWeightGenerator()->GetRStar()));
239 fHistDenWS->Fill(aPair->QInv(), 1.0);
240 Double_t weight = fManager->GetWeight(aPair);
241 fHistNumWS->Fill(aPair->QInv(), weight);
243 //_______________________
244 void AliFemtoModelCorrFctnSource::Write()
246 // write out all the histograms
255 AliFemtoModelCorrFctn::Write();
257 //________________________
258 TList* AliFemtoModelCorrFctnSource::GetOutputList()
260 // Prepare the list of objects to be written to the output
261 TList *tOutputList = AliFemtoModelCorrFctn::GetOutputList();
263 tOutputList->Add(fHistROut);
264 tOutputList->Add(fHistRSide);
265 tOutputList->Add(fHistRLong);
266 tOutputList->Add(fHistRStar);
267 tOutputList->Add(fHistdNdR);
268 tOutputList->Add(fHistDenWS);
269 tOutputList->Add(fHistNumWS);
273 //_______________________
274 AliFemtoModelCorrFctn* AliFemtoModelCorrFctnSource::Clone()
276 // Clone the correlation function
277 AliFemtoModelCorrFctnSource *tCopy = new AliFemtoModelCorrFctnSource(*this);
282 void AliFemtoModelCorrFctnSource::SetUseRPSelection(unsigned short aRPSel)
284 fUseRPSelection = aRPSel;