store all HLTOUT data blocks of an event in one DDL and use a round robin schedule...
[u/mrichter/AliRoot.git] / PWG1 / VZERO / AliAnaVZEROPbPb.cxx
CommitLineData
a148e064 1#include "TChain.h"
2#include "TTree.h"
3#include "TH1F.h"
4#include "TH2F.h"
5
6#include "AliAnalysisTask.h"
7#include "AliAnalysisManager.h"
8
9#include "AliESDEvent.h"
10#include "AliESDInputHandler.h"
11#include "AliAnaVZEROPbPb.h"
12#include "AliMultiplicity.h"
a148e064 13#include "AliESDUtils.h"
14#include "AliCentrality.h"
15
16// VZERO includes
17#include "AliESDVZERO.h"
a148e064 18
19ClassImp(AliAnaVZEROPbPb)
20
a148e064 21AliAnaVZEROPbPb::AliAnaVZEROPbPb()
6a9e696e 22 : AliAnalysisTaskSE("AliAnaVZEROPbPb"), fESD(0), fEsdV0(0), fOutputList(0), fNClasses(0), fClassesNames(0),
a148e064 23 fNFlags(0),
24 fhAdcPMTNoTime(0),
25 fhAdcPMTWithTime(0),
26 fhTimePMT(0),
27 fhWidthPMT(0),
28 fhTimeCorr(0),
29 fhPmtMult(0),
30 fhV0ampl(0),
31 fhEvents(0),
32 fhVtxXYBB(0),
33 fhVtxZBB(0),
34 fhVtxXYBGA(0),
35 fhVtxZBGA(0),
36 fhVtxXYBGC(0),
37 fhVtxZBGC(0),
38 fhL2Triggers(0),
39fhOnlineCharge(0),
40fhRecoMult(0),
41fhV0vsSPDCentrality(0),
42fhTriggerBits(0),
43fhTotRecoMult(0),
7b0ae030 44fhCentrality(0),
45fhEqualizedMult(0),
46fhEqualizedMultSum(0),
aea8bf4d 47fNBinTotMult(100),
48fTotMultMax(30000),
49fNBinMult(100),
50fV0AMultMax(20000),
51fV0CMultMax(30000),
52fNBinOnlineCharge(100),
53fV0AOnlineChargeMax(20000),
54fV0COnlineChargeMax(30000),
55fNBinEquaMult(100),
56fEquaMultMax(50),
57fNBinSumsEqMult(100),
58fV0AEqMultMax(1000),
59fV0CEqMultMax(1000)
60
a148e064 61{
62 // Constructor
6a9e696e 63 // Init arrays
a148e064 64 for(Int_t i = 0; i < 2; ++i) {
65 fhAdcNoTime[i] = fhAdcWithTime[i] = fhWidth[i] = fhTime[i] = NULL;
66 fhAdcTime[i] = fhAdcWidth[i] = NULL;
67 }
68
69 // Define input and output slots here
70 // Input slot #0 works with a TChain
71 DefineInput(0, TChain::Class());
72 // Output slot #0 id reserved by the base class for AOD
73 // Output slot #1 writes into a TH1 container
74 DefineOutput(1, TList::Class());
75}
76
77//________________________________________________________________________
78AliAnaVZEROPbPb::AliAnaVZEROPbPb(const char *name)
79 : AliAnalysisTaskSE(name), fESD(0), fEsdV0(0), fOutputList(0),fNClasses(0),fClassesNames(0),
80 fNFlags(0),
81 fhAdcPMTNoTime(0),
82 fhAdcPMTWithTime(0),
83 fhTimePMT(0),
84 fhWidthPMT(0),
85 fhTimeCorr(0),
86 fhPmtMult(0),
87 fhV0ampl(0),
88 fhEvents(0),
89 fhVtxXYBB(0),
90 fhVtxZBB(0),
91 fhVtxXYBGA(0),
92 fhVtxZBGA(0),
93 fhVtxXYBGC(0),
94 fhVtxZBGC(0),
95 fhL2Triggers(0),
96fhOnlineCharge(0),
97fhRecoMult(0),
98fhV0vsSPDCentrality(0),
99fhTriggerBits(0),
100fhTotRecoMult(0),
7b0ae030 101fhCentrality(0),
102fhEqualizedMult(0),
103fhEqualizedMultSum(0),
aea8bf4d 104fNBinTotMult(100),
105fTotMultMax(30000),
106fNBinMult(100),
107fV0AMultMax(20000),
108fV0CMultMax(30000),
109fNBinOnlineCharge(100),
110fV0AOnlineChargeMax(20000),
111fV0COnlineChargeMax(30000),
112fNBinEquaMult(100),
113fEquaMultMax(50),
114fNBinSumsEqMult(100),
115fV0AEqMultMax(1000),
116fV0CEqMultMax(1000)
a148e064 117{
118 // Constructor
6a9e696e 119 // Init arrays
a148e064 120 for(Int_t i = 0; i < 2; ++i) {
121 fhAdcNoTime[i] = fhAdcWithTime[i] = fhWidth[i] = fhTime[i] = NULL;
122 fhAdcTime[i] = fhAdcWidth[i] = NULL;
123 }
124 // Define input and output slots here
125 // Input slot #0 works with a TChain
126 DefineInput(0, TChain::Class());
127 // Output slot #0 id reserved by the base class for AOD
128 // Output slot #1 writes into a TH1 container
129 DefineOutput(1, TList::Class());
130}
131//________________________________________________________________________
132void AliAnaVZEROPbPb::SetClassesNames(const Char_t * nameList){
6a9e696e 133 // Initialize the class names
134 // which are used in the trigger split
a148e064 135 TString names("AllClasses,");
136 names += nameList;
137 fClassesNames = names.Tokenize(",");
138 fNClasses = fClassesNames->GetEntriesFast();
139}
140//________________________________________________________________________
141TH1F * AliAnaVZEROPbPb::CreateHisto1D(const char* name, const char* title,Int_t nBins,
142 Double_t xMin, Double_t xMax,
143 const char* xLabel, const char* yLabel)
144{
145 // create a histogram
6a9e696e 146 // and set the axis labels and the style
a148e064 147 TH1F* result = new TH1F(name, title, nBins, xMin, xMax);
148 result->SetOption("hist");
149 if (xLabel) result->GetXaxis()->SetTitle(xLabel);
150 if (yLabel) result->GetYaxis()->SetTitle(yLabel);
151 result->SetMarkerStyle(kFullCircle);
152 return result;
153}
154
155//________________________________________________________________________
156TH2F * AliAnaVZEROPbPb::CreateHisto2D(const char* name, const char* title,Int_t nBinsX,
157 Double_t xMin, Double_t xMax,
158 Int_t nBinsY,
159 Double_t yMin, Double_t yMax,
160 const char* xLabel, const char* yLabel)
161{
162 // create a histogram
6a9e696e 163 // and set the axis labels and the style
a148e064 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
171//________________________________________________________________________
172void AliAnaVZEROPbPb::UserCreateOutputObjects()
173{
174 // Create histograms
175 // Called once
176 if(fNClasses==0) {
177 AliFatal("No Classes Defined");
178 return;
179 }
180
181 fOutputList = new TList();
182 fOutputList->SetOwner(kTRUE);
183
184
7b0ae030 185 CreateHistosPerL2Trigger();
a148e064 186 CreateQAHistos();
a148e064 187
188 PostData(1, fOutputList);
189 }
190//________________________________________________________________________
191void AliAnaVZEROPbPb::Init()
192{
6a9e696e 193 // Nothing nere
194 // ...
a148e064 195}
196
197//________________________________________________________________________
198void AliAnaVZEROPbPb::UserExec(Option_t *)
199{
200 // Main loop
201 // Called for each event
202
203 fESD = dynamic_cast<AliESDEvent*>(InputEvent());
204 if (!fESD) {
205 printf("ERROR: fESD not available\n");
206 return;
207 }
208
209 fEsdV0 = fESD->GetVZEROData();
210 if (!fEsdV0) {
211 Printf("ERROR: esd V0 not available");
212 return;
213 }
214
215 FillQAHistos();
216
217 FillPerL2TriggerHistos();
218
219
220
221 PostData(1, fOutputList);
222}
223//________________________________________________________________________
224void AliAnaVZEROPbPb::CreateHistosPerL2Trigger(){
6a9e696e 225 // Create the histograms
226 // for all the required L2 trigger classes
a148e064 227 fhOnlineCharge= new TH2F*[fNClasses];
228 fhCentrality= new TH1F*[fNClasses];
229 fhV0vsSPDCentrality= new TH2F*[fNClasses];
230 fhRecoMult= new TH2F*[fNClasses];
231 fhTotRecoMult= new TH1F*[fNClasses];
232 fhTriggerBits= new TH1F*[fNClasses];
7b0ae030 233 fhEqualizedMult= new TH2F*[fNClasses];
234 fhEqualizedMultSum = new TH2F*[fNClasses];
235
a148e064 236 fhL2Triggers = CreateHisto1D("hL2Triggers","L2 Triggers",fNClasses,0,fNClasses);
237 fOutputList->Add(fhL2Triggers);
7b0ae030 238
a148e064 239 TIter iter(fClassesNames);
240 TObjString* name;
241 Int_t iClass =0;
242 while((name = (TObjString*) iter.Next())){
243 fhL2Triggers->GetXaxis()->SetBinLabel(iClass+1,name->String().Data());
244
aea8bf4d 245 fhOnlineCharge[iClass] = CreateHisto2D(Form("hOnlineCharge_%s",name->String().Data()),Form("Online Charge for %s",name->String().Data()),fNBinOnlineCharge,0.,fV0AOnlineChargeMax,fNBinOnlineCharge,0.,fV0COnlineChargeMax,"V0A","V0C");
a148e064 246 fOutputList->Add(fhOnlineCharge[iClass]);
247
248 fhCentrality[iClass] = CreateHisto1D(Form("hV0Centrality_%s",name->String().Data()),Form("V0 centrality for %s",name->String().Data()),100,0.,100.);
249 fOutputList->Add(fhCentrality[iClass]);
250
251 fhV0vsSPDCentrality[iClass] = CreateHisto2D(Form("hV0vsSPDCentrality_%s",name->String().Data()),Form("Centrality for %s",name->String().Data()),100,0.,100.,100,0.,100,"SPD Centrality (CL1)","V0 Centrality (V0M)");
252 fOutputList->Add(fhV0vsSPDCentrality[iClass]);
253
aea8bf4d 254 fhRecoMult[iClass] = CreateHisto2D(Form("hRecoMult_%s",name->String().Data()),Form("Reco Multiplicity for %s",name->String().Data()),fNBinMult,0.,fV0AMultMax,fNBinMult,0.,fV0CMultMax,"V0A Offline Mult","V0C Offline Mult");
a148e064 255 fOutputList->Add(fhRecoMult[iClass]);
256
aea8bf4d 257 fhTotRecoMult[iClass] = CreateHisto1D(Form("hTotRecoMult_%s",name->String().Data()),Form("Total Reco Multiplicity for %s",name->String().Data()),fNBinTotMult,0.,fTotMultMax,"V0A + V0C Offline Mult");
a148e064 258 fOutputList->Add(fhTotRecoMult[iClass]);
259
260 fhTriggerBits[iClass] = CreateHisto1D(Form("hTriggerBits_%s",name->String().Data()),Form("Trigger Bits for %s",name->String().Data()),16,-0.5,15.5);
261 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(1,"BBA_AND_BBC");
262 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(2,"BBA_OR_BBC");
263 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(3,"BGA_AND_BBC");
264 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(4,"BGA");
265 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(5,"BBA_AND_BGC");
266 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(6,"BGC");
267 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(7,"CTA1_AND_CTC1");
268 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(8,"CTA1_OR_CTC1");
269 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(9,"CTA2_AND_CTC2");
270 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(10,"CTA1_OR_CTC1");
271 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(11,"MTA_AND_MTC");
272 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(12,"MTA_OR_MTC");
273 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(13,"BBA");
274 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(14,"BBC");
275 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(15,"BGA_OR_BGC");
276 fhTriggerBits[iClass]->GetXaxis()->SetBinLabel(16,"All True BG");
7b0ae030 277 fOutputList->Add(fhTriggerBits[iClass]);
278
aea8bf4d 279 fhEqualizedMult[iClass] = CreateHisto2D(Form("hEqualizedMult_%s",name->String().Data()),Form("Equalized Multiplicity for %s",name->String().Data()),64,-0.5,63.5,fNBinEquaMult,0.,fEquaMultMax,"PMT channel","Equalized Multiplicity");
7b0ae030 280 fOutputList->Add(fhEqualizedMult[iClass]);
281
aea8bf4d 282 fhEqualizedMultSum[iClass] = CreateHisto2D(Form("hEqualizedMultSum_%s",name->String().Data()),Form("Summed Equalized Multiplicity for %s",name->String().Data()),fNBinSumsEqMult,0.,fV0AEqMultMax,fNBinSumsEqMult,0.,fV0CEqMultMax,"V0A","V0C");
7b0ae030 283 fOutputList->Add(fhEqualizedMultSum[iClass]);
a148e064 284
7b0ae030 285
a148e064 286 iClass++;
287 }
288
289}
290//________________________________________________________________________
291void AliAnaVZEROPbPb::CreateQAHistos(){
6a9e696e 292 // Create the main
293 // QA histos
a148e064 294 fNFlags = CreateHisto2D("hNFlags","BB Flags",33,-0.5,32.5,33,-0.5,32.5,"V0A","V0C");
295 fOutputList->Add(fNFlags);
296
297 for(int iSide = 0; iSide < 2; ++iSide){
298 TString side;
299 if(iSide) side = "V0A";
300 else side = "V0C";
301
302 fhAdcNoTime[iSide] = CreateHisto1D(Form("hAdcNoTime%s",side.Data()),Form("ADC (no Leading Time) %s",side.Data()),200,0,200,"ADC charge","Entries");
303 fOutputList->Add(fhAdcNoTime[iSide]);
304 fhAdcWithTime[iSide] = CreateHisto1D(Form("hAdcWithTime%s",side.Data()),Form("ADC (with Leading Time) %s",side.Data()),200,0,200,"ADC charge","Entries");
305 fOutputList->Add(fhAdcWithTime[iSide]);
306 fhTime[iSide] = CreateHisto1D(Form("htimepmt%s",side.Data()),Form("Time measured by TDC %s",side.Data()),400,-100,100,"Leading time (ns)","Entries");
307 fOutputList->Add(fhTime[iSide]);
308 fhWidth[iSide] = CreateHisto1D(Form("hwidth%s",side.Data()),Form("Signal width measured by TDC %s",side.Data()),128,0,200,"Signal width (ns)","Entries");
309 fOutputList->Add(fhWidth[iSide]);
310 fhAdcWidth[iSide] = CreateHisto2D(Form("hadcwidth%s",side.Data()),Form("Time width vs ADC %s",side.Data()),200,0,200,128,0,200,"ADC charge","Width (ns)");
311 fOutputList->Add(fhAdcWidth[iSide]);
312 fhAdcTime[iSide] = CreateHisto2D(Form("hAdcTime%s",side.Data()),Form("ADC vs Time %s",side.Data()),1000,-100,100,200,0,200,"Time (ns)","ADC charge");
313 fOutputList->Add(fhAdcTime[iSide]);
314 }
315
316 fhAdcPMTNoTime = CreateHisto2D("hadcpmtnotime","ADC vs PMT index (no leading time)",64,-0.5,63.5,200,0,200,"PMT index","ADC charge");
317 fhAdcPMTWithTime = CreateHisto2D("hadcpmtwithtime","ADC vs PMT index (with leading time)",64,-0.5,63.5,200,0,200,"PMT index","ADC charge");
318
319 fhTimePMT = CreateHisto2D("htimepmt","Time measured by TDC vs PMT index",64,-0.5,63.5,200,0,100,"PMT Index","Leading time (ns)");
320 fhWidthPMT = CreateHisto2D("hwidthpmt","Time width vs PMT index",64,-0.5,63.5,128,0,200,"PMT Index","Signal width (ns)");
321
322 fhTimeCorr = CreateHisto2D("htimecorr","Average time C side vs. A side",200,0,100,200,0,100,"Time V0A (ns)","Time V0C (ns");
323
324 fhV0ampl = CreateHisto1D("hV0ampl","V0 multiplicity in single channel (all V0 channels)",500,-0.5,499.5);
325
326 fhEvents = CreateHisto2D("hTriggerDecision","Trigger Decision",3,-0.5,2.5,3,-0.5,2.5,"V0A Decision","V0C Decision");
327 fhEvents->GetXaxis()->SetBinLabel(1,"Fake");
328 fhEvents->GetXaxis()->SetBinLabel(2,"BB");
329 fhEvents->GetXaxis()->SetBinLabel(3,"BG");
330 fhEvents->GetYaxis()->SetBinLabel(1,"Fake");
331 fhEvents->GetYaxis()->SetBinLabel(2,"BB");
332 fhEvents->GetYaxis()->SetBinLabel(3,"BG");
333
334 fhVtxXYBB = CreateHisto2D("fhVtxXYBB","XY SPD vertex (bb)",200,-2,2,200,-2,2);
335 fhVtxZBB = CreateHisto1D("fhVtxZBB","Z SPD vertex (bb)",400,-50,50);
336 fhVtxXYBGA = CreateHisto2D("fhVtxXYBGA","XY SPD vertex (bga)",200,-2,2,200,-2,2);
337 fhVtxZBGA = CreateHisto1D("fhVtxZBGA","Z SPD vertex (bga)",400,-50,50);
338 fhVtxXYBGC = CreateHisto2D("fhVtxXYBGC","XY SPD vertex (bgc)",200,-2,2,200,-2,2);
339 fhVtxZBGC = CreateHisto1D("fhVtxZBGC","Z SPD vertex (bgc)",400,-50,50);
340
341 fhPmtMult = CreateHisto2D("hV0CellMult","Number of fired PMTs (V0C vs V0A)",33,-0.5,32.5,33,-0.5,32.5,"# Cell (V0A)","# Cell (V0C)");
342 fOutputList->Add(fhPmtMult);
343
344
345 fOutputList->Add(fhAdcPMTNoTime);
346 fOutputList->Add(fhAdcPMTWithTime);
347
348 fOutputList->Add(fhTimePMT);
349 fOutputList->Add(fhWidthPMT);
350
351 fOutputList->Add(fhTimeCorr);
352 fOutputList->Add(fhV0ampl);
353
354 fOutputList->Add(fhEvents);
355
356 fOutputList->Add(fhVtxXYBB);
357 fOutputList->Add(fhVtxZBB);
358 fOutputList->Add(fhVtxXYBGA);
359 fOutputList->Add(fhVtxZBGA);
360 fOutputList->Add(fhVtxXYBGC);
361 fOutputList->Add(fhVtxZBGC);
362
363}
364//________________________________________________________________________
a148e064 365void AliAnaVZEROPbPb::FillPerL2TriggerHistos(){
6a9e696e 366 // Fill the histos which are split
367 // by L2 trigger class
a148e064 368 TString trigStr(fESD->GetFiredTriggerClasses());
369
a148e064 370 TIter iter(fClassesNames);
371 TObjString* name;
372 Int_t iClass =0;
7b0ae030 373
aea8bf4d 374
375 TObjArray * tokens = trigStr.Tokenize(" ");
376 Int_t ntokens = tokens->GetEntriesFast();
377
a148e064 378 while((name = (TObjString*) iter.Next())){
379
aea8bf4d 380 Bool_t goodTrig = kFALSE;
381 if(iClass>0){
382 for (Int_t itoken = 0; itoken < ntokens; ++itoken) {
383 if (!((((TObjString*)tokens->At(itoken))->String()).Contains("-B-"))) continue;
384 if ((((TObjString*)tokens->At(itoken))->String()).BeginsWith(name->String().Data())) {
385 goodTrig = kTRUE;
386 break;
387 }
388 }
389 } else goodTrig = kTRUE;
390
391 if (!goodTrig) {
392 iClass++;
393 continue;
394 }
395// if (!trigStr.Contains(name->String().Data())) continue;
a148e064 396
397 fhOnlineCharge[iClass]->Fill(fEsdV0->GetTriggerChargeA(),fEsdV0->GetTriggerChargeC());
398
399 fhL2Triggers->Fill(iClass);
400
401 fhRecoMult[iClass]->Fill(fEsdV0->GetMTotV0A(),fEsdV0->GetMTotV0C());
402 fhTotRecoMult[iClass]->Fill(fEsdV0->GetMTotV0A()+fEsdV0->GetMTotV0C());
403
404 for(int iTrig = 0; iTrig < 16; ++iTrig){
405 if(fEsdV0->GetTriggerBits() & (1<<iTrig)) fhTriggerBits[iClass]->Fill(iTrig);
406 }
407
408 AliCentrality *centrality = fESD->GetCentrality();
409 Float_t percentile = centrality->GetCentralityPercentile("V0M");
410 Float_t spdPercentile = centrality->GetCentralityPercentile("CL1");
411 if (spdPercentile < 0) spdPercentile = 0;
412 if (percentile < 0) percentile = 0;
413 fhCentrality[iClass]->Fill(percentile);
414 fhV0vsSPDCentrality[iClass]->Fill(spdPercentile,percentile);
7b0ae030 415
416 Float_t sumEqMult[2] = {0.,0.};
417 for(int iCh = 0; iCh < 64; ++iCh){
aea8bf4d 418 if(fEsdV0->GetTime(iCh) < -1024.+ 1e-6) continue;
7b0ae030 419 Int_t side = iCh / 32 ;
420 sumEqMult[side] += fESD->GetVZEROEqMultiplicity(iCh);
421 fhEqualizedMult[iClass]->Fill(iCh,fESD->GetVZEROEqMultiplicity(iCh));
422 }
423 fhEqualizedMultSum[iClass]->Fill(sumEqMult[1],sumEqMult[0]);
424
a148e064 425 iClass++;
426 }
aea8bf4d 427 delete tokens;
428
a148e064 429}
430//________________________________________________________________________
431void AliAnaVZEROPbPb::FillQAHistos(){
6a9e696e 432 // Fill the main QA histos
a148e064 433 // Count V0 flags
434 Int_t nV0A = 0, nV0C = 0;
435 for(Int_t i = 0; i < 32; ++i) {
436 if (fEsdV0->GetBBFlag(i)) nV0C++;
437 if (fEsdV0->GetBBFlag(i+32)) nV0A++;
438 }
439 fNFlags->Fill((Float_t)nV0A,(Float_t)nV0C);
440
441 for (Int_t i=0; i<64; ++i) {
442 Int_t side = i/32;
443 if (fEsdV0->GetTime(i) < 1e-6) {
444 fhAdcNoTime[side]->Fill(fEsdV0->GetAdc(i));
445 fhAdcPMTNoTime->Fill(i,fEsdV0->GetAdc(i));
446 } else {
447 fhAdcWithTime[side]->Fill(fEsdV0->GetAdc(i));
448 fhAdcPMTWithTime->Fill(i,fEsdV0->GetAdc(i));
449 }
450
451 fhTime[side]->Fill(fEsdV0->GetTime(i));
452 fhWidth[side]->Fill(fEsdV0->GetWidth(i));
453 fhAdcWidth[side]->Fill(fEsdV0->GetAdc(i),fEsdV0->GetWidth(i));
454 fhAdcTime[side]->Fill(fEsdV0->GetTime(i),fEsdV0->GetAdc(i));
455
456 fhTimePMT->Fill(i,fEsdV0->GetTime(i));
457 fhWidthPMT->Fill(i,fEsdV0->GetWidth(i));
458
459 }
460
461 fhTimeCorr->Fill(fEsdV0->GetV0ATime(),fEsdV0->GetV0CTime());
462
463 AliESDVZERO::Decision flaga = fEsdV0->GetV0ADecision();
464 AliESDVZERO::Decision flagc = fEsdV0->GetV0CDecision();
465
466 fhEvents->Fill(flaga,flagc);
467
468 const AliESDVertex *vtx = fESD->GetPrimaryVertexSPD();
469
470 if (flaga <= 1 && flagc <=1) {
471 fhVtxXYBB->Fill(vtx->GetXv(),vtx->GetYv());
472 fhVtxZBB->Fill(vtx->GetZv());
473 }
474 else {
475 if (flaga == 2) {
476 fhVtxXYBGA->Fill(vtx->GetXv(),vtx->GetYv());
477 fhVtxZBGA->Fill(vtx->GetZv());
478 }
479 if (flagc == 2) {
480 fhVtxXYBGC->Fill(vtx->GetXv(),vtx->GetYv());
481 fhVtxZBGC->Fill(vtx->GetZv());
482 }
483 }
484
485 fhPmtMult->Fill(fEsdV0->GetNbPMV0A(),fEsdV0->GetNbPMV0C());
486 for(Int_t i = 0; i < 64; i++) {
487 fhV0ampl->Fill(fEsdV0->GetMultiplicity(i));
488 }
489
490}
491//________________________________________________________________________
492void AliAnaVZEROPbPb::Terminate(Option_t *)
493{
6a9e696e 494 // Check if the output list is there
a148e064 495 // Called once at the end of the query
496
497 fOutputList = dynamic_cast<TList*> (GetOutputData(1));
498 if (!fOutputList) {
499 printf("ERROR: Output list not available\n");
500 return;
501 }
7b0ae030 502
a148e064 503}
aea8bf4d 504//________________________________________________________________________
aea8bf4d 505void AliAnaVZEROPbPb::SetOnlineChargeRange(Int_t nbins, Float_t maxA, Float_t maxC){
6a9e696e 506 // Set Trigger charge
507 // range used for histogramming
aea8bf4d 508 fNBinOnlineCharge = nbins;
509 fV0AOnlineChargeMax = maxA;
510 fV0COnlineChargeMax = maxC;
511}
512//________________________________________________________________________
513void AliAnaVZEROPbPb::SetTotalMultiplicityRange(Int_t nbins, Float_t max){
6a9e696e 514 // Set Multiplicity
515 // range used for histogramming
aea8bf4d 516 fNBinTotMult = nbins;
517 fTotMultMax = max;
518}
519//________________________________________________________________________
520void AliAnaVZEROPbPb::SetMultiplicityRange(Int_t nbins, Float_t maxA, Float_t maxC){
6a9e696e 521 // Set Multiplicity
522 // range used for histogramming
aea8bf4d 523 fNBinMult = nbins;
524 fV0AMultMax = maxA;
525 fV0CMultMax = maxC;
526}
527//________________________________________________________________________
528void AliAnaVZEROPbPb::SetEquaMultRange(Int_t nbins, Float_t max){
6a9e696e 529 // Set Equalized multiplicity
530 // range used for histogramming
aea8bf4d 531 fNBinEquaMult = nbins;
532 fEquaMultMax = max;
533}
534//________________________________________________________________________
535void AliAnaVZEROPbPb::SetSumEquaMultRange(Int_t nbins, Float_t maxA, Float_t maxC){
6a9e696e 536 // Set Equalized multiplicity
537 // range used for histogramming
aea8bf4d 538 fNBinSumsEqMult = nbins;
539 fV0AEqMultMax = maxA;
540 fV0CEqMultMax = maxC;
541}
542