1 /**************************************************************************
2 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 /////////////////////////////////////////////////////////////
20 // AliAnalysisTaskSE for HF quality assurance
22 // Author: Chiara Bianchin, chiara.bianchin@pd.infn.it
23 /////////////////////////////////////////////////////////////
25 #include <Riostream.h>
26 #include <TClonesArray.h>
32 #include <TProfile2D.h>
33 #include <TDatabasePDG.h>
35 #include <AliAnalysisDataSlot.h>
36 #include <AliAnalysisDataContainer.h>
37 #include "AliAnalysisManager.h"
38 #include "AliESDtrack.h"
39 #include "AliESDVertex.h"
40 #include "AliVertexerTracks.h"
42 #include "AliPIDResponse.h"
43 #include "AliTPCPIDResponse.h"
44 #include "AliAODHandler.h"
45 #include "AliAODEvent.h"
46 #include "AliAODVertex.h"
47 #include "AliAODTrack.h"
48 #include "AliAODMCParticle.h"
49 #include "AliAODMCHeader.h"
50 #include "AliAODRecoDecayHF2Prong.h"
51 #include "AliAODRecoCascadeHF.h"
52 #include "AliAnalysisVertexingHF.h"
53 #include "AliAnalysisTaskSE.h"
54 #include "AliCounterCollection.h"
55 #include "AliRDHFCuts.h"
56 #include "AliRDHFCutsDplustoKpipi.h"
57 #include "AliRDHFCutsD0toKpipipi.h"
58 #include "AliRDHFCutsDstoKKpi.h"
59 #include "AliRDHFCutsDStartoKpipi.h"
60 #include "AliRDHFCutsD0toKpi.h"
61 #include "AliRDHFCutsLctopKpi.h"
62 #include "AliRDHFCutsLctoV0.h"
63 #include "AliVertexingHFUtils.h"
64 #include "AliInputEventHandler.h"
66 #include "AliFlowEvent.h"
67 #include "AliFlowTrackCuts.h"
68 #include "AliFlowTrackSimple.h"
69 #include "AliFlowVector.h"
71 #include "AliTRDTriggerAnalysis.h"
73 #include "AliAnalysisTaskSEHFQA.h"
78 ClassImp(AliAnalysisTaskSEHFQA)
80 //____________________________________________________________________________
82 AliAnalysisTaskSEHFQA::AliAnalysisTaskSEHFQA():AliAnalysisTaskSE(),
87 fOutputCheckCentrality(0x0),
88 fOutputEvSelection(0x0),
90 fDecayChannel(AliAnalysisTaskSEHFQA::kD0toKpi),
94 fEstimator(AliRDHFCuts::kCentTRK),
97 fUseSelectionBit(kTRUE),
99 fFillDistrTrackEffChecks(kFALSE)
101 //default constructor
109 //____________________________________________________________________________
110 AliAnalysisTaskSEHFQA::AliAnalysisTaskSEHFQA(const char *name, AliAnalysisTaskSEHFQA::DecChannel ch,AliRDHFCuts* cuts):
111 AliAnalysisTaskSE(name),
115 fOutputCounters(0x0),
116 fOutputCheckCentrality(0x0),
117 fOutputEvSelection(0x0),
123 fEstimator(AliRDHFCuts::kCentTRK),
126 fUseSelectionBit(kTRUE),
128 fFillDistrTrackEffChecks(kFALSE)
132 //SetCutObject(cuts);
141 // Output slot #1 writes into a TH1F container (number of events)
142 DefineOutput(1,TH1F::Class()); //My private output
143 // Output slot #2 writes into a TList container (PID)
144 if (fOnOff[1]) DefineOutput(2,TList::Class()); //My private output
145 // Output slot #3 writes into a TList container (Tracks)
146 if (fOnOff[0]) DefineOutput(3,TList::Class()); //My private output
147 // Output slot #4 writes into a AliRDHFCuts container (cuts)
148 switch(fDecayChannel){
150 DefineOutput(4,AliRDHFCutsDplustoKpipi::Class()); //My private output
153 DefineOutput(4,AliRDHFCutsD0toKpi::Class()); //My private output
156 DefineOutput(4,AliRDHFCutsDStartoKpipi::Class()); //My private output
159 DefineOutput(4,AliRDHFCutsDstoKKpi::Class()); //My private output
162 DefineOutput(4,AliRDHFCutsD0toKpipipi::Class()); //My private output
165 DefineOutput(4,AliRDHFCutsLctopKpi::Class()); //My private output
168 DefineOutput(4,AliRDHFCutsLctoV0::Class()); //My private output
172 // Output slot #5 writes into a TList container (AliCounterCollection)
173 DefineOutput(5,TList::Class()); //My private output
174 // Output slot #6 writes into a TList container (TH1F)
175 DefineOutput(6,TList::Class()); //My private output
178 if(fOnOff[3]) DefineOutput(7,TList::Class()); //My private output
179 if(fOnOff[4]) DefineOutput(8,TList::Class()); //My private output
183 //___________________________________________________________________________
184 AliAnalysisTaskSEHFQA::~AliAnalysisTaskSEHFQA()
193 delete fOutputCounters;
195 delete fOutputCheckCentrality;
197 delete fOutputEvSelection;
200 delete fOutputFlowObs;
205 //___________________________________________________________________________
206 void AliAnalysisTaskSEHFQA::Init(){
209 if(fDebug > 1) printf("AnalysisTaskSEHFQA::Init() \n");
210 AliRDHFCuts *copycut = 0x0;
212 switch(fDecayChannel){
215 copycut=new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fCuts)));
220 copycut=new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fCuts)));
225 copycut=new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fCuts)));
230 copycut=new AliRDHFCutsDstoKKpi(*(static_cast<AliRDHFCutsDstoKKpi*>(fCuts)));
235 copycut=new AliRDHFCutsD0toKpipipi(*(static_cast<AliRDHFCutsD0toKpipipi*>(fCuts)));
240 copycut=new AliRDHFCutsLctopKpi(*(static_cast<AliRDHFCutsLctopKpi*>(fCuts)));
245 copycut=new AliRDHFCutsLctoV0(*(static_cast<AliRDHFCutsLctoV0*>(fCuts)));
249 AliFatal("Bad initialization for the decay channe - Exiting...");
253 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
255 copycut->SetName(nameoutput);
260 AliFatal("Failing initializing AliRDHFCuts object - Exiting...");
267 //___________________________________________________________________________
268 void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
271 //create the output container
272 if(fDebug > 1) printf("AnalysisTaskSEHFQA::UserCreateOutputObjects() \n");
276 fNEntries=new TH1F(GetOutputSlot(1)->GetContainer()->GetName(), "Counts the number of events", 10,-0.5,9.5);
277 fNEntries->GetXaxis()->SetBinLabel(1,"nEventsAnal");
278 fNEntries->GetXaxis()->SetBinLabel(2,"Pile-up Rej");
279 fNEntries->GetXaxis()->SetBinLabel(3,"No VertexingHF");
280 fNEntries->GetXaxis()->SetBinLabel(4,"nCandidates(AnCuts)");
281 fNEntries->GetXaxis()->SetBinLabel(5,"EventsWithGoodVtx");
282 //fNEntries->GetXaxis()->SetBinLabel(6,"N. of 0SMH");
283 fNEntries->GetXaxis()->SetBinLabel(6,"N candidates");
285 fNEntries->GetXaxis()->SetBinLabel(7,"MC Cand from c");
286 fNEntries->GetXaxis()->SetBinLabel(8,"MC Cand from b");
287 fNEntries->GetXaxis()->SetBinLabel(9,"N fake Trks");
288 fNEntries->GetXaxis()->SetBinLabel(10,"N true Trks");
291 fNEntries->GetXaxis()->SetNdivisions(1,kFALSE);
295 fOutputPID=new TList();
296 fOutputPID->SetOwner();
297 fOutputPID->SetName(GetOutputSlot(2)->GetContainer()->GetName());
300 TH1F* hTOFflags=new TH1F("hTOFflags","TOF flags",7,-0.5,6.5);
301 hTOFflags->SetMinimum(0.);
302 hTOFflags->GetXaxis()->SetBinLabel(1,"All Tracks");
303 hTOFflags->GetXaxis()->SetBinLabel(2,"kTPCout");
304 hTOFflags->GetXaxis()->SetBinLabel(3,"kTOFout");
305 hTOFflags->GetXaxis()->SetBinLabel(4,"kTIME");
306 hTOFflags->GetXaxis()->SetBinLabel(5,"kTOFpid");
307 hTOFflags->GetXaxis()->SetBinLabel(6,"kTOFmismatch");
308 hTOFflags->GetXaxis()->SetBinLabel(7,"kDetPidOK");
310 TString hname="hTOFsig";
311 TH1F* hTOFsig=new TH1F(hname.Data(),"Distribution of TOF signal;TOF time [ps];Entries", 100, -2.e3,40.e3);
313 hname="hTOFstartTimeMask";
314 TH1F* hTOFstartTimeMask=new TH1F(hname.Data(),"TOF start time mask; Mask ;Entries", 8, -0.5,7.5);
315 hTOFstartTimeMask->GetXaxis()->SetBinLabel(1,"FILL");
316 hTOFstartTimeMask->GetXaxis()->SetBinLabel(2,"TOF");
317 hTOFstartTimeMask->GetXaxis()->SetBinLabel(3,"T0A");
318 hTOFstartTimeMask->GetXaxis()->SetBinLabel(4,"TOF.and.T0A");
319 hTOFstartTimeMask->GetXaxis()->SetBinLabel(5,"T0C");
320 hTOFstartTimeMask->GetXaxis()->SetBinLabel(6,"TOF.and.T0C");
321 hTOFstartTimeMask->GetXaxis()->SetBinLabel(7,"T0AC");
322 hTOFstartTimeMask->GetXaxis()->SetBinLabel(8,"TOF.and.T0AC");
324 hname="hTOFstartTimeRes";
325 TH1F* hTOFstartTimeRes=new TH1F(hname.Data(),"TOF start time resolution; Resolution (ps) ;Entries", 100, 0.,300.);
327 hname="hTOFstartTimeDistrib";
328 TH1F* hTOFstartTimeDistrib=new TH1F(hname.Data(),"TOF start time distribution; Start time ;Entries", 400, -1000.,1000.);
331 TH1F* hTOFtime=new TH1F(hname.Data(),"Distribution of TOF time Kaon;TOF time(Kaon) [ps];Entries", 1000, 0.,50000.);
333 hname="hTOFtimeKaonHyptime";
334 TH2F* hTOFtimeKaonHyptime=new TH2F(hname.Data(),"TOFtime - timeHypothesisForKaon;p[GeV/c];TOFtime - timeHypothesisForKaon [ps]",500,0.,10.,1000,-20000.,20000.);
336 hname="hTOFtimeKaonHyptimeAC";
337 TH2F* hTOFtimeKaonHyptimeAC=new TH2F(hname.Data(),"TOFtime - timeHypothesisForKaon;p[GeV/c];TOFtime - timeHypothesisForKaon [ps]",500,0.,10.,1000,-20000.,20000.);
339 hname="hTOFsigmaKSigPid";
340 TH2F* hTOFsigmaKSigPid=new TH2F(hname.Data(),"(TOFsignal-timeK)/tofSigPid;p[GeV/c];(TOFsignal-timeK)/tofSigPid",500,0.,10.,400,-20,20);
342 hname="hTOFsigmaPionSigPid";
343 TH2F* hTOFsigmaPionSigPid=new TH2F(hname.Data(),"(TOFsignal-time#pi)/tofSigPid;p[GeV/c];(TOFsignal-time#pi)/tofSigPid",500,0.,10.,400,-20,20);
345 hname="hTOFsigmaProtonSigPid";
346 TH2F* hTOFsigmaProtonSigPid=new TH2F(hname.Data(),"(TOFsignal-timep)/tofSigPid;p[GeV/c];(TOFsignal-time p)/tofSigPid",500,0.,10.,400,-20,20);
348 hname="hTOFsigPid3sigPion";
349 TH1F* hTOFsigPid3sigPion=new TH1F(hname.Data(),"TOF PID resolution (#pi) [ps]",500,0.,1000.);
351 hname="hTOFsigPid3sigKaon";
352 TH1F* hTOFsigPid3sigKaon=new TH1F(hname.Data(),"TOF PID resolution (K) [ps]",500,0.,1000.);
354 hname="hTOFsigPid3sigProton";
355 TH1F* hTOFsigPid3sigProton=new TH1F(hname.Data(),"TOF PID resolution (p) [ps]",500,0.,1000.);
360 TH1F* hTPCsig=new TH1F(hname.Data(),"Distribution of TPC signal;TPC sig;Entries", 100, 35.,100.);
363 TH2F* hTPCsigvsp=new TH2F(hname.Data(),"TPCsig vs p;TPC p[GeV/c];TPCsig",500,0.,10.,1000,35.,100.);
365 hname="hTPCsigvspAC";
366 TH2F* hTPCsigvspAC=new TH2F(hname.Data(),"TPCsig vs p;TPCp[GeV/c];TPCsig",500,0.,10.,1000,35.,100.);
369 TH2F* hTPCsigmaK=new TH2F(hname.Data(),"TPC Sigma for K as a function of momentum;p[GeV/c];Sigma Kaon",500,0.,10.,400,-20,20);
371 hname="hTPCsigmaPion";
372 TH2F* hTPCsigmaPion=new TH2F(hname.Data(),"TPC Sigma for #pi as a function of momentum;p[GeV/c];Sigma #pi",500,0.,10.,400,-20,20);
374 hname="hTPCsigmaProton";
375 TH2F* hTPCsigmaProton=new TH2F(hname.Data(),"TPC Sigma for proton as a function of momentum;p[GeV/c];Sigma Proton",500,0.,10.,400,-20,20);
378 fOutputPID->Add(hTOFflags);
379 fOutputPID->Add(hTOFsig);
380 fOutputPID->Add(hTPCsig);
381 fOutputPID->Add(hTOFstartTimeMask);
382 fOutputPID->Add(hTOFstartTimeRes);
383 fOutputPID->Add(hTOFstartTimeDistrib);
384 fOutputPID->Add(hTOFtime);
385 fOutputPID->Add(hTOFtimeKaonHyptime);
386 fOutputPID->Add(hTOFtimeKaonHyptimeAC);
387 fOutputPID->Add(hTOFsigmaKSigPid);
388 fOutputPID->Add(hTOFsigmaPionSigPid);
389 fOutputPID->Add(hTOFsigmaProtonSigPid);
390 fOutputPID->Add(hTOFsigPid3sigPion);
391 fOutputPID->Add(hTOFsigPid3sigKaon);
392 fOutputPID->Add(hTOFsigPid3sigProton);
393 fOutputPID->Add(hTPCsigvsp);
394 fOutputPID->Add(hTPCsigvspAC);
395 fOutputPID->Add(hTPCsigmaK);
396 fOutputPID->Add(hTPCsigmaPion);
397 fOutputPID->Add(hTPCsigmaProton);
399 if(fFillDistrTrackEffChecks){
401 hname="hTPCsigNvsPtAllTracks";
402 TH2F* hTPCsigNvsPtAllTracks=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. p_{T};p_{T} [GeV/c]; n. points", 200, 0.,20.,161,-0.5,160.5);
404 hname="hTPCsigNvsPhiAllTracks";
405 TH2F* hTPCsigNvsPhiAllTracks=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. #phi;#phi [rad]; n. points", 100, 0.,2*TMath::Pi(),161,-0.5,160.5);
407 hname="hTPCsigNvsEtaAllTracks";
408 TH2F* hTPCsigNvsEtaAllTracks=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. #eta;eta; n. points", 80,-2.,2.,161,-0.5,160.5);
410 hname="hTPCsigNvsPtDaughters";
411 TH2F* hTPCsigNvsPtDaughters=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. p_{T};p_{T} [GeV/c]; n. points", 200, 0.,20.,161,-0.5,160.5);
413 hname="hTPCsigNvsPhiDaughters";
414 TH2F* hTPCsigNvsPhiDaughters=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. #phi;#phi [rad]; n. points", 100, 0.,2*TMath::Pi(),161,-0.5,160.5);
416 hname="hTPCsigNvsEtaDaughters";
417 TH2F* hTPCsigNvsEtaDaughters=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. #eta;eta; n. points", 80,-2.,2.,161,-0.5,160.5);
419 fOutputPID->Add(hTPCsigNvsPtAllTracks);
420 fOutputPID->Add(hTPCsigNvsPhiAllTracks);
421 fOutputPID->Add(hTPCsigNvsEtaAllTracks);
422 fOutputPID->Add(hTPCsigNvsPtDaughters);
423 fOutputPID->Add(hTPCsigNvsPhiDaughters);
424 fOutputPID->Add(hTPCsigNvsEtaDaughters);
430 hname="hTOFsigmaMCKSigPid";
431 TH2F* hTOFsigmaMCKSigPid=new TH2F(hname.Data(),"(TOFsignal-timeK)/tofSigPid;p[GeV/c];(TOFsignal-timeK)/tofSigPid",500,0.,10.,400,-20,20);
433 hname="hTOFsigmaMCPionSigPid";
434 TH2F* hTOFsigmaMCPionSigPid=new TH2F(hname.Data(),"(TOFsignal-time#pi)/tofSigPid;p[GeV/c];(TOFsignal-time#pi)/tofSigPid",500,0.,10.,400,-20,20);
436 hname="hTOFsigmaMCProtonSigPid";
437 TH2F* hTOFsigmaMCProtonSigPid=new TH2F(hname.Data(),"(TOFsignal-timep)/tofSigPid;p[GeV/c];(TOFsignal-time p)/tofSigPid",500,0.,10.,400,-20,20);
440 hname="hTPCsigmaMCK";
441 TH2F* hTPCsigmaMCK=new TH2F(hname.Data(),"TPC Sigma for K as a function of momentum;p[GeV/c];Sigma Kaon",500,0.,10.,400,-20,20);
443 hname="hTPCsigmaMCPion";
444 TH2F* hTPCsigmaMCPion=new TH2F(hname.Data(),"TPC Sigma for #pi as a function of momentum;p[GeV/c];Sigma #pi",500,0.,10.,400,-20,20);
446 hname="hTPCsigmaMCProton";
447 TH2F* hTPCsigmaMCProton=new TH2F(hname.Data(),"TPC Sigma for proton as a function of momentum;p[GeV/c];Sigma Proton",500,0.,10.,400,-20,20);
449 fOutputPID->Add(hTOFsigmaMCKSigPid);
450 fOutputPID->Add(hTOFsigmaMCPionSigPid);
451 fOutputPID->Add(hTOFsigmaMCProtonSigPid);
452 fOutputPID->Add(hTPCsigmaMCK);
453 fOutputPID->Add(hTPCsigmaMCPion);
454 fOutputPID->Add(hTPCsigmaMCProton);
459 //quality of the tracks
461 fOutputTrack=new TList();
462 fOutputTrack->SetOwner();
463 fOutputTrack->SetName(GetOutputSlot(3)->GetContainer()->GetName());
465 TString hname="hnClsITS";
466 TH1F* hnClsITS=new TH1F(hname.Data(),"Distribution of number of ITS clusters;nITScls;Entries",7,-0.5,6.5);
468 hname="hnClsITSselTr";
469 TH1F* hnClsITSselTr=new TH1F(hname.Data(),"Distribution of number of ITS clusters selected tracks;nITScls;Entries",7,-0.5,6.5);
472 TH1F* hnClsITSSA=new TH1F(hname.Data(),"Distribution of number of ITS clusters(ITS-SA);nITScls;Entries",7,-0.5,6.5);
476 TH1F* hnLayerITS=new TH1F(hname.Data(),"Number of tracks with point in layer;ITS layer;",7,-1.5,5.5);
477 hnLayerITS->GetXaxis()->SetBinLabel(1,"n tracks");
478 hnLayerITS->GetXaxis()->SetBinLabel(2,"SPDin");
479 hnLayerITS->GetXaxis()->SetBinLabel(3,"SPDout");
480 hnLayerITS->GetXaxis()->SetBinLabel(4,"SDDin");
481 hnLayerITS->GetXaxis()->SetBinLabel(5,"SDDout");
482 hnLayerITS->GetXaxis()->SetBinLabel(6,"SSDin");
483 hnLayerITS->GetXaxis()->SetBinLabel(7,"SSDout");
485 hname="hnLayerITSsa";
486 TH1F* hnLayerITSsa=new TH1F(hname.Data(),"Number of tracks with point in layer;ITS layer;",7,-1.5,5.5);
487 hnLayerITSsa->GetXaxis()->SetBinLabel(1,"n tracks");
488 hnLayerITSsa->GetXaxis()->SetBinLabel(2,"SPDin");
489 hnLayerITSsa->GetXaxis()->SetBinLabel(3,"SPDout");
490 hnLayerITSsa->GetXaxis()->SetBinLabel(4,"SDDin");
491 hnLayerITSsa->GetXaxis()->SetBinLabel(5,"SDDout");
492 hnLayerITSsa->GetXaxis()->SetBinLabel(6,"SSDin");
493 hnLayerITSsa->GetXaxis()->SetBinLabel(7,"SSDout");
496 TH1F* hnClsSPD=new TH1F(hname.Data(),"Distribution of number of SPD clusters;nSPDcls;Entries",3,-0.5,2.5);
499 TH1F* hptGoodTr=new TH1F(hname.Data(),"Pt distribution of 'good' tracks;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
500 hptGoodTr->SetTitleOffset(1.3,"Y");
503 hname="hptGoodTrFromDaugh";
504 TH1F* hptGoodTrFromDaugh=new TH1F(hname.Data(),"Pt distribution of 'good' candidate's daughters;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
505 hptGoodTrFromDaugh->SetTitleOffset(1.3,"Y");
506 fOutputTrack->Add(hptGoodTrFromDaugh);
509 hname="hdistrGoodTr";
510 TH1F* hdistrGoodTr=new TH1F(hname.Data(),"Distribution of number of 'good' candidate's daughters per event;no.good-tracks/ev;Entries",4000,-0.5,3999.5);
511 hdistrGoodTr->SetTitleOffset(1.3,"Y");
514 TH1F* hdistrSelTr=new TH1F(hname.Data(),"Distribution of number of Selected tracks per event;no.good-tracks/ev;Entries",4000,-0.5,3999.5);
515 hdistrSelTr->SetTitleOffset(1.3,"Y");
518 TH1F* hd0dau=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of D daughter tracks;d_{0rphi}[cm];Entries/10^{3} cm",200,-0.1,0.1);
521 TH2F* hd0dauphi=new TH2F(hname.Data(), "Impact parameter (rphi) distribution of D daughter tracks versus #phi; #phi [rad]; d_{0rphi} [cm]",400,0,6.3,200,-0.1,0.1);
524 TH1F* hd0zdau=new TH1F(hname.Data(),"Impact parameter (z) distribution of D daughter tracks;d_{0z}[cm];Entries/10^{3} cm",200,-0.1,0.1);
527 TH2F* hd0zdauphi=new TH2F(hname.Data(), "Impact parameter (z) distribution of D daughter tracks versus #phi; #phi [rad]; d_{0z} [cm]",400,0,6.3,200,-0.1,0.1);
529 hname="hd0TracksSPDin";
530 TH1F* hd0TracksSPDin=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks kITSrefit, SPDinner; d_{0rphi}[cm];Entries",200,-0.5,0.5);
532 hname="hd0TracksSPDany";
533 TH1F* hd0TracksSPDany=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks kITSrefit, SPDany; d_{0rphi}[cm];Entries",200,-0.5,0.5);
535 hname="hd0TracksFilterBit4";
536 TH1F* hd0TracksFilterBit4=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks FilterBit4; d_{0rphi}[cm];Entries",200,-0.5,0.5);
538 hname="hd0TracksTPCITSSPDany";
539 TH1F* hd0TracksTPCITSSPDany=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks TPC+ITScuts+SPDany; d_{0rphi}[cm];Entries",200,-0.5,0.5);
542 if(fFillDistrTrackEffChecks){
543 hname="hPtDaughters";
544 TH1F *hPtDaughters=new TH1F(hname.Data(),"p_{T} distributions of the daughter tracks;p_{T} [GeV/c];Entries",200,0.,20.);
546 hname="hPhiDaughters";
547 TH1F *hPhiDaughters=new TH1F(hname.Data(),"#phi distribution of the daughter tracks;#phi [rad];Entries",100,0.,2*(TMath::Pi()));
549 hname="hEtaDaughters";
550 TH1F *hEtaDaughters=new TH1F(hname.Data(),"#eta distribution of the daughter tracks;#eta;Entries",80,-2.,2.);
552 hname="hEtavsPhiDaughters";
553 TH2F *hEtavsPhiDaughters=new TH2F(hname.Data(),"#eta vs #phi distribution of the daughter tracks;#phi;#eta",100,0.,2*(TMath::Pi()),80,-2.,2.);
555 hname="hNTPCclsvsPtDaughters";
556 TH2F *hNTPCclsvsPtDaughters=new TH2F(hname.Data(),"N TPC clusters vs p_{T} distribution of the daughter tracks;p_{T} [GeV/c];N TPC cls",200,0.,20.,85,-0.5,169.5);
558 hname="hNTPCclsvsPhiDaughters";
559 TH2F *hNTPCclsvsPhiDaughters=new TH2F(hname.Data(),"N TPC clusters vs #phi distribution of the daughter tracks;#phi [rad];N TPC cls",100,0.,2*(TMath::Pi()),85,-0.5,169.5);
561 hname="hNTPCclsvsEtaDaughters";
562 TH2F *hNTPCclsvsEtaDaughters=new TH2F(hname.Data(),"N TPC clusters vs #eta distribution of the daughter tracks;#eta;N TPC cls",80,-2.,2.,85,-0.5,169.5);
564 hname="hNTPCCrossedRowsvsPtDaughters";
565 TH2F *hNTPCCrossedRowsvsPtDaughters=new TH2F(hname.Data(),"N TPC crossed rows vs p_{T} distribution of the daughter tracks;p_{T} [GeV/c];N TPC cros. rows",200,0.,20.,100,-0.5,199.5);
567 hname="hNTPCCrossedRowsvsPhiDaughters";
568 TH2F *hNTPCCrossedRowsvsPhiDaughters=new TH2F(hname.Data(),"N TPC crossed rows vs #phi distribution of the daughter tracks;#phi [rad];N TPC cros. rows",100,0.,2*(TMath::Pi()),100,-0.5,199.5);
570 hname="hNTPCCrossedRowsvsEtaDaughters";
571 TH2F *hNTPCCrossedRowsvsEtaDaughters=new TH2F(hname.Data(),"N TPC crossed rows vs #eta distribution of the daughter tracks;#eta;N TPC cros. rows",80,-2.,2.,100,-0.5,199.5);
573 hname="hRatioCRowsOverFclsvsPtDaughters";
574 TH2F *hRatioCRowsOverFclsvsPtDaughters=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs p_{T} distribution of the daughter tracks;p_{T} [GeV/c];CRows/FCls",200,0.,20,100,0.,1.);
576 hname="hRatioCRowsOverFclsvsPhiDaughters";
577 TH2F *hRatioCRowsOverFclsvsPhiDaughters=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #phi distribution of the daughter tracks;#phi [rad];CRows/FCls",100,0.,2*(TMath::Pi()),100,0.,1.);
579 hname="hRatioCRowsOverFclsvsEtaDaughters";
580 TH2F *hRatioCRowsOverFclsvsEtaDaughters=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #eta distribution of the daughter tracks;#eta;CRows/FCls",80,-2.,2.,100,0.,1.);
582 hname="hNITSclsvsPtDaughters";
583 TH2F *hNITSclsvsPtDaughters=new TH2F(hname.Data(),"N ITS clusters vs p_{T} distribution of the daughter tracks;p_{T} [GeV/c];N ITS cls",200,0.,20,7,-0.5,6.5);
585 hname="hNITSclsvsPhiDaughters";
586 TH2F *hNITSclsvsPhiDaughters=new TH2F(hname.Data(),"N ITS clusters vs #phi distribution of the daughter tracks;#phi [rad];N ITS cls",100,0.,2*(TMath::Pi()),7,-0.5,6.5);
588 hname="hNITSclsvsEtaDaughters";
589 TH2F *hNITSclsvsEtaDaughters=new TH2F(hname.Data(),"N ITS clusters vs #eta distribution of the daughter tracks;#eta;N ITS cls",80,-2.,2.,7,-0.5,6.5);
591 hname="hSPDclsDaughters";
592 TH1I *hSPDclsDaughters = new TH1I(hname.Data(),"N SPD points distribution;;Entries",4,-0.5,3.5);
593 hSPDclsDaughters->GetXaxis()->SetBinLabel(1, "no SPD");
594 hSPDclsDaughters->GetXaxis()->SetBinLabel(2, "kOnlyFirst");
595 hSPDclsDaughters->GetXaxis()->SetBinLabel(3, "kOnlySecond");
596 hSPDclsDaughters->GetXaxis()->SetBinLabel(4, "kBoth");
598 hname="hPtAllTracks";
599 TH1F *hPtAllTracks=new TH1F(hname.Data(),"p_{T} distributions of the AOD tracks (ID>0);p_{T} [GeV/c];Entries",200,0.,20.);
601 hname="hPhiAllTracks";
602 TH1F *hPhiAllTracks=new TH1F(hname.Data(),"#phi distribution of the AOD tracks (ID>0);#phi [rad];Entries",100,0.,2*(TMath::Pi()));
604 hname="hEtaAllTracks";
605 TH1F *hEtaAllTracks=new TH1F(hname.Data(),"#eta distribution of the AOD tracks (ID>0);#eta;Entries",80,-2.,2.);
607 hname="hEtavsPhiAllTracks";
608 TH2F *hEtavsPhiAllTracks=new TH2F(hname.Data(),"#eta vs #phi distribution of the AOD tracks (ID>0);#phi;#eta",100,0.,2*(TMath::Pi()),80,-2.,2.);
610 hname="hNTPCclsvsPtAllTracks";
611 TH2F *hNTPCclsvsPtAllTracks=new TH2F(hname.Data(),"N TPC clusters vs p_{T} distribution of the AOD tracks (ID>0);p_{T} [GeV/c];N TPC cls",200,0.,20,85,-0.5,169.5);
613 hname="hNTPCclsvsPhiAllTracks";
614 TH2F *hNTPCclsvsPhiAllTracks=new TH2F(hname.Data(),"N TPC clusters vs #phi distribution of the AOD tracks (ID>0);#phi [rad];N TPC cls",100,0.,2*(TMath::Pi()),85,-0.5,169.5);
616 hname="hNTPCclsvsEtaAllTracks";
617 TH2F *hNTPCclsvsEtaAllTracks=new TH2F(hname.Data(),"N TPC clusters vs #eta distribution of the AOD tracks (ID>0);#eta;N TPC cls",80,-2.,2.,85,-0.5,169.5);
619 hname="hNTPCCrossedRowsvsPtAllTracks";
620 TH2F *hNTPCCrossedRowsvsPtAllTracks=new TH2F(hname.Data(),"N TPC crossed rows vs p_{T} distribution of the AOD tracks;p_{T} [GeV/c];N TPC cros. rows",200,0.,20.,100,-0.5,199.5);
622 hname="hNTPCCrossedRowsvsPhiAllTracks";
623 TH2F *hNTPCCrossedRowsvsPhiAllTracks=new TH2F(hname.Data(),"N TPC crossed rows vs #phi distribution of the AOD tracks;#phi [rad];N TPC cros. rows",100,0.,2*(TMath::Pi()),100,-0.5,199.5);
625 hname="hNTPCCrossedRowsvsEtaAllTracks";
626 TH2F *hNTPCCrossedRowsvsEtaAllTracks=new TH2F(hname.Data(),"N TPC crossed rows vs #eta distribution of the AOD tracks;#eta;N TPC cros. rows",80,-2.,2.,100,-0.5,199.5);
628 hname="hRatioCRowsOverFclsvsPtAllTracks";
629 TH2F *hRatioCRowsOverFclsvsPtAllTracks=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs p_{T} distribution of the AOD tracks (ID>0);p_{T} [GeV/c];CRows/FCls",200,0.,20,100,0.,1.);
631 hname="hRatioCRowsOverFclsvsPhiAllTracks";
632 TH2F *hRatioCRowsOverFclsvsPhiAllTracks=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #phi distribution of the AOD tracks (ID>0);#phi [rad];CRows/FCls",100,0.,2*(TMath::Pi()),100,0.,1.);
634 hname="hRatioCRowsOverFclsvsEtaAllTracks";
635 TH2F *hRatioCRowsOverFclsvsEtaAllTracks=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #eta distribution of the AOD tracks (ID>0);#eta;CRows/FCls",80,-2.,2.,100,0.,1.);
637 hname="hNITSclsvsPtAllTracks";
638 TH2F *hNITSclsvsPtAllTracks=new TH2F(hname.Data(),"N ITS clusters vs p_{T} distribution of the AOD tracks (ID>0);p_{T} [GeV/c];N ITS cls",200,0.,20,7,-0.5,6.5);
640 hname="hNITSclsvsPhiAllTracks";
641 TH2F *hNITSclsvsPhiAllTracks=new TH2F(hname.Data(),"N ITS clusters vs #phi distribution of the AOD tracks (ID>0);#phi [rad];N ITS cls",100,0.,2*(TMath::Pi()),7,-0.5,6.5);
643 hname="hNITSclsvsEtaAllTracks";
644 TH2F *hNITSclsvsEtaAllTracks=new TH2F(hname.Data(),"N ITS clusters vs #eta distribution of the AOD tracks (ID>0);#eta;N ITS cls",80,-2.,2.,7,-0.5,6.5);
646 hname="hSPDclsAllTracks";
647 TH1I *hSPDclsAllTracks = new TH1I(hname.Data(),"N SPD points distribution AOD tracks (ID>0);;Entries",4,-0.5,3.5);
648 hSPDclsAllTracks->GetXaxis()->SetBinLabel(1, "no SPD");
649 hSPDclsAllTracks->GetXaxis()->SetBinLabel(2, "kOnlyFirst");
650 hSPDclsAllTracks->GetXaxis()->SetBinLabel(3, "kOnlySecond");
651 hSPDclsAllTracks->GetXaxis()->SetBinLabel(4, "kBoth");
654 fOutputTrack->Add(hPtDaughters);
655 fOutputTrack->Add(hPhiDaughters);
656 fOutputTrack->Add(hEtaDaughters);
657 fOutputTrack->Add(hEtavsPhiDaughters);
658 fOutputTrack->Add(hNTPCclsvsPtDaughters);
659 fOutputTrack->Add(hNTPCclsvsPhiDaughters);
660 fOutputTrack->Add(hNTPCclsvsEtaDaughters);
661 fOutputTrack->Add(hNTPCCrossedRowsvsPtDaughters);
662 fOutputTrack->Add(hNTPCCrossedRowsvsPhiDaughters);
663 fOutputTrack->Add(hNTPCCrossedRowsvsEtaDaughters);
664 fOutputTrack->Add(hRatioCRowsOverFclsvsPtDaughters);
665 fOutputTrack->Add(hRatioCRowsOverFclsvsPhiDaughters);
666 fOutputTrack->Add(hRatioCRowsOverFclsvsEtaDaughters);
667 fOutputTrack->Add(hNITSclsvsPtDaughters);
668 fOutputTrack->Add(hNITSclsvsPhiDaughters);
669 fOutputTrack->Add(hNITSclsvsEtaDaughters);
670 fOutputTrack->Add(hSPDclsDaughters);
671 fOutputTrack->Add(hPtAllTracks);
672 fOutputTrack->Add(hPhiAllTracks);
673 fOutputTrack->Add(hEtaAllTracks);
674 fOutputTrack->Add(hEtavsPhiAllTracks);
675 fOutputTrack->Add(hNTPCclsvsPtAllTracks);
676 fOutputTrack->Add(hNTPCclsvsPhiAllTracks);
677 fOutputTrack->Add(hNTPCclsvsEtaAllTracks);
678 fOutputTrack->Add(hNTPCCrossedRowsvsPtAllTracks);
679 fOutputTrack->Add(hNTPCCrossedRowsvsPhiAllTracks);
680 fOutputTrack->Add(hNTPCCrossedRowsvsEtaAllTracks);
681 fOutputTrack->Add(hRatioCRowsOverFclsvsPtAllTracks);
682 fOutputTrack->Add(hRatioCRowsOverFclsvsPhiAllTracks);
683 fOutputTrack->Add(hRatioCRowsOverFclsvsEtaAllTracks);
684 fOutputTrack->Add(hNITSclsvsPtAllTracks);
685 fOutputTrack->Add(hNITSclsvsPhiAllTracks);
686 fOutputTrack->Add(hNITSclsvsEtaAllTracks);
687 fOutputTrack->Add(hSPDclsAllTracks);
691 fOutputTrack->Add(hnClsITS);
692 fOutputTrack->Add(hnClsITSselTr);
693 fOutputTrack->Add(hnClsITSSA);
694 fOutputTrack->Add(hnLayerITS);
695 fOutputTrack->Add(hnLayerITSsa);
696 fOutputTrack->Add(hnClsSPD);
697 fOutputTrack->Add(hptGoodTr);
698 fOutputTrack->Add(hdistrGoodTr);
699 fOutputTrack->Add(hdistrSelTr);
700 fOutputTrack->Add(hd0TracksSPDin);
701 fOutputTrack->Add(hd0TracksSPDany);
702 fOutputTrack->Add(hd0TracksFilterBit4);
703 fOutputTrack->Add(hd0TracksTPCITSSPDany);
704 fOutputTrack->Add(hd0dau);
705 fOutputTrack->Add(hd0dauphi);
706 fOutputTrack->Add(hd0zdau);
707 fOutputTrack->Add(hd0zdauphi);
711 hname="hdistrFakeTr";
712 TH1F* hdistrFakeTr=new TH1F(hname.Data(),"Distribution of number of fake tracks per event;no.fake-tracks/ev;Entries",4000,-0.5,3999.5);
713 hdistrFakeTr->SetTitleOffset(1.3,"Y");
716 TH1F* hd0f=new TH1F(hname.Data(),"Impact parameter distribution of fake tracks;d_{0}[cm];Entries/10^{3} cm",200,-0.1,0.1);
719 TH1F* hptFakeTr=new TH1F(hname.Data(),"Pt distribution of fake tracks;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
720 hptFakeTr->SetTitleOffset(1.3,"Y");
722 hname="hptFakeTrFromDaugh";
723 TH1F* hptFakeTrFromDaugh=new TH1F(hname.Data(),"Pt distribution of fake tracks from daughters;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
724 hptFakeTrFromDaugh->SetTitleOffset(1.3,"Y");
725 fOutputTrack->Add(hptFakeTrFromDaugh);
728 fOutputTrack->Add(hptFakeTr);
729 fOutputTrack->Add(hdistrFakeTr);
730 fOutputTrack->Add(hd0f);
736 if(fOnOff[2] && fCuts->GetUseCentrality()){
738 //Centrality (Counters)
739 fOutputCounters=new TList();
740 fOutputCounters->SetOwner();
741 fOutputCounters->SetName(GetOutputSlot(5)->GetContainer()->GetName());
743 AliCounterCollection *stdEstimator=new AliCounterCollection("stdEstimator");
744 stdEstimator->AddRubric("run",500000);
745 stdEstimator->AddRubric("centralityclass","-10_0/0_10/10_20/20_30/30_40/40_50/50_60/60_70/70_80/80_90/90_100/-990_-980");
746 stdEstimator->Init();
747 AliCounterCollection *secondEstimator=new AliCounterCollection("secondEstimator");
748 secondEstimator->AddRubric("run",500000);
749 secondEstimator->AddRubric("centralityclass","-10_0/0_10/10_20/20_30/30_40/40_50/50_60/60_70/70_80/80_90/90_100/-990_-980");
750 secondEstimator->Init();
752 fOutputCounters->Add(stdEstimator);
753 fOutputCounters->Add(secondEstimator);
755 //Centrality (Checks)
756 fOutputCheckCentrality=new TList();
757 fOutputCheckCentrality->SetOwner();
758 fOutputCheckCentrality->SetName(GetOutputSlot(6)->GetContainer()->GetName());
760 TString hname="hNtrackletsIn";
761 TH1F* hNtrackletsIn=new TH1F(hname.Data(),"Number of tracklets in Centrality range;ntracklets;Entries",5000,-0.5,4999.5);
764 TH1F* hMultIn=new TH1F(hname.Data(),"Multiplicity;multiplicity in Centrality range;Entries",10000,-0.5,9999.5);
766 hname="hNtrackletsOut";
767 TH1F* hNtrackletsOut=new TH1F(hname.Data(),"Number of tracklets out of Centrality range;ntracklets;Entries",5000,-0.5,4999.5);
770 TH1F* hMultOut=new TH1F(hname.Data(),"Multiplicity out of Centrality range;multiplicity;Entries",10000,-0.5,9999.5);
772 hname="hMultvsPercentile";
773 TH2F* hMultvsPercentile=new TH2F(hname.Data(),"Multiplicity vs Percentile;multiplicity;percentile",10000,-0.5,9999.5,240,-10.,110);
775 hname="hntrklvsPercentile";
776 TH2F* hntrklvsPercentile=new TH2F(hname.Data(),"N tracklets vs Percentile;ntracklets;percentile",5000,-0.5,4999.5,240,-10.,110);
778 hname="hntrklvsPercentile01";
779 TH2F* hntrklvsPercentile01=new TH2F(hname.Data(),"N tracklets vs Percentile |#eta|<1;ntracklets;percentile",5000,-0.5,4999.5,240,-10.,110);
781 hname="hnTPCTracksvsPercentile";
782 TH2F* hnTPCTracksvsPercentile=new TH2F(hname.Data(),"N TPC tracks vs Percentile;nTPCTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
784 hname="hnTPCITSTracksvsPercentile";
785 TH2F* hnTPCITSTracksvsPercentile=new TH2F(hname.Data(),"N TPC+ITS tracks vs Percentile;nTPCITSTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
787 hname="hnTPCITS1SPDTracksvsPercentile";
788 TH2F* hnTPCITS1SPDTracksvsPercentile=new TH2F(hname.Data(),"N TPC+ITS+1SPD tracks vs Percentile;nTPCITS1SPDTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
790 hname="hStdEstimSignalPercentile";
791 TH2F*hStdEstimSignalPercentile = new TH2F(hname.Data(),"Std estimator signal vs Percentile;Std estimator signal;percentile",1000,-0.5,9999.5,120,-10.,110);
793 hname="hStdEstimSignalNtrackletsIn";
794 TH2F*hStdEstimSignalNtrackletsIn = new TH2F(hname.Data(),"Std estimator signal vs Number of tracklets in the CC;Std estimator signal;number of tracklets",1000,-0.5,9999.5,5000,-0.5,4999.5);
796 hname="hStdEstimSignal";
797 TH1F*hStdEstimSignal = new TH1F(hname.Data(),"Std estimator signal",700,0,1400);
799 hname="hStdPercentileSecondPercentile";
800 TH2F* hStdPercentileSecondPercentile = new TH2F(hname.Data(),"Std estimator Percentile Vs Second Estimator Percentile;Std estimator percentile;Second estimator percentile",120,-10.,110,120,-10.,110);
802 hname="hStdSignalSecondSignal";
803 TH2F* hStdSignalSecondSignal = new TH2F(hname.Data(),"Std estimator signal Vs Second Estimator signal;Std estimator;Second estimator",1000,-0.5,9999.5,1000,-0.5,9999.5);
805 fOutputCheckCentrality->Add(hNtrackletsIn);
806 fOutputCheckCentrality->Add(hNtrackletsOut);
807 fOutputCheckCentrality->Add(hMultIn);
808 fOutputCheckCentrality->Add(hMultOut);
809 fOutputCheckCentrality->Add(hMultvsPercentile);
810 fOutputCheckCentrality->Add(hntrklvsPercentile);
811 fOutputCheckCentrality->Add(hntrklvsPercentile01);
812 fOutputCheckCentrality->Add(hnTPCTracksvsPercentile);
813 fOutputCheckCentrality->Add(hnTPCITSTracksvsPercentile);
814 fOutputCheckCentrality->Add(hnTPCITS1SPDTracksvsPercentile);
815 fOutputCheckCentrality->Add(hStdEstimSignalPercentile);
816 fOutputCheckCentrality->Add(hStdEstimSignal);
817 fOutputCheckCentrality->Add(hStdEstimSignalNtrackletsIn);
818 fOutputCheckCentrality->Add(hStdPercentileSecondPercentile);
819 fOutputCheckCentrality->Add(hStdSignalSecondSignal);
821 PostData(6,fOutputCheckCentrality);
825 TString hname="hNtracklets";
826 TH1F* hNtracklets=new TH1F(hname.Data(),"Number of tracklets;ntracklets;Entries",5000,-0.5,4999.5);
827 hname="hNtracklets01";
828 TH1F* hNtracklets01=new TH1F(hname.Data(),"Number of tracklets |#eta|<1;ntracklets;Entries",5000,-0.5,4999.5);
831 TH1F* hMult=new TH1F(hname.Data(),"Multiplicity;multiplicity;Entries",10000,-0.5,9999.5);
833 TH1F* hMultFBit4=new TH1F(hname.Data(),"Multiplicity (global+tracklet) with filter bit 4;multiplicity;Entries",10000,-0.5,9999.5);
835 TH1F* hMultC05=new TH1F(hname.Data(),"Multiplicity (global+tracklet) in |#eta|<0.5;multiplicity;Entries",10000,-0.5,9999.5);
837 TH1F* hMultC08=new TH1F(hname.Data(),"Multiplicity (global+tracklet) in |#eta|<0.8;multiplicity;Entries",10000,-0.5,9999.5);
839 fOutputTrack->Add(hNtracklets);
840 fOutputTrack->Add(hNtracklets01);
841 fOutputTrack->Add(hMult);
842 fOutputTrack->Add(hMultFBit4);
843 fOutputTrack->Add(hMultC05);
844 fOutputTrack->Add(hMultC08);
848 //event selection (z vertex for the moment)
850 fOutputEvSelection=new TList();
851 fOutputEvSelection->SetOwner();
852 fOutputEvSelection->SetName(GetOutputSlot(7)->GetContainer()->GetName());
853 AliCounterCollection *evselection=new AliCounterCollection("evselection");
854 evselection->AddRubric("run",500000);
855 evselection->AddRubric("evnonsel","zvtx");
858 TH1F* hxvtx=new TH1F("hxvtx", "Distribution of x_{VTX};x_{VTX} [cm];Entries",800,-1,1);
859 TH1F* hyvtx=new TH1F("hyvtx", "Distribution of y_{VTX};y_{VTX} [cm];Entries",800,-1,1);
860 TH1F* hzvtx=new TH1F("hzvtx", "Distribution of z_{VTX};z_{VTX} [cm];Entries",800,-30,30);
861 TH1F* hxvtxSelEv=new TH1F("hxvtxSelEv", "Distribution of x_{VTX} Selected Ev;x_{VTX} [cm];Entries",800,-1,1);
862 TH1F* hyvtxSelEv=new TH1F("hyvtxSelEv", "Distribution of y_{VTX} Selected Ev;y_{VTX} [cm];Entries",800,-1,1);
863 TH1F* hzvtxSelEv=new TH1F("hzvtxSelEv", "Distribution of z_{VTX} Selected Ev;z_{VTX} [cm];Entries",800,-30,30);
864 TH1F* hWhichVert=new TH1F("hWhichVert","Vertex Type",4,-1.5,2.5);
865 hWhichVert->GetXaxis()->SetBinLabel(1,"Not found");
866 hWhichVert->GetXaxis()->SetBinLabel(2,"Track");
867 hWhichVert->GetXaxis()->SetBinLabel(3,"SPD-3D");
868 hWhichVert->GetXaxis()->SetBinLabel(4,"SPD-z");
869 TH1F* hWhichVertSelEv=new TH1F("hWhichVertSelEv","Vertex Type",4,-1.5,2.5);
870 hWhichVertSelEv->GetXaxis()->SetBinLabel(1,"Not found");
871 hWhichVertSelEv->GetXaxis()->SetBinLabel(2,"Track");
872 hWhichVertSelEv->GetXaxis()->SetBinLabel(3,"SPD-3D");
873 hWhichVertSelEv->GetXaxis()->SetBinLabel(4,"SPD-z");
875 TH2F* hTrigCent=new TH2F("hTrigCent","Centrality vs. Trigger types",24,-1.5,22.5,12,-10,110);
876 hTrigCent->GetXaxis()->SetBinLabel(1,"All");
877 hTrigCent->GetXaxis()->SetBinLabel(2,"kAny");
878 hTrigCent->GetXaxis()->SetBinLabel(3,"kMB");
879 hTrigCent->GetXaxis()->SetBinLabel(4,"kINT7");
880 hTrigCent->GetXaxis()->SetBinLabel(5,"kINT8");
881 hTrigCent->GetXaxis()->SetBinLabel(6,"kCINT5");
882 hTrigCent->GetXaxis()->SetBinLabel(7,"kCent");
883 hTrigCent->GetXaxis()->SetBinLabel(8,"kSemiCent");
884 hTrigCent->GetXaxis()->SetBinLabel(9,"kEMC1");
885 hTrigCent->GetXaxis()->SetBinLabel(10,"kEMC7");
886 hTrigCent->GetXaxis()->SetBinLabel(11,"kEMC8");
887 hTrigCent->GetXaxis()->SetBinLabel(12,"kEMCJET7");
888 hTrigCent->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
889 hTrigCent->GetXaxis()->SetBinLabel(14,"kEMCJET8");
890 hTrigCent->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
891 hTrigCent->GetXaxis()->SetBinLabel(16,"Muons");
892 hTrigCent->GetXaxis()->SetBinLabel(17,"PHOS");
893 hTrigCent->GetXaxis()->SetBinLabel(18,"TRD");
894 hTrigCent->GetXaxis()->SetBinLabel(19,"TRDHJT");
895 hTrigCent->GetXaxis()->SetBinLabel(20,"TRDHSE");
896 hTrigCent->GetXaxis()->SetBinLabel(21,"HighMult");
897 hTrigCent->GetXaxis()->SetBinLabel(22,"SPI7");
898 hTrigCent->GetXaxis()->SetBinLabel(23,"SPI8");
899 hTrigCent->GetXaxis()->SetBinLabel(24,"Others");
901 TH2F* hTrigMul=new TH2F("hTrigMul","Multiplicity vs. Trigger types",24,-1.5,22.5,1000,0.,10000.);
902 hTrigMul->GetXaxis()->SetBinLabel(1,"All");
903 hTrigMul->GetXaxis()->SetBinLabel(2,"kAny");
904 hTrigMul->GetXaxis()->SetBinLabel(3,"kMB");
905 hTrigMul->GetXaxis()->SetBinLabel(4,"kINT7");
906 hTrigMul->GetXaxis()->SetBinLabel(5,"kINT8");
907 hTrigMul->GetXaxis()->SetBinLabel(6,"kCINT5");
908 hTrigMul->GetXaxis()->SetBinLabel(7,"kCent");
909 hTrigMul->GetXaxis()->SetBinLabel(8,"kSemiCent");
910 hTrigMul->GetXaxis()->SetBinLabel(9,"kEMC1");
911 hTrigMul->GetXaxis()->SetBinLabel(10,"kEMC7");
912 hTrigMul->GetXaxis()->SetBinLabel(11,"kEMC8");
913 hTrigMul->GetXaxis()->SetBinLabel(12,"kEMCJET7");
914 hTrigMul->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
915 hTrigMul->GetXaxis()->SetBinLabel(14,"kEMCJET8");
916 hTrigMul->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
917 hTrigMul->GetXaxis()->SetBinLabel(16,"Muons");
918 hTrigMul->GetXaxis()->SetBinLabel(17,"PHOS");
919 hTrigMul->GetXaxis()->SetBinLabel(18,"TRD");
920 hTrigMul->GetXaxis()->SetBinLabel(19,"TRDHJT");
921 hTrigMul->GetXaxis()->SetBinLabel(20,"TRDHSE");
922 hTrigMul->GetXaxis()->SetBinLabel(21,"HighMult");
923 hTrigMul->GetXaxis()->SetBinLabel(22,"SPI7");
924 hTrigMul->GetXaxis()->SetBinLabel(23,"SPI8");
925 hTrigMul->GetXaxis()->SetBinLabel(24,"Others");
927 TH2F* hTrigCentSel=new TH2F("hTrigCentSel","Trigger types",24,-1.5,22.5,12,-10,110);
928 hTrigCentSel->GetXaxis()->SetBinLabel(1,"All");
929 hTrigCentSel->GetXaxis()->SetBinLabel(2,"kAny");
930 hTrigCentSel->GetXaxis()->SetBinLabel(3,"kMB");
931 hTrigCentSel->GetXaxis()->SetBinLabel(4,"kINT7");
932 hTrigCentSel->GetXaxis()->SetBinLabel(5,"kINT8");
933 hTrigCentSel->GetXaxis()->SetBinLabel(6,"kCINT5");
934 hTrigCentSel->GetXaxis()->SetBinLabel(7,"kCent");
935 hTrigCentSel->GetXaxis()->SetBinLabel(8,"kSemiCent");
936 hTrigCentSel->GetXaxis()->SetBinLabel(9,"kEMC1");
937 hTrigCentSel->GetXaxis()->SetBinLabel(10,"kEMC7");
938 hTrigCentSel->GetXaxis()->SetBinLabel(11,"kEMC8");
939 hTrigCentSel->GetXaxis()->SetBinLabel(12,"kEMCJET7");
940 hTrigCentSel->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
941 hTrigCentSel->GetXaxis()->SetBinLabel(14,"kEMCJET8");
942 hTrigCentSel->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
943 hTrigCentSel->GetXaxis()->SetBinLabel(16,"Muons");
944 hTrigCentSel->GetXaxis()->SetBinLabel(17,"PHOS");
945 hTrigCentSel->GetXaxis()->SetBinLabel(18,"TRD");
946 hTrigCentSel->GetXaxis()->SetBinLabel(19,"TRDHJT");
947 hTrigCentSel->GetXaxis()->SetBinLabel(20,"TRDHSE");
948 hTrigCentSel->GetXaxis()->SetBinLabel(21,"HighMult");
949 hTrigCentSel->GetXaxis()->SetBinLabel(22,"SPI7");
950 hTrigCentSel->GetXaxis()->SetBinLabel(23,"SPI8");
951 hTrigCentSel->GetXaxis()->SetBinLabel(24,"Others");
953 TH2F* hTrigMulSel=new TH2F("hTrigMulSel","Multiplicity after selection vs. Trigger types",24,-1.5,22.5,1000,0.,10000.);
954 hTrigMulSel->GetXaxis()->SetBinLabel(1,"All");
955 hTrigMulSel->GetXaxis()->SetBinLabel(2,"kAny");
956 hTrigMulSel->GetXaxis()->SetBinLabel(3,"kMB");
957 hTrigMulSel->GetXaxis()->SetBinLabel(4,"kINT7");
958 hTrigMulSel->GetXaxis()->SetBinLabel(5,"kINT8");
959 hTrigMulSel->GetXaxis()->SetBinLabel(6,"kCINT5");
960 hTrigMulSel->GetXaxis()->SetBinLabel(7,"kCent");
961 hTrigMulSel->GetXaxis()->SetBinLabel(8,"kSemiCent");
962 hTrigMulSel->GetXaxis()->SetBinLabel(9,"kEMC1");
963 hTrigMulSel->GetXaxis()->SetBinLabel(10,"kEMC7");
964 hTrigMulSel->GetXaxis()->SetBinLabel(11,"kEMC8");
965 hTrigMulSel->GetXaxis()->SetBinLabel(12,"kEMCJET7");
966 hTrigMulSel->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
967 hTrigMulSel->GetXaxis()->SetBinLabel(14,"kEMCJET8");
968 hTrigMulSel->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
969 hTrigMulSel->GetXaxis()->SetBinLabel(16,"Muons");
970 hTrigMulSel->GetXaxis()->SetBinLabel(17,"PHOS");
971 hTrigMulSel->GetXaxis()->SetBinLabel(18,"TRD");
972 hTrigMulSel->GetXaxis()->SetBinLabel(19,"TRDHJT");
973 hTrigMulSel->GetXaxis()->SetBinLabel(20,"TRDHSE");
974 hTrigMulSel->GetXaxis()->SetBinLabel(21,"HighMult");
975 hTrigMulSel->GetXaxis()->SetBinLabel(22,"SPI7");
976 hTrigMulSel->GetXaxis()->SetBinLabel(23,"SPI8");
977 hTrigMulSel->GetXaxis()->SetBinLabel(24,"Others");
979 AliCounterCollection *trigCounter=new AliCounterCollection("trigCounter");
980 trigCounter->AddRubric("run",500000);
981 trigCounter->AddRubric("triggerType","All/Any/MB/Cent/SemiCent/EMCAL/MUON/NoPhysSelMUON/NoPhysSelEvNot7/NoPhysSelCMUP1/NoPhysSelMB/NoPhysSelCent/NoPhysSelSemiCent/CINT7/INT8");
984 AliCounterCollection *trigCounter2=new AliCounterCollection("trigCounter2");
985 trigCounter2->AddRubric("run",500000);
986 trigCounter2->AddRubric("triggerType","All/Any/MB/CINT7/INT8/NoPhysSelEvNot7/NoPhysSelMB/HighMult/SPI7/SPI8/EMC1/EMC7/EMC8/EMCJET7/EMCJET8/EMCGAMMA/TRD/TRDHJT/TRDHSE");
987 trigCounter2->Init();
989 TH1F* hWhyEvRejected=new TH1F("hWhyEvRejected", "Why Event rejected",7,-1.5,5.5);
991 hWhyEvRejected->GetXaxis()->SetBinLabel(1,"N events");
992 hWhyEvRejected->GetXaxis()->SetBinLabel(2,"pileup");
993 hWhyEvRejected->GetXaxis()->SetBinLabel(3,"centrality");
994 hWhyEvRejected->GetXaxis()->SetBinLabel(4,"Vertex not found");
995 hWhyEvRejected->GetXaxis()->SetBinLabel(5,"trigger");
996 hWhyEvRejected->GetXaxis()->SetBinLabel(6,"z vertex out of 10 cm");
997 hWhyEvRejected->GetXaxis()->SetBinLabel(7,"physics sel");
1000 fOutputEvSelection->Add(evselection);
1001 fOutputEvSelection->Add(hxvtx);
1002 fOutputEvSelection->Add(hyvtx);
1003 fOutputEvSelection->Add(hzvtx);
1004 fOutputEvSelection->Add(hxvtxSelEv);
1005 fOutputEvSelection->Add(hyvtxSelEv);
1006 fOutputEvSelection->Add(hzvtxSelEv);
1007 fOutputEvSelection->Add(hWhichVert);
1008 fOutputEvSelection->Add(hWhichVertSelEv);
1009 fOutputEvSelection->Add(hTrigCent);
1010 fOutputEvSelection->Add(hTrigMul);
1011 fOutputEvSelection->Add(hTrigMulSel);
1012 fOutputEvSelection->Add(hTrigCentSel);
1013 fOutputEvSelection->Add(trigCounter);
1014 fOutputEvSelection->Add(trigCounter2);
1015 fOutputEvSelection->Add(hWhyEvRejected);
1018 if(fOnOff[4]){ // FLOW OBSERVABLES
1019 fOutputFlowObs=new TList();
1020 fOutputFlowObs->SetOwner();
1021 fOutputFlowObs->SetName(GetOutputSlot(8)->GetContainer()->GetName());
1023 fFlowEvent = new AliFlowEvent(3000);
1024 fRFPcuts = new AliFlowTrackCuts("rfpCuts");
1026 TH2F *hFEvents = new TH2F("hFlowEvents","FlowEvent Selection",7,0,7,7,-10,60);
1027 hFEvents->GetXaxis()->SetBinLabel(1,"REACHED");
1028 hFEvents->GetXaxis()->SetBinLabel(2,"TRIGGERED");
1029 hFEvents->GetXaxis()->SetBinLabel(3,"kMB");
1030 hFEvents->GetXaxis()->SetBinLabel(4,"kCent");
1031 hFEvents->GetXaxis()->SetBinLabel(5,"kSemiC");
1032 hFEvents->GetXaxis()->SetBinLabel(6,"Triggered + vtx cut");
1033 hFEvents->GetXaxis()->SetBinLabel(7,"UnexpectedBehaviour");
1034 fOutputFlowObs->Add(hFEvents);
1039 TString ref[3] = {"FB1","FB128","VZE"};
1040 Int_t etabin[3] = {40,40,20};
1041 Int_t etamax[3] = { 1, 1, 5};
1042 for(Int_t i=0; i<3; ++i) {
1043 hQ[i]= new TProfile2D( Form("h%s_Q",ref[i].Data()),
1044 Form("Q_{2} components for %s",ref[i].Data()),
1046 hQ[i]->GetXaxis()->SetBinLabel(1,"Qx^{-}");
1047 hQ[i]->GetXaxis()->SetBinLabel(2,"Qy^{-}");
1048 hQ[i]->GetXaxis()->SetBinLabel(3,"Qx^{+}");
1049 hQ[i]->GetXaxis()->SetBinLabel(4,"Qy^{+}");
1050 hQ[i]->GetYaxis()->SetTitle("Centrality");
1051 fOutputFlowObs->Add(hQ[i]);
1053 hAngleQ[i] = new TH2F( Form("h%s_AngleQ",ref[i].Data()),
1054 Form("#Psi_{2} for %s",ref[i].Data()),
1055 72,0,TMath::Pi(),12,0,60);
1056 hAngleQ[i]->GetXaxis()->SetTitle( Form("#Psi_{2}^{%s}",ref[i].Data()) );
1057 hAngleQ[i]->GetYaxis()->SetTitle("Centrality");
1058 fOutputFlowObs->Add(hAngleQ[i]);
1060 hPhiEta[i] = new TH3F( Form("h%s_PhiEta",ref[i].Data()),
1061 Form("Eta vs Phi for %s",ref[i].Data()),
1062 144,0,TMath::TwoPi(),etabin[i],-1.0*etamax[i],+1.0*etamax[i],12,0,60);
1063 hPhiEta[i]->GetXaxis()->SetTitle("Phi");
1064 hPhiEta[i]->GetYaxis()->SetTitle("Eta");
1065 hPhiEta[i]->GetZaxis()->SetTitle("Centrality");
1066 fOutputFlowObs->Add(hPhiEta[i]);
1069 TH3F *hTPCVZE_AngleQ = new TH3F("hTPCVZE_AngleQ","#Psi_{2}^{VZERO} vs #Psi_{2}^{TPC}", 72,0,TMath::Pi(),72,0,TMath::Pi(),12,0,60);
1070 hTPCVZE_AngleQ->GetXaxis()->SetTitle("#Psi_{2}^{TPC}");
1071 hTPCVZE_AngleQ->GetYaxis()->SetTitle("#Psi_{2}^{VZE}");
1072 hTPCVZE_AngleQ->GetZaxis()->SetTitle("Centrality");
1073 fOutputFlowObs->Add(hTPCVZE_AngleQ);
1075 TH2F *hCentVsMultRPS = new TH2F("hCentVsMultRPS", " Centrality Vs. Multiplicity RPs",5000, 0, 5000.,12,0,60 );
1076 hCentVsMultRPS->GetXaxis()->SetTitle("Multiplicity RPs");
1077 hCentVsMultRPS->GetYaxis()->SetTitle("Centrality");
1078 fOutputFlowObs->Add(hCentVsMultRPS);
1082 PostData(1,fNEntries);
1084 if(fOnOff[1]) PostData(2,fOutputPID);
1085 if(fOnOff[0]) PostData(3,fOutputTrack);
1087 if(fOnOff[2]) PostData(5,fOutputCounters);
1088 if(fOnOff[3]) PostData(7,fOutputEvSelection);
1089 if(fOnOff[4]) PostData(8,fOutputFlowObs);
1091 if(!fOnOff[0] && !fOnOff[1] && !fOnOff[2]) AliError("Nothing will be filled!");
1094 //___________________________________________________________________________
1095 void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
1097 // Execute analysis for current event
1099 AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
1100 if(fDebug>2) printf("Analysing decay %d\n",fDecayChannel);
1101 // Post the data already here
1102 PostData(1,fNEntries);
1103 if(fOnOff[1]) PostData(2,fOutputPID);
1104 if(fOnOff[0]) PostData(3,fOutputTrack);
1107 PostData(5,fOutputCounters);
1108 if(fCuts->GetUseCentrality()) PostData(6,fOutputCheckCentrality);
1111 TClonesArray *arrayProng =0;
1113 Int_t *pdgdaughters=0x0;
1115 if(!aod && AODEvent() && IsStandardAOD()) {
1116 // In case there is an AOD handler writing a standard AOD, use the AOD
1117 // event in memory rather than the input (ESD) event.
1118 aod = dynamic_cast<AliAODEvent*> (AODEvent());
1119 // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
1120 // have to taken from the AOD event hold by the AliAODExtension
1121 AliAODHandler* aodHandler = (AliAODHandler*)
1122 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1123 if(aodHandler->GetExtensions()) {
1125 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
1126 AliAODEvent *aodFromExt = ext->GetAOD();
1130 switch(fDecayChannel){
1132 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1135 pdgdaughters =new Int_t[3];
1136 pdgdaughters[0]=211;//pi
1137 pdgdaughters[1]=321;//K
1138 pdgdaughters[2]=211;//pi
1142 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
1145 pdgdaughters =new Int_t[2];
1146 pdgdaughters[0]=211;//pi
1147 pdgdaughters[1]=321;//K
1151 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar");
1154 pdgdaughters =new Int_t[3];
1155 pdgdaughters[1]=211;//pi
1156 pdgdaughters[0]=321;//K
1157 pdgdaughters[2]=211;//pi (soft?)
1161 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1164 pdgdaughters =new Int_t[3];
1165 pdgdaughters[0]=321;//K
1166 pdgdaughters[1]=321;//K
1167 pdgdaughters[2]=211;//pi
1171 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm4Prong");
1174 pdgdaughters =new Int_t[4];
1175 pdgdaughters[0]=321;
1176 pdgdaughters[1]=211;
1177 pdgdaughters[2]=211;
1178 pdgdaughters[3]=211;
1182 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1185 pdgdaughters =new Int_t[3];
1186 pdgdaughters[0]=2212;//p
1187 pdgdaughters[1]=321;//K
1188 pdgdaughters[2]=211;//pi
1192 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("CascadesHF");
1195 pdgdaughters =new Int_t[3];
1196 pdgdaughters[0]=2212;//p
1197 pdgdaughters[1]=211;//pi
1198 pdgdaughters[2]=211;//pi
1204 switch(fDecayChannel){
1206 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1209 pdgdaughters =new Int_t[3];
1210 pdgdaughters[0]=211;//pi
1211 pdgdaughters[1]=321;//K
1212 pdgdaughters[2]=211;//pi
1216 arrayProng=(TClonesArray*)aod->GetList()->FindObject("D0toKpi");
1219 pdgdaughters =new Int_t[2];
1220 pdgdaughters[0]=211;//pi
1221 pdgdaughters[1]=321;//K
1225 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Dstar");
1228 pdgdaughters =new Int_t[3];
1229 pdgdaughters[1]=211;//pi
1230 pdgdaughters[0]=321;//K
1231 pdgdaughters[2]=211;//pi (soft?)
1235 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1238 pdgdaughters =new Int_t[3];
1239 pdgdaughters[0]=321;//K
1240 pdgdaughters[1]=321;//K
1241 pdgdaughters[2]=211;//pi
1245 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm4Prong");
1248 pdgdaughters =new Int_t[4];
1249 pdgdaughters[0]=321;
1250 pdgdaughters[1]=211;
1251 pdgdaughters[2]=211;
1252 pdgdaughters[3]=211;
1256 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1259 pdgdaughters =new Int_t[3];
1260 pdgdaughters[0]=2212;//p
1261 pdgdaughters[1]=321;//K
1262 pdgdaughters[2]=211;//pi
1266 arrayProng=(TClonesArray*)aod->GetList()->FindObject("CascadesHF");
1269 pdgdaughters =new Int_t[3];
1270 pdgdaughters[0]=2212;//p
1271 pdgdaughters[1]=211;//pi
1272 pdgdaughters[2]=211;//pi
1277 Bool_t isSimpleMode=fSimpleMode;
1279 AliInfo("Branch not found! The output will contain only track related histograms\n");
1284 TClonesArray *mcArray = 0;
1285 AliAODMCHeader *mcHeader = 0;
1288 delete [] pdgdaughters;
1294 // load MC particles
1295 mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1297 printf("AliAnalysisTaskSEHFQA::UserExec: MC particles branch not found!\n");
1298 delete [] pdgdaughters;
1303 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1305 printf("AliAnalysisTaskSEHFQA::UserExec: MC header branch not found!\n");
1306 delete [] pdgdaughters;
1312 UInt_t evSelMask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1313 Double_t centrality=fCuts->GetCentrality(aod);
1314 Double_t multiplicity=aod->GetHeader()->GetRefMultiplicity();
1315 Int_t runNumber = aod->GetRunNumber();
1316 TString trigClass=aod->GetFiredTriggerClasses();
1317 Int_t nAODtracks=aod->GetNTracks();
1318 Int_t nSelTracksTPCOnly=0;
1319 Int_t nSelTracksTPCITS=0;
1320 Int_t nSelTracksTPCITS1SPD=0;
1321 Int_t ntracksFBit4=0;
1323 AliTRDTriggerAnalysis trdSelection;
1324 trdSelection.CalcTriggers(aod);
1327 if(aod->GetTriggerMask()==0 &&
1328 (runNumber>=195344 && runNumber<=195677)){
1329 AliDebug(3,"Event rejected because of null trigger mask");
1330 delete [] pdgdaughters;
1335 for (Int_t k=0;k<nAODtracks;k++){
1336 AliAODTrack* track=aod->GetTrack(k);
1337 if(track->GetID()<0) continue;
1338 Int_t nclsTot=0,nclsSPD=0;
1339 for(Int_t l=0;l<6;l++) {
1340 if(TESTBIT(track->GetITSClusterMap(),l)) {
1341 nclsTot++; if(l<2) nclsSPD++;
1344 UShort_t nTPCClus=track->GetTPCClusterMap().CountBits();
1345 if(TMath::Abs(track->Eta())<0.8 && nTPCClus>=70 && track->GetStatus()&AliESDtrack::kTPCrefit){
1346 if(track->TestFilterBit(1)) nSelTracksTPCOnly++;
1347 if(track->GetStatus()&AliESDtrack::kITSrefit){
1349 if(nclsSPD>0) nSelTracksTPCITS1SPD++;
1352 if(track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){
1359 PostData(8,fOutputFlowObs);
1362 TH2F* hTrigC=(TH2F*)fOutputEvSelection->FindObject("hTrigCent");
1363 TH2F* hTrigM=(TH2F*)fOutputEvSelection->FindObject("hTrigMul");
1364 AliCounterCollection* trigCount=(AliCounterCollection*)fOutputEvSelection->FindObject("trigCounter");
1365 AliCounterCollection* trigCount2=(AliCounterCollection*)fOutputEvSelection->FindObject("trigCounter2");
1367 hTrigC->Fill(-1.,centrality);
1368 hTrigM->Fill(-1.,multiplicity);
1369 trigCount->Count(Form("triggerType:All/Run:%d",runNumber));
1370 trigCount2->Count(Form("triggerType:All/Run:%d",runNumber));
1372 if(aod->GetEventType()!=7){
1373 trigCount->Count(Form("triggerType:NoPhysSelEvNot7/Run:%d",runNumber));
1374 trigCount2->Count(Form("triggerType:NoPhysSelEvNot7/Run:%d",runNumber));
1375 }else if(trigClass.Contains("CMUP1")){
1376 trigCount->Count(Form("triggerType:NoPhysSelCMUP1/Run:%d",runNumber));
1377 }else if(trigClass.Contains("MUON")){
1378 trigCount->Count(Form("triggerType:NoPhysSelMUON/Run:%d",runNumber));
1379 }else if(trigClass.Contains("CPBI2_B1-B") || trigClass.Contains(" CPBI2WU_B1-B")){
1380 trigCount->Count(Form("triggerType:NoPhysSelMB/Run:%d",runNumber));
1381 trigCount2->Count(Form("triggerType:NoPhysSelMB/Run:%d",runNumber));
1382 }else if(trigClass.Contains("CCENT") || trigClass.Contains("CVHN")){
1383 trigCount->Count(Form("triggerType:NoPhysSelCent/Run:%d",runNumber));
1384 }else if(trigClass.Contains("CSEMI") || trigClass.Contains("CVLN")){
1385 trigCount->Count(Form("triggerType:NoPhysSelSemiCent/Run:%d",runNumber));
1388 if(evSelMask & AliVEvent::kAny){
1389 hTrigC->Fill(0.,centrality);
1390 hTrigM->Fill(0.,multiplicity);
1391 trigCount->Count(Form("triggerType:Any/Run:%d",runNumber));
1392 trigCount2->Count(Form("triggerType:Any/Run:%d",runNumber));
1394 if(evSelMask & AliVEvent::kMB){
1395 hTrigC->Fill(1.,centrality);
1396 hTrigM->Fill(1.,multiplicity);
1397 trigCount->Count(Form("triggerType:MB/Run:%d",runNumber));
1398 trigCount2->Count(Form("triggerType:MB/Run:%d",runNumber));
1400 if(evSelMask & AliVEvent::kINT7){
1401 hTrigC->Fill(2.,centrality);
1402 hTrigM->Fill(2.,multiplicity);
1403 trigCount->Count(Form("triggerType:CINT7/Run:%d",runNumber));
1404 trigCount2->Count(Form("triggerType:CINT7/Run:%d",runNumber));
1406 if(evSelMask & AliVEvent::kINT8){
1407 hTrigC->Fill(3.,centrality);
1408 hTrigM->Fill(3.,multiplicity);
1409 trigCount->Count(Form("triggerType:INT8/Run:%d",runNumber));
1410 trigCount2->Count(Form("triggerType:INT8/Run:%d",runNumber));
1412 if(evSelMask & AliVEvent::kCINT5){
1413 hTrigC->Fill(4.,centrality);
1414 hTrigM->Fill(4.,multiplicity);
1416 if(evSelMask & AliVEvent::kCentral){
1417 hTrigC->Fill(5.,centrality);
1418 hTrigM->Fill(5.,multiplicity);
1419 trigCount->Count(Form("triggerType:Cent/Run:%d",runNumber));
1421 if(evSelMask & AliVEvent::kSemiCentral){
1422 hTrigC->Fill(6.,centrality);
1423 hTrigM->Fill(6.,multiplicity);
1424 trigCount->Count(Form("triggerType:SemiCent/Run:%d",runNumber));
1427 if(evSelMask & AliVEvent::kEMC1){
1428 hTrigC->Fill(7.,centrality);
1429 hTrigM->Fill(7.,multiplicity);
1430 trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1431 trigCount2->Count(Form("triggerType:EMC1/Run:%d",runNumber));
1433 if((evSelMask & AliVEvent::kEMC7) && trigClass.Contains("CEMC7")){
1434 hTrigC->Fill(8.,centrality);
1435 hTrigM->Fill(8.,multiplicity);
1436 trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1437 trigCount2->Count(Form("triggerType:EMC7/Run:%d",runNumber));
1439 if((evSelMask & AliVEvent::kEMC8) && trigClass.Contains("CEMC8")){
1440 hTrigC->Fill(9.,centrality);
1441 hTrigM->Fill(9.,multiplicity);
1442 trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1443 trigCount2->Count(Form("triggerType:EMC8/Run:%d",runNumber));
1445 if(evSelMask & AliVEvent::kEMCEJE){
1446 trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1447 if(trigClass.Contains("CEMC7EJE")) {
1448 trigCount2->Count(Form("triggerType:EMCJET7/Run:%d",runNumber));
1449 hTrigC->Fill(10.,centrality);
1450 hTrigM->Fill(10.,multiplicity);
1453 else if(trigClass.Contains("CEMC8EJE")) {
1454 trigCount2->Count(Form("triggerType:EMCJET8/Run:%d",runNumber));
1455 hTrigC->Fill(12.,centrality);
1456 hTrigM->Fill(12.,multiplicity);
1459 if(evSelMask & AliVEvent::kEMCEGA){
1460 if(trigClass.Contains("CEMC7EGA")) {
1461 hTrigC->Fill(11.,centrality);
1462 hTrigM->Fill(11.,multiplicity);
1463 } else if (trigClass.Contains("CEMC8EGA")){
1464 hTrigC->Fill(13.,centrality);
1465 hTrigM->Fill(13.,multiplicity);
1468 trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1469 trigCount2->Count(Form("triggerType:EMCGAMMA/Run:%d",runNumber));
1471 if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) | (AliVEvent::kMUS7 | AliVEvent::kMUON))){
1472 hTrigC->Fill(14.,centrality);
1473 hTrigM->Fill(14.,multiplicity);
1474 trigCount->Count(Form("triggerType:MUON/Run:%d",runNumber));
1476 if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)){
1477 hTrigC->Fill(15.,centrality);
1478 hTrigM->Fill(15.,multiplicity);
1480 if(evSelMask & (AliVEvent::kTRD)){
1481 hTrigC->Fill(16.,centrality);
1482 hTrigM->Fill(16.,multiplicity);
1483 trigCount2->Count(Form("triggerType:TRD/Run:%d",runNumber));
1485 if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHJT)){
1486 hTrigC->Fill(17.,centrality);
1487 hTrigM->Fill(17.,multiplicity);
1488 trigCount2->Count(Form("triggerType:TRDHJT/Run:%d",runNumber));
1490 if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHSE)){
1491 hTrigC->Fill(18.,centrality);
1492 hTrigM->Fill(18.,multiplicity);
1493 trigCount2->Count(Form("triggerType:TRDHSE/Run:%d",runNumber));
1495 if(evSelMask & (AliVEvent::kHighMult)){
1496 hTrigC->Fill(19.,centrality);
1497 hTrigM->Fill(19.,multiplicity);
1498 trigCount2->Count(Form("triggerType:HighMult/Run:%d",runNumber));
1500 if(evSelMask & AliVEvent::kSPI7){
1501 if(trigClass.Contains("CSPI7")) {
1502 hTrigC->Fill(20.,centrality);
1503 hTrigM->Fill(20.,multiplicity);
1504 trigCount2->Count(Form("triggerType:SPI7/Run:%d",runNumber));
1507 if(evSelMask & AliVEvent::kSPI){
1508 if(trigClass.Contains("CSPI8")) {
1509 hTrigC->Fill(21.,centrality);
1510 hTrigM->Fill(21.,multiplicity);
1511 trigCount2->Count(Form("triggerType:SPI8/Run:%d",runNumber));
1514 if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)){
1515 hTrigC->Fill(22.,centrality);
1516 hTrigM->Fill(22.,multiplicity);
1521 // fix for temporary bug in ESDfilter
1522 // the AODs with null vertex pointer didn't pass the PhysSel
1523 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001) {
1524 delete [] pdgdaughters;
1531 //count events with good vertex
1532 // AOD primary vertex
1533 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1535 Double_t pos[3],cov[6];
1537 vtx1->GetCovarianceMatrix(cov);
1538 const AliESDVertex vESD(pos,cov,100.,100);
1540 TString primTitle = vtx1->GetTitle();
1541 if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0) fNEntries->Fill(4);
1543 // trigger class for PbPb C0SMH-B-NOPF-ALLNOTRD, C0SMH-B-NOPF-ALL
1544 //TString trigclass=aod->GetFiredTriggerClasses();
1545 //if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL")) fNEntries->Fill(5); //tmp
1550 Bool_t evSelbyCentrality=kTRUE,evSelected=kTRUE,evSelByVertex=kTRUE,evselByPileup=kTRUE,evSelByPS=kTRUE;
1552 TH1F* hWhyEvRejected=0x0;
1554 hWhyEvRejected=(TH1F*)fOutputEvSelection->FindObject("hWhyEvRejected");
1555 if(hWhyEvRejected) hWhyEvRejected->Fill(-1);
1559 if(!fCuts->IsEventSelected(aod)) {
1561 if(fCuts->IsEventRejectedDueToPileup()) {
1562 if(hWhyEvRejected) hWhyEvRejected->Fill(0);
1563 evselByPileup=kFALSE;
1564 }// rejected for pileup
1565 if(fCuts->IsEventRejectedDueToCentrality()) {
1566 if(hWhyEvRejected) hWhyEvRejected->Fill(1);
1567 evSelbyCentrality=kFALSE; //rejected by centrality
1569 if(fCuts->IsEventRejectedDueToNotRecoVertex() ||
1570 fCuts->IsEventRejectedDueToVertexContributors()){
1571 evSelByVertex=kFALSE;
1572 if(hWhyEvRejected) hWhyEvRejected->Fill(2);
1574 if(fCuts->IsEventRejectedDueToTrigger()){
1575 if(hWhyEvRejected) hWhyEvRejected->Fill(3);
1577 if(fCuts->IsEventRejectedDueToZVertexOutsideFiducialRegion()) {
1578 evSelByVertex=kFALSE;
1579 if(fOnOff[3]) ((AliCounterCollection*)fOutputEvSelection->FindObject("evselection"))->Count(Form("evnonsel:zvtx/Run:%d",runNumber));
1580 if(hWhyEvRejected) hWhyEvRejected->Fill(4);
1582 if(fCuts->IsEventRejectedDuePhysicsSelection()) {
1584 if(hWhyEvRejected) hWhyEvRejected->Fill(5);
1587 if(evSelected && fOnOff[3]){
1588 TH2F* hTrigS=(TH2F*)fOutputEvSelection->FindObject("hTrigCentSel");
1589 TH2F* hTrigSM=(TH2F*)fOutputEvSelection->FindObject("hTrigMulSel");
1590 hTrigS->Fill(-1.,centrality);
1591 hTrigSM->Fill(-1.,multiplicity);
1592 if(evSelMask & AliVEvent::kAny) {
1593 hTrigS->Fill(0.,centrality);
1594 hTrigSM->Fill(0.,multiplicity);}
1595 if(evSelMask & AliVEvent::kMB) {
1596 hTrigS->Fill(1.,centrality);
1597 hTrigSM->Fill(1.,multiplicity);}
1598 if(evSelMask & AliVEvent::kINT7){
1599 hTrigS->Fill(2.,centrality);
1600 hTrigSM->Fill(2.,multiplicity);}
1601 if(evSelMask & AliVEvent::kINT8){
1602 hTrigS->Fill(3.,centrality);
1603 hTrigSM->Fill(3.,multiplicity);}
1604 if(evSelMask & AliVEvent::kCINT5){
1605 hTrigS->Fill(4.,centrality);
1606 hTrigSM->Fill(4.,multiplicity);}
1607 if(evSelMask & AliVEvent::kCentral){
1608 hTrigS->Fill(5.,centrality);
1609 hTrigSM->Fill(5.,multiplicity);}
1610 if(evSelMask & AliVEvent::kSemiCentral){
1611 hTrigS->Fill(6.,centrality);
1612 hTrigSM->Fill(6.,multiplicity);}
1613 if(evSelMask & AliVEvent::kEMC1){
1614 hTrigS->Fill(7.,centrality);
1615 hTrigSM->Fill(7.,multiplicity);
1617 if((evSelMask & AliVEvent::kEMC7) && trigClass.Contains("CEMC7")){
1618 hTrigS->Fill(8.,centrality);
1619 hTrigSM->Fill(8.,multiplicity);
1621 if((evSelMask & AliVEvent::kEMC8) && trigClass.Contains("CEMC8")){
1622 hTrigS->Fill(9.,centrality);
1623 hTrigSM->Fill(9.,multiplicity);
1625 if((evSelMask & AliVEvent::kEMCEJE) && trigClass.Contains("CEMC7EJE")){
1626 hTrigS->Fill(10.,centrality);
1627 hTrigSM->Fill(10.,multiplicity);
1629 if((evSelMask & AliVEvent::kEMCEGA) && trigClass.Contains("CEMC7EGA")){
1630 hTrigS->Fill(11.,centrality);
1631 hTrigSM->Fill(11.,multiplicity);
1633 if((evSelMask & AliVEvent::kEMCEJE) && trigClass.Contains("CEMC8EJE")){
1634 hTrigS->Fill(12.,centrality);
1635 hTrigSM->Fill(12.,multiplicity);
1637 if((evSelMask & AliVEvent::kEMCEGA) && trigClass.Contains("CEMC8EGA")){
1638 hTrigS->Fill(13.,centrality);
1639 hTrigSM->Fill(13.,multiplicity);
1641 if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) | (AliVEvent::kMUS7 | AliVEvent::kMUON))){
1642 hTrigS->Fill(14.,centrality);
1643 hTrigSM->Fill(14.,multiplicity);}
1644 if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)){
1645 hTrigS->Fill(15.,centrality);
1646 hTrigSM->Fill(15.,multiplicity);}
1647 if(evSelMask & (AliVEvent::kTRD)){
1648 hTrigS->Fill(16.,centrality);
1649 hTrigSM->Fill(16.,multiplicity);
1651 if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHJT)){
1652 hTrigS->Fill(17.,centrality);
1653 hTrigSM->Fill(17.,multiplicity);
1655 if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHSE)){
1656 hTrigS->Fill(18.,centrality);
1657 hTrigSM->Fill(18.,multiplicity);
1659 if(evSelMask & (AliVEvent::kHighMult)){
1660 hTrigS->Fill(19.,centrality);
1661 hTrigSM->Fill(19.,multiplicity);}
1662 if(evSelMask & AliVEvent::kSPI7){
1663 if(trigClass.Contains("CSPI7")) {
1664 hTrigS->Fill(20.,centrality);
1665 hTrigSM->Fill(20.,multiplicity);
1668 if(evSelMask & AliVEvent::kSPI){
1669 if(trigClass.Contains("CSPI8")) {
1670 hTrigS->Fill(21.,centrality);
1671 hTrigSM->Fill(21.,multiplicity);
1674 if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)){
1675 hTrigS->Fill(22.,centrality);
1676 hTrigSM->Fill(22.,multiplicity);}
1679 if(evSelected || (!evSelbyCentrality && evSelByVertex && evselByPileup && evSelByPS)){ //events selected or not selected because of centrality
1680 if(fOnOff[2] && fCuts->GetUseCentrality()){
1682 Float_t stdCentf=fCuts->GetCentrality(aod);
1683 Int_t stdCent = (Int_t)(stdCentf+0.5);
1684 Float_t secondCentf =fCuts->GetCentrality(aod,fEstimator);
1685 Int_t secondCent = (Int_t)(secondCentf+0.5);
1686 Int_t mincent=stdCent-stdCent%10;
1687 Float_t stdSignal = 0.;
1688 Float_t secondSignal = 0.;
1689 AliAODVZERO *vzeroAOD = (AliAODVZERO*)aod->GetVZEROData();
1690 AliAODZDC *zdcAOD = (AliAODZDC*)aod->GetZDCData();
1691 const Double_t *towerZNASignal = zdcAOD->GetZNATowerEnergy();
1692 switch(fCuts->GetUseCentrality())
1694 case AliRDHFCuts::kCentV0M:
1695 stdSignal = vzeroAOD->GetMTotV0A() + vzeroAOD->GetMTotV0C();
1697 case AliRDHFCuts::kCentV0A:
1698 stdSignal = vzeroAOD->GetMTotV0A();
1700 case AliRDHFCuts::kCentZNA:
1701 stdSignal = towerZNASignal[0];
1709 case AliRDHFCuts::kCentV0M:
1710 secondSignal = vzeroAOD->GetMTotV0A() + vzeroAOD->GetMTotV0C();
1712 case AliRDHFCuts::kCentV0A:
1713 secondSignal = vzeroAOD->GetMTotV0A();
1715 case AliRDHFCuts::kCentZNA:
1716 secondSignal = towerZNASignal[0];
1722 //AliCentrality *aodcent = aod->GetCentrality();
1723 // Float_t spdCentf = aodcent->GetCentralityPercentile("CL1");
1728 if(mincent==100)mincent--;
1729 ((AliCounterCollection*)fOutputCounters->FindObject("stdEstimator"))->Count(Form("centralityclass:%d_%d/Run:%d",mincent,mincent+10,runNumber));
1731 mincent=secondCent-secondCent%10;
1732 if(secondCentf==-1) {
1736 if(mincent==100)mincent--;
1737 ((AliCounterCollection*)fOutputCounters->FindObject("secondEstimator"))->Count(Form("centralityclass:%d_%d/Run:%d",mincent,mincent+10,runNumber));
1739 if(stdCent<fCuts->GetMinCentrality() || stdCent>fCuts->GetMaxCentrality()){
1740 ((TH1F*)fOutputCheckCentrality->FindObject("hNtrackletsOut"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
1741 ((TH1F*)fOutputCheckCentrality->FindObject("hMultOut"))->Fill(aod->GetHeader()->GetRefMultiplicity());
1743 ((TH1F*)fOutputCheckCentrality->FindObject("hNtrackletsIn"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
1744 ((TH1F*)fOutputCheckCentrality->FindObject("hMultIn"))->Fill(aod->GetHeader()->GetRefMultiplicity());
1746 ((TH2F*)fOutputCheckCentrality->FindObject("hMultvsPercentile"))->Fill(aod->GetHeader()->GetRefMultiplicity(),stdCentf);
1747 ((TH2F*)fOutputCheckCentrality->FindObject("hntrklvsPercentile"))->Fill(aod->GetTracklets()->GetNumberOfTracklets(),stdCentf);
1748 ((TH2F*)fOutputCheckCentrality->FindObject("hntrklvsPercentile01"))->Fill(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.),stdCentf);
1749 ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCTracksvsPercentile"))->Fill(nSelTracksTPCOnly,stdCentf);
1750 ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCITSTracksvsPercentile"))->Fill(nSelTracksTPCITS,stdCentf);
1751 ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCITS1SPDTracksvsPercentile"))->Fill(nSelTracksTPCITS1SPD,stdCentf);
1752 ((TH2F*)fOutputCheckCentrality->FindObject("hStdEstimSignalPercentile"))->Fill(stdSignal,stdCentf);
1753 ((TH1F*)fOutputCheckCentrality->FindObject("hStdEstimSignal"))->Fill(stdSignal);
1754 ((TH2F*)fOutputCheckCentrality->FindObject("hStdEstimSignalNtrackletsIn"))->Fill(stdSignal,aod->GetTracklets()->GetNumberOfTracklets());
1755 ((TH2F*)fOutputCheckCentrality->FindObject("hStdPercentileSecondPercentile"))->Fill(stdCentf,secondCentf);
1756 ((TH2F*)fOutputCheckCentrality->FindObject("hStdSignalSecondSignal"))->Fill(stdSignal,secondSignal);
1758 PostData(6,fOutputCheckCentrality);
1762 ((TH1F*)fOutputTrack->FindObject("hNtracklets"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
1763 ((TH1F*)fOutputTrack->FindObject("hNtracklets01"))->Fill(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.));
1764 ((TH1F*)fOutputTrack->FindObject("hMult"))->Fill(aod->GetHeader()->GetRefMultiplicity());
1765 ((TH1F*)fOutputTrack->FindObject("hMultFBit4"))->Fill(ntracksFBit4);
1766 ((TH1F*)fOutputTrack->FindObject("hMultComb05"))->Fill(aod->GetHeader()->GetRefMultiplicityComb05());
1767 ((TH1F*)fOutputTrack->FindObject("hMultComb08"))->Fill(aod->GetHeader()->GetRefMultiplicityComb08());
1773 const AliVVertex *vertex = aod->GetPrimaryVertex();
1774 Double_t xvtx=vertex->GetX();
1775 Double_t yvtx=vertex->GetY();
1776 Double_t zvtx=vertex->GetZ();
1778 if(vertex->GetNContributors()<=0) vtxTyp=-1;
1779 TString title=vertex->GetTitle();
1780 if(title.Contains("Z")) vtxTyp=2;
1781 if(title.Contains("3D")) vtxTyp=1;
1782 ((TH1F*)fOutputEvSelection->FindObject("hxvtx"))->Fill(xvtx);
1783 ((TH1F*)fOutputEvSelection->FindObject("hyvtx"))->Fill(yvtx);
1784 ((TH1F*)fOutputEvSelection->FindObject("hzvtx"))->Fill(zvtx);
1785 ((TH1F*)fOutputEvSelection->FindObject("hWhichVert"))->Fill(vtxTyp);
1787 ((TH1F*)fOutputEvSelection->FindObject("hxvtxSelEv"))->Fill(xvtx);
1788 ((TH1F*)fOutputEvSelection->FindObject("hyvtxSelEv"))->Fill(yvtx);
1789 ((TH1F*)fOutputEvSelection->FindObject("hzvtxSelEv"))->Fill(zvtx);
1790 ((TH1F*)fOutputEvSelection->FindObject("hWhichVertSelEv"))->Fill(vtxTyp);
1795 delete [] pdgdaughters;
1796 return; //discard all events not selected (vtx and/or centrality)
1800 AliAODPidHF* pidHF=fCuts->GetPidHF();
1802 delete [] pdgdaughters;
1805 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
1806 AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
1807 AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
1809 //AliPIDResponse* respF=pidHF->GetPidResponse();
1810 AliTPCPIDResponse* tpcres=new AliTPCPIDResponse();
1811 Bool_t oldPID=pidHF->GetOldPid();
1813 Double_t alephParameters[5];
1814 pidHF->GetTPCBetheBlochParams(alephParameters);
1815 tpcres->SetBetheBlochParameters(alephParameters[0],alephParameters[1],alephParameters[2],alephParameters[3],alephParameters[4]);
1820 Int_t isGoodTrack=0, isFakeTrack=0, isSelTrack=0;
1822 if(aod) ntracks=aod->GetNTracks();
1824 if(fOnOff[0] || fOnOff[1]){
1825 //loop on tracks in the event
1826 for (Int_t k=0;k<ntracks;k++){
1827 AliAODTrack* track=aod->GetTrack(k);
1829 // Track selection cuts
1830 if(track->GetID()<0) continue;
1831 Double_t d0z0[2],covd0z0[3];
1832 if(!track->PropagateToDCA(vtx1,aod->GetMagneticField(),99999.,d0z0,covd0z0)) continue;
1833 if(track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){
1834 ((TH1F*)fOutputTrack->FindObject("hd0TracksFilterBit4"))->Fill(d0z0[0]);
1836 ULong_t trStatus=track->GetStatus();
1837 if(trStatus&AliESDtrack::kITSrefit){
1838 if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)){
1839 ((TH1F*)fOutputTrack->FindObject("hd0TracksSPDany"))->Fill(d0z0[0]);
1840 if(track->HasPointOnITSLayer(0)){
1841 ((TH1F*)fOutputTrack->FindObject("hd0TracksSPDin"))->Fill(d0z0[0]);
1846 Bool_t selTrack=kTRUE;
1847 if (!((trStatus & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||
1848 !((trStatus & AliVTrack::kITSrefit) == AliVTrack::kITSrefit)){
1852 Float_t nCrossedRowsTPC = track->GetTPCClusterInfo(2,1);
1853 Float_t ratioCrossedRowsOverFindableClustersTPC = 1.0;
1854 if (track->GetTPCNclsF()>0) {
1855 ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC/track->GetTPCNclsF();
1857 if ( nCrossedRowsTPC<70 || ratioCrossedRowsOverFindableClustersTPC<.8 ){
1861 if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)){
1862 ((TH1F*)fOutputTrack->FindObject("hd0TracksTPCITSSPDany"))->Fill(d0z0[0]);
1866 AliAODPid *pid = track->GetDetPid();
1867 if(!pid && fDebug>1) cout<<"No AliAODPid found"<<endl;
1869 if(pid && fOnOff[1]){
1870 Double_t times[AliPID::kSPECIES];
1871 pid->GetIntegratedTimes(times);
1873 Double_t tofRes[AliPID::kSPECIES];
1874 pid->GetTOFpidResolution(tofRes);
1877 TH1F* htmpfl=((TH1F*)fOutputPID->FindObject("hTOFflags"));
1879 if (trStatus&AliESDtrack::kTPCout) htmpfl->Fill(1.);
1880 if (trStatus&AliESDtrack::kTOFout) htmpfl->Fill(2.);
1881 if (trStatus&AliESDtrack::kTIME) htmpfl->Fill(3.);
1882 if (trStatus&AliESDtrack::kTOFpid) htmpfl->Fill(4.);
1883 if (trStatus&AliESDtrack::kTOFmismatch) htmpfl->Fill(5.);
1885 Bool_t isTOFok=kFALSE;
1887 Double_t prob[AliPID::kSPECIES];
1888 if(pidResp->ComputeTOFProbability(track,AliPID::kSPECIES,prob)==AliPIDResponse::kDetPidOk){
1894 if(selTrack && isTOFok){
1895 Double_t tofTime=pid->GetTOFsignal();
1896 AliTOFHeader* tofH=(AliTOFHeader*)aod->GetTOFHeader();
1897 if (tofH && (TMath::Abs(tofRes[0]) <= 1.E-16) ) { // new AOD
1898 // with new AOD we need to retrieve startTime, subtract it and retrieve correctly TOF PID resolutions *PA*
1899 AliTOFPIDResponse tofResp=pidResp->GetTOFResponse();
1900 Double_t startTime = tofResp.GetStartTime(track->P());
1901 Float_t startTimeRes = tofResp.GetStartTimeRes(track->P());
1902 Int_t startTimeMask = tofResp.GetStartTimeMask(track->P());
1903 ((TH1F*)fOutputPID->FindObject("hTOFstartTimeDistrib"))->Fill(startTime);
1904 ((TH1F*)fOutputPID->FindObject("hTOFstartTimeMask"))->Fill(startTimeMask);
1905 ((TH1F*)fOutputPID->FindObject("hTOFstartTimeRes"))->Fill(startTimeRes);
1907 for (Int_t type=0;type<AliPID::kSPECIES;type++) tofRes[type]=tofResp.GetExpectedSigma(track->P(),times[type],AliPID::ParticleMassZ(type));
1909 ((TH1F*)fOutputPID->FindObject("hTOFtime"))->Fill(times[AliPID::kProton]);
1910 ((TH2F*)fOutputPID->FindObject("hTOFtimeKaonHyptime"))->Fill(track->P(),tofTime-times[3]); //3 is kaon
1911 ((TH1F*)fOutputPID->FindObject("hTOFsig"))->Fill(tofTime);
1912 if (pid->GetTOFsignal()< 0) ((TH1F*)fOutputPID->FindObject("hTOFsig"))->Fill(-1);
1914 Double_t nsigma[3]={-10,-10,-10};
1915 nsigma[0]=pidResp->NumberOfSigmasTOF(track,AliPID::kPion);
1916 nsigma[1]=pidResp->NumberOfSigmasTOF(track,AliPID::kKaon);
1917 nsigma[2]=pidResp->NumberOfSigmasTOF(track,AliPID::kProton);
1919 ((TH2F*)fOutputPID->FindObject("hTOFsigmaKSigPid"))->Fill(track->P(),nsigma[1]);
1920 ((TH2F*)fOutputPID->FindObject("hTOFsigmaPionSigPid"))->Fill(track->P(),nsigma[0]);
1921 ((TH2F*)fOutputPID->FindObject("hTOFsigmaProtonSigPid"))->Fill(track->P(),nsigma[2]);
1923 Int_t label=track->GetLabel();
1924 if(label<=0) continue;
1925 AliMCParticle* mcpart=(AliMCParticle*)mcArray->At(label);
1927 Int_t abspdgcode=TMath::Abs(mcpart->PdgCode());
1928 if(abspdgcode==211) ((TH2F*)fOutputPID->FindObject("hTOFsigmaMCPionSigPid"))->Fill(track->P(),nsigma[0]);
1929 if(abspdgcode==321) ((TH2F*)fOutputPID->FindObject("hTOFsigmaMCKSigPid"))->Fill(track->P(),nsigma[1]);
1930 if(abspdgcode==2212) ((TH2F*)fOutputPID->FindObject("hTOFsigmaMCProtonSigPid"))->Fill(track->P(),nsigma[2]);
1935 for (Int_t iS=2; iS<5; iS++){ //we plot TOF Pid resolution for 3-sigma identified particles
1936 if ( TMath::Abs(nsigma[iS-2])<3.){
1939 ((TH1F*)fOutputPID->FindObject("hTOFsigPid3sigPion"))->Fill(tofRes[iS]);
1942 ((TH1F*)fOutputPID->FindObject("hTOFsigPid3sigKaon"))->Fill(tofRes[iS]);
1944 case AliPID::kProton:
1945 ((TH1F*)fOutputPID->FindObject("hTOFsigPid3sigProton"))->Fill(tofRes[iS]);
1955 if(pidHF && pidHF->CheckStatus(track,"TPC")){
1957 Double_t TPCp=pid->GetTPCmomentum();
1958 Double_t TPCsignal=pid->GetTPCsignal();
1959 UShort_t TPCsignalN=pid->GetTPCsignalN();
1960 ((TH1F*)fOutputPID->FindObject("hTPCsig"))->Fill(TPCsignal);
1961 ((TH1F*)fOutputPID->FindObject("hTPCsigvsp"))->Fill(TPCp,TPCsignal);
1962 //if (pidHF->IsKaonRaw(track, "TOF"))
1963 Double_t nsigma[3]={-10,-10,-10};
1964 pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kPion,nsigma[0]);
1965 pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kKaon,nsigma[1]);
1966 pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kProton,nsigma[2]);
1968 ((TH2F*)fOutputPID->FindObject("hTPCsigmaK"))->Fill(TPCp,nsigma[1]);
1970 ((TH2F*)fOutputPID->FindObject("hTPCsigmaPion"))->Fill(TPCp,nsigma[0]);
1971 ((TH2F*)fOutputPID->FindObject("hTPCsigmaProton"))->Fill(TPCp,nsigma[2]);
1974 Int_t label=track->GetLabel();
1975 if(label<=0) continue;
1976 AliMCParticle* mcpart=(AliMCParticle*)mcArray->At(label);
1978 Int_t abspdgcode=TMath::Abs(mcpart->PdgCode());
1979 if(abspdgcode==211) ((TH2F*)fOutputPID->FindObject("hTPCsigmaMCPion"))->Fill(track->P(),nsigma[0]);
1980 if(abspdgcode==321) ((TH2F*)fOutputPID->FindObject("hTPCsigmaMCK"))->Fill(track->P(),nsigma[1]);
1981 if(abspdgcode==2212) ((TH2F*)fOutputPID->FindObject("hTPCsigmaMCProton"))->Fill(track->P(),nsigma[2]);
1986 if(fFillDistrTrackEffChecks && track->GetStatus()&AliESDtrack::kITSrefit && track->GetStatus()&AliESDtrack::kTPCrefit){
1987 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPtAllTracks"))->Fill(track->Pt(),(Float_t)TPCsignalN);
1988 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPhiAllTracks"))->Fill(track->Phi(),(Float_t)TPCsignalN);
1989 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsEtaAllTracks"))->Fill(track->Eta(),(Float_t)TPCsignalN);
1993 } //end PID histograms
1995 Int_t nclsTot=0,nclsSPD=0;
1997 //check clusters of the tracks
2000 ((TH1F*)fOutputTrack->FindObject("hnLayerITS"))->Fill(-1);
2001 for(Int_t l=0;l<6;l++) {
2002 if(TESTBIT(track->GetITSClusterMap(),l)) {
2003 ((TH1F*)fOutputTrack->FindObject("hnLayerITS"))->Fill(l);
2004 nclsTot++; if(l<2) nclsSPD++;
2007 ((TH1F*)fOutputTrack->FindObject("hnClsITS"))->Fill(nclsTot);
2008 ((TH1F*)fOutputTrack->FindObject("hnClsSPD"))->Fill(nclsSPD);
2010 if(fFillDistrTrackEffChecks && track->GetStatus()&AliESDtrack::kITSrefit && track->GetStatus()&AliESDtrack::kTPCrefit){
2012 ((TH1F*)fOutputTrack->FindObject("hPtAllTracks"))->Fill(track->Pt());
2013 ((TH1F*)fOutputTrack->FindObject("hPhiAllTracks"))->Fill(track->Phi());
2014 ((TH1F*)fOutputTrack->FindObject("hEtaAllTracks"))->Fill(track->Eta());
2015 ((TH2F*)fOutputTrack->FindObject("hEtavsPhiAllTracks"))->Fill(track->Phi(),track->Eta());
2016 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPtAllTracks"))->Fill(track->Pt(),track->GetTPCNcls());
2017 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPhiAllTracks"))->Fill(track->Phi(),track->GetTPCNcls());
2018 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsEtaAllTracks"))->Fill(track->Eta(),track->GetTPCNcls());
2020 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPtAllTracks"))->Fill(track->Pt(),nCrossedRowsTPC);
2021 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPhiAllTracks"))->Fill(track->Phi(),nCrossedRowsTPC);
2022 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsEtaAllTracks"))->Fill(track->Eta(),nCrossedRowsTPC);
2024 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPtAllTracks"))->Fill(track->Pt(),ratioCrossedRowsOverFindableClustersTPC);
2025 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPhiAllTracks"))->Fill(track->Phi(),ratioCrossedRowsOverFindableClustersTPC);
2026 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsEtaAllTracks"))->Fill(track->Eta(),ratioCrossedRowsOverFindableClustersTPC);
2028 if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
2029 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(0);
2031 if(track->HasPointOnITSLayer(0) && !(track->HasPointOnITSLayer(1))){ //kOnlyFirst
2032 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(1);
2034 if(!(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1)){ //kOnlySecond
2035 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(2);
2037 if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)){ //kBoth
2038 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(3);
2040 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPtAllTracks"))->Fill(track->Pt(), nclsTot);
2041 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPhiAllTracks"))->Fill(track->Phi(), nclsTot);
2042 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsEtaAllTracks"))->Fill(track->Eta(), nclsTot);
2046 if(track->Pt()>0.3 &&
2047 TMath::Abs(track->Eta())<0.8 &&
2048 track->GetStatus()&AliESDtrack::kITSrefit &&
2049 track->GetStatus()&AliESDtrack::kTPCrefit &&
2051 ((TH1F*)fOutputTrack->FindObject("hnClsITSselTr"))->Fill(nclsTot);
2053 if(!(track->GetStatus()&AliESDtrack::kTPCin) && track->GetStatus()&AliESDtrack::kITSrefit && !(track->GetStatus()&AliESDtrack::kITSpureSA)){//tracks retrieved in the ITS and not reconstructed in the TPC
2054 ((TH1F*)fOutputTrack->FindObject("hnClsITS-SA"))->Fill(nclsTot);
2055 ((TH1F*)fOutputTrack->FindObject("hnLayerITS"))->Fill(-1);
2056 for(Int_t l=0;l<6;l++) {
2057 if(TESTBIT(track->GetITSClusterMap(),l)) {
2058 ((TH1F*)fOutputTrack->FindObject("hnLayerITSsa"))->Fill(l);
2064 label=track->GetLabel();
2065 if (label<0)fNEntries->Fill(8);
2066 else fNEntries->Fill(9);
2070 if (track->Pt()>0.3 &&
2071 track->GetStatus()&AliESDtrack::kTPCrefit &&
2072 track->GetStatus()&AliESDtrack::kITSrefit &&
2074 nclsSPD>0) {//count good tracks
2077 if(fReadMC && label<0) {
2078 ((TH1F*)fOutputTrack->FindObject("hptFakeTr"))->Fill(track->Pt());
2081 ((TH1F*)fOutputTrack->FindObject("hptGoodTr"))->Fill(track->Pt());
2085 if(fCuts->IsDaughterSelected(track,&vESD,fCuts->GetTrackCuts())){
2087 }//select tracks for our analyses
2090 } //fill track histos
2091 } //end loop on tracks
2093 //fill once per event
2095 if (fReadMC) ((TH1F*)fOutputTrack->FindObject("hdistrFakeTr"))->Fill(isFakeTrack);
2096 ((TH1F*)fOutputTrack->FindObject("hdistrGoodTr"))->Fill(isGoodTrack);
2097 ((TH1F*)fOutputTrack->FindObject("hdistrSelTr"))->Fill(isSelTrack);
2101 // loop over candidates
2102 Int_t nCand = arrayProng->GetEntriesFast();
2104 if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpi) ndaugh=2;
2105 if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpipipi) ndaugh=4;
2107 for (Int_t iCand = 0; iCand < nCand; iCand++) {
2108 AliAODRecoDecayHF *d = (AliAODRecoDecayHF*)arrayProng->UncheckedAt(iCand);
2109 if(fUseSelectionBit && d->GetSelectionMap()) {
2110 if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpi && !d->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) continue; //skip the D0 from Dstar
2111 if(fDecayChannel==AliAnalysisTaskSEHFQA::kDplustoKpipi && !d->HasSelectionBit(AliRDHFCuts::kDplusCuts)) continue; //skip the 3 prong !D+
2117 if (fDecayChannel==AliAnalysisTaskSEHFQA::kLambdactoV0 && (dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0()) {
2119 Int_t pdgDgLctoV0bachelor[2]={2212,310};
2120 Int_t pdgDgV0toDaughters[2]={211,211};
2121 Int_t mcLabelK0S = (dynamic_cast<AliAODRecoCascadeHF*>(d))->MatchToMC(pdg,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,mcArray,kTRUE); // Lc->K0S+p and cc
2122 pdgDgLctoV0bachelor[1]=3122, pdgDgLctoV0bachelor[0]=211;
2123 pdgDgV0toDaughters[0]=2212, pdgDgV0toDaughters[1]=211;
2124 Int_t mcLabelLambda = (dynamic_cast<AliAODRecoCascadeHF*>(d))->MatchToMC(pdg,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,mcArray,kTRUE); // Lc->Lambda+pi and cc
2125 if (mcLabelK0S!=-1 || mcLabelLambda!=-1) AliInfo(Form("mcLabelK0S=%d - mcLabelLambda=%d",mcLabelK0S,mcLabelLambda));
2127 if (mcLabelK0S!=-1 && mcLabelLambda!=-1)
2128 AliInfo("Strange: current Lc->V0+bachelor candidate has two MC different labels!");
2129 else if (mcLabelK0S>-1 && mcLabelLambda==-1)
2131 else if (mcLabelLambda>-1 && mcLabelK0S==-1)
2132 labD = mcLabelLambda;
2135 labD = d->MatchToMC(pdg,mcArray,ndaugh,pdgdaughters);
2138 AliAODMCParticle *partD = (AliAODMCParticle*)mcArray->At(labD);
2139 Int_t label=partD->GetMother();
2140 AliAODMCParticle *mot = (AliAODMCParticle*)mcArray->At(label);
2141 while(label>=0){//get first mother
2142 mot = (AliAODMCParticle*)mcArray->At(label);
2143 label=mot->GetMother();
2146 Int_t pdgMotCode = mot->GetPdgCode();
2148 if(TMath::Abs(pdgMotCode)==4) fNEntries->Fill(6); //from primary charm
2149 if(TMath::Abs(pdgMotCode)==5) fNEntries->Fill(7); //from beauty
2153 fNEntries->Fill(5); //count the candidates (data and MC)
2155 for(Int_t id=0;id<ndaugh;id++){
2156 //other histograms to be filled when the cut object is given
2157 AliAODTrack* track=0;
2159 if (fDecayChannel==AliAnalysisTaskSEHFQA::kLambdactoV0 && (dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0()) {
2161 track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->GetBachelor();
2163 track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0PositiveTrack();
2165 track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0NegativeTrack();
2168 track=(AliAODTrack*)d->GetDaughter(id);
2172 if (fCuts->IsInFiducialAcceptance(d->Pt(),d->Y(pdg)) && fCuts->IsSelected(d,AliRDHFCuts::kTracks,aod)) {
2175 if(fReadMC)label=track->GetLabel();
2178 if(fReadMC && label<0) {
2180 ((TH1F*)fOutputTrack->FindObject("hptFakeTrFromDaugh"))->Fill(track->Pt());
2182 ((TH1F*)fOutputTrack->FindObject("hd0f"))->Fill(d->Getd0Prong(id));
2184 ((TH1F*)fOutputTrack->FindObject("hptGoodTrFromDaugh"))->Fill(track->Pt());
2185 ((TH1F*)fOutputTrack->FindObject("hd0dau"))->Fill(d->Getd0Prong(id));
2186 Double_t phidaughter = d->PhiProng(id);
2187 if(phidaughter<0) phidaughter=2.0*TMath::Pi()+phidaughter;
2188 ((TH2F*)fOutputTrack->FindObject("hd0dauphi"))->Fill(phidaughter, d->Getd0Prong(id));
2189 Double_t d0rphiz[2],covd0[3];
2190 Bool_t isDCA=track->PropagateToDCA(aod->GetPrimaryVertex(),aod->GetMagneticField(),9999.,d0rphiz,covd0);
2192 ((TH1F*)fOutputTrack->FindObject("hd0zdau"))->Fill(d0rphiz[1]);
2193 ((TH2F*)fOutputTrack->FindObject("hd0zdauphi"))->Fill(phidaughter,d0rphiz[1]);
2199 if(fFillDistrTrackEffChecks){
2201 Double_t nTPCCrossedRows = track->GetTPCClusterInfo(2,1);
2202 Double_t ratioCrossedRowsOverFcls = 1.0;
2203 if(track->GetTPCNclsF()>0){
2204 ratioCrossedRowsOverFcls = (nTPCCrossedRows)/(track->GetTPCNclsF());
2206 for(Int_t l=0;l<6;l++) {
2207 if(TESTBIT(track->GetITSClusterMap(),l)) {
2212 ((TH1F*)fOutputTrack->FindObject("hPtDaughters"))->Fill(track->Pt());
2213 ((TH1F*)fOutputTrack->FindObject("hPhiDaughters"))->Fill(track->Phi());
2214 ((TH1F*)fOutputTrack->FindObject("hEtaDaughters"))->Fill(track->Eta());
2215 ((TH2F*)fOutputTrack->FindObject("hEtavsPhiDaughters"))->Fill(track->Phi(),track->Eta());
2217 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPtDaughters"))->Fill(track->Pt(),track->GetTPCNcls());
2218 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPhiDaughters"))->Fill(track->Phi(),track->GetTPCNcls());
2219 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsEtaDaughters"))->Fill(track->Eta(),track->GetTPCNcls());
2221 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPtDaughters"))->Fill(track->Pt(),nTPCCrossedRows);
2222 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPhiDaughters"))->Fill(track->Phi(),nTPCCrossedRows);
2223 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsEtaDaughters"))->Fill(track->Eta(),nTPCCrossedRows);
2225 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPtDaughters"))->Fill(track->Pt(),ratioCrossedRowsOverFcls);
2226 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPhiDaughters"))->Fill(track->Phi(),ratioCrossedRowsOverFcls);
2227 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsEtaDaughters"))->Fill(track->Eta(),ratioCrossedRowsOverFcls);
2229 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPtDaughters"))->Fill(track->Pt(), nITScls);
2230 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPhiDaughters"))->Fill(track->Phi(), nITScls);
2231 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsEtaDaughters"))->Fill(track->Eta(), nITScls);
2232 if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
2233 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(0);
2235 if(track->HasPointOnITSLayer(0) && !(track->HasPointOnITSLayer(1))){ //kOnlyFirst
2236 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(1);
2238 if(!(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1)){ //kOnlySecond
2239 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(2);
2241 if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)){ //kBoth
2242 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(3);
2247 AliAODPid *pid = track->GetDetPid();
2249 if(pidHF && pidHF->CheckStatus(track,"TPC")){
2250 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPtDaughters"))->Fill(track->Pt(),pid->GetTPCsignalN());
2251 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPhiDaughters"))->Fill(track->Phi(),pid->GetTPCsignalN());
2252 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsEtaDaughters"))->Fill(track->Eta(),pid->GetTPCsignalN());
2259 if (fCuts->IsSelected(d,AliRDHFCuts::kAll,aod) && fOnOff[1]){
2260 fNEntries->Fill(3); //candidates passing analysis cuts
2262 AliAODPid *pid = track->GetDetPid();
2265 pid->GetIntegratedTimes(times);
2266 if(pidHF && pidHF->CheckStatus(track,"TOF")){
2267 Double_t tofTime=pid->GetTOFsignal();
2268 AliTOFHeader* tofH=(AliTOFHeader*)aod->GetTOFHeader();
2269 Double_t tofRes[AliPID::kSPECIES];
2270 pid->GetTOFpidResolution(tofRes);
2271 if (tofH && (TMath::Abs(tofRes[0]) <= 1.E-16) ) { // new AOD
2272 AliTOFPIDResponse tofResp=pidHF->GetPidResponse()->GetTOFResponse();
2273 Double_t startTime=tofResp.GetStartTime(track->P());
2276 ((TH2F*)fOutputPID->FindObject("hTOFtimeKaonHyptimeAC"))->Fill(track->P(),tofTime-times[AliPID::kKaon]);
2278 if(pidHF && pidHF->CheckStatus(track,"TPC")) ((TH2F*)fOutputPID->FindObject("hTPCsigvspAC"))->Fill(pid->GetTPCmomentum(),pid->GetTPCsignal());
2281 } //end analysis cuts
2282 } //end acceptance and track cuts
2283 } //end loop on tracks in the candidate
2284 } //end loop on candidates
2287 } //end if on pid or track histograms
2290 delete [] pdgdaughters;
2291 PostData(1,fNEntries);
2292 if(fOnOff[1]) PostData(2,fOutputPID);
2293 if(fOnOff[0]) PostData(3,fOutputTrack);
2295 if(fOnOff[2]) PostData(5,fOutputCounters);
2296 //Post data 6 done in case of centrality on
2300 //____________________________________________________________________________
2301 void AliAnalysisTaskSEHFQA::FillFlowObs(AliAODEvent *aod){
2302 //fills the flow observables
2304 cc = fCuts->GetCentrality(aod);
2305 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(0., cc);
2307 UInt_t mask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
2308 UInt_t trigger=AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral;
2309 if(mask & trigger) {
2310 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(1.,cc); // fired
2311 if (mask & AliVEvent::kMB) ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(2.,cc);
2312 if (mask & AliVEvent::kCentral) ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(3.,cc);
2313 if (mask & AliVEvent::kSemiCentral) ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(4.,cc);
2314 Bool_t rejected=false;
2315 if(cc<0 || cc>60) rejected=true;
2316 const AliVVertex *vertex = aod->GetPrimaryVertex();
2317 Double_t zvtx=vertex->GetZ();
2318 if(TMath::Abs(zvtx)>fCuts->GetMaxVtxZ()) rejected=true;
2319 if(rejected) return; //not interesting for flow QA
2325 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(5.,cc);
2326 fRFPcuts->SetParamType(AliFlowTrackCuts::kGlobal);
2327 fRFPcuts->SetPtRange(0.2,5.);
2328 fRFPcuts->SetEtaRange(-0.8,0.8);
2329 fRFPcuts->SetMinNClustersTPC(70);
2330 fRFPcuts->SetMinChi2PerClusterTPC(0.2);
2331 fRFPcuts->SetMaxChi2PerClusterTPC(4.0);
2332 fRFPcuts->SetAcceptKinkDaughters(kFALSE);
2333 fRFPcuts->SetEvent(aod);
2335 TString ref[3] = {"FB1","FB128","VZE"};
2337 for(Int_t i=0; i!=3; ++i) {
2338 if(i==0) { // switching to bit 1
2339 fRFPcuts->SetMinimalTPCdedx(10.);
2340 fRFPcuts->SetAODfilterBit(1);
2341 } else { // switching to bit 128
2342 fRFPcuts->SetMinimalTPCdedx(-1);
2343 fRFPcuts->SetAODfilterBit(128);
2346 fRFPcuts->SetParamType(AliFlowTrackCuts::kVZERO);
2347 fRFPcuts->SetEtaRange(-5,+5);
2348 fRFPcuts->SetPhiMin(0);
2349 fRFPcuts->SetPhiMax(TMath::TwoPi());
2351 fFlowEvent->Fill(fRFPcuts,fRFPcuts);
2352 fFlowEvent->TagSubeventsInEta(-5,0,0,+5);
2353 // getting informationt
2354 AliFlowVector vQ, vQaQb[2];
2355 fFlowEvent->Get2Qsub(vQaQb,2);
2356 vQ = vQaQb[0]+vQaQb[1];
2357 Double_t dMa=vQaQb[0].GetMult();
2358 Double_t dMb=vQaQb[1].GetMult();
2359 if( dMa<2 || dMb<2 ) {
2360 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(6.,cc); //???
2363 psi[i] = vQ.Phi()/2;
2365 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(0,cc,vQaQb[0].X()/dMa,dMa); // Qx-
2366 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(1,cc,vQaQb[0].Y()/dMa,dMa); // Qy-
2367 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(2,cc,vQaQb[1].X()/dMb,dMb); // Qx+
2368 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(3,cc,vQaQb[1].Y()/dMb,dMb); // Qy+
2369 ((TH2F*) fOutputFlowObs->FindObject( Form("h%s_AngleQ",ref[i].Data()) ))->Fill(psi[i],cc); // Psi
2370 AliFlowTrackSimple *track;
2371 for(Int_t t=0; t!=fFlowEvent->NumberOfTracks(); ++t) {
2372 track = (AliFlowTrackSimple*) fFlowEvent->GetTrack(t);
2373 if(!track) continue;
2374 if(!track->InRPSelection()) continue;
2375 ((TH3F*) fOutputFlowObs->FindObject( Form("h%s_PhiEta",ref[i].Data()) ))->Fill(track->Phi(),track->Eta(),cc,track->Weight()); //PhiEta
2378 //histo filled only for TPCFB1
2380 ((TH2F*) fOutputFlowObs->FindObject("hCentVsMultRPS"))->Fill(fFlowEvent->GetNumberOfRPs(),cc);
2384 ((TH3F*) fOutputFlowObs->FindObject( "hTPCVZE_AngleQ" ))->Fill(psi[0],psi[2],cc);
2387 //____________________________________________________________________________
2388 void AliAnalysisTaskSEHFQA::Terminate(Option_t */*option*/){
2389 //terminate analysis
2391 fNEntries = dynamic_cast<TH1F*>(GetOutputData(1));
2393 printf("ERROR: %s not available\n",GetOutputSlot(1)->GetContainer()->GetName());
2397 fOutputPID = dynamic_cast<TList*> (GetOutputData(2));
2398 if (!fOutputPID && fOnOff[1]) {
2399 printf("ERROR: %s not available\n",GetOutputSlot(2)->GetContainer()->GetName());
2403 fOutputTrack = dynamic_cast<TList*> (GetOutputData(3));
2404 if (!fOutputTrack && fOnOff[0]) {
2405 printf("ERROR: %s not available\n",GetOutputSlot(3)->GetContainer()->GetName());