]>
Commit | Line | Data |
---|---|---|
17b6dded | 1 | //////////////////////////////////////////////////////////////////////////////// |
2 | /// /// | |
3 | /// AliFemtoModelCorrFctnDirectYlm - 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 /// | |
7 | /// /// | |
8 | //////////////////////////////////////////////////////////////////////////////// | |
9 | #ifdef __ROOT__ | |
10 | ClassImp(AliFemtoModelCorrFctnDirectYlm, 1) | |
11 | #endif | |
12 | ||
13 | #include "AliFemtoModelGausLCMSFreezeOutGenerator.h" | |
14 | #include "AliFemtoModelHiddenInfo.h" | |
15 | #include "AliFemtoModelCorrFctnDirectYlm.h" | |
16 | ||
17 | //_______________________ | |
18 | AliFemtoModelCorrFctnDirectYlm::AliFemtoModelCorrFctnDirectYlm(): | |
19 | AliFemtoModelCorrFctn(), | |
20 | fCYlmTrue(0), | |
963893bf | 21 | fCYlmFake(0), |
22 | fUseLCMS(0) | |
17b6dded | 23 | { |
24 | // default constructor | |
25 | ||
26 | fCYlmTrue = new AliFemtoCorrFctnDirectYlm(); | |
27 | fCYlmFake = new AliFemtoCorrFctnDirectYlm(); | |
963893bf | 28 | fCYlmTrue->SetUseLCMS(fUseLCMS); |
29 | fCYlmFake->SetUseLCMS(fUseLCMS); | |
17b6dded | 30 | } |
31 | //_______________________ | |
963893bf | 32 | AliFemtoModelCorrFctnDirectYlm::AliFemtoModelCorrFctnDirectYlm(const char *title, Int_t aMaxL, Int_t aNbins, Double_t aQinvLo, Double_t aQinvHi, int aUseLCMS=0): |
17b6dded | 33 | AliFemtoModelCorrFctn(title, aNbins, aQinvLo, aQinvHi), |
34 | fCYlmTrue(0), | |
963893bf | 35 | fCYlmFake(0), |
36 | fUseLCMS(aUseLCMS) | |
17b6dded | 37 | { |
38 | // basic constructor | |
39 | char fname[1000]; | |
237760ed | 40 | snprintf(fname, 1000, "%s%s", title, "True"); |
963893bf | 41 | fCYlmTrue = new AliFemtoCorrFctnDirectYlm(fname, aMaxL, aNbins, aQinvLo, aQinvHi, fUseLCMS); |
237760ed | 42 | snprintf(fname, 1000, "%s%s", title, "Fake"); |
963893bf | 43 | fCYlmFake = new AliFemtoCorrFctnDirectYlm(fname, aMaxL, aNbins, aQinvLo, aQinvHi, fUseLCMS); |
17b6dded | 44 | } |
45 | //_______________________ | |
46 | AliFemtoModelCorrFctnDirectYlm::AliFemtoModelCorrFctnDirectYlm(const AliFemtoModelCorrFctnDirectYlm& aCorrFctn): | |
47 | AliFemtoModelCorrFctn(aCorrFctn), | |
6147b9e2 | 48 | fCYlmTrue(new AliFemtoCorrFctnDirectYlm(*(aCorrFctn.fCYlmTrue))), |
49 | fCYlmFake(new AliFemtoCorrFctnDirectYlm(*(aCorrFctn.fCYlmFake))), | |
963893bf | 50 | fUseLCMS(0) |
17b6dded | 51 | { |
52 | // copy constructor | |
963893bf | 53 | fUseLCMS = aCorrFctn.fUseLCMS; |
6147b9e2 | 54 | // fCYlmTrue = dynamic_cast<AliFemtoCorrFctnDirectYlm*>(aCorrFctn.fCYlmTrue->Clone()); |
55 | // fCYlmFake = dynamic_cast<AliFemtoCorrFctnDirectYlm*>(aCorrFctn.fCYlmFake->Clone()); | |
17b6dded | 56 | } |
57 | //_______________________ | |
58 | AliFemtoModelCorrFctnDirectYlm::~AliFemtoModelCorrFctnDirectYlm() | |
59 | { | |
60 | // destructor | |
61 | if (fCYlmTrue) delete fCYlmTrue; | |
62 | if (fCYlmFake) delete fCYlmFake; | |
63 | if (fNumeratorTrue) delete fNumeratorTrue; | |
64 | if (fNumeratorFake) delete fNumeratorFake; | |
65 | if (fDenominator) delete fDenominator; | |
66 | } | |
67 | ||
68 | //_______________________ | |
69 | AliFemtoModelCorrFctnDirectYlm& AliFemtoModelCorrFctnDirectYlm::operator=(const AliFemtoModelCorrFctnDirectYlm& aCorrFctn) | |
70 | { | |
71 | // assignment operator | |
83c8e4fe | 72 | if (this != &aCorrFctn) { |
17b6dded | 73 | |
83c8e4fe | 74 | fUseLCMS = aCorrFctn.fUseLCMS; |
75 | ||
76 | if (fCYlmTrue) delete fCYlmTrue; | |
77 | if (aCorrFctn.fCYlmTrue) | |
78 | fCYlmTrue = new AliFemtoCorrFctnDirectYlm(*aCorrFctn.fCYlmTrue); | |
79 | else fCYlmTrue = 0; | |
80 | ||
81 | if (fCYlmFake) delete fCYlmFake; | |
82 | if (aCorrFctn.fCYlmFake) | |
83 | fCYlmFake = new AliFemtoCorrFctnDirectYlm(*aCorrFctn.fCYlmFake); | |
84 | else fCYlmFake = 0; | |
85 | ||
86 | if (fNumeratorTrue) delete fNumeratorTrue; | |
87 | if (aCorrFctn.fNumeratorTrue) | |
88 | fNumeratorTrue = new TH1D(*aCorrFctn.fNumeratorTrue); | |
89 | else | |
90 | fNumeratorTrue = 0; | |
91 | ||
92 | if (fNumeratorFake) delete fNumeratorFake; | |
93 | if (aCorrFctn.fNumeratorFake) | |
94 | fNumeratorFake = new TH1D(*aCorrFctn.fNumeratorFake); | |
95 | else | |
96 | fNumeratorFake = 0; | |
97 | ||
98 | if (fDenominator) delete fDenominator; | |
99 | if (aCorrFctn.fDenominator) | |
100 | fDenominator = new TH1D(*aCorrFctn.fDenominator); | |
101 | else | |
102 | fDenominator = 0; | |
103 | } | |
7bce483d | 104 | |
17b6dded | 105 | return *this; |
106 | } | |
107 | //_______________________ | |
108 | AliFemtoString AliFemtoModelCorrFctnDirectYlm::Report() | |
109 | { | |
110 | // construct report | |
111 | AliFemtoString tStr = "AliFemtoModelCorrFctnDirectYlm report"; | |
112 | ||
113 | return tStr; | |
114 | } | |
115 | ||
116 | //_______________________ | |
117 | void AliFemtoModelCorrFctnDirectYlm::AddRealPair(AliFemtoPair* aPair) | |
118 | { | |
119 | // add real (effect) pair | |
44c6b6dc | 120 | if (fPairCut) |
121 | if (!(fPairCut->Pass(aPair))) return; | |
122 | ||
17b6dded | 123 | Double_t weight = fManager->GetWeight(aPair); |
124 | ||
963893bf | 125 | if (fUseLCMS) |
126 | fCYlmTrue->AddRealPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), weight); | |
127 | else | |
128 | fCYlmTrue->AddRealPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), weight); | |
17b6dded | 129 | } |
130 | //_______________________ | |
131 | void AliFemtoModelCorrFctnDirectYlm::AddMixedPair(AliFemtoPair* aPair) | |
132 | { | |
133 | // add mixed (background) pair | |
44c6b6dc | 134 | if (fPairCut) |
135 | if (!(fPairCut->Pass(aPair))) return; | |
136 | ||
17b6dded | 137 | Double_t weight = fManager->GetWeight(aPair); |
138 | ||
963893bf | 139 | if (fUseLCMS) { |
140 | fCYlmTrue->AddMixedPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), 1.0); | |
141 | fCYlmFake->AddRealPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), weight); | |
142 | fCYlmFake->AddMixedPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), 1.0); | |
143 | } | |
144 | else { | |
145 | fCYlmTrue->AddMixedPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), 1.0); | |
146 | fCYlmFake->AddRealPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), weight); | |
147 | fCYlmFake->AddMixedPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), 1.0); | |
148 | } | |
17b6dded | 149 | } |
150 | //_______________________ | |
151 | void AliFemtoModelCorrFctnDirectYlm::Write() | |
152 | { | |
153 | // write out all the histograms | |
154 | ||
155 | fCYlmTrue->Write(); | |
156 | fCYlmFake->Write(); | |
157 | } | |
158 | //_______________________ | |
159 | TList* AliFemtoModelCorrFctnDirectYlm::GetOutputList() | |
160 | { | |
161 | // Prepare the list of objects to be written to the output | |
162 | TList *tOutputList = AliFemtoModelCorrFctn::GetOutputList(); | |
163 | tOutputList->Clear(); | |
164 | ||
1fb889b2 | 165 | TList *tListCfTrue = fCYlmTrue->GetOutputList(); |
166 | ||
167 | TIter nextListCfTrue(tListCfTrue); | |
168 | while (TObject *obj = nextListCfTrue()) { | |
169 | tOutputList->Add(obj); | |
170 | } | |
171 | ||
172 | TList *tListCfFake = fCYlmFake->GetOutputList(); | |
173 | ||
174 | TIter nextListCfFake(tListCfFake); | |
175 | while (TObject *obj = nextListCfFake()) { | |
176 | tOutputList->Add(obj); | |
177 | } | |
178 | // tOutputList->Add(fCYlmTrue->GetOutputList()); | |
179 | // tOutputList->Add(fCYlmFake->GetOutputList()); | |
17b6dded | 180 | |
181 | return tOutputList; | |
182 | } | |
183 | //_______________________ | |
184 | AliFemtoModelCorrFctn* AliFemtoModelCorrFctnDirectYlm::Clone() | |
185 | { | |
186 | // Clone the correlation function | |
187 | AliFemtoModelCorrFctnDirectYlm *tCopy = new AliFemtoModelCorrFctnDirectYlm(*this); | |
188 | ||
189 | return tCopy; | |
190 | } | |
963893bf | 191 | //_______________________ |
17b6dded | 192 | void AliFemtoModelCorrFctnDirectYlm::Finish() |
193 | { | |
194 | fCYlmTrue->Finish(); | |
195 | fCYlmFake->Finish(); | |
196 | } | |
963893bf | 197 | //_______________________ |
198 | void AliFemtoModelCorrFctnDirectYlm::SetUseLCMS(int aUseLCMS) | |
199 | { | |
200 | fUseLCMS = aUseLCMS; | |
201 | fCYlmTrue->SetUseLCMS(fUseLCMS); | |
202 | fCYlmFake->SetUseLCMS(fUseLCMS); | |
203 | } | |
204 | //_______________________ | |
205 | int AliFemtoModelCorrFctnDirectYlm::GetUseLCMS() | |
206 | { | |
207 | return fUseLCMS; | |
208 | } | |
209 |