]>
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), | |
48 | fCYlmTrue(0), | |
963893bf | 49 | fCYlmFake(0), |
50 | fUseLCMS(0) | |
17b6dded | 51 | { |
52 | // copy constructor | |
963893bf | 53 | fUseLCMS = aCorrFctn.fUseLCMS; |
17b6dded | 54 | fCYlmTrue = dynamic_cast<AliFemtoCorrFctnDirectYlm*>(aCorrFctn.fCYlmTrue->Clone()); |
55 | fCYlmFake = dynamic_cast<AliFemtoCorrFctnDirectYlm*>(aCorrFctn.fCYlmFake->Clone()); | |
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 | |
72 | if (this == &aCorrFctn) | |
73 | return *this; | |
74 | ||
963893bf | 75 | fUseLCMS = aCorrFctn.fUseLCMS; |
76 | ||
17b6dded | 77 | if (aCorrFctn.fCYlmTrue) |
78 | fCYlmTrue = dynamic_cast<AliFemtoCorrFctnDirectYlm*>(aCorrFctn.fCYlmTrue->Clone()); | |
79 | else fCYlmTrue = 0; | |
80 | ||
81 | if (aCorrFctn.fCYlmFake) | |
82 | fCYlmFake = dynamic_cast<AliFemtoCorrFctnDirectYlm*>(aCorrFctn.fCYlmFake->Clone()); | |
83 | else fCYlmFake = 0; | |
84 | ||
7bce483d | 85 | if (aCorrFctn.fNumeratorTrue) |
86 | fNumeratorTrue = new TH1D(*aCorrFctn.fNumeratorTrue); | |
87 | else | |
88 | fNumeratorTrue = 0; | |
89 | ||
90 | if (aCorrFctn.fNumeratorFake) | |
91 | fNumeratorFake = new TH1D(*aCorrFctn.fNumeratorFake); | |
92 | else | |
93 | fNumeratorFake = 0; | |
94 | ||
95 | if (aCorrFctn.fDenominator) | |
96 | fDenominator = new TH1D(*aCorrFctn.fDenominator); | |
97 | else | |
98 | fDenominator = 0; | |
99 | ||
17b6dded | 100 | return *this; |
101 | } | |
102 | //_______________________ | |
103 | AliFemtoString AliFemtoModelCorrFctnDirectYlm::Report() | |
104 | { | |
105 | // construct report | |
106 | AliFemtoString tStr = "AliFemtoModelCorrFctnDirectYlm report"; | |
107 | ||
108 | return tStr; | |
109 | } | |
110 | ||
111 | //_______________________ | |
112 | void AliFemtoModelCorrFctnDirectYlm::AddRealPair(AliFemtoPair* aPair) | |
113 | { | |
114 | // add real (effect) pair | |
44c6b6dc | 115 | if (fPairCut) |
116 | if (!(fPairCut->Pass(aPair))) return; | |
117 | ||
17b6dded | 118 | Double_t weight = fManager->GetWeight(aPair); |
119 | ||
963893bf | 120 | if (fUseLCMS) |
121 | fCYlmTrue->AddRealPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), weight); | |
122 | else | |
123 | fCYlmTrue->AddRealPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), weight); | |
17b6dded | 124 | } |
125 | //_______________________ | |
126 | void AliFemtoModelCorrFctnDirectYlm::AddMixedPair(AliFemtoPair* aPair) | |
127 | { | |
128 | // add mixed (background) pair | |
44c6b6dc | 129 | if (fPairCut) |
130 | if (!(fPairCut->Pass(aPair))) return; | |
131 | ||
17b6dded | 132 | Double_t weight = fManager->GetWeight(aPair); |
133 | ||
963893bf | 134 | if (fUseLCMS) { |
135 | fCYlmTrue->AddMixedPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), 1.0); | |
136 | fCYlmFake->AddRealPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), weight); | |
137 | fCYlmFake->AddMixedPair(aPair->QOutCMS(), aPair->QSideCMS(), aPair->QLongCMS(), 1.0); | |
138 | } | |
139 | else { | |
140 | fCYlmTrue->AddMixedPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), 1.0); | |
141 | fCYlmFake->AddRealPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), weight); | |
142 | fCYlmFake->AddMixedPair(aPair->KOut(), aPair->KSide(), aPair->KLong(), 1.0); | |
143 | } | |
17b6dded | 144 | } |
145 | //_______________________ | |
146 | void AliFemtoModelCorrFctnDirectYlm::Write() | |
147 | { | |
148 | // write out all the histograms | |
149 | ||
150 | fCYlmTrue->Write(); | |
151 | fCYlmFake->Write(); | |
152 | } | |
153 | //_______________________ | |
154 | TList* AliFemtoModelCorrFctnDirectYlm::GetOutputList() | |
155 | { | |
156 | // Prepare the list of objects to be written to the output | |
157 | TList *tOutputList = AliFemtoModelCorrFctn::GetOutputList(); | |
158 | tOutputList->Clear(); | |
159 | ||
1fb889b2 | 160 | TList *tListCfTrue = fCYlmTrue->GetOutputList(); |
161 | ||
162 | TIter nextListCfTrue(tListCfTrue); | |
163 | while (TObject *obj = nextListCfTrue()) { | |
164 | tOutputList->Add(obj); | |
165 | } | |
166 | ||
167 | TList *tListCfFake = fCYlmFake->GetOutputList(); | |
168 | ||
169 | TIter nextListCfFake(tListCfFake); | |
170 | while (TObject *obj = nextListCfFake()) { | |
171 | tOutputList->Add(obj); | |
172 | } | |
173 | // tOutputList->Add(fCYlmTrue->GetOutputList()); | |
174 | // tOutputList->Add(fCYlmFake->GetOutputList()); | |
17b6dded | 175 | |
176 | return tOutputList; | |
177 | } | |
178 | //_______________________ | |
179 | AliFemtoModelCorrFctn* AliFemtoModelCorrFctnDirectYlm::Clone() | |
180 | { | |
181 | // Clone the correlation function | |
182 | AliFemtoModelCorrFctnDirectYlm *tCopy = new AliFemtoModelCorrFctnDirectYlm(*this); | |
183 | ||
184 | return tCopy; | |
185 | } | |
963893bf | 186 | //_______________________ |
17b6dded | 187 | void AliFemtoModelCorrFctnDirectYlm::Finish() |
188 | { | |
189 | fCYlmTrue->Finish(); | |
190 | fCYlmFake->Finish(); | |
191 | } | |
963893bf | 192 | //_______________________ |
193 | void AliFemtoModelCorrFctnDirectYlm::SetUseLCMS(int aUseLCMS) | |
194 | { | |
195 | fUseLCMS = aUseLCMS; | |
196 | fCYlmTrue->SetUseLCMS(fUseLCMS); | |
197 | fCYlmFake->SetUseLCMS(fUseLCMS); | |
198 | } | |
199 | //_______________________ | |
200 | int AliFemtoModelCorrFctnDirectYlm::GetUseLCMS() | |
201 | { | |
202 | return fUseLCMS; | |
203 | } | |
204 |