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