]>
Commit | Line | Data |
---|---|---|
7984e5f7 | 1 | // |
2 | // This class calculates the exclusive charged particle density | |
3 | // in each for the 5 FMD rings. | |
4 | // | |
5 | // Input: | |
6 | // - 5 RingHistos objects - each with a number of vertex dependent | |
7 | // 2D histograms of the inclusive charge particle density | |
8 | // | |
9 | // Output: | |
10 | // - 5 RingHistos objects - each with a number of vertex dependent | |
11 | // 2D histograms of the exclusive charge particle density | |
12 | // | |
13 | // Corrections used: | |
14 | // - AliFMDCorrSecondaryMap; | |
15 | // - AliFMDCorrVertexBias | |
16 | // - AliFMDCorrMergingEfficiency | |
17 | // | |
72cc12cd | 18 | #include "AliFMDMCCorrector.h" |
886dd429 | 19 | #include <AliESDFMD.h> |
20 | #include <TAxis.h> | |
21 | #include <TList.h> | |
22 | #include <TMath.h> | |
23 | #include "AliForwardCorrectionManager.h" | |
fb3430ac | 24 | #include "AliFMDCorrVertexBias.h" |
886dd429 | 25 | #include "AliLog.h" |
26 | #include <TH2D.h> | |
27 | #include <TROOT.h> | |
28 | #include <TProfile2D.h> | |
e58000b7 | 29 | #include <iostream> |
72cc12cd | 30 | ClassImp(AliFMDMCCorrector) |
886dd429 | 31 | #if 0 |
32 | ; // For Emacs | |
33 | #endif | |
34 | ||
35 | ||
36 | //____________________________________________________________________ | |
72cc12cd | 37 | AliFMDMCCorrector::~AliFMDMCCorrector() |
886dd429 | 38 | { |
7984e5f7 | 39 | // |
40 | // Destructor | |
41 | // | |
886dd429 | 42 | if (fComps) fComps->Clear(); |
43 | if (fFMD1i) delete fFMD1i; | |
44 | if (fFMD2i) delete fFMD2i; | |
45 | if (fFMD2o) delete fFMD2o; | |
46 | if (fFMD3i) delete fFMD3i; | |
47 | if (fFMD3o) delete fFMD3o; | |
48 | } | |
49 | ||
50 | //____________________________________________________________________ | |
72cc12cd | 51 | AliFMDMCCorrector& |
52 | AliFMDMCCorrector::operator=(const AliFMDMCCorrector& o) | |
886dd429 | 53 | { |
7984e5f7 | 54 | // |
55 | // Assignement operator | |
56 | // | |
57 | // Parameters: | |
58 | // o Object to assign from | |
59 | // | |
60 | // Return: | |
61 | // Reference to this object | |
62 | // | |
72cc12cd | 63 | AliFMDCorrector::operator=(o); |
886dd429 | 64 | |
65 | return *this; | |
66 | } | |
67 | ||
68 | //____________________________________________________________________ | |
69 | Bool_t | |
72cc12cd | 70 | AliFMDMCCorrector::CorrectMC(AliForwardUtil::Histos& hists, |
886dd429 | 71 | UShort_t vtxbin) |
72 | { | |
7984e5f7 | 73 | // |
74 | // Do the calculations | |
75 | // | |
76 | // Parameters: | |
77 | // hists Cache of histograms | |
78 | // vtxBin Vertex bin | |
79 | // | |
80 | // Return: | |
81 | // true on successs | |
82 | // | |
886dd429 | 83 | AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance(); |
84 | ||
85 | UShort_t uvb = vtxbin; | |
86 | for (UShort_t d=1; d<=3; d++) { | |
87 | UShort_t nr = (d == 1 ? 1 : 2); | |
88 | for (UShort_t q=0; q<nr; q++) { | |
89 | Char_t r = (q == 0 ? 'I' : 'O'); | |
90 | TH2D* h = hists.Get(d,r); | |
7ec4d843 | 91 | |
92 | ||
93 | if (fUseSecondaryMap) { | |
94 | TH2D* bg = fcm.GetSecondaryMap()->GetCorrection(d,r,uvb); | |
95 | if (!bg) { | |
96 | AliWarning(Form("No secondary correction for FMDM%d%c in vertex bin %d", | |
97 | d, r, uvb)); | |
98 | continue; | |
99 | } | |
100 | // Divide by primary/total ratio | |
101 | h->Divide(bg); | |
886dd429 | 102 | } |
7ec4d843 | 103 | if (fUseVertexBias) { |
104 | TH2D* ef = fcm.GetVertexBias()->GetCorrection(r, uvb); | |
e58000b7 | 105 | if (!ef) { |
7ec4d843 | 106 | AliWarning(Form("No event vertex bias correction in vertex bin %d", |
886dd429 | 107 | uvb)); |
7ec4d843 | 108 | continue; |
109 | } | |
110 | // Divide by the event selection efficiency | |
111 | h->Divide(ef); | |
886dd429 | 112 | } |
886dd429 | 113 | } |
114 | } | |
115 | ||
116 | return kTRUE; | |
117 | } | |
118 | ||
119 | //____________________________________________________________________ | |
120 | void | |
72cc12cd | 121 | AliFMDMCCorrector::Init(const TAxis& eAxis) |
886dd429 | 122 | { |
7984e5f7 | 123 | // |
124 | // Initialize this object | |
125 | // | |
126 | // Parameters: | |
127 | // etaAxis Eta axis to use | |
128 | // | |
7ec4d843 | 129 | AliFMDCorrector::Init(eAxis); |
130 | ||
886dd429 | 131 | fFMD1i = Make(1,'I',eAxis); |
132 | fFMD2i = Make(2,'I',eAxis); | |
133 | fFMD2o = Make(2,'O',eAxis); | |
134 | fFMD3i = Make(3,'I',eAxis); | |
135 | fFMD3o = Make(3,'O',eAxis); | |
136 | ||
137 | fComps->Add(fFMD1i); | |
138 | fComps->Add(fFMD2i); | |
139 | fComps->Add(fFMD2o); | |
140 | fComps->Add(fFMD3i); | |
141 | fComps->Add(fFMD3o); | |
142 | } | |
143 | ||
144 | //____________________________________________________________________ | |
145 | TProfile2D* | |
72cc12cd | 146 | AliFMDMCCorrector::Make(UShort_t d, Char_t r, |
886dd429 | 147 | const TAxis& axis) const |
148 | { | |
7984e5f7 | 149 | // |
150 | // MAke comparison profiles | |
151 | // | |
152 | // Parameters: | |
153 | // d Detector | |
154 | // r Ring | |
155 | // axis Eta axis | |
156 | // | |
157 | // Return: | |
158 | // Newly allocated profile object | |
159 | // | |
886dd429 | 160 | TProfile2D* ret = new TProfile2D(Form("FMD%d%c_esd_vs_mc", d, r), |
161 | Form("ESD/MC signal for FMD%d%c", d, r), | |
162 | axis.GetNbins(), | |
163 | axis.GetXmin(), | |
164 | axis.GetXmax(), | |
165 | (r == 'I' || r == 'i') ? 20 : 40, | |
166 | 0, 2*TMath::Pi()); | |
167 | ret->GetXaxis()->SetTitle("#eta"); | |
168 | ret->GetYaxis()->SetTitle("#varphi [degrees]"); | |
169 | ret->GetZaxis()->SetTitle("#LT primary density ESD/MC#GT"); | |
170 | ret->SetDirectory(0); | |
171 | return ret; | |
172 | } | |
173 | //____________________________________________________________________ | |
174 | void | |
72cc12cd | 175 | AliFMDMCCorrector::Fill(UShort_t d, Char_t r, TH2* esd, TH2* mc) |
886dd429 | 176 | { |
7984e5f7 | 177 | // |
178 | // Fill comparison profiles | |
179 | // | |
180 | // Parameters: | |
181 | // d Detector | |
182 | // r Ring | |
183 | // esd ESD histogram | |
184 | // mc MC histogram | |
185 | // | |
886dd429 | 186 | if (!esd || !mc) return; |
187 | TProfile2D* p = 0; | |
188 | switch (d) { | |
189 | case 1: p = fFMD1i; break; | |
190 | case 2: p = (r == 'I' || r == 'i' ? fFMD2i : fFMD2o); break; | |
191 | case 3: p = (r == 'I' || r == 'i' ? fFMD3i : fFMD3o); break; | |
192 | } | |
193 | if (!p) return; | |
194 | ||
195 | for (Int_t iEta = 1; iEta <= esd->GetNbinsX(); iEta++) { | |
196 | Double_t eta = esd->GetXaxis()->GetBinCenter(iEta); | |
197 | for (Int_t iPhi = 1; iPhi <= esd->GetNbinsY(); iPhi++) { | |
198 | Double_t phi = esd->GetYaxis()->GetBinCenter(iPhi); | |
199 | Double_t mEsd = esd->GetBinContent(iEta,iPhi); | |
200 | Double_t mMc = mc->GetBinContent(iEta,iPhi); | |
201 | ||
202 | p->Fill(eta, phi, (mMc > 0 ? mEsd / mMc : 0)); | |
203 | } | |
204 | } | |
205 | } | |
206 | ||
207 | //____________________________________________________________________ | |
208 | Bool_t | |
72cc12cd | 209 | AliFMDMCCorrector::CompareResults(AliForwardUtil::Histos& esd, |
886dd429 | 210 | AliForwardUtil::Histos& mc) |
211 | { | |
7984e5f7 | 212 | // |
213 | // Compare the result of analysing the ESD for | |
214 | // the inclusive charged particle density to analysing | |
215 | // MC truth | |
216 | // | |
217 | // Parameters: | |
218 | // esd | |
219 | // mc | |
220 | // | |
221 | // Return: | |
222 | // true | |
223 | // | |
886dd429 | 224 | Fill(1, 'I', esd.Get(1,'I'), mc.Get(1,'I')); |
225 | Fill(2, 'I', esd.Get(2,'I'), mc.Get(2,'I')); | |
226 | Fill(2, 'O', esd.Get(2,'O'), mc.Get(2,'O')); | |
227 | Fill(3, 'I', esd.Get(3,'I'), mc.Get(3,'I')); | |
228 | Fill(3, 'O', esd.Get(3,'O'), mc.Get(3,'O')); | |
229 | ||
230 | return kTRUE; | |
231 | } | |
232 | ||
233 | //____________________________________________________________________ | |
234 | void | |
72cc12cd | 235 | AliFMDMCCorrector::DefineOutput(TList* dir) |
886dd429 | 236 | { |
7984e5f7 | 237 | // |
238 | // Output diagnostic histograms to directory | |
239 | // | |
240 | // Parameters: | |
241 | // dir List to write in | |
242 | // | |
72cc12cd | 243 | AliFMDCorrector::DefineOutput(dir); |
886dd429 | 244 | TList* d = static_cast<TList*>(dir->FindObject(GetName())); |
245 | ||
246 | fComps = new TList; | |
247 | fComps->SetName("esd_mc_comparison"); | |
248 | d->Add(fComps); | |
249 | } | |
250 | ||
251 | //____________________________________________________________________ | |
252 | // | |
253 | // EOF | |
254 | // | |
255 | ||
256 | ||
257 |