]>
Commit | Line | Data |
---|---|---|
3bb122c7 | 1 | |
2 | #include <TROOT.h> | |
3 | #include <TSystem.h> | |
4 | #include <TInterpreter.h> | |
5 | #include <TChain.h> | |
6 | #include <TFile.h> | |
7 | #include <TList.h> | |
8 | #include <iostream> | |
9 | #include "TH2F.h" | |
10 | #include "AliFMDAnalysisTaskBackgroundCorrection.h" | |
11 | #include "AliAnalysisManager.h" | |
12 | #include "AliESDFMD.h" | |
13 | #include "AliESDEvent.h" | |
14 | #include "AliAODEvent.h" | |
15 | #include "AliAODHandler.h" | |
16 | #include "AliMCEventHandler.h" | |
17 | #include "AliStack.h" | |
7c3e5162 | 18 | #include "AliLog.h" |
3bb122c7 | 19 | #include "AliESDVertex.h" |
20 | #include "TMath.h" | |
21 | #include "AliFMDAnaParameters.h" | |
04f1ff3d | 22 | #include "AliESDInputHandler.h" |
23 | #include "AliMultiplicity.h" | |
ff293341 | 24 | #include "TProfile2D.h" |
78f6f750 | 25 | //#include "AliFMDGeometry.h" |
3bb122c7 | 26 | |
27 | ClassImp(AliFMDAnalysisTaskBackgroundCorrection) | |
28 | ||
29 | ||
30 | AliFMDAnalysisTaskBackgroundCorrection::AliFMDAnalysisTaskBackgroundCorrection() | |
31 | : fDebug(0), | |
3bb122c7 | 32 | fOutputList(0), |
7c3e5162 | 33 | fInputList(0), |
cc066cb9 | 34 | fHitList(0), |
c78bc12b | 35 | fVertexString(0x0), |
7c3e5162 | 36 | fNevents(), |
37 | fStandalone(kTRUE), | |
38 | fOutputVertexString(0) | |
3bb122c7 | 39 | { |
40 | // Default constructor | |
41 | DefineInput (0, TList::Class()); | |
8dc7c4c2 | 42 | DefineOutput(0, TList::Class()); |
9f55be54 | 43 | |
3bb122c7 | 44 | } |
8dc823cc | 45 | //_____________________________________________________________________ |
7c3e5162 | 46 | AliFMDAnalysisTaskBackgroundCorrection::AliFMDAnalysisTaskBackgroundCorrection(const char* name, Bool_t SE): |
3bb122c7 | 47 | AliAnalysisTask(name, "Density"), |
48 | fDebug(0), | |
7c3e5162 | 49 | fOutputList(0), |
50 | fInputList(0), | |
cc066cb9 | 51 | fHitList(0), |
c78bc12b | 52 | fVertexString(0x0), |
7c3e5162 | 53 | fNevents(), |
54 | fStandalone(kTRUE), | |
55 | fOutputVertexString(0) | |
3bb122c7 | 56 | { |
7c3e5162 | 57 | fStandalone = SE; |
58 | if(fStandalone) { | |
59 | DefineInput (0, TList::Class()); | |
60 | DefineOutput(0, TList::Class()); | |
7c3e5162 | 61 | } |
3bb122c7 | 62 | } |
8dc823cc | 63 | //_____________________________________________________________________ |
3bb122c7 | 64 | void AliFMDAnalysisTaskBackgroundCorrection::CreateOutputObjects() |
65 | { | |
66 | AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); | |
3bb122c7 | 67 | |
7c3e5162 | 68 | if(!fOutputList) |
69 | fOutputList = new TList(); | |
70 | fOutputList->SetName("BackgroundCorrectedPerEvent"); | |
cc066cb9 | 71 | if(!fHitList) |
72 | fHitList = new TList(); | |
73 | fHitList->SetName("HitsList"); | |
7c3e5162 | 74 | |
9f55be54 | 75 | //if(fStandalone) { |
76 | fOutputVertexString = new TObjString(); | |
77 | // } | |
78 | fOutputList->Add(fOutputVertexString); | |
79 | ||
80 | ||
7c3e5162 | 81 | |
3bb122c7 | 82 | TH2F* hMult = 0; |
6c63da78 | 83 | TH2F* hMultTrVtx = 0; |
bb8a464f | 84 | TH2F* hHits = 0; |
04f1ff3d | 85 | TH2F* hSPDMult = 0; |
86 | TH2F* hSPDMultTrVtx = 0; | |
ae26bdd7 | 87 | // TH2F* hHitsNoCuts = 0; |
3bb122c7 | 88 | Int_t nVtxbins = pars->GetNvtxBins(); |
04f1ff3d | 89 | for(Int_t i = 0; i< nVtxbins; i++) { |
90 | for(Int_t det =1; det<=3;det++) | |
91 | { | |
92 | Int_t nRings = (det==1 ? 1 : 2); | |
93 | for(Int_t ring = 0;ring<nRings;ring++) | |
94 | { | |
95 | Char_t ringChar = (ring == 0 ? 'I' : 'O'); | |
96 | Int_t nSec = (ring == 0 ? 20 : 40); | |
97 | ||
98 | ||
3bb122c7 | 99 | TH2F* hBg = pars->GetBackgroundCorrection(det, ringChar, i); |
100 | hMult = new TH2F(Form("mult_FMD%d%c_vtxbin%d",det,ringChar,i),Form("mult_FMD%d%c_vtxbin%d",det,ringChar,i), | |
101 | hBg->GetNbinsX(), | |
102 | hBg->GetXaxis()->GetXmin(), | |
103 | hBg->GetXaxis()->GetXmax(), | |
104 | nSec, 0, 2*TMath::Pi()); | |
8dc823cc | 105 | hMult->Sumw2(); |
7c3e5162 | 106 | fOutputList->Add(hMult); |
6c63da78 | 107 | hMultTrVtx = new TH2F(Form("multTrVtx_FMD%d%c_vtxbin%d",det,ringChar,i),Form("mult_FMD%d%c_vtxbin%d",det,ringChar,i), |
108 | hBg->GetNbinsX(), | |
109 | hBg->GetXaxis()->GetXmin(), | |
110 | hBg->GetXaxis()->GetXmax(), | |
111 | nSec, 0, 2*TMath::Pi()); | |
112 | hMultTrVtx->Sumw2(); | |
113 | ||
114 | fOutputList->Add(hMultTrVtx); | |
bb8a464f | 115 | hHits = new TH2F(Form("hits_FMD%d%c_vtxbin%d",det,ringChar,i),Form("hits_FMD%d%c_vtxbin%d",det,ringChar,i), |
116 | hBg->GetNbinsX(), | |
117 | hBg->GetXaxis()->GetXmin(), | |
118 | hBg->GetXaxis()->GetXmax(), | |
119 | nSec, 0, 2*TMath::Pi()); | |
120 | ||
0a2f2742 | 121 | /* hHitsNoCuts = new TH2F(Form("hits_NoCuts_FMD%d%c_vtxbin%d",det,ringChar,i),Form("hits_NoCuts_FMD%d%c_vtxbin%d",det,ringChar,i), |
122 | hBg->GetNbinsX(), | |
123 | hBg->GetXaxis()->GetXmin(), | |
124 | hBg->GetXaxis()->GetXmax(), | |
125 | nSec, 0, 2*TMath::Pi()); | |
126 | ||
127 | */ | |
bb8a464f | 128 | hHits->Sumw2(); |
cc066cb9 | 129 | fHitList->Add(hHits); |
04f1ff3d | 130 | |
3bb122c7 | 131 | } |
04f1ff3d | 132 | } |
133 | //HHD SPD hists | |
134 | TH2F* hBg = pars->GetBackgroundCorrection(1, 'I', i); | |
135 | hSPDMult = new TH2F(Form("mult_SPD_vtxbin%d",i),Form("mult_SPD_vtxbin%d",i), | |
136 | hBg->GetNbinsX(), | |
137 | hBg->GetXaxis()->GetXmin(), | |
138 | hBg->GetXaxis()->GetXmax(), | |
139 | 20, 0, 2*TMath::Pi()); | |
140 | hSPDMult->Sumw2(); | |
141 | fOutputList->Add(hSPDMult); | |
142 | hSPDMultTrVtx = new TH2F(Form("multTrVtx_SPD_vtxbin%d",i),Form("multTrVtx_SPD_vtxbin%d",i), | |
143 | hBg->GetNbinsX(), | |
144 | hBg->GetXaxis()->GetXmin(), | |
145 | hBg->GetXaxis()->GetXmax(), | |
146 | 20, 0, 2*TMath::Pi()); | |
147 | hSPDMultTrVtx->Sumw2(); | |
148 | fOutputList->Add(hSPDMultTrVtx); | |
149 | ||
150 | } | |
a99f398f | 151 | TH2F* hBg = pars->GetBackgroundCorrection(1, 'I', 5); |
152 | TH2F* dNdetadphiHistogram = new TH2F("dNdetadphiHistogramTrVtx","dNdetadphiHistogramTrVtx;#eta;#Phi",pars->GetNetaBins(),hBg->GetXaxis()->GetXmin(),hBg->GetXaxis()->GetXmax(),20,0,2*TMath::Pi()); | |
153 | TH2F* dNdetadphiHistogramSPD = new TH2F("dNdetadphiHistogramSPDTrVtx","dNdetadphiHistogramSPDTrVtx;#eta;#Phi",pars->GetNetaBins(),hBg->GetXaxis()->GetXmin(),hBg->GetXaxis()->GetXmax(),20,0,2*TMath::Pi()); | |
ff293341 | 154 | //dNdetadphiHistogram->SetErrorOption("g"); |
155 | ||
156 | fHitList->Add(dNdetadphiHistogram); | |
b4387910 | 157 | fOutputList->Add(dNdetadphiHistogram); |
2f323ab5 | 158 | fHitList->Add(dNdetadphiHistogramSPD); |
159 | fOutputList->Add(dNdetadphiHistogramSPD); | |
3bb122c7 | 160 | |
bb8a464f | 161 | |
3bb122c7 | 162 | } |
8dc823cc | 163 | //_____________________________________________________________________ |
3bb122c7 | 164 | void AliFMDAnalysisTaskBackgroundCorrection::ConnectInputData(Option_t */*option*/) |
165 | { | |
7c3e5162 | 166 | if(fStandalone) { |
167 | fInputList = (TList*)GetInputData(0); | |
168 | ||
169 | } | |
3bb122c7 | 170 | } |
8dc823cc | 171 | //_____________________________________________________________________ |
3bb122c7 | 172 | void AliFMDAnalysisTaskBackgroundCorrection::Exec(Option_t */*option*/) |
173 | { | |
174 | AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); | |
175 | ||
9f55be54 | 176 | fVertexString = (TObjString*)fInputList->At(0); |
177 | ||
8dc823cc | 178 | Int_t vtxbin = fVertexString->GetString().Atoi(); |
7c3e5162 | 179 | fOutputVertexString->SetString(Form("%d",vtxbin)); |
8dc7c4c2 | 180 | |
875e75b6 | 181 | fNevents.Fill(vtxbin); |
7c3e5162 | 182 | //Reset everything |
183 | for(UShort_t det=1;det<=3;det++) { | |
7c3e5162 | 184 | Int_t nRings = (det==1 ? 1 : 2); |
185 | for (UShort_t ir = 0; ir < nRings; ir++) { | |
9f55be54 | 186 | Char_t ringChar = (ir == 0 ? 'I' : 'O'); |
187 | TH2F* hMult = (TH2F*)fOutputList->FindObject(Form("mult_FMD%d%c_vtxbin%d",det,ringChar,vtxbin)); | |
7c3e5162 | 188 | hMult->Reset(); |
6c63da78 | 189 | TH2F* hMultTrVtx = (TH2F*)fOutputList->FindObject(Form("multTrVtx_FMD%d%c_vtxbin%d",det,ringChar,vtxbin)); |
190 | hMultTrVtx->Reset(); | |
04f1ff3d | 191 | |
192 | TH2F* hSPDMult = (TH2F*)fOutputList->FindObject(Form("mult_SPD_vtxbin%d",vtxbin)); | |
193 | hSPDMult->Reset(); | |
194 | TH2F* hSPDMultTrVtx = (TH2F*)fOutputList->FindObject(Form("multTrVtx_SPD_vtxbin%d",vtxbin)); | |
7d51350c | 195 | hSPDMultTrVtx->Reset(); |
7c3e5162 | 196 | } |
197 | ||
198 | } | |
199 | ||
200 | ||
201 | ||
3bb122c7 | 202 | for(UShort_t det=1;det<=3;det++) { |
6c63da78 | 203 | |
3bb122c7 | 204 | Int_t nRings = (det==1 ? 1 : 2); |
205 | for (UShort_t ir = 0; ir < nRings; ir++) { | |
206 | Char_t ringChar = (ir == 0 ? 'I' : 'O'); | |
6c63da78 | 207 | |
208 | TH2F* hMult = (TH2F*)fOutputList->FindObject(Form("mult_FMD%d%c_vtxbin%d",det,ringChar,vtxbin)); | |
209 | TH2F* hMultTrVtx = (TH2F*)fOutputList->FindObject(Form("multTrVtx_FMD%d%c_vtxbin%d",det,ringChar,vtxbin)); | |
9f55be54 | 210 | TH2F* hMultInput = (TH2F*)fInputList->FindObject(Form("FMD%d%c_vtxbin%d",det,ringChar,vtxbin)); |
5c7816c0 | 211 | TH2F* hHits = (TH2F*)fHitList->FindObject(Form("hits_FMD%d%c_vtxbin%d",det,ringChar,vtxbin)); |
bb8a464f | 212 | |
5c7816c0 | 213 | //if(pars->GetProcessHits()) |
214 | hHits->Add(hMultInput); | |
55cadbf9 | 215 | |
8dc823cc | 216 | TH2F* hBg = pars->GetBackgroundCorrection(det, ringChar, vtxbin); |
7c3e5162 | 217 | |
6c63da78 | 218 | hMult->Add(hMultInput); |
219 | hMultTrVtx->Add(hMultInput); | |
220 | hMult->Divide(hBg);//,"B"); | |
221 | hMultTrVtx->Divide(hBg);//,"B"); | |
222 | ||
223 | //sharing efficiency correction ? | |
70d74659 | 224 | if(pars->SharingEffPresent()) { |
ab3e0abc | 225 | TH1F* hSharingEff = pars->GetSharingEfficiencyTrVtx(det,ringChar,vtxbin); |
70d74659 | 226 | TH1F* hSharingEffTrVtx = pars->GetSharingEfficiencyTrVtx(det,ringChar,vtxbin); |
bb8a464f | 227 | |
70d74659 | 228 | for(Int_t nx=1; nx<hMult->GetNbinsX(); nx++) { |
229 | Float_t correction = hSharingEff->GetBinContent(nx); | |
230 | Float_t correctionTrVtx = hSharingEffTrVtx->GetBinContent(nx); | |
ab3e0abc | 231 | |
70d74659 | 232 | for(Int_t ny=1; ny<hMult->GetNbinsY(); ny++) { |
233 | ||
234 | if(correction != 0){ | |
235 | hMult->SetBinContent(nx,ny,hMult->GetBinContent(nx,ny)/correction); | |
236 | Float_t error = TMath::Sqrt(TMath::Power(hMult->GetBinError(nx,ny),2) + TMath::Power(hMult->GetBinContent(nx,ny)*hSharingEff->GetBinError(nx),2)) / correction; | |
237 | hMult->SetBinError(nx,ny,error); | |
238 | } | |
239 | if(correctionTrVtx != 0){ | |
240 | hMultTrVtx->SetBinContent(nx,ny,hMultTrVtx->GetBinContent(nx,ny)/correctionTrVtx); | |
241 | Float_t error = TMath::Sqrt(TMath::Power(hMultTrVtx->GetBinError(nx,ny),2) + TMath::Power(hMultTrVtx->GetBinContent(nx,ny)*hSharingEffTrVtx->GetBinError(nx),2)) / correctionTrVtx; | |
242 | hMultTrVtx->SetBinError(nx,ny,error); | |
243 | } | |
6c63da78 | 244 | } |
70d74659 | 245 | |
6c63da78 | 246 | } |
6c63da78 | 247 | } |
ab3e0abc | 248 | |
249 | //if(pars->GetEventSelectionEfficiency(vtxbin) > 0) | |
250 | // hMult->Scale(1/pars->GetEventSelectionEfficiency(vtxbin)); | |
251 | //else | |
252 | //hMult->Scale(0); | |
253 | hMult->Divide(pars->GetEventSelectionEfficiency(vtxbin,ringChar)); | |
254 | ||
6c63da78 | 255 | |
70d74659 | 256 | } |
04f1ff3d | 257 | } |
258 | ||
259 | //HHD SPD code | |
260 | ||
261 | TH2F* hSPDMult = (TH2F*)fOutputList->FindObject(Form("mult_SPD_vtxbin%d",vtxbin)); | |
262 | TH2F* hSPDMultTrVtx = (TH2F*)fOutputList->FindObject(Form("multTrVtx_SPD_vtxbin%d",vtxbin)); | |
263 | ||
264 | AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); | |
265 | AliESDEvent* esd = esdH->GetEvent(); | |
266 | const AliMultiplicity* spdmult = esd->GetMultiplicity(); | |
267 | for(Int_t j = 0; j< spdmult->GetNumberOfTracklets();j++) { | |
268 | hSPDMult->Fill(spdmult->GetEta(j),spdmult->GetPhi(j)); | |
269 | hSPDMultTrVtx->Fill(spdmult->GetEta(j),spdmult->GetPhi(j)); | |
270 | } | |
271 | for(Int_t j = 0; j< spdmult->GetNumberOfSingleClusters();j++) { | |
272 | hSPDMult->Fill(-TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.)),spdmult->GetPhiSingle(j)); | |
273 | hSPDMultTrVtx->Fill(-TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.)),spdmult->GetPhiSingle(j)); | |
70d74659 | 274 | |
04f1ff3d | 275 | } |
276 | ||
277 | TH2F* hBgSPD = pars->GetBackgroundCorrection(0, 'Q', vtxbin); | |
278 | if(hBgSPD) { | |
279 | TH1F* hDead = pars->GetSPDDeadCorrection(vtxbin); | |
280 | for(Int_t i=1; i<=hSPDMult->GetNbinsX(); i++) { | |
281 | for(Int_t j=1; j<=hSPDMult->GetNbinsY(); j++) { | |
282 | Float_t mult = hSPDMult->GetBinContent(i,j); | |
283 | Float_t correction = hBgSPD->GetBinContent(i,j); | |
284 | Float_t correctedMult = 0; | |
285 | Float_t correctedError = 0; | |
286 | if(correction > 0 && mult > 0) { | |
287 | correctedMult = mult/correction; | |
288 | if(hDead->GetBinContent(i) > 0) | |
289 | correctedMult = correctedMult/hDead->GetBinContent(i); | |
290 | correctedError = correctedMult*TMath::Sqrt( TMath::Power(hSPDMult->GetBinError(i,j)/hSPDMult->GetBinContent(i,j),2) + | |
291 | TMath::Power(hBgSPD->GetBinError(i,j)/hBgSPD->GetBinContent(i,j),2)); | |
292 | ||
293 | } | |
294 | ||
295 | if(correctedMult != 0) { | |
296 | hSPDMult->SetBinContent(i,j,correctedMult); | |
297 | hSPDMultTrVtx->SetBinContent(i,j,correctedMult); | |
298 | hSPDMult->SetBinError(i,j,correctedError); | |
299 | hSPDMultTrVtx->SetBinError(i,j,correctedError); | |
300 | } | |
301 | } | |
302 | } | |
ab3e0abc | 303 | hSPDMult->Divide(pars->GetEventSelectionEfficiency(vtxbin,'I')); |
04f1ff3d | 304 | |
ab3e0abc | 305 | //if(pars->GetEventSelectionEfficiency(vtxbin) > 0) |
daedf077 | 306 | // hSPDMult->Scale(1/pars->GetEventSelectionEfficiency(vtxbin)); |
307 | //else | |
ab3e0abc | 308 | // hSPDMult->Scale(0); |
04f1ff3d | 309 | |
310 | } | |
311 | else | |
312 | AliWarning("No SPD background map found"); | |
313 | ||
314 | //std::cout<<spdmult->GetNumberOfTracklets()<<" "<<spdmult->GetNumberOfITSClusters(0)<<" "<< spdmult->GetNumberOfSingleClusters()<<std::endl; | |
ff293341 | 315 | |
316 | CreatePerEventHistogram(vtxbin); | |
317 | ||
7c3e5162 | 318 | if(fStandalone) { |
319 | PostData(0, fOutputList); | |
7c3e5162 | 320 | } |
3bb122c7 | 321 | |
322 | } | |
8dc823cc | 323 | //_____________________________________________________________________ |
324 | void AliFMDAnalysisTaskBackgroundCorrection::Terminate(Option_t */*option*/) { | |
18d4b9ae | 325 | AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); |
8dc823cc | 326 | |
18d4b9ae | 327 | Int_t nVtxbins = pars->GetNvtxBins(); |
8dc823cc | 328 | |
18d4b9ae | 329 | for(UShort_t det=1;det<=3;det++) { |
330 | Int_t nRings = (det==1 ? 1 : 2); | |
331 | for (UShort_t ir = 0; ir < nRings; ir++) { | |
332 | Char_t ringChar = (ir == 0 ? 'I' : 'O'); | |
333 | for(Int_t i =0; i<nVtxbins; i++) { | |
5c7816c0 | 334 | TH2F* hHits = (TH2F*)fHitList->FindObject(Form("hits_FMD%d%c_vtxbin%d",det,ringChar,i)); |
18d4b9ae | 335 | TH1D* hHitsproj = hHits->ProjectionX(Form("hits_FMD%d%c_vtxbin%d_proj",det,ringChar,i),1,hHits->GetNbinsY()); |
0a2f2742 | 336 | TH1D* hHitsNoCuts = (TH1D*)hHitsproj->Clone(Form("hits_NoCuts_FMD%d%c_vtxbin%d_proj",det,ringChar,i)); |
70d74659 | 337 | if(pars->GetEventSelectionEfficiency(i) > 0) |
338 | hHitsNoCuts->Scale(1/pars->GetEventSelectionEfficiency(i)); | |
339 | else | |
340 | hHitsNoCuts->Scale(0); | |
18d4b9ae | 341 | fHitList->Add(hHitsproj); |
0a2f2742 | 342 | fHitList->Add(hHitsNoCuts); |
18d4b9ae | 343 | |
344 | } | |
345 | } | |
346 | } | |
8dc823cc | 347 | } |
ff293341 | 348 | |
349 | //_____________________________________________________________________ | |
350 | void AliFMDAnalysisTaskBackgroundCorrection::CreatePerEventHistogram(Int_t vtxbin) { | |
351 | ||
352 | AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); | |
353 | TH2F* dNdetadphiHistogram = (TH2F*)fHitList->FindObject("dNdetadphiHistogramTrVtx"); | |
2f323ab5 | 354 | TH2F* dNdetadphiHistogramSPD = (TH2F*)fHitList->FindObject("dNdetadphiHistogramSPDTrVtx"); |
355 | ||
ff293341 | 356 | dNdetadphiHistogram->Reset(); |
2f323ab5 | 357 | dNdetadphiHistogramSPD->Reset(); |
ff293341 | 358 | |
2f323ab5 | 359 | for(Int_t det = 0; det<=3; det++) { |
360 | Int_t maxRing = (det<= 1 ? 0 : 1); | |
361 | ||
362 | ||
363 | ||
ff293341 | 364 | for(Int_t ring = 0;ring<=maxRing;ring++) { |
365 | ||
366 | Char_t ringChar = (ring == 0 ? 'I' : 'O'); | |
367 | ||
2f323ab5 | 368 | TH2F* multhistoriginal = 0; |
369 | ||
370 | if(det == 0) | |
371 | multhistoriginal = (TH2F*)fOutputList->FindObject(Form("multTrVtx_SPD_vtxbin%d",vtxbin)); | |
372 | else | |
373 | multhistoriginal = (TH2F*)fOutputList->FindObject(Form("multTrVtx_FMD%d%c_vtxbin%d",det,ringChar,vtxbin)); | |
374 | ||
ff293341 | 375 | TH2F* multhist = (TH2F*)multhistoriginal->Clone("tmp"); |
2f323ab5 | 376 | |
377 | ||
378 | ||
379 | if(ringChar == 'O' && det > 0) | |
ff293341 | 380 | multhist->RebinY(2); |
381 | ||
382 | for(Int_t i=pars->GetFirstEtaBinToInclude(vtxbin,det,ringChar); i<=pars->GetLastEtaBinToInclude(vtxbin,det,ringChar); i++) { | |
383 | for(Int_t j=1; j<=multhist->GetNbinsY(); j++) { | |
384 | if(multhist->GetBinContent(i,j) < 0.0001) continue; | |
385 | ||
2f323ab5 | 386 | Bool_t overlapFMD = kFALSE; |
387 | Bool_t overlapSPD = kFALSE; | |
388 | ||
ff293341 | 389 | if(det == 1 && ringChar =='I') |
390 | if(i<=pars->GetLastEtaBinToInclude(vtxbin,2,'I')) | |
2f323ab5 | 391 | overlapFMD = kTRUE; |
ff293341 | 392 | |
2f323ab5 | 393 | if(det == 2 && ringChar =='O') { |
ff293341 | 394 | if(i>=pars->GetFirstEtaBinToInclude(vtxbin,2,'I')) |
2f323ab5 | 395 | overlapFMD = kTRUE; |
396 | if(i<=pars->GetLastEtaBinToInclude(vtxbin,0,'I'))// && TMath::Abs(multhist->GetXaxis()->GetBinCenter(i)) < 2) | |
397 | overlapSPD = kTRUE; | |
398 | } | |
ff293341 | 399 | if(det == 2 && ringChar =='I') |
400 | if(i<=pars->GetLastEtaBinToInclude(vtxbin,2,'O') || i>=pars->GetFirstEtaBinToInclude(vtxbin,1,'I')) | |
2f323ab5 | 401 | overlapFMD = kTRUE; |
ff293341 | 402 | |
403 | if(det == 3 && ringChar =='I') | |
404 | if(i>=pars->GetFirstEtaBinToInclude(vtxbin,3,'O')) | |
2f323ab5 | 405 | overlapFMD = kTRUE; |
ff293341 | 406 | |
2f323ab5 | 407 | if(det == 3 && ringChar =='O') { |
ff293341 | 408 | if(i<=pars->GetLastEtaBinToInclude(vtxbin,3,'I')) |
2f323ab5 | 409 | overlapFMD = kTRUE; |
410 | if(i>=pars->GetFirstEtaBinToInclude(vtxbin,0,'I'))// && TMath::Abs(multhist->GetXaxis()->GetBinCenter(i)) < 2) | |
411 | overlapSPD = kTRUE; | |
412 | } | |
ff293341 | 413 | |
2f323ab5 | 414 | if(det == 0) { |
415 | if(i<=pars->GetLastEtaBinToInclude(vtxbin,3,'O') || i>=pars->GetFirstEtaBinToInclude(vtxbin,2,'O')) | |
416 | overlapSPD = kTRUE; | |
417 | } | |
418 | //std::cout<<overlapFMD<<" "<<overlapSPD<<std::endl; | |
ff293341 | 419 | |
ff293341 | 420 | |
2f323ab5 | 421 | if(det > 0) { |
422 | if(overlapFMD) { | |
423 | dNdetadphiHistogram->SetBinContent(i,j,dNdetadphiHistogram->GetBinContent(i,j)+0.5*multhist->GetBinContent(i,j)); | |
424 | dNdetadphiHistogram->SetBinError(i,j,TMath::Sqrt(TMath::Power(dNdetadphiHistogram->GetBinError(i,j),2)+TMath::Power(0.5*multhist->GetBinError(i,j),2))); | |
425 | } | |
ff293341 | 426 | else { |
427 | dNdetadphiHistogram->SetBinContent(i,j,multhist->GetBinContent(i,j)); | |
428 | dNdetadphiHistogram->SetBinError(i,j,multhist->GetBinError(i,j)); | |
429 | } | |
2f323ab5 | 430 | } |
431 | ||
432 | if( overlapFMD && overlapSPD) { | |
433 | dNdetadphiHistogramSPD->SetBinContent(i,j,dNdetadphiHistogramSPD->GetBinContent(i,j)+0.33*multhist->GetBinContent(i,j)); | |
434 | dNdetadphiHistogramSPD->SetBinError(i,j,TMath::Sqrt(TMath::Power(dNdetadphiHistogramSPD->GetBinError(i,j),2)+TMath::Power(0.33*multhist->GetBinError(i,j),2))); | |
435 | } | |
436 | else if( overlapFMD || overlapSPD) { | |
437 | dNdetadphiHistogramSPD->SetBinContent(i,j,dNdetadphiHistogramSPD->GetBinContent(i,j)+0.5*multhist->GetBinContent(i,j)); | |
438 | dNdetadphiHistogramSPD->SetBinError(i,j,TMath::Sqrt(TMath::Power(dNdetadphiHistogramSPD->GetBinError(i,j),2)+TMath::Power(0.5*multhist->GetBinError(i,j),2))); | |
439 | } | |
440 | else { | |
441 | dNdetadphiHistogramSPD->SetBinContent(i,j,multhist->GetBinContent(i,j)); | |
442 | dNdetadphiHistogramSPD->SetBinError(i,j,multhist->GetBinError(i,j)); | |
443 | } | |
444 | ||
445 | ||
446 | ||
447 | ||
448 | ||
ff293341 | 449 | } |
450 | } | |
451 | delete multhist; | |
452 | } | |
453 | } | |
454 | } | |
8dc823cc | 455 | //_____________________________________________________________________ |
456 | // | |
457 | // | |
458 | // EOF |