]>
Commit | Line | Data |
---|---|---|
ecb38463 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | //------------------------------ | |
17 | // Analysis task for quality-assurance | |
18 | // of VZERO ESD | |
19 | // | |
20 | // 05/12/2009 cvetan.cheshkov@cern.ch | |
21 | //------------------------------ | |
22 | ||
23 | #include "TChain.h" | |
24 | #include "TROOT.h" | |
25 | #include "TFile.h" | |
26 | #include "TH1F.h" | |
27 | #include "TH2F.h" | |
28 | #include "TF1.h" | |
29 | #include "TCanvas.h" | |
30 | #include "AliLog.h" | |
31 | #include "AliESDEvent.h" | |
32 | #include "AliESDVZERO.h" | |
33 | ||
34 | #include "AliAnaVZEROQA.h" | |
35 | ||
36 | ClassImp(AliAnaVZEROQA) | |
37 | ||
38 | AliAnaVZEROQA::AliAnaVZEROQA(): | |
39 | AliAnalysisTaskSE("AliAnaVZEROQA"), | |
40 | fListOfHistos(0), | |
41 | ||
42 | fhAdcNoTimeA(0), | |
43 | fhAdcWithTimeA(0), | |
44 | fhAdcNoTimeC(0), | |
45 | fhAdcWithTimeC(0), | |
46 | ||
47 | fhAdcPMTNoTime(0), | |
48 | fhAdcPMTWithTime(0), | |
49 | ||
50 | fhTimeA(0), | |
51 | fhTimeC(0), | |
52 | ||
53 | fhWidthA(0), | |
54 | fhWidthC(0), | |
55 | ||
56 | fhTimePMT(0), | |
57 | fhWidthPMT(0), | |
58 | ||
59 | fhAdcWidthA(0), | |
60 | fhAdcWidthC(0), | |
61 | ||
62 | fhTimeCorr(0), | |
63 | ||
64 | fhAdcTimeA(0), | |
65 | fhAdcTimeC(0), | |
66 | ||
67 | fV0a(0), | |
68 | fV0c(0), | |
69 | fV0multA(0), | |
70 | fV0multC(0), | |
892effee | 71 | fV0ampl(0), |
72 | ||
73 | fhTimePMTCorr(0), | |
74 | fhEvents(0), | |
75 | ||
76 | fhVtxXYBB(0), | |
77 | fhVtxZBB(0), | |
78 | fhVtxXYBGA(0), | |
79 | fhVtxZBGA(0), | |
80 | fhVtxXYBGC(0), | |
81 | fhVtxZBGC(0) | |
ecb38463 | 82 | { |
83 | // Default constructor | |
84 | // Define input and output slots here | |
85 | // Input slot #0 works with a TChain | |
86 | DefineInput(0, TChain::Class()); | |
87 | // Output slot #1 TList | |
88 | DefineOutput(1, TList::Class()); | |
89 | } | |
90 | ||
91 | AliAnaVZEROQA::AliAnaVZEROQA(const char* name): | |
92 | AliAnalysisTaskSE(name), | |
93 | fListOfHistos(0), | |
94 | fhAdcNoTimeA(0), | |
95 | fhAdcWithTimeA(0), | |
96 | fhAdcNoTimeC(0), | |
97 | fhAdcWithTimeC(0), | |
98 | ||
99 | fhAdcPMTNoTime(0), | |
100 | fhAdcPMTWithTime(0), | |
101 | ||
102 | fhTimeA(0), | |
103 | fhTimeC(0), | |
104 | ||
105 | fhWidthA(0), | |
106 | fhWidthC(0), | |
107 | ||
108 | fhTimePMT(0), | |
109 | fhWidthPMT(0), | |
110 | ||
111 | fhAdcWidthA(0), | |
112 | fhAdcWidthC(0), | |
113 | ||
114 | fhTimeCorr(0), | |
115 | ||
116 | fhAdcTimeA(0), | |
117 | fhAdcTimeC(0), | |
118 | ||
119 | fV0a(0), | |
120 | fV0c(0), | |
121 | fV0multA(0), | |
122 | fV0multC(0), | |
892effee | 123 | fV0ampl(0), |
124 | ||
125 | fhTimePMTCorr(0), | |
126 | fhEvents(0), | |
127 | ||
128 | fhVtxXYBB(0), | |
129 | fhVtxZBB(0), | |
130 | fhVtxXYBGA(0), | |
131 | fhVtxZBGA(0), | |
132 | fhVtxXYBGC(0), | |
133 | fhVtxZBGC(0) | |
ecb38463 | 134 | { |
135 | // Constructor | |
136 | AliInfo("Constructor AliAnaVZEROQA"); | |
137 | // Define input and output slots here | |
138 | // Input slot #0 works with a TChain | |
139 | DefineInput(0, TChain::Class()); | |
140 | // Output slot #1 TList | |
141 | DefineOutput(1, TList::Class()); | |
142 | } | |
143 | ||
144 | TH1F * AliAnaVZEROQA::CreateHisto1D(const char* name, const char* title,Int_t nBins, | |
145 | Double_t xMin, Double_t xMax, | |
146 | const char* xLabel, const char* yLabel) | |
147 | { | |
148 | // create a histogram | |
149 | TH1F* result = new TH1F(name, title, nBins, xMin, xMax); | |
150 | result->SetOption("E"); | |
151 | if (xLabel) result->GetXaxis()->SetTitle(xLabel); | |
152 | if (yLabel) result->GetYaxis()->SetTitle(yLabel); | |
153 | result->SetMarkerStyle(kFullCircle); | |
154 | return result; | |
155 | } | |
156 | ||
157 | TH2F * AliAnaVZEROQA::CreateHisto2D(const char* name, const char* title,Int_t nBinsX, | |
158 | Double_t xMin, Double_t xMax, | |
159 | Int_t nBinsY, | |
160 | Double_t yMin, Double_t yMax, | |
161 | const char* xLabel, const char* yLabel) | |
162 | { | |
163 | // create a histogram | |
164 | TH2F* result = new TH2F(name, title, nBinsX, xMin, xMax, nBinsY, yMin, yMax); | |
165 | if (xLabel) result->GetXaxis()->SetTitle(xLabel); | |
166 | if (yLabel) result->GetYaxis()->SetTitle(yLabel); | |
167 | return result; | |
168 | } | |
169 | ||
170 | void AliAnaVZEROQA::UserCreateOutputObjects() | |
171 | { | |
172 | // Create histograms | |
173 | AliInfo("AliAnaVZEROQA::UserCreateOutputObjects"); | |
174 | // Create output container | |
175 | fListOfHistos = new TList(); | |
176 | ||
177 | fhAdcNoTimeA = CreateHisto1D("hAdcNoTimeA","ADC (no Leading Time) V0A",200,0,200,"ADC charge","Entries"); | |
178 | fhAdcWithTimeA = CreateHisto1D("hAdcWithTimeA","ADC ( with Leading Time) V0A",200,0,200,"ADC charge","Entries"); | |
179 | fhAdcNoTimeC = CreateHisto1D("hAdcNoTimeC","ADC (no Leading Time) V0C",200,0,200,"ADC charge","Entries"); | |
180 | fhAdcWithTimeC = CreateHisto1D("hAdcWithTimeC","ADC ( with Leading Time) V0C",200,0,200,"ADC charge","Entries"); | |
181 | ||
182 | fhAdcPMTNoTime = CreateHisto2D("hadcpmtnotime","ADC vs PMT index (no leading time)",64,-0.5,63.5,200,0,200,"PMT index","ADC charge"); | |
183 | fhAdcPMTWithTime = CreateHisto2D("hadcpmtwithtime","ADC vs PMT index (with leading time)",64,-0.5,63.5,200,0,200,"PMT index","ADC charge"); | |
184 | ||
185 | fhTimeA = CreateHisto1D("htimepmtA","Time measured by TDC V0A",400,-100,100,"Leading time (ns)","Entries"); | |
186 | fhTimeC = CreateHisto1D("htimepmtC","Time measured by TDC V0C",400,-100,100,"Leading time (ns)","Entries"); | |
187 | ||
188 | fhWidthA = CreateHisto1D("hwidthA","Signal width measured by TDC V0A",200,0,100,"Signal width (ns)","Entries"); | |
189 | fhWidthC = CreateHisto1D("hwidthC","Signal width measured by TDC V0C",200,0,100,"Signal width (ns)","Entries"); | |
190 | ||
191 | fhTimePMT = CreateHisto2D("htimepmt","Time measured by TDC vs PMT index",64,-0.5,63.5,200,0,100,"PMT Index","Leading time (ns)"); | |
192 | fhWidthPMT = CreateHisto2D("hwidthpmt","Time width vs PMT index",64,-0.5,63.5,200,0,100,"PMT Index","Signal width (ns)"); | |
193 | ||
194 | fhAdcWidthA = CreateHisto2D("hadcwidthA","Time width vs ADC V0A",200,0,200,200,0,100,"ADC charge","Width (ns)"); | |
195 | fhAdcWidthC = CreateHisto2D("hadcwidthC","Time width vs ADC V0C",200,0,200,200,0,100,"ADC charge","Width (ns)"); | |
196 | ||
197 | fhTimeCorr = CreateHisto2D("htimecorr","Average time C side vs. A side",200,0,100,200,0,100,"Time V0A (ns)","Time V0C (ns"); | |
198 | ||
199 | fhAdcTimeA = CreateHisto2D("hAdcTimeA","ADC vs Time V0A",1000,-100,100,200,0,200,"Time (ns)","ADC charge"); | |
200 | fhAdcTimeC = CreateHisto2D("hAdcTimeC","ADC vs Time V0C",1000,-100,100,200,0,200,"Time (ns)","ADC charge"); | |
201 | ||
202 | fV0a = CreateHisto1D("hV0a","Number of fired PMTs (V0A)",65,-0.5,64.5); | |
203 | fV0c = CreateHisto1D("hV0c","Number of fired PMTs (V0C)",65,-0.5,64.5); | |
204 | fV0multA = CreateHisto1D("hV0multA","Total reconstructed multiplicity (V0A)",100,0.,1000.); | |
205 | fV0multC = CreateHisto1D("hV0multC","Total reconstructed multiplicity (V0C)",100,0.,1000.); | |
206 | fV0ampl = CreateHisto1D("hV0ampl","V0 multiplicity in single channel (all V0 channels)",400,-0.5,99.5); | |
207 | ||
892effee | 208 | fhTimePMTCorr = CreateHisto2D("htimepmtcorr","Time measured by TDC (corrected for slewing, channels aligned) vs PMT index",64,-0.5,63.5,200,0,100,"PMT Index","Leading time (ns)"); |
209 | fhEvents = CreateHisto2D("hEvents","V0C vs V0A (empty,bb,bg)",3,-0.5,2.5,3,-0.5,2.5); | |
210 | ||
211 | fhVtxXYBB = CreateHisto2D("fhVtxXYBB","XY SPD vertex (bb)",200,-2,2,200,-2,2); | |
212 | fhVtxZBB = CreateHisto1D("fhVtxZBB","Z SPD vertex (bb)",400,-50,50); | |
213 | fhVtxXYBGA = CreateHisto2D("fhVtxXYBGA","XY SPD vertex (bga)",200,-2,2,200,-2,2); | |
214 | fhVtxZBGA = CreateHisto1D("fhVtxZBGA","Z SPD vertex (bga)",400,-50,50); | |
215 | fhVtxXYBGC = CreateHisto2D("fhVtxXYBGC","XY SPD vertex (bgc)",200,-2,2,200,-2,2); | |
216 | fhVtxZBGC = CreateHisto1D("fhVtxZBGC","Z SPD vertex (bgc)",400,-50,50); | |
217 | ||
ecb38463 | 218 | fListOfHistos->Add(fhAdcNoTimeA); |
219 | fListOfHistos->Add(fhAdcWithTimeA); | |
220 | fListOfHistos->Add(fhAdcNoTimeC); | |
221 | fListOfHistos->Add(fhAdcWithTimeC); | |
222 | ||
223 | fListOfHistos->Add(fhAdcPMTNoTime); | |
224 | fListOfHistos->Add(fhAdcPMTWithTime); | |
225 | ||
226 | fListOfHistos->Add(fhTimeA); | |
227 | fListOfHistos->Add(fhTimeC); | |
228 | ||
229 | fListOfHistos->Add(fhWidthA); | |
230 | fListOfHistos->Add(fhWidthC); | |
231 | ||
232 | fListOfHistos->Add(fhTimePMT); | |
233 | fListOfHistos->Add(fhWidthPMT); | |
234 | ||
235 | fListOfHistos->Add(fhAdcWidthA); | |
236 | fListOfHistos->Add(fhAdcWidthC); | |
237 | ||
238 | fListOfHistos->Add(fhTimeCorr); | |
239 | ||
240 | fListOfHistos->Add(fhAdcTimeA); | |
241 | fListOfHistos->Add(fhAdcTimeC); | |
242 | ||
243 | fListOfHistos->Add(fV0a); | |
244 | fListOfHistos->Add(fV0c); | |
245 | fListOfHistos->Add(fV0multA); | |
246 | fListOfHistos->Add(fV0multC); | |
247 | fListOfHistos->Add(fV0ampl); | |
892effee | 248 | |
249 | fListOfHistos->Add(fhTimePMTCorr); | |
250 | fListOfHistos->Add(fhEvents); | |
251 | ||
252 | fListOfHistos->Add(fhVtxXYBB); | |
253 | fListOfHistos->Add(fhVtxZBB); | |
254 | fListOfHistos->Add(fhVtxXYBGA); | |
255 | fListOfHistos->Add(fhVtxZBGA); | |
256 | fListOfHistos->Add(fhVtxXYBGC); | |
257 | fListOfHistos->Add(fhVtxZBGC); | |
ecb38463 | 258 | } |
259 | ||
260 | void AliAnaVZEROQA::UserExec(Option_t */*option*/) | |
261 | { | |
262 | AliVEvent* event = InputEvent(); | |
263 | if (!event) { | |
264 | Printf("ERROR: Could not retrieve event"); | |
265 | return; | |
266 | } | |
267 | ||
268 | AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event); | |
269 | AliESDVZERO* esdV0 = esd->GetVZEROData(); | |
270 | ||
271 | Float_t timeA = 0,timeC = 0; | |
272 | Int_t ntimeA = 0, ntimeC = 0; | |
273 | for (Int_t i=0; i<64; ++i) { | |
274 | if (esdV0->GetTime(i) < 1e-6) { | |
275 | if (i >= 32) { | |
276 | fhAdcNoTimeA->Fill(esdV0->GetAdc(i)); | |
277 | } | |
278 | else { | |
279 | fhAdcNoTimeC->Fill(esdV0->GetAdc(i)); | |
280 | } | |
281 | fhAdcPMTNoTime->Fill(i,esdV0->GetAdc(i)); | |
282 | } | |
283 | else { | |
284 | if (i >= 32) { | |
285 | fhAdcWithTimeA->Fill(esdV0->GetAdc(i)); | |
286 | } | |
287 | else { | |
288 | fhAdcWithTimeC->Fill(esdV0->GetAdc(i)); | |
289 | } | |
290 | fhAdcPMTWithTime->Fill(i,esdV0->GetAdc(i)); | |
291 | } | |
292 | ||
293 | if (i >= 32) { | |
294 | fhTimeA->Fill(esdV0->GetTime(i)); | |
295 | fhWidthA->Fill(esdV0->GetWidth(i)); | |
296 | fhAdcWidthA->Fill(esdV0->GetAdc(i),esdV0->GetTime(i)); | |
297 | fhAdcTimeA->Fill(esdV0->GetTime(i),esdV0->GetAdc(i)); | |
298 | } | |
299 | else { | |
300 | fhTimeC->Fill(esdV0->GetTime(i)); | |
301 | fhWidthC->Fill(esdV0->GetWidth(i)); | |
302 | fhAdcWidthC->Fill(esdV0->GetAdc(i),esdV0->GetTime(i)); | |
303 | fhAdcTimeC->Fill(esdV0->GetTime(i),esdV0->GetAdc(i)); | |
304 | } | |
305 | fhTimePMT->Fill(i,esdV0->GetTime(i)); | |
306 | fhWidthPMT->Fill(i,esdV0->GetWidth(i)); | |
307 | ||
892effee | 308 | Float_t correctedTime = CorrectLeadingTime(i,esdV0->GetTime(i),esdV0->GetAdc(i)); |
309 | fhTimePMTCorr->Fill(i,correctedTime); | |
310 | ||
ecb38463 | 311 | if (esdV0->GetTime(i) > 1e-6) { |
312 | if (i >= 32) { | |
892effee | 313 | timeA += correctedTime; |
ecb38463 | 314 | ntimeA++; |
315 | } | |
316 | else { | |
892effee | 317 | timeC += correctedTime; |
ecb38463 | 318 | ntimeC++; |
319 | } | |
320 | } | |
321 | } | |
322 | ||
323 | if (ntimeA > 0) timeA = timeA/ntimeA; | |
324 | if (ntimeC > 0) timeC = timeC/ntimeC; | |
325 | ||
326 | fhTimeCorr->Fill(timeA,timeC); | |
327 | ||
892effee | 328 | Int_t flaga = 0, flagc = 0; |
329 | TString stra("emptyA"),strc("emptyC"); | |
330 | if (timeA > 48 && timeA < 62) { flaga = 1; stra = "BBA"; } | |
331 | if (timeA > 26 && timeA < 33) { flaga = 2; stra = "BGA"; } | |
332 | if (timeC > 49 && timeC < 60) { flagc = 1; strc = "BBC"; } | |
333 | if (timeC > 43 && timeC < 48.5) { flagc = 2; strc = "BGC"; } | |
334 | ||
335 | fhEvents->Fill(flaga,flagc); | |
336 | ||
337 | const AliESDVertex *vtx = esd->GetPrimaryVertexSPD(); | |
338 | ||
339 | if (flaga <= 1 && flagc <=1) { | |
340 | fhVtxXYBB->Fill(vtx->GetXv(),vtx->GetYv()); | |
341 | fhVtxZBB->Fill(vtx->GetZv()); | |
342 | } | |
343 | else { | |
344 | if (flaga == 2) { | |
345 | fhVtxXYBGA->Fill(vtx->GetXv(),vtx->GetYv()); | |
346 | fhVtxZBGA->Fill(vtx->GetZv()); | |
347 | } | |
348 | if (flagc == 2) { | |
349 | fhVtxXYBGC->Fill(vtx->GetXv(),vtx->GetYv()); | |
350 | fhVtxZBGC->Fill(vtx->GetZv()); | |
351 | } | |
352 | } | |
353 | ||
ecb38463 | 354 | fV0a->Fill(esdV0->GetNbPMV0A()); |
355 | fV0c->Fill(esdV0->GetNbPMV0C()); | |
356 | fV0multA->Fill(esdV0->GetMTotV0A()); | |
357 | fV0multC->Fill(esdV0->GetMTotV0C()); | |
358 | for(Int_t i = 0; i < 64; i++) { | |
359 | fV0ampl->Fill(esdV0->GetMultiplicity(i)); | |
360 | } | |
361 | ||
362 | // Post output data. | |
363 | PostData(1, fListOfHistos); | |
364 | } | |
365 | ||
366 | void AliAnaVZEROQA::Terminate(Option_t *) | |
367 | { | |
368 | fListOfHistos = dynamic_cast<TList*>(GetOutputData(1)); | |
369 | if (!fListOfHistos) { | |
370 | Printf("ERROR: fListOfHistos not available"); | |
371 | return; | |
372 | } | |
373 | ||
374 | fhAdcNoTimeA = dynamic_cast<TH1F*>(fListOfHistos->At(0)); | |
375 | fhAdcWithTimeA = dynamic_cast<TH1F*>(fListOfHistos->At(1)); | |
376 | fhAdcNoTimeC = dynamic_cast<TH1F*>(fListOfHistos->At(2)); | |
377 | fhAdcWithTimeC = dynamic_cast<TH1F*>(fListOfHistos->At(3)); | |
378 | ||
379 | fhAdcPMTNoTime = dynamic_cast<TH2F*>(fListOfHistos->At(4)); | |
380 | fhAdcPMTWithTime = dynamic_cast<TH2F*>(fListOfHistos->At(5)); | |
381 | ||
382 | fhTimeA = dynamic_cast<TH1F*>(fListOfHistos->At(6)); | |
383 | fhTimeC = dynamic_cast<TH1F*>(fListOfHistos->At(7)); | |
384 | ||
385 | fhWidthA = dynamic_cast<TH1F*>(fListOfHistos->At(8)); | |
386 | fhWidthC = dynamic_cast<TH1F*>(fListOfHistos->At(9)); | |
387 | ||
388 | fhTimePMT = dynamic_cast<TH2F*>(fListOfHistos->At(10)); | |
389 | fhWidthPMT = dynamic_cast<TH2F*>(fListOfHistos->At(11)); | |
390 | ||
391 | fhAdcWidthA = dynamic_cast<TH2F*>(fListOfHistos->At(12)); | |
392 | fhAdcWidthC = dynamic_cast<TH2F*>(fListOfHistos->At(13)); | |
393 | ||
394 | fhTimeCorr = dynamic_cast<TH2F*>(fListOfHistos->At(14)); | |
395 | ||
396 | fhAdcTimeA = dynamic_cast<TH2F*>(fListOfHistos->At(15)); | |
397 | fhAdcTimeC = dynamic_cast<TH2F*>(fListOfHistos->At(16)); | |
398 | ||
399 | fV0a = dynamic_cast<TH1F*>(fListOfHistos->At(17)); | |
400 | fV0c = dynamic_cast<TH1F*>(fListOfHistos->At(18)); | |
401 | fV0multA = dynamic_cast<TH1F*>(fListOfHistos->At(19)); | |
402 | fV0multC = dynamic_cast<TH1F*>(fListOfHistos->At(20)); | |
403 | fV0ampl = dynamic_cast<TH1F*>(fListOfHistos->At(21)); | |
404 | ||
892effee | 405 | fhTimePMTCorr = dynamic_cast<TH2F*>(fListOfHistos->At(22)); |
406 | fhEvents = dynamic_cast<TH2F*>(fListOfHistos->At(23)); | |
407 | ||
408 | fhVtxXYBB = dynamic_cast<TH2F*>(fListOfHistos->At(24)); | |
409 | fhVtxZBB = dynamic_cast<TH1F*>(fListOfHistos->At(25)); | |
410 | fhVtxXYBGA = dynamic_cast<TH2F*>(fListOfHistos->At(26)); | |
411 | fhVtxZBGA = dynamic_cast<TH1F*>(fListOfHistos->At(27)); | |
412 | fhVtxXYBGC = dynamic_cast<TH2F*>(fListOfHistos->At(28)); | |
413 | fhVtxZBGC = dynamic_cast<TH1F*>(fListOfHistos->At(29)); | |
414 | ||
415 | // draw the histograms if not in batch mode | |
ecb38463 | 416 | if (!gROOT->IsBatch()) { |
417 | new TCanvas; | |
418 | fhTimePMT->DrawCopy(); | |
419 | new TCanvas; | |
420 | fhAdcTimeA->DrawCopy(); | |
421 | new TCanvas; | |
422 | fhAdcTimeC->DrawCopy(); | |
423 | new TCanvas; | |
424 | fhAdcPMTNoTime->DrawCopy(); | |
425 | new TCanvas; | |
426 | fhAdcPMTWithTime->DrawCopy(); | |
427 | new TCanvas; | |
428 | fhTimeCorr->DrawCopy("E"); | |
429 | new TCanvas; | |
430 | fV0ampl->DrawCopy("E"); | |
892effee | 431 | new TCanvas; |
432 | fhTimePMTCorr->DrawCopy("colz"); | |
433 | new TCanvas; | |
434 | fhEvents->DrawCopy("colz"); | |
ecb38463 | 435 | } |
436 | ||
437 | // write the output histograms to a file | |
438 | TFile* outputFile = TFile::Open("VZEROQA.root", "recreate"); | |
439 | if (!outputFile || !outputFile->IsOpen()) | |
440 | { | |
441 | Error("AliAnaVZEROQA", "opening output file VZEROQA.root failed"); | |
442 | return; | |
443 | } | |
444 | ||
445 | fhAdcNoTimeA->Write(); | |
446 | fhAdcWithTimeA->Write(); | |
447 | fhAdcNoTimeC->Write(); | |
448 | fhAdcWithTimeC->Write(); | |
449 | ||
450 | fhAdcPMTNoTime->Write(); | |
451 | fhAdcPMTWithTime->Write(); | |
452 | ||
453 | fhTimeA->Write(); | |
454 | fhTimeC->Write(); | |
455 | ||
456 | fhWidthA->Write(); | |
457 | fhWidthC->Write(); | |
458 | ||
459 | fhTimePMT->Write(); | |
460 | fhWidthPMT->Write(); | |
461 | ||
462 | fhAdcWidthA->Write(); | |
463 | fhAdcWidthC->Write(); | |
464 | ||
465 | fhTimeCorr->Write(); | |
466 | ||
467 | fhAdcTimeA->Write(); | |
468 | fhAdcTimeC->Write(); | |
469 | ||
470 | fV0a->Write(); | |
471 | fV0c->Write(); | |
472 | fV0multA->Write(); | |
473 | fV0multC->Write(); | |
474 | fV0ampl->Write(); | |
475 | ||
892effee | 476 | fhTimePMTCorr->Write(); |
477 | fhEvents->Write(); | |
478 | ||
479 | fhVtxXYBB->Write(); | |
480 | fhVtxZBB->Write(); | |
481 | fhVtxXYBGA->Write(); | |
482 | fhVtxZBGA->Write(); | |
483 | fhVtxXYBGC->Write(); | |
484 | fhVtxZBGC->Write(); | |
485 | ||
ecb38463 | 486 | outputFile->Close(); |
487 | delete outputFile; | |
488 | ||
489 | //delete esd; | |
490 | Info("AliAnaVZEROQA", "Successfully finished"); | |
491 | } | |
492 | ||
892effee | 493 | Float_t AliAnaVZEROQA::CorrectLeadingTime(Int_t i, Float_t time, Float_t adc) |
494 | { | |
495 | // Correct for slewing and align the channels | |
496 | ||
497 | if (time == 0) return 0; | |
498 | ||
499 | // Time offsets between channels | |
500 | Float_t timeShift[64] = {30.2914 , 30.0019 , 30.7429 , 30.1997 , 30.1511 , 29.6437 , 30.0609 , 29.5452 , 30.1437 , 30.745 , 30.7537 , 30.446 , 30.2771 , 30.838 , 30.3748 , 30.0635 , 30.1786 , 30.282 , 31.0992 , 30.7491 , 30.624 , 30.9268 , 30.6585 , 30.4895 , 31.5815 , 31.3871 , 31.2032 , 31.5778 , 31.0838 , 31.2259 , 31.2122 , 31.5989 , 28.3792 , 28.8325 , 27.8719 , 28.3475 , 26.9925 , 27.9300 , 28.4223 , 28.4996 , 28.2934 , 28.1281 , 27.209 , 28.5327 , 28.1181 , 28.0888 , 29.5111 , 28.6601 , 29.7705 , 29.6531 , 30.3373 , 30.2345 , 30.5935 , 29.8164 , 30.2235 , 29.6505 , 30.1225 , 31.2045 , 30.8399 , 30.6789 , 30.2784 , 31.7028 , 31.4239 , 30.1814}; | |
501 | time -= timeShift[i]; | |
502 | ||
503 | // Slewing correction | |
504 | if (adc == 0) return time; | |
505 | ||
506 | time += 30.; | |
507 | if (adc > 300.) adc = 300.; | |
508 | if (adc > 70.) { | |
509 | return (time - | |
510 | 2.93028e+01 + | |
511 | adc*1.25188e-02 - | |
512 | adc*adc*2.68348e-05); | |
513 | } | |
514 | else { | |
515 | return (time - | |
516 | 3.52314e+01 + | |
517 | adc*5.99289e-01 - | |
518 | adc*adc*2.74668e-02 + | |
519 | adc*adc*adc*6.61224e-04 - | |
520 | adc*adc*adc*adc*7.77105e-06 + | |
521 | adc*adc*adc*adc*adc*3.51229e-08); | |
522 | } | |
523 | } | |
ecb38463 | 524 | |
525 | ||
526 | ||
527 | ||
528 | ||
529 | ||
530 | ||
531 | ||
532 | ||
533 | ||
534 | ||
535 | ||
536 | ||
537 | ||
538 | ||
539 | ||
540 | ||
541 | ||
542 | ||
543 | ||
544 | ||
545 | ||
546 | ||
547 | ||
548 | ||
549 | ||
550 | ||
551 | ||
552 | ||
553 | ||
554 | ||
555 | ||
556 | ||
557 | ||
558 | ||
559 | ||
560 | ||
561 | ||
562 | ||
563 | ||
564 | ||
565 | ||
566 | ||
567 | ||
568 | ||
569 | ||
570 | ||
571 | ||
572 | ||
573 | ||
574 | ||
575 | ||
576 | ||
577 | ||
578 | ||
579 | ||
580 | ||
581 | ||
582 | ||
583 | ||
584 |