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 "AliInputEventHandler.h"
65 #include "AliFlowEvent.h"
66 #include "AliFlowTrackCuts.h"
67 #include "AliFlowTrackSimple.h"
68 #include "AliFlowVector.h"
70 #include "AliAnalysisTaskSEHFQA.h"
75 ClassImp(AliAnalysisTaskSEHFQA)
77 //____________________________________________________________________________
79 AliAnalysisTaskSEHFQA::AliAnalysisTaskSEHFQA():AliAnalysisTaskSE(),
84 fOutputCheckCentrality(0x0),
85 fOutputEvSelection(0x0),
87 fDecayChannel(AliAnalysisTaskSEHFQA::kD0toKpi),
91 fEstimator(AliRDHFCuts::kCentTRK),
94 fUseSelectionBit(kTRUE),
96 fFillDistrTrackEffChecks(kFALSE)
106 //____________________________________________________________________________
107 AliAnalysisTaskSEHFQA::AliAnalysisTaskSEHFQA(const char *name, AliAnalysisTaskSEHFQA::DecChannel ch,AliRDHFCuts* cuts):
108 AliAnalysisTaskSE(name),
112 fOutputCounters(0x0),
113 fOutputCheckCentrality(0x0),
114 fOutputEvSelection(0x0),
120 fEstimator(AliRDHFCuts::kCentTRK),
123 fUseSelectionBit(kTRUE),
125 fFillDistrTrackEffChecks(kFALSE)
129 //SetCutObject(cuts);
138 // Output slot #1 writes into a TH1F container (number of events)
139 DefineOutput(1,TH1F::Class()); //My private output
140 // Output slot #2 writes into a TList container (PID)
141 if (fOnOff[1]) DefineOutput(2,TList::Class()); //My private output
142 // Output slot #3 writes into a TList container (Tracks)
143 if (fOnOff[0]) DefineOutput(3,TList::Class()); //My private output
144 // Output slot #4 writes into a AliRDHFCuts container (cuts)
145 switch(fDecayChannel){
147 DefineOutput(4,AliRDHFCutsDplustoKpipi::Class()); //My private output
150 DefineOutput(4,AliRDHFCutsD0toKpi::Class()); //My private output
153 DefineOutput(4,AliRDHFCutsDStartoKpipi::Class()); //My private output
156 DefineOutput(4,AliRDHFCutsDstoKKpi::Class()); //My private output
159 DefineOutput(4,AliRDHFCutsD0toKpipipi::Class()); //My private output
162 DefineOutput(4,AliRDHFCutsLctopKpi::Class()); //My private output
165 DefineOutput(4,AliRDHFCutsLctoV0::Class()); //My private output
169 // Output slot #5 writes into a TList container (AliCounterCollection)
170 DefineOutput(5,TList::Class()); //My private output
171 // Output slot #6 writes into a TList container (TH1F)
172 DefineOutput(6,TList::Class()); //My private output
175 if(fOnOff[3]) DefineOutput(7,TList::Class()); //My private output
176 if(fOnOff[4]) DefineOutput(8,TList::Class()); //My private output
180 //___________________________________________________________________________
181 AliAnalysisTaskSEHFQA::~AliAnalysisTaskSEHFQA()
190 delete fOutputCounters;
192 delete fOutputCheckCentrality;
194 delete fOutputEvSelection;
197 delete fOutputFlowObs;
202 //___________________________________________________________________________
203 void AliAnalysisTaskSEHFQA::Init(){
206 if(fDebug > 1) printf("AnalysisTaskSEHFQA::Init() \n");
207 AliRDHFCuts *copycut = 0x0;
209 switch(fDecayChannel){
212 copycut=new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fCuts)));
217 copycut=new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fCuts)));
222 copycut=new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fCuts)));
227 copycut=new AliRDHFCutsDstoKKpi(*(static_cast<AliRDHFCutsDstoKKpi*>(fCuts)));
232 copycut=new AliRDHFCutsD0toKpipipi(*(static_cast<AliRDHFCutsD0toKpipipi*>(fCuts)));
237 copycut=new AliRDHFCutsLctopKpi(*(static_cast<AliRDHFCutsLctopKpi*>(fCuts)));
242 copycut=new AliRDHFCutsLctoV0(*(static_cast<AliRDHFCutsLctoV0*>(fCuts)));
246 AliFatal("Bad initialization for the decay channe - Exiting...");
250 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
252 copycut->SetName(nameoutput);
257 AliFatal("Failing initializing AliRDHFCuts object - Exiting...");
264 //___________________________________________________________________________
265 void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
268 //create the output container
269 if(fDebug > 1) printf("AnalysisTaskSEHFQA::UserCreateOutputObjects() \n");
273 fNEntries=new TH1F(GetOutputSlot(1)->GetContainer()->GetName(), "Counts the number of events", 10,-0.5,9.5);
274 fNEntries->GetXaxis()->SetBinLabel(1,"nEventsAnal");
275 fNEntries->GetXaxis()->SetBinLabel(2,"Pile-up Rej");
276 fNEntries->GetXaxis()->SetBinLabel(3,"No VertexingHF");
277 fNEntries->GetXaxis()->SetBinLabel(4,"nCandidates(AnCuts)");
278 fNEntries->GetXaxis()->SetBinLabel(5,"EventsWithGoodVtx");
279 //fNEntries->GetXaxis()->SetBinLabel(6,"N. of 0SMH");
280 fNEntries->GetXaxis()->SetBinLabel(6,"N candidates");
282 fNEntries->GetXaxis()->SetBinLabel(7,"MC Cand from c");
283 fNEntries->GetXaxis()->SetBinLabel(8,"MC Cand from b");
284 fNEntries->GetXaxis()->SetBinLabel(9,"N fake Trks");
285 fNEntries->GetXaxis()->SetBinLabel(10,"N true Trks");
288 fNEntries->GetXaxis()->SetNdivisions(1,kFALSE);
292 fOutputPID=new TList();
293 fOutputPID->SetOwner();
294 fOutputPID->SetName(GetOutputSlot(2)->GetContainer()->GetName());
297 TH1F* hTOFflags=new TH1F("hTOFflags","TOF flags",7,-0.5,6.5);
298 hTOFflags->SetMinimum(0.);
299 hTOFflags->GetXaxis()->SetBinLabel(1,"All Tracks");
300 hTOFflags->GetXaxis()->SetBinLabel(2,"kTPCout");
301 hTOFflags->GetXaxis()->SetBinLabel(3,"kTOFout");
302 hTOFflags->GetXaxis()->SetBinLabel(4,"kTIME");
303 hTOFflags->GetXaxis()->SetBinLabel(5,"kTOFpid");
304 hTOFflags->GetXaxis()->SetBinLabel(6,"kTOFmismatch");
305 hTOFflags->GetXaxis()->SetBinLabel(7,"kDetPidOK");
307 TString hname="hTOFsig";
308 TH1F* hTOFsig=new TH1F(hname.Data(),"Distribution of TOF signal;TOF time [ps];Entries", 100, -2.e3,40.e3);
310 hname="hTOFstartTimeMask";
311 TH1F* hTOFstartTimeMask=new TH1F(hname.Data(),"TOF start time mask; Mask ;Entries", 8, -0.5,7.5);
312 hTOFstartTimeMask->GetXaxis()->SetBinLabel(1,"FILL");
313 hTOFstartTimeMask->GetXaxis()->SetBinLabel(2,"TOF");
314 hTOFstartTimeMask->GetXaxis()->SetBinLabel(3,"T0A");
315 hTOFstartTimeMask->GetXaxis()->SetBinLabel(4,"TOF.and.T0A");
316 hTOFstartTimeMask->GetXaxis()->SetBinLabel(5,"T0C");
317 hTOFstartTimeMask->GetXaxis()->SetBinLabel(6,"TOF.and.T0C");
318 hTOFstartTimeMask->GetXaxis()->SetBinLabel(7,"T0AC");
319 hTOFstartTimeMask->GetXaxis()->SetBinLabel(8,"TOF.and.T0AC");
321 hname="hTOFstartTimeRes";
322 TH1F* hTOFstartTimeRes=new TH1F(hname.Data(),"TOF start time resolution; Resolution (ps) ;Entries", 100, 0.,300.);
324 hname="hTOFstartTimeDistrib";
325 TH1F* hTOFstartTimeDistrib=new TH1F(hname.Data(),"TOF start time distribution; Start time ;Entries", 400, -1000.,1000.);
328 TH1F* hTOFtime=new TH1F(hname.Data(),"Distribution of TOF time Kaon;TOF time(Kaon) [ps];Entries", 1000, 0.,50000.);
330 hname="hTOFtimeKaonHyptime";
331 TH2F* hTOFtimeKaonHyptime=new TH2F(hname.Data(),"TOFtime - timeHypothesisForKaon;p[GeV/c];TOFtime - timeHypothesisForKaon [ps]",500,0.,10.,1000,-20000.,20000.);
333 hname="hTOFtimeKaonHyptimeAC";
334 TH2F* hTOFtimeKaonHyptimeAC=new TH2F(hname.Data(),"TOFtime - timeHypothesisForKaon;p[GeV/c];TOFtime - timeHypothesisForKaon [ps]",500,0.,10.,1000,-20000.,20000.);
336 hname="hTOFsigmaKSigPid";
337 TH2F* hTOFsigmaKSigPid=new TH2F(hname.Data(),"(TOFsignal-timeK)/tofSigPid;p[GeV/c];(TOFsignal-timeK)/tofSigPid",500,0.,10.,400,-20,20);
339 hname="hTOFsigmaPionSigPid";
340 TH2F* hTOFsigmaPionSigPid=new TH2F(hname.Data(),"(TOFsignal-time#pi)/tofSigPid;p[GeV/c];(TOFsignal-time#pi)/tofSigPid",500,0.,10.,400,-20,20);
342 hname="hTOFsigmaProtonSigPid";
343 TH2F* hTOFsigmaProtonSigPid=new TH2F(hname.Data(),"(TOFsignal-timep)/tofSigPid;p[GeV/c];(TOFsignal-time p)/tofSigPid",500,0.,10.,400,-20,20);
345 hname="hTOFsigPid3sigPion";
346 TH1F* hTOFsigPid3sigPion=new TH1F(hname.Data(),"TOF PID resolution (#pi) [ps]",500,0.,1000.);
348 hname="hTOFsigPid3sigKaon";
349 TH1F* hTOFsigPid3sigKaon=new TH1F(hname.Data(),"TOF PID resolution (K) [ps]",500,0.,1000.);
351 hname="hTOFsigPid3sigProton";
352 TH1F* hTOFsigPid3sigProton=new TH1F(hname.Data(),"TOF PID resolution (p) [ps]",500,0.,1000.);
357 TH1F* hTPCsig=new TH1F(hname.Data(),"Distribution of TPC signal;TPC sig;Entries", 100, 35.,100.);
360 TH2F* hTPCsigvsp=new TH2F(hname.Data(),"TPCsig vs p;TPC p[GeV/c];TPCsig",500,0.,10.,1000,35.,100.);
362 hname="hTPCsigvspAC";
363 TH2F* hTPCsigvspAC=new TH2F(hname.Data(),"TPCsig vs p;TPCp[GeV/c];TPCsig",500,0.,10.,1000,35.,100.);
366 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);
368 hname="hTPCsigmaPion";
369 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);
371 hname="hTPCsigmaProton";
372 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);
375 fOutputPID->Add(hTOFflags);
376 fOutputPID->Add(hTOFsig);
377 fOutputPID->Add(hTPCsig);
378 fOutputPID->Add(hTOFstartTimeMask);
379 fOutputPID->Add(hTOFstartTimeRes);
380 fOutputPID->Add(hTOFstartTimeDistrib);
381 fOutputPID->Add(hTOFtime);
382 fOutputPID->Add(hTOFtimeKaonHyptime);
383 fOutputPID->Add(hTOFtimeKaonHyptimeAC);
384 fOutputPID->Add(hTOFsigmaKSigPid);
385 fOutputPID->Add(hTOFsigmaPionSigPid);
386 fOutputPID->Add(hTOFsigmaProtonSigPid);
387 fOutputPID->Add(hTOFsigPid3sigPion);
388 fOutputPID->Add(hTOFsigPid3sigKaon);
389 fOutputPID->Add(hTOFsigPid3sigProton);
390 fOutputPID->Add(hTPCsigvsp);
391 fOutputPID->Add(hTPCsigvspAC);
392 fOutputPID->Add(hTPCsigmaK);
393 fOutputPID->Add(hTPCsigmaPion);
394 fOutputPID->Add(hTPCsigmaProton);
396 if(fFillDistrTrackEffChecks){
398 hname="hTPCsigNvsPtAllTracks";
399 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);
401 hname="hTPCsigNvsPhiAllTracks";
402 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);
404 hname="hTPCsigNvsEtaAllTracks";
405 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);
407 hname="hTPCsigNvsPtDaughters";
408 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);
410 hname="hTPCsigNvsPhiDaughters";
411 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);
413 hname="hTPCsigNvsEtaDaughters";
414 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);
416 fOutputPID->Add(hTPCsigNvsPtAllTracks);
417 fOutputPID->Add(hTPCsigNvsPhiAllTracks);
418 fOutputPID->Add(hTPCsigNvsEtaAllTracks);
419 fOutputPID->Add(hTPCsigNvsPtDaughters);
420 fOutputPID->Add(hTPCsigNvsPhiDaughters);
421 fOutputPID->Add(hTPCsigNvsEtaDaughters);
427 hname="hTOFsigmaMCKSigPid";
428 TH2F* hTOFsigmaMCKSigPid=new TH2F(hname.Data(),"(TOFsignal-timeK)/tofSigPid;p[GeV/c];(TOFsignal-timeK)/tofSigPid",500,0.,10.,400,-20,20);
430 hname="hTOFsigmaMCPionSigPid";
431 TH2F* hTOFsigmaMCPionSigPid=new TH2F(hname.Data(),"(TOFsignal-time#pi)/tofSigPid;p[GeV/c];(TOFsignal-time#pi)/tofSigPid",500,0.,10.,400,-20,20);
433 hname="hTOFsigmaMCProtonSigPid";
434 TH2F* hTOFsigmaMCProtonSigPid=new TH2F(hname.Data(),"(TOFsignal-timep)/tofSigPid;p[GeV/c];(TOFsignal-time p)/tofSigPid",500,0.,10.,400,-20,20);
437 hname="hTPCsigmaMCK";
438 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);
440 hname="hTPCsigmaMCPion";
441 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);
443 hname="hTPCsigmaMCProton";
444 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);
446 fOutputPID->Add(hTOFsigmaMCKSigPid);
447 fOutputPID->Add(hTOFsigmaMCPionSigPid);
448 fOutputPID->Add(hTOFsigmaMCProtonSigPid);
449 fOutputPID->Add(hTPCsigmaMCK);
450 fOutputPID->Add(hTPCsigmaMCPion);
451 fOutputPID->Add(hTPCsigmaMCProton);
456 //quality of the tracks
458 fOutputTrack=new TList();
459 fOutputTrack->SetOwner();
460 fOutputTrack->SetName(GetOutputSlot(3)->GetContainer()->GetName());
462 TString hname="hnClsITS";
463 TH1F* hnClsITS=new TH1F(hname.Data(),"Distribution of number of ITS clusters;nITScls;Entries",7,-0.5,6.5);
465 hname="hnClsITSselTr";
466 TH1F* hnClsITSselTr=new TH1F(hname.Data(),"Distribution of number of ITS clusters selected tracks;nITScls;Entries",7,-0.5,6.5);
469 TH1F* hnClsITSSA=new TH1F(hname.Data(),"Distribution of number of ITS clusters(ITS-SA);nITScls;Entries",7,-0.5,6.5);
473 TH1F* hnLayerITS=new TH1F(hname.Data(),"Number of tracks with point in layer;ITS layer;",7,-1.5,5.5);
474 hnLayerITS->GetXaxis()->SetBinLabel(1,"n tracks");
475 hnLayerITS->GetXaxis()->SetBinLabel(2,"SPDin");
476 hnLayerITS->GetXaxis()->SetBinLabel(3,"SPDout");
477 hnLayerITS->GetXaxis()->SetBinLabel(4,"SDDin");
478 hnLayerITS->GetXaxis()->SetBinLabel(5,"SDDout");
479 hnLayerITS->GetXaxis()->SetBinLabel(6,"SSDin");
480 hnLayerITS->GetXaxis()->SetBinLabel(7,"SSDout");
482 hname="hnLayerITSsa";
483 TH1F* hnLayerITSsa=new TH1F(hname.Data(),"Number of tracks with point in layer;ITS layer;",7,-1.5,5.5);
484 hnLayerITSsa->GetXaxis()->SetBinLabel(1,"n tracks");
485 hnLayerITSsa->GetXaxis()->SetBinLabel(2,"SPDin");
486 hnLayerITSsa->GetXaxis()->SetBinLabel(3,"SPDout");
487 hnLayerITSsa->GetXaxis()->SetBinLabel(4,"SDDin");
488 hnLayerITSsa->GetXaxis()->SetBinLabel(5,"SDDout");
489 hnLayerITSsa->GetXaxis()->SetBinLabel(6,"SSDin");
490 hnLayerITSsa->GetXaxis()->SetBinLabel(7,"SSDout");
493 TH1F* hnClsSPD=new TH1F(hname.Data(),"Distribution of number of SPD clusters;nSPDcls;Entries",3,-0.5,2.5);
496 TH1F* hptGoodTr=new TH1F(hname.Data(),"Pt distribution of 'good' tracks;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
497 hptGoodTr->SetTitleOffset(1.3,"Y");
500 hname="hptGoodTrFromDaugh";
501 TH1F* hptGoodTrFromDaugh=new TH1F(hname.Data(),"Pt distribution of 'good' candidate's daughters;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
502 hptGoodTrFromDaugh->SetTitleOffset(1.3,"Y");
503 fOutputTrack->Add(hptGoodTrFromDaugh);
506 hname="hdistrGoodTr";
507 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);
508 hdistrGoodTr->SetTitleOffset(1.3,"Y");
511 TH1F* hdistrSelTr=new TH1F(hname.Data(),"Distribution of number of Selected tracks per event;no.good-tracks/ev;Entries",4000,-0.5,3999.5);
512 hdistrSelTr->SetTitleOffset(1.3,"Y");
515 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);
518 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);
520 hname="hd0TracksSPDin";
521 TH1F* hd0TracksSPDin=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks kITSrefit, SPDinner; d_{0rphi}[cm];Entries",200,-0.5,0.5);
523 hname="hd0TracksSPDany";
524 TH1F* hd0TracksSPDany=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks kITSrefit, SPDany; d_{0rphi}[cm];Entries",200,-0.5,0.5);
526 hname="hd0TracksFilterBit4";
527 TH1F* hd0TracksFilterBit4=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks FilterBit4; d_{0rphi}[cm];Entries",200,-0.5,0.5);
529 hname="hd0TracksTPCITSSPDany";
530 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);
533 if(fFillDistrTrackEffChecks){
534 hname="hPtDaughters";
535 TH1F *hPtDaughters=new TH1F(hname.Data(),"p_{T} distributions of the daughter tracks;p_{T} [GeV/c];Entries",200,0.,20.);
537 hname="hPhiDaughters";
538 TH1F *hPhiDaughters=new TH1F(hname.Data(),"#phi distribution of the daughter tracks;#phi [rad];Entries",100,0.,2*(TMath::Pi()));
540 hname="hEtaDaughters";
541 TH1F *hEtaDaughters=new TH1F(hname.Data(),"#eta distribution of the daughter tracks;#eta;Entries",80,-2.,2.);
543 hname="hEtavsPhiDaughters";
544 TH2F *hEtavsPhiDaughters=new TH2F(hname.Data(),"#eta vs #phi distribution of the daughter tracks;#phi;#eta",100,0.,2*(TMath::Pi()),80,-2.,2.);
546 hname="hNTPCclsvsPtDaughters";
547 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);
549 hname="hNTPCclsvsPhiDaughters";
550 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);
552 hname="hNTPCclsvsEtaDaughters";
553 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);
555 hname="hNTPCCrossedRowsvsPtDaughters";
556 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);
558 hname="hNTPCCrossedRowsvsPhiDaughters";
559 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);
561 hname="hNTPCCrossedRowsvsEtaDaughters";
562 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);
564 hname="hRatioCRowsOverFclsvsPtDaughters";
565 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.);
567 hname="hRatioCRowsOverFclsvsPhiDaughters";
568 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.);
570 hname="hRatioCRowsOverFclsvsEtaDaughters";
571 TH2F *hRatioCRowsOverFclsvsEtaDaughters=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #eta distribution of the daughter tracks;#eta;CRows/FCls",80,-2.,2.,100,0.,1.);
573 hname="hNITSclsvsPtDaughters";
574 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);
576 hname="hNITSclsvsPhiDaughters";
577 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);
579 hname="hNITSclsvsEtaDaughters";
580 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);
582 hname="hSPDclsDaughters";
583 TH1I *hSPDclsDaughters = new TH1I(hname.Data(),"N SPD points distribution;;Entries",4,0,4);
584 hSPDclsDaughters->GetXaxis()->SetBinLabel(1, "no SPD");
585 hSPDclsDaughters->GetXaxis()->SetBinLabel(2, "kOnlyFirst");
586 hSPDclsDaughters->GetXaxis()->SetBinLabel(3, "kOnlySecond");
587 hSPDclsDaughters->GetXaxis()->SetBinLabel(4, "kBoth");
589 hname="hPtAllTracks";
590 TH1F *hPtAllTracks=new TH1F(hname.Data(),"p_{T} distributions of the AOD tracks (ID>0);p_{T} [GeV/c];Entries",200,0.,20.);
592 hname="hPhiAllTracks";
593 TH1F *hPhiAllTracks=new TH1F(hname.Data(),"#phi distribution of the AOD tracks (ID>0);#phi [rad];Entries",100,0.,2*(TMath::Pi()));
595 hname="hEtaAllTracks";
596 TH1F *hEtaAllTracks=new TH1F(hname.Data(),"#eta distribution of the AOD tracks (ID>0);#eta;Entries",80,-2.,2.);
598 hname="hEtavsPhiAllTracks";
599 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.);
601 hname="hNTPCclsvsPtAllTracks";
602 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);
604 hname="hNTPCclsvsPhiAllTracks";
605 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);
607 hname="hNTPCclsvsEtaAllTracks";
608 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);
610 hname="hNTPCCrossedRowsvsPtAllTracks";
611 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);
613 hname="hNTPCCrossedRowsvsPhiAllTracks";
614 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);
616 hname="hNTPCCrossedRowsvsEtaAllTracks";
617 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);
619 hname="hRatioCRowsOverFclsvsPtAllTracks";
620 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.);
622 hname="hRatioCRowsOverFclsvsPhiAllTracks";
623 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.);
625 hname="hRatioCRowsOverFclsvsEtaAllTracks";
626 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.);
628 hname="hNITSclsvsPtAllTracks";
629 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);
631 hname="hNITSclsvsPhiAllTracks";
632 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);
634 hname="hNITSclsvsEtaAllTracks";
635 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);
637 hname="hSPDclsAllTracks";
638 TH1I *hSPDclsAllTracks = new TH1I(hname.Data(),"N SPD points distribution AOD tracks (ID>0);;Entries",4,0,4);
639 hSPDclsAllTracks->GetXaxis()->SetBinLabel(1, "no SPD");
640 hSPDclsAllTracks->GetXaxis()->SetBinLabel(2, "kOnlyFirst");
641 hSPDclsAllTracks->GetXaxis()->SetBinLabel(3, "kOnlySecond");
642 hSPDclsAllTracks->GetXaxis()->SetBinLabel(4, "kBoth");
645 fOutputTrack->Add(hPtDaughters);
646 fOutputTrack->Add(hPhiDaughters);
647 fOutputTrack->Add(hEtaDaughters);
648 fOutputTrack->Add(hEtavsPhiDaughters);
649 fOutputTrack->Add(hNTPCclsvsPtDaughters);
650 fOutputTrack->Add(hNTPCclsvsPhiDaughters);
651 fOutputTrack->Add(hNTPCclsvsEtaDaughters);
652 fOutputTrack->Add(hNTPCCrossedRowsvsPtDaughters);
653 fOutputTrack->Add(hNTPCCrossedRowsvsPhiDaughters);
654 fOutputTrack->Add(hNTPCCrossedRowsvsEtaDaughters);
655 fOutputTrack->Add(hRatioCRowsOverFclsvsPtDaughters);
656 fOutputTrack->Add(hRatioCRowsOverFclsvsPhiDaughters);
657 fOutputTrack->Add(hRatioCRowsOverFclsvsEtaDaughters);
658 fOutputTrack->Add(hNITSclsvsPtDaughters);
659 fOutputTrack->Add(hNITSclsvsPhiDaughters);
660 fOutputTrack->Add(hNITSclsvsEtaDaughters);
661 fOutputTrack->Add(hSPDclsDaughters);
662 fOutputTrack->Add(hPtAllTracks);
663 fOutputTrack->Add(hPhiAllTracks);
664 fOutputTrack->Add(hEtaAllTracks);
665 fOutputTrack->Add(hEtavsPhiAllTracks);
666 fOutputTrack->Add(hNTPCclsvsPtAllTracks);
667 fOutputTrack->Add(hNTPCclsvsPhiAllTracks);
668 fOutputTrack->Add(hNTPCclsvsEtaAllTracks);
669 fOutputTrack->Add(hNTPCCrossedRowsvsPtAllTracks);
670 fOutputTrack->Add(hNTPCCrossedRowsvsPhiAllTracks);
671 fOutputTrack->Add(hNTPCCrossedRowsvsEtaAllTracks);
672 fOutputTrack->Add(hRatioCRowsOverFclsvsPtAllTracks);
673 fOutputTrack->Add(hRatioCRowsOverFclsvsPhiAllTracks);
674 fOutputTrack->Add(hRatioCRowsOverFclsvsEtaAllTracks);
675 fOutputTrack->Add(hNITSclsvsPtAllTracks);
676 fOutputTrack->Add(hNITSclsvsPhiAllTracks);
677 fOutputTrack->Add(hNITSclsvsEtaAllTracks);
678 fOutputTrack->Add(hSPDclsAllTracks);
682 fOutputTrack->Add(hnClsITS);
683 fOutputTrack->Add(hnClsITSselTr);
684 fOutputTrack->Add(hnClsITSSA);
685 fOutputTrack->Add(hnLayerITS);
686 fOutputTrack->Add(hnLayerITSsa);
687 fOutputTrack->Add(hnClsSPD);
688 fOutputTrack->Add(hptGoodTr);
689 fOutputTrack->Add(hdistrGoodTr);
690 fOutputTrack->Add(hdistrSelTr);
691 fOutputTrack->Add(hd0TracksSPDin);
692 fOutputTrack->Add(hd0TracksSPDany);
693 fOutputTrack->Add(hd0TracksFilterBit4);
694 fOutputTrack->Add(hd0TracksTPCITSSPDany);
695 fOutputTrack->Add(hd0dau);
696 fOutputTrack->Add(hd0zdau);
700 hname="hdistrFakeTr";
701 TH1F* hdistrFakeTr=new TH1F(hname.Data(),"Distribution of number of fake tracks per event;no.fake-tracks/ev;Entries",4000,-0.5,3999.5);
702 hdistrFakeTr->SetTitleOffset(1.3,"Y");
705 TH1F* hd0f=new TH1F(hname.Data(),"Impact parameter distribution of fake tracks;d_{0}[cm];Entries/10^{3} cm",200,-0.1,0.1);
708 TH1F* hptFakeTr=new TH1F(hname.Data(),"Pt distribution of fake tracks;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
709 hptFakeTr->SetTitleOffset(1.3,"Y");
711 hname="hptFakeTrFromDaugh";
712 TH1F* hptFakeTrFromDaugh=new TH1F(hname.Data(),"Pt distribution of fake tracks from daughters;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
713 hptFakeTrFromDaugh->SetTitleOffset(1.3,"Y");
714 fOutputTrack->Add(hptFakeTrFromDaugh);
717 fOutputTrack->Add(hptFakeTr);
718 fOutputTrack->Add(hdistrFakeTr);
719 fOutputTrack->Add(hd0f);
725 if(fOnOff[2] && fCuts->GetUseCentrality()){
727 //Centrality (Counters)
728 fOutputCounters=new TList();
729 fOutputCounters->SetOwner();
730 fOutputCounters->SetName(GetOutputSlot(5)->GetContainer()->GetName());
732 AliCounterCollection *stdEstimator=new AliCounterCollection("stdEstimator");
733 stdEstimator->AddRubric("run",500000);
734 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");
735 stdEstimator->Init();
736 AliCounterCollection *secondEstimator=new AliCounterCollection("secondEstimator");
737 secondEstimator->AddRubric("run",500000);
738 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");
739 secondEstimator->Init();
741 fOutputCounters->Add(stdEstimator);
742 fOutputCounters->Add(secondEstimator);
744 //Centrality (Checks)
745 fOutputCheckCentrality=new TList();
746 fOutputCheckCentrality->SetOwner();
747 fOutputCheckCentrality->SetName(GetOutputSlot(6)->GetContainer()->GetName());
749 TString hname="hNtrackletsIn";
750 TH1F* hNtrackletsIn=new TH1F(hname.Data(),"Number of tracklets in Centrality range;ntracklets;Entries",5000,-0.5,4999.5);
753 TH1F* hMultIn=new TH1F(hname.Data(),"Multiplicity;multiplicity in Centrality range;Entries",10000,-0.5,9999.5);
755 hname="hNtrackletsOut";
756 TH1F* hNtrackletsOut=new TH1F(hname.Data(),"Number of tracklets out of Centrality range;ntracklets;Entries",5000,-0.5,4999.5);
759 TH1F* hMultOut=new TH1F(hname.Data(),"Multiplicity out of Centrality range;multiplicity;Entries",10000,-0.5,9999.5);
761 hname="hMultvsPercentile";
762 TH2F* hMultvsPercentile=new TH2F(hname.Data(),"Multiplicity vs Percentile;multiplicity;percentile",10000,-0.5,9999.5,240,-10.,110);
764 hname="hntrklvsPercentile";
765 TH2F* hntrklvsPercentile=new TH2F(hname.Data(),"N tracklets vs Percentile;ntracklets;percentile",5000,-0.5,4999.5,240,-10.,110);
767 hname="hnTPCTracksvsPercentile";
768 TH2F* hnTPCTracksvsPercentile=new TH2F(hname.Data(),"N TPC tracks vs Percentile;nTPCTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
770 hname="hnTPCITSTracksvsPercentile";
771 TH2F* hnTPCITSTracksvsPercentile=new TH2F(hname.Data(),"N TPC+ITS tracks vs Percentile;nTPCITSTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
773 hname="hnTPCITS1SPDTracksvsPercentile";
774 TH2F* hnTPCITS1SPDTracksvsPercentile=new TH2F(hname.Data(),"N TPC+ITS+1SPD tracks vs Percentile;nTPCITS1SPDTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
776 hname="hV0MultiplicityPercentile";
777 TH2F*hV0MultiplicityPercentile = new TH2F(hname.Data(),"V0 Multiplicity vs Percentile;V0 multiplicity;percentile",1000,-0.5,9999.5,120,-10.,110);
779 hname="hV0MultiplicityNtrackletsIn";
780 TH2F*hV0MultiplicityNtrackletsIn = new TH2F(hname.Data(),"V0 Multiplicity vs Number of tracklets in the CC;V0 multiplicity;percentile",1000,-0.5,9999.5,5000,-0.5,4999.5);
782 hname="hStdPercentileSPDPercentile";
783 TH2F* hStdPercentileSPDPercentile = new TH2F(hname.Data(),"Std estimator Percentile Vs SPD Percentile;Std estimator percentile;SPD percentile",120,-10.,110,120,-10.,110);
785 fOutputCheckCentrality->Add(hNtrackletsIn);
786 fOutputCheckCentrality->Add(hNtrackletsOut);
787 fOutputCheckCentrality->Add(hMultIn);
788 fOutputCheckCentrality->Add(hMultOut);
789 fOutputCheckCentrality->Add(hMultvsPercentile);
790 fOutputCheckCentrality->Add(hntrklvsPercentile);
791 fOutputCheckCentrality->Add(hnTPCTracksvsPercentile);
792 fOutputCheckCentrality->Add(hnTPCITSTracksvsPercentile);
793 fOutputCheckCentrality->Add(hnTPCITS1SPDTracksvsPercentile);
794 fOutputCheckCentrality->Add(hV0MultiplicityPercentile);
795 fOutputCheckCentrality->Add(hV0MultiplicityNtrackletsIn);
796 fOutputCheckCentrality->Add(hStdPercentileSPDPercentile);
798 PostData(6,fOutputCheckCentrality);
802 TString hname="hNtracklets";
803 TH1F* hNtracklets=new TH1F(hname.Data(),"Number of tracklets;ntracklets;Entries",5000,-0.5,4999.5);
806 TH1F* hMult=new TH1F(hname.Data(),"Multiplicity;multiplicity;Entries",10000,-0.5,9999.5);
807 fOutputTrack->Add(hNtracklets);
808 fOutputTrack->Add(hMult);
812 //event selection (z vertex for the moment)
814 fOutputEvSelection=new TList();
815 fOutputEvSelection->SetOwner();
816 fOutputEvSelection->SetName(GetOutputSlot(7)->GetContainer()->GetName());
817 AliCounterCollection *evselection=new AliCounterCollection("evselection");
818 evselection->AddRubric("run",500000);
819 evselection->AddRubric("evnonsel","zvtx");
822 TH1F* hxvtx=new TH1F("hxvtx", "Distribution of x_{VTX};x_{VTX} [cm];Entries",800,-1,1);
823 TH1F* hyvtx=new TH1F("hyvtx", "Distribution of y_{VTX};y_{VTX} [cm];Entries",800,-1,1);
824 TH1F* hzvtx=new TH1F("hzvtx", "Distribution of z_{VTX};z_{VTX} [cm];Entries",800,-30,30);
825 TH1F* hxvtxSelEv=new TH1F("hxvtxSelEv", "Distribution of x_{VTX} Selected Ev;x_{VTX} [cm];Entries",800,-1,1);
826 TH1F* hyvtxSelEv=new TH1F("hyvtxSelEv", "Distribution of y_{VTX} Selected Ev;y_{VTX} [cm];Entries",800,-1,1);
827 TH1F* hzvtxSelEv=new TH1F("hzvtxSelEv", "Distribution of z_{VTX} Selected Ev;z_{VTX} [cm];Entries",800,-30,30);
828 TH1F* hWhichVert=new TH1F("hWhichVert","Vertex Type",4,-1.5,2.5);
829 hWhichVert->GetXaxis()->SetBinLabel(1,"Not found");
830 hWhichVert->GetXaxis()->SetBinLabel(2,"Track");
831 hWhichVert->GetXaxis()->SetBinLabel(3,"SPD-3D");
832 hWhichVert->GetXaxis()->SetBinLabel(4,"SPD-z");
833 TH1F* hWhichVertSelEv=new TH1F("hWhichVertSelEv","Vertex Type",4,-1.5,2.5);
834 hWhichVertSelEv->GetXaxis()->SetBinLabel(1,"Not found");
835 hWhichVertSelEv->GetXaxis()->SetBinLabel(2,"Track");
836 hWhichVertSelEv->GetXaxis()->SetBinLabel(3,"SPD-3D");
837 hWhichVertSelEv->GetXaxis()->SetBinLabel(4,"SPD-z");
839 TH2F* hTrigCent=new TH2F("hTrigCent","Centrality vs. Trigger types",14,-1.5,12.5,12,-10,110);
840 hTrigCent->GetXaxis()->SetBinLabel(1,"All");
841 hTrigCent->GetXaxis()->SetBinLabel(2,"kAny");
842 hTrigCent->GetXaxis()->SetBinLabel(3,"kMB");
843 hTrigCent->GetXaxis()->SetBinLabel(4,"kINT7");
844 hTrigCent->GetXaxis()->SetBinLabel(5,"kCINT5");
845 hTrigCent->GetXaxis()->SetBinLabel(6,"kCent");
846 hTrigCent->GetXaxis()->SetBinLabel(7,"kSemiCent");
847 hTrigCent->GetXaxis()->SetBinLabel(8,"kEMC1+7");
848 hTrigCent->GetXaxis()->SetBinLabel(9,"kEMCJET+GAMMA");
849 hTrigCent->GetXaxis()->SetBinLabel(10,"Muons");
850 hTrigCent->GetXaxis()->SetBinLabel(11,"PHOS");
851 hTrigCent->GetXaxis()->SetBinLabel(12,"TRD");
852 hTrigCent->GetXaxis()->SetBinLabel(13,"HighMult");
853 hTrigCent->GetXaxis()->SetBinLabel(14,"Others");
855 TH2F* hTrigMul=new TH2F("hTrigMul","Multiplicity vs. Trigger types",14,-1.5,12.5,100,0.,10000.);
856 hTrigMul->GetXaxis()->SetBinLabel(1,"All");
857 hTrigMul->GetXaxis()->SetBinLabel(2,"kAny");
858 hTrigMul->GetXaxis()->SetBinLabel(3,"kMB");
859 hTrigMul->GetXaxis()->SetBinLabel(4,"kINT7");
860 hTrigMul->GetXaxis()->SetBinLabel(5,"kCINT5");
861 hTrigMul->GetXaxis()->SetBinLabel(6,"kCent");
862 hTrigMul->GetXaxis()->SetBinLabel(7,"kSemiCent");
863 hTrigMul->GetXaxis()->SetBinLabel(8,"kEMC1+7");
864 hTrigMul->GetXaxis()->SetBinLabel(9,"kEMCJET+GAMMA");
865 hTrigMul->GetXaxis()->SetBinLabel(10,"Muons");
866 hTrigMul->GetXaxis()->SetBinLabel(11,"PHOS");
867 hTrigMul->GetXaxis()->SetBinLabel(12,"TRD");
868 hTrigMul->GetXaxis()->SetBinLabel(13,"HighMult");
869 hTrigMul->GetXaxis()->SetBinLabel(14,"Others");
871 TH2F* hTrigCentSel=new TH2F("hTrigCentSel","Trigger types",14,-1.5,12.5,12,-10,110);
872 hTrigCentSel->GetXaxis()->SetBinLabel(1,"All");
873 hTrigCentSel->GetXaxis()->SetBinLabel(2,"kAny");
874 hTrigCentSel->GetXaxis()->SetBinLabel(3,"kMB");
875 hTrigCentSel->GetXaxis()->SetBinLabel(4,"kINT7");
876 hTrigCentSel->GetXaxis()->SetBinLabel(5,"kCINT5");
877 hTrigCentSel->GetXaxis()->SetBinLabel(6,"kCent");
878 hTrigCentSel->GetXaxis()->SetBinLabel(7,"kSemiCent");
879 hTrigCentSel->GetXaxis()->SetBinLabel(8,"kEMC1+7");
880 hTrigCentSel->GetXaxis()->SetBinLabel(9,"kEMCJET+GAMMA");
881 hTrigCentSel->GetXaxis()->SetBinLabel(10,"Muons");
882 hTrigCentSel->GetXaxis()->SetBinLabel(11,"PHOS");
883 hTrigCentSel->GetXaxis()->SetBinLabel(12,"TRD");
884 hTrigCentSel->GetXaxis()->SetBinLabel(13,"HighMult");
885 hTrigCentSel->GetXaxis()->SetBinLabel(14,"Others");
887 AliCounterCollection *trigCounter=new AliCounterCollection("trigCounter");
888 trigCounter->AddRubric("run",500000);
889 trigCounter->AddRubric("triggerType","All/Any/MB/Cent/SemiCent/EMCAL/MUON/NoPhysSelMUON/NoPhysSelEvNot7/NoPhysSelCMUP1/NoPhysSelMB/NoPhysSelCent/NoPhysSelSemiCent/CINT7");
892 TH1F* hWhyEvRejected=new TH1F("hWhyEvRejected", "Why Event rejected",7,-1.5,5.5);
894 hWhyEvRejected->GetXaxis()->SetBinLabel(1,"N events");
895 hWhyEvRejected->GetXaxis()->SetBinLabel(2,"pileup");
896 hWhyEvRejected->GetXaxis()->SetBinLabel(3,"centrality");
897 hWhyEvRejected->GetXaxis()->SetBinLabel(4,"Vertex not found");
898 hWhyEvRejected->GetXaxis()->SetBinLabel(5,"trigger");
899 hWhyEvRejected->GetXaxis()->SetBinLabel(6,"z vertex out of 10 cm");
900 hWhyEvRejected->GetXaxis()->SetBinLabel(7,"physics sel");
903 fOutputEvSelection->Add(evselection);
904 fOutputEvSelection->Add(hxvtx);
905 fOutputEvSelection->Add(hyvtx);
906 fOutputEvSelection->Add(hzvtx);
907 fOutputEvSelection->Add(hxvtxSelEv);
908 fOutputEvSelection->Add(hyvtxSelEv);
909 fOutputEvSelection->Add(hzvtxSelEv);
910 fOutputEvSelection->Add(hWhichVert);
911 fOutputEvSelection->Add(hWhichVertSelEv);
912 fOutputEvSelection->Add(hTrigCent);
913 fOutputEvSelection->Add(hTrigMul);
914 fOutputEvSelection->Add(hTrigCentSel);
915 fOutputEvSelection->Add(trigCounter);
916 fOutputEvSelection->Add(hWhyEvRejected);
919 if(fOnOff[4]){ // FLOW OBSERVABLES
920 fOutputFlowObs=new TList();
921 fOutputFlowObs->SetOwner();
922 fOutputFlowObs->SetName(GetOutputSlot(8)->GetContainer()->GetName());
924 fFlowEvent = new AliFlowEvent(3000);
925 fRFPcuts = new AliFlowTrackCuts("rfpCuts");
927 TH2F *hFEvents = new TH2F("hFlowEvents","FlowEvent Selection",7,0,7,7,-10,60);
928 hFEvents->GetXaxis()->SetBinLabel(1,"REACHED");
929 hFEvents->GetXaxis()->SetBinLabel(2,"TRIGGERED");
930 hFEvents->GetXaxis()->SetBinLabel(3,"kMB");
931 hFEvents->GetXaxis()->SetBinLabel(4,"kCent");
932 hFEvents->GetXaxis()->SetBinLabel(5,"kSemiC");
933 hFEvents->GetXaxis()->SetBinLabel(6,"Triggered + vtx cut");
934 hFEvents->GetXaxis()->SetBinLabel(7,"UnexpectedBehaviour");
935 fOutputFlowObs->Add(hFEvents);
940 TString ref[3] = {"FB1","FB128","VZE"};
941 Int_t etabin[3] = {40,40,20};
942 Int_t etamax[3] = { 1, 1, 5};
943 for(Int_t i=0; i<3; ++i) {
944 hQ[i]= new TProfile2D( Form("h%s_Q",ref[i].Data()),
945 Form("Q_{2} components for %s",ref[i].Data()),
947 hQ[i]->GetXaxis()->SetBinLabel(1,"Qx^{-}");
948 hQ[i]->GetXaxis()->SetBinLabel(2,"Qy^{-}");
949 hQ[i]->GetXaxis()->SetBinLabel(3,"Qx^{+}");
950 hQ[i]->GetXaxis()->SetBinLabel(4,"Qy^{+}");
951 hQ[i]->GetYaxis()->SetTitle("Centrality");
952 fOutputFlowObs->Add(hQ[i]);
954 hAngleQ[i] = new TH2F( Form("h%s_AngleQ",ref[i].Data()),
955 Form("#Psi_{2} for %s",ref[i].Data()),
956 72,0,TMath::Pi(),12,0,60);
957 hAngleQ[i]->GetXaxis()->SetTitle( Form("#Psi_{2}^{%s}",ref[i].Data()) );
958 hAngleQ[i]->GetYaxis()->SetTitle("Centrality");
959 fOutputFlowObs->Add(hAngleQ[i]);
961 hPhiEta[i] = new TH3F( Form("h%s_PhiEta",ref[i].Data()),
962 Form("Eta vs Phi for %s",ref[i].Data()),
963 144,0,TMath::TwoPi(),etabin[i],-1.0*etamax[i],+1.0*etamax[i],12,0,60);
964 hPhiEta[i]->GetXaxis()->SetTitle("Phi");
965 hPhiEta[i]->GetYaxis()->SetTitle("Eta");
966 hPhiEta[i]->GetZaxis()->SetTitle("Centrality");
967 fOutputFlowObs->Add(hPhiEta[i]);
970 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);
971 hTPCVZE_AngleQ->GetXaxis()->SetTitle("#Psi_{2}^{TPC}");
972 hTPCVZE_AngleQ->GetYaxis()->SetTitle("#Psi_{2}^{VZE}");
973 hTPCVZE_AngleQ->GetZaxis()->SetTitle("Centrality");
974 fOutputFlowObs->Add(hTPCVZE_AngleQ);
976 TH2F *hCentVsMultRPS = new TH2F("hCentVsMultRPS", " Centrality Vs. Multiplicity RPs",5000, 0, 5000.,12,0,60 );
977 hCentVsMultRPS->GetXaxis()->SetTitle("Multiplicity RPs");
978 hCentVsMultRPS->GetYaxis()->SetTitle("Centrality");
979 fOutputFlowObs->Add(hCentVsMultRPS);
983 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
984 AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
985 AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
986 if (fCuts->GetIsUsePID() && fDecayChannel==kLambdactoV0) {
987 fCuts->GetPidHF()->SetPidResponse(pidResp);
988 AliRDHFCutsLctoV0* lccuts=dynamic_cast<AliRDHFCutsLctoV0*>(fCuts);
990 lccuts->GetPidV0pos()->SetPidResponse(pidResp);
991 lccuts->GetPidV0neg()->SetPidResponse(pidResp);
992 fCuts->GetPidHF()->SetOldPid(kFALSE);
993 lccuts->GetPidV0pos()->SetOldPid(kFALSE);
994 lccuts->GetPidV0neg()->SetOldPid(kFALSE);
1000 PostData(1,fNEntries);
1002 if(fOnOff[1]) PostData(2,fOutputPID);
1003 if(fOnOff[0]) PostData(3,fOutputTrack);
1005 if(fOnOff[2]) PostData(5,fOutputCounters);
1006 if(fOnOff[3]) PostData(7,fOutputEvSelection);
1007 if(fOnOff[4]) PostData(8,fOutputFlowObs);
1009 if(!fOnOff[0] && !fOnOff[1] && !fOnOff[2]) AliError("Nothing will be filled!");
1012 //___________________________________________________________________________
1013 void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
1015 // Execute analysis for current event
1017 AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
1018 if(fDebug>2) printf("Analysing decay %d\n",fDecayChannel);
1019 // Post the data already here
1020 PostData(1,fNEntries);
1021 if(fOnOff[1]) PostData(2,fOutputPID);
1022 if(fOnOff[0]) PostData(3,fOutputTrack);
1025 PostData(5,fOutputCounters);
1026 if(fCuts->GetUseCentrality()) PostData(6,fOutputCheckCentrality);
1029 TClonesArray *arrayProng =0;
1031 Int_t *pdgdaughters=0x0;
1033 if(!aod && AODEvent() && IsStandardAOD()) {
1034 // In case there is an AOD handler writing a standard AOD, use the AOD
1035 // event in memory rather than the input (ESD) event.
1036 aod = dynamic_cast<AliAODEvent*> (AODEvent());
1037 // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
1038 // have to taken from the AOD event hold by the AliAODExtension
1039 AliAODHandler* aodHandler = (AliAODHandler*)
1040 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1041 if(aodHandler->GetExtensions()) {
1043 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
1044 AliAODEvent *aodFromExt = ext->GetAOD();
1048 switch(fDecayChannel){
1050 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1053 pdgdaughters =new Int_t[3];
1054 pdgdaughters[0]=211;//pi
1055 pdgdaughters[1]=321;//K
1056 pdgdaughters[2]=211;//pi
1060 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
1063 pdgdaughters =new Int_t[2];
1064 pdgdaughters[0]=211;//pi
1065 pdgdaughters[1]=321;//K
1069 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar");
1072 pdgdaughters =new Int_t[3];
1073 pdgdaughters[1]=211;//pi
1074 pdgdaughters[0]=321;//K
1075 pdgdaughters[2]=211;//pi (soft?)
1079 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1082 pdgdaughters =new Int_t[3];
1083 pdgdaughters[0]=321;//K
1084 pdgdaughters[1]=321;//K
1085 pdgdaughters[2]=211;//pi
1089 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm4Prong");
1092 pdgdaughters =new Int_t[4];
1093 pdgdaughters[0]=321;
1094 pdgdaughters[1]=211;
1095 pdgdaughters[2]=211;
1096 pdgdaughters[3]=211;
1100 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1103 pdgdaughters =new Int_t[3];
1104 pdgdaughters[0]=2212;//p
1105 pdgdaughters[1]=321;//K
1106 pdgdaughters[2]=211;//pi
1110 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("CascadesHF");
1113 pdgdaughters =new Int_t[3];
1114 pdgdaughters[0]=2212;//p
1115 pdgdaughters[1]=211;//pi
1116 pdgdaughters[2]=211;//pi
1122 switch(fDecayChannel){
1124 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1127 pdgdaughters =new Int_t[3];
1128 pdgdaughters[0]=211;//pi
1129 pdgdaughters[1]=321;//K
1130 pdgdaughters[2]=211;//pi
1134 arrayProng=(TClonesArray*)aod->GetList()->FindObject("D0toKpi");
1137 pdgdaughters =new Int_t[2];
1138 pdgdaughters[0]=211;//pi
1139 pdgdaughters[1]=321;//K
1143 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Dstar");
1146 pdgdaughters =new Int_t[3];
1147 pdgdaughters[1]=211;//pi
1148 pdgdaughters[0]=321;//K
1149 pdgdaughters[2]=211;//pi (soft?)
1153 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1156 pdgdaughters =new Int_t[3];
1157 pdgdaughters[0]=321;//K
1158 pdgdaughters[1]=321;//K
1159 pdgdaughters[2]=211;//pi
1163 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm4Prong");
1166 pdgdaughters =new Int_t[4];
1167 pdgdaughters[0]=321;
1168 pdgdaughters[1]=211;
1169 pdgdaughters[2]=211;
1170 pdgdaughters[3]=211;
1174 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1177 pdgdaughters =new Int_t[3];
1178 pdgdaughters[0]=2212;//p
1179 pdgdaughters[1]=321;//K
1180 pdgdaughters[2]=211;//pi
1184 arrayProng=(TClonesArray*)aod->GetList()->FindObject("CascadesHF");
1187 pdgdaughters =new Int_t[3];
1188 pdgdaughters[0]=2212;//p
1189 pdgdaughters[1]=211;//pi
1190 pdgdaughters[2]=211;//pi
1195 Bool_t isSimpleMode=fSimpleMode;
1197 AliInfo("Branch not found! The output will contain only track related histograms\n");
1202 TClonesArray *mcArray = 0;
1203 AliAODMCHeader *mcHeader = 0;
1206 delete [] pdgdaughters;
1212 // load MC particles
1213 mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1215 printf("AliAnalysisTaskSEHFQA::UserExec: MC particles branch not found!\n");
1216 delete [] pdgdaughters;
1221 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1223 printf("AliAnalysisTaskSEHFQA::UserExec: MC header branch not found!\n");
1224 delete [] pdgdaughters;
1230 UInt_t evSelMask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1231 Double_t centrality=fCuts->GetCentrality(aod);
1232 Double_t multiplicity=aod->GetHeader()->GetRefMultiplicity();
1233 Int_t runNumber = aod->GetRunNumber();
1234 TString trigClass=aod->GetFiredTriggerClasses();
1235 Int_t nAODtracks=aod->GetNTracks();
1236 Int_t nSelTracksTPCOnly=0;
1237 Int_t nSelTracksTPCITS=0;
1238 Int_t nSelTracksTPCITS1SPD=0;
1241 if(aod->GetTriggerMask()==0 &&
1242 (runNumber>=195344 && runNumber<=195677)){
1243 AliDebug(3,"Event rejected because of null trigger mask");
1244 delete [] pdgdaughters;
1249 for (Int_t k=0;k<nAODtracks;k++){
1250 AliAODTrack* track=aod->GetTrack(k);
1251 if(track->GetID()<0) continue;
1252 Int_t nclsTot=0,nclsSPD=0;
1253 for(Int_t l=0;l<6;l++) {
1254 if(TESTBIT(track->GetITSClusterMap(),l)) {
1255 nclsTot++; if(l<2) nclsSPD++;
1258 UShort_t nTPCClus=track->GetTPCClusterMap().CountBits();
1259 if(TMath::Abs(track->Eta())<0.8 && nTPCClus>=70 && track->GetStatus()&AliESDtrack::kTPCrefit){
1260 if(track->TestFilterBit(1)) nSelTracksTPCOnly++;
1261 if(track->GetStatus()&AliESDtrack::kITSrefit){
1263 if(nclsSPD>0) nSelTracksTPCITS1SPD++;
1270 PostData(8,fOutputFlowObs);
1273 TH2F* hTrigC=(TH2F*)fOutputEvSelection->FindObject("hTrigCent");
1274 TH2F* hTrigM=(TH2F*)fOutputEvSelection->FindObject("hTrigMul");
1275 AliCounterCollection* trigCount=(AliCounterCollection*)fOutputEvSelection->FindObject("trigCounter");
1277 hTrigC->Fill(-1.,centrality);
1278 hTrigM->Fill(-1.,multiplicity);
1279 trigCount->Count(Form("triggerType:All/Run:%d",runNumber));
1281 if(aod->GetEventType()!=7){
1282 trigCount->Count(Form("triggerType:NoPhysSelEvNot7/Run:%d",runNumber));
1283 }else if(trigClass.Contains("CMUP1")){
1284 trigCount->Count(Form("triggerType:NoPhysSelCMUP1/Run:%d",runNumber));
1285 }else if(trigClass.Contains("MUON")){
1286 trigCount->Count(Form("triggerType:NoPhysSelMUON/Run:%d",runNumber));
1287 }else if(trigClass.Contains("CPBI2_B1-B") || trigClass.Contains(" CPBI2WU_B1-B")){
1288 trigCount->Count(Form("triggerType:NoPhysSelMB/Run:%d",runNumber));
1289 }else if(trigClass.Contains("CCENT") || trigClass.Contains("CVHN")){
1290 trigCount->Count(Form("triggerType:NoPhysSelCent/Run:%d",runNumber));
1291 }else if(trigClass.Contains("CSEMI") || trigClass.Contains("CVLN")){
1292 trigCount->Count(Form("triggerType:NoPhysSelSemiCent/Run:%d",runNumber));
1295 if(evSelMask & AliVEvent::kAny){
1296 hTrigC->Fill(0.,centrality);
1297 hTrigM->Fill(0.,multiplicity);
1298 trigCount->Count(Form("triggerType:Any/Run:%d",runNumber));
1300 if(evSelMask & AliVEvent::kMB){
1301 hTrigC->Fill(1.,centrality);
1302 hTrigM->Fill(1.,multiplicity);
1303 trigCount->Count(Form("triggerType:MB/Run:%d",runNumber));
1305 if(evSelMask & AliVEvent::kINT7){
1306 hTrigC->Fill(2.,centrality);
1307 hTrigM->Fill(2.,multiplicity);
1308 trigCount->Count(Form("triggerType:CINT7/Run:%d",runNumber));
1310 if(evSelMask & AliVEvent::kCINT5){
1311 hTrigC->Fill(3.,centrality);
1312 hTrigM->Fill(3.,multiplicity);
1314 if(evSelMask & AliVEvent::kCentral){
1315 hTrigC->Fill(4.,centrality);
1316 hTrigM->Fill(4.,multiplicity);
1317 trigCount->Count(Form("triggerType:Cent/Run:%d",runNumber));
1319 if(evSelMask & AliVEvent::kSemiCentral){
1320 hTrigC->Fill(5.,centrality);
1321 hTrigM->Fill(5.,multiplicity);
1322 trigCount->Count(Form("triggerType:SemiCent/Run:%d",runNumber));
1324 if(evSelMask & (AliVEvent::kEMC1 | AliVEvent::kEMC7)){
1325 hTrigC->Fill(6.,centrality);
1326 hTrigM->Fill(6.,multiplicity);
1328 if(evSelMask & (AliVEvent::kEMCEJE | AliVEvent::kEMCEGA)){
1329 hTrigC->Fill(7.,centrality);
1330 hTrigM->Fill(7.,multiplicity);
1331 trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1333 if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) | (AliVEvent::kMUS7 | AliVEvent::kMUON))){
1334 hTrigC->Fill(8.,centrality);
1335 hTrigM->Fill(8.,multiplicity);
1336 trigCount->Count(Form("triggerType:MUON/Run:%d",runNumber));
1338 if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)){
1339 hTrigC->Fill(9.,centrality);
1340 hTrigM->Fill(9.,multiplicity);
1342 if(evSelMask & (AliVEvent::kTRD)){
1343 hTrigC->Fill(10.,centrality);
1344 hTrigM->Fill(10.,multiplicity);
1346 if(evSelMask & (AliVEvent::kHighMult)){
1347 hTrigC->Fill(11.,centrality);
1348 hTrigM->Fill(11.,multiplicity);
1350 if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)){
1351 hTrigC->Fill(12.,centrality);
1352 hTrigM->Fill(12.,multiplicity);
1357 // fix for temporary bug in ESDfilter
1358 // the AODs with null vertex pointer didn't pass the PhysSel
1359 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001) {
1360 delete [] pdgdaughters;
1367 //count events with good vertex
1368 // AOD primary vertex
1369 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1371 Double_t pos[3],cov[6];
1373 vtx1->GetCovarianceMatrix(cov);
1374 const AliESDVertex vESD(pos,cov,100.,100);
1376 TString primTitle = vtx1->GetTitle();
1377 if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0) fNEntries->Fill(4);
1379 // trigger class for PbPb C0SMH-B-NOPF-ALLNOTRD, C0SMH-B-NOPF-ALL
1380 //TString trigclass=aod->GetFiredTriggerClasses();
1381 //if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL")) fNEntries->Fill(5); //tmp
1386 Bool_t evSelbyCentrality=kTRUE,evSelected=kTRUE,evSelByVertex=kTRUE,evselByPileup=kTRUE,evSelByPS=kTRUE;
1388 TH1F* hWhyEvRejected=0x0;
1390 hWhyEvRejected=(TH1F*)fOutputEvSelection->FindObject("hWhyEvRejected");
1391 if(hWhyEvRejected) hWhyEvRejected->Fill(-1);
1395 if(!fCuts->IsEventSelected(aod)) {
1397 if(fCuts->IsEventRejectedDueToPileupSPD()) {
1398 if(hWhyEvRejected) hWhyEvRejected->Fill(0);
1399 evselByPileup=kFALSE;
1400 }// rejected for pileup
1401 if(fCuts->IsEventRejectedDueToCentrality()) {
1402 if(hWhyEvRejected) hWhyEvRejected->Fill(1);
1403 evSelbyCentrality=kFALSE; //rejected by centrality
1405 if(fCuts->IsEventRejectedDueToNotRecoVertex() ||
1406 fCuts->IsEventRejectedDueToVertexContributors()){
1407 evSelByVertex=kFALSE;
1408 if(hWhyEvRejected) hWhyEvRejected->Fill(2);
1410 if(fCuts->IsEventRejectedDueToTrigger()){
1411 if(hWhyEvRejected) hWhyEvRejected->Fill(3);
1413 if(fCuts->IsEventRejectedDueToZVertexOutsideFiducialRegion()) {
1414 evSelByVertex=kFALSE;
1415 if(fOnOff[3]) ((AliCounterCollection*)fOutputEvSelection->FindObject("evselection"))->Count(Form("evnonsel:zvtx/Run:%d",runNumber));
1416 if(hWhyEvRejected) hWhyEvRejected->Fill(4);
1418 if(fCuts->IsEventRejectedDuePhysicsSelection()) {
1420 if(hWhyEvRejected) hWhyEvRejected->Fill(5);
1423 if(evSelected && fOnOff[3]){
1424 TH2F* hTrigS=(TH2F*)fOutputEvSelection->FindObject("hTrigCentSel");
1425 hTrigS->Fill(-1.,centrality);
1427 if(evSelMask & AliVEvent::kAny) hTrigS->Fill(0.,centrality);
1428 if(evSelMask & AliVEvent::kMB) hTrigS->Fill(1.,centrality);
1429 if(evSelMask & AliVEvent::kINT7) hTrigS->Fill(2.,centrality);
1430 if(evSelMask & AliVEvent::kCINT5) hTrigS->Fill(3.,centrality);
1431 if(evSelMask & AliVEvent::kCentral) hTrigS->Fill(4.,centrality);
1432 if(evSelMask & AliVEvent::kSemiCentral) hTrigS->Fill(5.,centrality);
1433 if(evSelMask & (AliVEvent::kEMC1 | AliVEvent::kEMC7)) hTrigS->Fill(6.,centrality);
1434 if(evSelMask & (AliVEvent::kEMCEJE | AliVEvent::kEMCEGA)) hTrigS->Fill(7.,centrality);
1435 if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) | (AliVEvent::kMUS7 | AliVEvent::kMUON))) hTrigS->Fill(8.,centrality);
1436 if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)) hTrigS->Fill(9.,centrality);
1437 if(evSelMask & (AliVEvent::kTRD)) hTrigS->Fill(10.,centrality);
1438 if(evSelMask & (AliVEvent::kHighMult)) hTrigS->Fill(11.,centrality);
1439 if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)) hTrigS->Fill(12.,centrality);
1442 if(evSelected || (!evSelbyCentrality && evSelByVertex && evselByPileup && evSelByPS)){ //events selected or not selected because of centrality
1443 if(fOnOff[2] && fCuts->GetUseCentrality()){
1445 Float_t stdCentf=fCuts->GetCentrality(aod);
1446 Int_t stdCent = (Int_t)(stdCentf+0.5);
1447 Float_t secondCentf =fCuts->GetCentrality(aod,fEstimator);
1448 Int_t secondCent = (Int_t)(secondCentf+0.5);
1449 Int_t mincent=stdCent-stdCent%10;
1450 AliAODVZERO *vzeroAOD = (AliAODVZERO*)aod->GetVZEROData();
1451 Float_t vzeroMult = vzeroAOD->GetMTotV0A() + vzeroAOD->GetMTotV0C();
1452 AliCentrality *aodcent = aod->GetCentrality();
1453 Float_t spdCentf = aodcent->GetCentralityPercentile("CL1");
1458 if(mincent==100)mincent--;
1459 ((AliCounterCollection*)fOutputCounters->FindObject("stdEstimator"))->Count(Form("centralityclass:%d_%d/Run:%d",mincent,mincent+10,runNumber));
1461 mincent=secondCent-secondCent%10;
1462 if(secondCentf==-1) {
1466 if(mincent==100)mincent--;
1467 ((AliCounterCollection*)fOutputCounters->FindObject("secondEstimator"))->Count(Form("centralityclass:%d_%d/Run:%d",mincent,mincent+10,runNumber));
1469 if(stdCent<fCuts->GetMinCentrality() || stdCent>fCuts->GetMaxCentrality()){
1470 ((TH1F*)fOutputCheckCentrality->FindObject("hNtrackletsOut"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
1471 ((TH1F*)fOutputCheckCentrality->FindObject("hMultOut"))->Fill(aod->GetHeader()->GetRefMultiplicity());
1473 ((TH1F*)fOutputCheckCentrality->FindObject("hNtrackletsIn"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
1474 ((TH1F*)fOutputCheckCentrality->FindObject("hMultIn"))->Fill(aod->GetHeader()->GetRefMultiplicity());
1476 ((TH2F*)fOutputCheckCentrality->FindObject("hMultvsPercentile"))->Fill(aod->GetHeader()->GetRefMultiplicity(),stdCentf);
1477 ((TH2F*)fOutputCheckCentrality->FindObject("hntrklvsPercentile"))->Fill(aod->GetTracklets()->GetNumberOfTracklets(),stdCentf);
1478 ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCTracksvsPercentile"))->Fill(nSelTracksTPCOnly,stdCentf);
1479 ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCITSTracksvsPercentile"))->Fill(nSelTracksTPCITS,stdCentf);
1480 ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCITS1SPDTracksvsPercentile"))->Fill(nSelTracksTPCITS1SPD,stdCentf);
1481 ((TH2F*)fOutputCheckCentrality->FindObject("hV0MultiplicityPercentile"))->Fill(vzeroMult,stdCentf);
1482 ((TH2F*)fOutputCheckCentrality->FindObject("hV0MultiplicityNtrackletsIn"))->Fill(vzeroMult,aod->GetTracklets()->GetNumberOfTracklets());
1483 ((TH2F*)fOutputCheckCentrality->FindObject("hStdPercentileSPDPercentile"))->Fill(stdCentf,spdCentf);
1485 PostData(6,fOutputCheckCentrality);
1489 ((TH1F*)fOutputTrack->FindObject("hNtracklets"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
1490 ((TH1F*)fOutputTrack->FindObject("hMult"))->Fill(aod->GetHeader()->GetRefMultiplicity());
1496 const AliVVertex *vertex = aod->GetPrimaryVertex();
1497 Double_t xvtx=vertex->GetX();
1498 Double_t yvtx=vertex->GetY();
1499 Double_t zvtx=vertex->GetZ();
1501 if(vertex->GetNContributors()<=0) vtxTyp=-1;
1502 TString title=vertex->GetTitle();
1503 if(title.Contains("Z")) vtxTyp=2;
1504 if(title.Contains("3D")) vtxTyp=1;
1505 ((TH1F*)fOutputEvSelection->FindObject("hxvtx"))->Fill(xvtx);
1506 ((TH1F*)fOutputEvSelection->FindObject("hyvtx"))->Fill(yvtx);
1507 ((TH1F*)fOutputEvSelection->FindObject("hzvtx"))->Fill(zvtx);
1508 ((TH1F*)fOutputEvSelection->FindObject("hWhichVert"))->Fill(vtxTyp);
1510 ((TH1F*)fOutputEvSelection->FindObject("hxvtxSelEv"))->Fill(xvtx);
1511 ((TH1F*)fOutputEvSelection->FindObject("hyvtxSelEv"))->Fill(yvtx);
1512 ((TH1F*)fOutputEvSelection->FindObject("hzvtxSelEv"))->Fill(zvtx);
1513 ((TH1F*)fOutputEvSelection->FindObject("hWhichVertSelEv"))->Fill(vtxTyp);
1518 delete [] pdgdaughters;
1519 return; //discard all events not selected (vtx and/or centrality)
1523 AliAODPidHF* pidHF=fCuts->GetPidHF();
1525 delete [] pdgdaughters;
1528 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
1529 AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
1530 AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
1532 //AliPIDResponse* respF=pidHF->GetPidResponse();
1533 AliTPCPIDResponse* tpcres=new AliTPCPIDResponse();
1534 Bool_t oldPID=pidHF->GetOldPid();
1536 Double_t alephParameters[5];
1537 pidHF->GetTPCBetheBlochParams(alephParameters);
1538 tpcres->SetBetheBlochParameters(alephParameters[0],alephParameters[1],alephParameters[2],alephParameters[3],alephParameters[4]);
1543 Int_t isGoodTrack=0, isFakeTrack=0, isSelTrack=0;
1545 if(aod) ntracks=aod->GetNTracks();
1547 if(fOnOff[0] || fOnOff[1]){
1548 //loop on tracks in the event
1549 for (Int_t k=0;k<ntracks;k++){
1550 AliAODTrack* track=aod->GetTrack(k);
1552 // Track selection cuts
1553 if(track->GetID()<0) continue;
1554 Double_t d0z0[2],covd0z0[3];
1555 track->PropagateToDCA(vtx1,aod->GetMagneticField(),99999.,d0z0,covd0z0);
1556 if(track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){
1557 ((TH1F*)fOutputTrack->FindObject("hd0TracksFilterBit4"))->Fill(d0z0[0]);
1559 ULong_t trStatus=track->GetStatus();
1560 if(trStatus&AliESDtrack::kITSrefit){
1561 if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)){
1562 ((TH1F*)fOutputTrack->FindObject("hd0TracksSPDany"))->Fill(d0z0[0]);
1563 if(track->HasPointOnITSLayer(0)){
1564 ((TH1F*)fOutputTrack->FindObject("hd0TracksSPDin"))->Fill(d0z0[0]);
1569 Bool_t selTrack=kTRUE;
1570 if (!((trStatus & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||
1571 !((trStatus & AliVTrack::kITSrefit) == AliVTrack::kITSrefit)){
1575 Float_t nCrossedRowsTPC = track->GetTPCClusterInfo(2,1);
1576 Float_t ratioCrossedRowsOverFindableClustersTPC = 1.0;
1577 if (track->GetTPCNclsF()>0) {
1578 ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC/track->GetTPCNclsF();
1580 if ( nCrossedRowsTPC<70 || ratioCrossedRowsOverFindableClustersTPC<.8 ){
1584 if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)){
1585 ((TH1F*)fOutputTrack->FindObject("hd0TracksTPCITSSPDany"))->Fill(d0z0[0]);
1589 AliAODPid *pid = track->GetDetPid();
1590 if(!pid && fDebug>1) cout<<"No AliAODPid found"<<endl;
1592 if(pid && fOnOff[1]){
1593 Double_t times[AliPID::kSPECIES];
1594 pid->GetIntegratedTimes(times);
1596 Double_t tofRes[AliPID::kSPECIES];
1597 pid->GetTOFpidResolution(tofRes);
1600 TH1F* htmpfl=((TH1F*)fOutputPID->FindObject("hTOFflags"));
1602 if (trStatus&AliESDtrack::kTPCout) htmpfl->Fill(1.);
1603 if (trStatus&AliESDtrack::kTOFout) htmpfl->Fill(2.);
1604 if (trStatus&AliESDtrack::kTIME) htmpfl->Fill(3.);
1605 if (trStatus&AliESDtrack::kTOFpid) htmpfl->Fill(4.);
1606 if (trStatus&AliESDtrack::kTOFmismatch) htmpfl->Fill(5.);
1608 Bool_t isTOFok=kFALSE;
1610 Double_t prob[AliPID::kSPECIES];
1611 if(pidResp->ComputeTOFProbability(track,AliPID::kSPECIES,prob)==AliPIDResponse::kDetPidOk){
1617 if(selTrack && isTOFok){
1618 Double_t tofTime=pid->GetTOFsignal();
1619 AliTOFHeader* tofH=(AliTOFHeader*)aod->GetTOFHeader();
1620 if (tofH && (TMath::Abs(tofRes[0]) <= 1.E-16) ) { // new AOD
1621 // with new AOD we need to retrieve startTime, subtract it and retrieve correctly TOF PID resolutions *PA*
1622 AliTOFPIDResponse tofResp=pidResp->GetTOFResponse();
1623 Double_t startTime = tofResp.GetStartTime(track->P());
1624 Float_t startTimeRes = tofResp.GetStartTimeRes(track->P());
1625 Int_t startTimeMask = tofResp.GetStartTimeMask(track->P());
1626 ((TH1F*)fOutputPID->FindObject("hTOFstartTimeDistrib"))->Fill(startTime);
1627 ((TH1F*)fOutputPID->FindObject("hTOFstartTimeMask"))->Fill(startTimeMask);
1628 ((TH1F*)fOutputPID->FindObject("hTOFstartTimeRes"))->Fill(startTimeRes);
1630 for (Int_t type=0;type<AliPID::kSPECIES;type++) tofRes[type]=tofResp.GetExpectedSigma(track->P(),times[type],AliPID::ParticleMassZ(type));
1632 ((TH1F*)fOutputPID->FindObject("hTOFtime"))->Fill(times[AliPID::kProton]);
1633 ((TH2F*)fOutputPID->FindObject("hTOFtimeKaonHyptime"))->Fill(track->P(),tofTime-times[3]); //3 is kaon
1634 ((TH1F*)fOutputPID->FindObject("hTOFsig"))->Fill(tofTime);
1635 if (pid->GetTOFsignal()< 0) ((TH1F*)fOutputPID->FindObject("hTOFsig"))->Fill(-1);
1637 Double_t nsigma[3]={-10,-10,-10};
1638 nsigma[0]=pidResp->NumberOfSigmasTOF(track,AliPID::kPion);
1639 nsigma[1]=pidResp->NumberOfSigmasTOF(track,AliPID::kKaon);
1640 nsigma[2]=pidResp->NumberOfSigmasTOF(track,AliPID::kProton);
1642 ((TH2F*)fOutputPID->FindObject("hTOFsigmaKSigPid"))->Fill(track->P(),nsigma[1]);
1643 ((TH2F*)fOutputPID->FindObject("hTOFsigmaPionSigPid"))->Fill(track->P(),nsigma[0]);
1644 ((TH2F*)fOutputPID->FindObject("hTOFsigmaProtonSigPid"))->Fill(track->P(),nsigma[2]);
1646 Int_t label=track->GetLabel();
1647 if(label<=0) continue;
1648 AliMCParticle* mcpart=(AliMCParticle*)mcArray->At(label);
1650 Int_t abspdgcode=TMath::Abs(mcpart->PdgCode());
1651 if(abspdgcode==211) ((TH2F*)fOutputPID->FindObject("hTOFsigmaMCPionSigPid"))->Fill(track->P(),nsigma[0]);
1652 if(abspdgcode==321) ((TH2F*)fOutputPID->FindObject("hTOFsigmaMCKSigPid"))->Fill(track->P(),nsigma[1]);
1653 if(abspdgcode==2212) ((TH2F*)fOutputPID->FindObject("hTOFsigmaMCProtonSigPid"))->Fill(track->P(),nsigma[2]);
1658 for (Int_t iS=2; iS<5; iS++){ //we plot TOF Pid resolution for 3-sigma identified particles
1659 if ( TMath::Abs(nsigma[iS-2])<3.){
1662 ((TH1F*)fOutputPID->FindObject("hTOFsigPid3sigPion"))->Fill(tofRes[iS]);
1665 ((TH1F*)fOutputPID->FindObject("hTOFsigPid3sigKaon"))->Fill(tofRes[iS]);
1667 case AliPID::kProton:
1668 ((TH1F*)fOutputPID->FindObject("hTOFsigPid3sigProton"))->Fill(tofRes[iS]);
1678 if(pidHF && pidHF->CheckStatus(track,"TPC")){
1680 Double_t TPCp=pid->GetTPCmomentum();
1681 Double_t TPCsignal=pid->GetTPCsignal();
1682 UShort_t TPCsignalN=pid->GetTPCsignalN();
1683 ((TH1F*)fOutputPID->FindObject("hTPCsig"))->Fill(TPCsignal);
1684 ((TH1F*)fOutputPID->FindObject("hTPCsigvsp"))->Fill(TPCp,TPCsignal);
1685 //if (pidHF->IsKaonRaw(track, "TOF"))
1686 Double_t nsigma[3]={-10,-10,-10};
1687 pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kPion,nsigma[0]);
1688 pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kKaon,nsigma[1]);
1689 pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kProton,nsigma[2]);
1691 ((TH2F*)fOutputPID->FindObject("hTPCsigmaK"))->Fill(TPCp,nsigma[1]);
1693 ((TH2F*)fOutputPID->FindObject("hTPCsigmaPion"))->Fill(TPCp,nsigma[0]);
1694 ((TH2F*)fOutputPID->FindObject("hTPCsigmaProton"))->Fill(TPCp,nsigma[2]);
1697 Int_t label=track->GetLabel();
1698 if(label<=0) continue;
1699 AliMCParticle* mcpart=(AliMCParticle*)mcArray->At(label);
1701 Int_t abspdgcode=TMath::Abs(mcpart->PdgCode());
1702 if(abspdgcode==211) ((TH2F*)fOutputPID->FindObject("hTPCsigmaMCPion"))->Fill(track->P(),nsigma[0]);
1703 if(abspdgcode==321) ((TH2F*)fOutputPID->FindObject("hTPCsigmaMCK"))->Fill(track->P(),nsigma[1]);
1704 if(abspdgcode==2212) ((TH2F*)fOutputPID->FindObject("hTPCsigmaMCProton"))->Fill(track->P(),nsigma[2]);
1709 if(fFillDistrTrackEffChecks && track->GetStatus()&AliESDtrack::kITSrefit && track->GetStatus()&AliESDtrack::kTPCrefit){
1710 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPtAllTracks"))->Fill(track->Pt(),(Float_t)TPCsignalN);
1711 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPhiAllTracks"))->Fill(track->Phi(),(Float_t)TPCsignalN);
1712 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsEtaAllTracks"))->Fill(track->Eta(),(Float_t)TPCsignalN);
1716 } //end PID histograms
1718 Int_t nclsTot=0,nclsSPD=0;
1720 //check clusters of the tracks
1723 ((TH1F*)fOutputTrack->FindObject("hnLayerITS"))->Fill(-1);
1724 for(Int_t l=0;l<6;l++) {
1725 if(TESTBIT(track->GetITSClusterMap(),l)) {
1726 ((TH1F*)fOutputTrack->FindObject("hnLayerITS"))->Fill(l);
1727 nclsTot++; if(l<2) nclsSPD++;
1730 ((TH1F*)fOutputTrack->FindObject("hnClsITS"))->Fill(nclsTot);
1731 ((TH1F*)fOutputTrack->FindObject("hnClsSPD"))->Fill(nclsSPD);
1733 if(fFillDistrTrackEffChecks && track->GetStatus()&AliESDtrack::kITSrefit && track->GetStatus()&AliESDtrack::kTPCrefit){
1735 ((TH1F*)fOutputTrack->FindObject("hPtAllTracks"))->Fill(track->Pt());
1736 ((TH1F*)fOutputTrack->FindObject("hPhiAllTracks"))->Fill(track->Phi());
1737 ((TH1F*)fOutputTrack->FindObject("hEtaAllTracks"))->Fill(track->Eta());
1738 ((TH2F*)fOutputTrack->FindObject("hEtavsPhiAllTracks"))->Fill(track->Phi(),track->Eta());
1739 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPtAllTracks"))->Fill(track->Pt(),track->GetTPCNcls());
1740 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPhiAllTracks"))->Fill(track->Phi(),track->GetTPCNcls());
1741 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsEtaAllTracks"))->Fill(track->Eta(),track->GetTPCNcls());
1743 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPtAllTracks"))->Fill(track->Pt(),nCrossedRowsTPC);
1744 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPhiAllTracks"))->Fill(track->Phi(),nCrossedRowsTPC);
1745 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsEtaAllTracks"))->Fill(track->Eta(),nCrossedRowsTPC);
1747 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPtAllTracks"))->Fill(track->Pt(),ratioCrossedRowsOverFindableClustersTPC);
1748 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPhiAllTracks"))->Fill(track->Phi(),ratioCrossedRowsOverFindableClustersTPC);
1749 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsEtaAllTracks"))->Fill(track->Eta(),ratioCrossedRowsOverFindableClustersTPC);
1751 if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
1752 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(0);
1754 if(track->HasPointOnITSLayer(0) && !(track->HasPointOnITSLayer(1))){ //kOnlyFirst
1755 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(1);
1757 if(!(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1)){ //kOnlySecond
1758 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(2);
1760 if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)){ //kBoth
1761 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(3);
1763 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPtAllTracks"))->Fill(track->Pt(), nclsTot);
1764 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPhiAllTracks"))->Fill(track->Phi(), nclsTot);
1765 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsEtaAllTracks"))->Fill(track->Eta(), nclsTot);
1769 if(track->Pt()>0.3 &&
1770 TMath::Abs(track->Eta())<0.8 &&
1771 track->GetStatus()&AliESDtrack::kITSrefit &&
1772 track->GetStatus()&AliESDtrack::kTPCrefit &&
1774 ((TH1F*)fOutputTrack->FindObject("hnClsITSselTr"))->Fill(nclsTot);
1776 if(!(track->GetStatus()&AliESDtrack::kTPCin) && track->GetStatus()&AliESDtrack::kITSrefit && !(track->GetStatus()&AliESDtrack::kITSpureSA)){//tracks retrieved in the ITS and not reconstructed in the TPC
1777 ((TH1F*)fOutputTrack->FindObject("hnClsITS-SA"))->Fill(nclsTot);
1778 ((TH1F*)fOutputTrack->FindObject("hnLayerITS"))->Fill(-1);
1779 for(Int_t l=0;l<6;l++) {
1780 if(TESTBIT(track->GetITSClusterMap(),l)) {
1781 ((TH1F*)fOutputTrack->FindObject("hnLayerITSsa"))->Fill(l);
1787 label=track->GetLabel();
1788 if (label<0)fNEntries->Fill(8);
1789 else fNEntries->Fill(9);
1793 if (track->Pt()>0.3 &&
1794 track->GetStatus()&AliESDtrack::kTPCrefit &&
1795 track->GetStatus()&AliESDtrack::kITSrefit &&
1797 nclsSPD>0) {//count good tracks
1800 if(fReadMC && label<0) {
1801 ((TH1F*)fOutputTrack->FindObject("hptFakeTr"))->Fill(track->Pt());
1804 ((TH1F*)fOutputTrack->FindObject("hptGoodTr"))->Fill(track->Pt());
1808 if(fCuts->IsDaughterSelected(track,&vESD,fCuts->GetTrackCuts())){
1810 }//select tracks for our analyses
1811 } //fill track histos
1812 } //end loop on tracks
1814 //fill once per event
1816 if (fReadMC) ((TH1F*)fOutputTrack->FindObject("hdistrFakeTr"))->Fill(isFakeTrack);
1817 ((TH1F*)fOutputTrack->FindObject("hdistrGoodTr"))->Fill(isGoodTrack);
1818 ((TH1F*)fOutputTrack->FindObject("hdistrSelTr"))->Fill(isSelTrack);
1822 // loop over candidates
1823 Int_t nCand = arrayProng->GetEntriesFast();
1825 if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpi) ndaugh=2;
1826 if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpipipi) ndaugh=4;
1828 for (Int_t iCand = 0; iCand < nCand; iCand++) {
1829 AliAODRecoDecayHF *d = (AliAODRecoDecayHF*)arrayProng->UncheckedAt(iCand);
1830 if(fUseSelectionBit && d->GetSelectionMap()) {
1831 if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpi && !d->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) continue; //skip the D0 from Dstar
1832 if(fDecayChannel==AliAnalysisTaskSEHFQA::kDplustoKpipi && !d->HasSelectionBit(AliRDHFCuts::kDplusCuts)) continue; //skip the 3 prong !D+
1838 if (fDecayChannel==AliAnalysisTaskSEHFQA::kLambdactoV0 && (dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0()) {
1840 Int_t pdgDgLctoV0bachelor[2]={2212,310};
1841 Int_t pdgDgV0toDaughters[2]={211,211};
1842 Int_t mcLabelK0S = (dynamic_cast<AliAODRecoCascadeHF*>(d))->MatchToMC(pdg,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,mcArray,kTRUE); // Lc->K0S+p and cc
1843 pdgDgLctoV0bachelor[1]=3122, pdgDgLctoV0bachelor[0]=211;
1844 pdgDgV0toDaughters[0]=2212, pdgDgV0toDaughters[1]=211;
1845 Int_t mcLabelLambda = (dynamic_cast<AliAODRecoCascadeHF*>(d))->MatchToMC(pdg,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,mcArray,kTRUE); // Lc->Lambda+pi and cc
1846 if (mcLabelK0S!=-1 || mcLabelLambda!=-1) AliInfo(Form("mcLabelK0S=%d - mcLabelLambda=%d",mcLabelK0S,mcLabelLambda));
1848 if (mcLabelK0S!=-1 && mcLabelLambda!=-1)
1849 AliInfo("Strange: current Lc->V0+bachelor candidate has two MC different labels!");
1850 else if (mcLabelK0S>-1 && mcLabelLambda==-1)
1852 else if (mcLabelLambda>-1 && mcLabelK0S==-1)
1853 labD = mcLabelLambda;
1856 labD = d->MatchToMC(pdg,mcArray,ndaugh,pdgdaughters);
1859 AliAODMCParticle *partD = (AliAODMCParticle*)mcArray->At(labD);
1860 Int_t label=partD->GetMother();
1861 AliAODMCParticle *mot = (AliAODMCParticle*)mcArray->At(label);
1862 while(label>=0){//get first mother
1863 mot = (AliAODMCParticle*)mcArray->At(label);
1864 label=mot->GetMother();
1867 Int_t pdgMotCode = mot->GetPdgCode();
1869 if(TMath::Abs(pdgMotCode)==4) fNEntries->Fill(6); //from primary charm
1870 if(TMath::Abs(pdgMotCode)==5) fNEntries->Fill(7); //from beauty
1874 fNEntries->Fill(5); //count the candidates (data and MC)
1876 for(Int_t id=0;id<ndaugh;id++){
1877 //other histograms to be filled when the cut object is given
1878 AliAODTrack* track=0;
1880 if (fDecayChannel==AliAnalysisTaskSEHFQA::kLambdactoV0 && (dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0()) {
1882 track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->GetBachelor();
1884 track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0PositiveTrack();
1886 track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0NegativeTrack();
1889 track=(AliAODTrack*)d->GetDaughter(id);
1893 if (fCuts->IsInFiducialAcceptance(d->Pt(),d->Y(pdg)) && fCuts->IsSelected(d,AliRDHFCuts::kTracks,aod)) {
1896 if(fReadMC)label=track->GetLabel();
1899 if(fReadMC && label<0) {
1901 ((TH1F*)fOutputTrack->FindObject("hptFakeTrFromDaugh"))->Fill(track->Pt());
1903 ((TH1F*)fOutputTrack->FindObject("hd0f"))->Fill(d->Getd0Prong(id));
1905 ((TH1F*)fOutputTrack->FindObject("hptGoodTrFromDaugh"))->Fill(track->Pt());
1906 ((TH1F*)fOutputTrack->FindObject("hd0dau"))->Fill(d->Getd0Prong(id));
1907 Double_t d0rphiz[2],covd0[3];
1908 Bool_t isDCA=track->PropagateToDCA(aod->GetPrimaryVertex(),aod->GetMagneticField(),9999.,d0rphiz,covd0);
1909 if(isDCA) ((TH1F*)fOutputTrack->FindObject("hd0zdau"))->Fill(d0rphiz[1]);
1914 if(fFillDistrTrackEffChecks){
1916 Double_t nTPCCrossedRows = track->GetTPCClusterInfo(2,1);
1917 Double_t ratioCrossedRowsOverFcls = 1.0;
1918 if(track->GetTPCNclsF()>0){
1919 ratioCrossedRowsOverFcls = (nTPCCrossedRows)/(track->GetTPCNclsF());
1921 for(Int_t l=0;l<6;l++) {
1922 if(TESTBIT(track->GetITSClusterMap(),l)) {
1927 ((TH1F*)fOutputTrack->FindObject("hPtDaughters"))->Fill(track->Pt());
1928 ((TH1F*)fOutputTrack->FindObject("hPhiDaughters"))->Fill(track->Phi());
1929 ((TH1F*)fOutputTrack->FindObject("hEtaDaughters"))->Fill(track->Eta());
1930 ((TH2F*)fOutputTrack->FindObject("hEtavsPhiDaughters"))->Fill(track->Phi(),track->Eta());
1932 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPtDaughters"))->Fill(track->Pt(),track->GetTPCNcls());
1933 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPhiDaughters"))->Fill(track->Phi(),track->GetTPCNcls());
1934 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsEtaDaughters"))->Fill(track->Eta(),track->GetTPCNcls());
1936 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPtDaughters"))->Fill(track->Pt(),nTPCCrossedRows);
1937 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPhiDaughters"))->Fill(track->Phi(),nTPCCrossedRows);
1938 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsEtaDaughters"))->Fill(track->Eta(),nTPCCrossedRows);
1940 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPtDaughters"))->Fill(track->Pt(),ratioCrossedRowsOverFcls);
1941 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPhiDaughters"))->Fill(track->Phi(),ratioCrossedRowsOverFcls);
1942 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsEtaDaughters"))->Fill(track->Eta(),ratioCrossedRowsOverFcls);
1944 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPtDaughters"))->Fill(track->Pt(), nITScls);
1945 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPhiDaughters"))->Fill(track->Phi(), nITScls);
1946 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsEtaDaughters"))->Fill(track->Eta(), nITScls);
1947 if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
1948 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(0);
1950 if(track->HasPointOnITSLayer(0) && !(track->HasPointOnITSLayer(1))){ //kOnlyFirst
1951 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(1);
1953 if(!(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1)){ //kOnlySecond
1954 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(2);
1956 if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)){ //kBoth
1957 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(3);
1962 AliAODPid *pid = track->GetDetPid();
1964 if(pidHF && pidHF->CheckStatus(track,"TPC")){
1965 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPtDaughters"))->Fill(track->Pt(),pid->GetTPCsignalN());
1966 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPhiDaughters"))->Fill(track->Phi(),pid->GetTPCsignalN());
1967 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsEtaDaughters"))->Fill(track->Eta(),pid->GetTPCsignalN());
1974 if (fCuts->IsSelected(d,AliRDHFCuts::kAll,aod) && fOnOff[1]){
1975 fNEntries->Fill(3); //candidates passing analysis cuts
1977 AliAODPid *pid = track->GetDetPid();
1980 pid->GetIntegratedTimes(times);
1981 if(pidHF && pidHF->CheckStatus(track,"TOF")){
1982 Double_t tofTime=pid->GetTOFsignal();
1983 AliTOFHeader* tofH=(AliTOFHeader*)aod->GetTOFHeader();
1984 Double_t tofRes[AliPID::kSPECIES];
1985 pid->GetTOFpidResolution(tofRes);
1986 if (tofH && (TMath::Abs(tofRes[0]) <= 1.E-16) ) { // new AOD
1987 AliTOFPIDResponse tofResp=pidHF->GetPidResponse()->GetTOFResponse();
1988 Double_t startTime=tofResp.GetStartTime(track->P());
1991 ((TH2F*)fOutputPID->FindObject("hTOFtimeKaonHyptimeAC"))->Fill(track->P(),tofTime-times[AliPID::kKaon]);
1993 if(pidHF && pidHF->CheckStatus(track,"TPC")) ((TH2F*)fOutputPID->FindObject("hTPCsigvspAC"))->Fill(pid->GetTPCmomentum(),pid->GetTPCsignal());
1996 } //end analysis cuts
1997 } //end acceptance and track cuts
1998 } //end loop on tracks in the candidate
1999 } //end loop on candidates
2002 } //end if on pid or track histograms
2005 delete [] pdgdaughters;
2006 PostData(1,fNEntries);
2007 if(fOnOff[1]) PostData(2,fOutputPID);
2008 if(fOnOff[0]) PostData(3,fOutputTrack);
2010 if(fOnOff[2]) PostData(5,fOutputCounters);
2011 //Post data 6 done in case of centrality on
2015 //____________________________________________________________________________
2016 void AliAnalysisTaskSEHFQA::FillFlowObs(AliAODEvent *aod){
2017 //fills the flow observables
2019 cc = fCuts->GetCentrality(aod);
2020 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(0., cc);
2022 UInt_t mask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
2023 UInt_t trigger=AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral;
2024 if(mask & trigger) {
2025 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(1.,cc); // fired
2026 if (mask & AliVEvent::kMB) ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(2.,cc);
2027 if (mask & AliVEvent::kCentral) ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(3.,cc);
2028 if (mask & AliVEvent::kSemiCentral) ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(4.,cc);
2029 Bool_t rejected=false;
2030 if(cc<0 || cc>60) rejected=true;
2031 const AliVVertex *vertex = aod->GetPrimaryVertex();
2032 Double_t zvtx=vertex->GetZ();
2033 if(TMath::Abs(zvtx)>fCuts->GetMaxVtxZ()) rejected=true;
2034 if(rejected) return; //not interesting for flow QA
2040 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(5.,cc);
2041 fRFPcuts->SetParamType(AliFlowTrackCuts::kGlobal);
2042 fRFPcuts->SetPtRange(0.2,5.);
2043 fRFPcuts->SetEtaRange(-0.8,0.8);
2044 fRFPcuts->SetMinNClustersTPC(70);
2045 fRFPcuts->SetMinChi2PerClusterTPC(0.2);
2046 fRFPcuts->SetMaxChi2PerClusterTPC(4.0);
2047 fRFPcuts->SetAcceptKinkDaughters(kFALSE);
2048 fRFPcuts->SetEvent(aod);
2050 TString ref[3] = {"FB1","FB128","VZE"};
2052 for(Int_t i=0; i!=3; ++i) {
2053 if(i==0) { // switching to bit 1
2054 fRFPcuts->SetMinimalTPCdedx(10.);
2055 fRFPcuts->SetAODfilterBit(1);
2056 } else { // switching to bit 128
2057 fRFPcuts->SetMinimalTPCdedx(-1);
2058 fRFPcuts->SetAODfilterBit(128);
2061 fRFPcuts->SetParamType(AliFlowTrackCuts::kV0);
2062 fRFPcuts->SetEtaRange(-5,+5);
2063 fRFPcuts->SetPhiMin(0);
2064 fRFPcuts->SetPhiMax(TMath::TwoPi());
2066 fFlowEvent->Fill(fRFPcuts,fRFPcuts);
2067 fFlowEvent->TagSubeventsInEta(-5,0,0,+5);
2068 // getting informationt
2069 AliFlowVector vQ, vQaQb[2];
2070 fFlowEvent->Get2Qsub(vQaQb,2);
2071 vQ = vQaQb[0]+vQaQb[1];
2072 Double_t dMa=vQaQb[0].GetMult();
2073 Double_t dMb=vQaQb[1].GetMult();
2074 if( dMa<2 || dMb<2 ) {
2075 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(6.,cc); //???
2078 psi[i] = vQ.Phi()/2;
2080 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(0,cc,vQaQb[0].X()/dMa,dMa); // Qx-
2081 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(1,cc,vQaQb[0].Y()/dMa,dMa); // Qy-
2082 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(2,cc,vQaQb[1].X()/dMb,dMb); // Qx+
2083 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(3,cc,vQaQb[1].Y()/dMb,dMb); // Qy+
2084 ((TH2F*) fOutputFlowObs->FindObject( Form("h%s_AngleQ",ref[i].Data()) ))->Fill(psi[i],cc); // Psi
2085 AliFlowTrackSimple *track;
2086 for(Int_t t=0; t!=fFlowEvent->NumberOfTracks(); ++t) {
2087 track = (AliFlowTrackSimple*) fFlowEvent->GetTrack(t);
2088 if(!track) continue;
2089 if(!track->InRPSelection()) continue;
2090 ((TH3F*) fOutputFlowObs->FindObject( Form("h%s_PhiEta",ref[i].Data()) ))->Fill(track->Phi(),track->Eta(),cc,track->Weight()); //PhiEta
2093 //histo filled only for TPCFB1
2095 ((TH2F*) fOutputFlowObs->FindObject("hCentVsMultRPS"))->Fill(fFlowEvent->GetNumberOfRPs(),cc);
2099 ((TH3F*) fOutputFlowObs->FindObject( "hTPCVZE_AngleQ" ))->Fill(psi[0],psi[2],cc);
2102 //____________________________________________________________________________
2103 void AliAnalysisTaskSEHFQA::Terminate(Option_t */*option*/){
2104 //terminate analysis
2106 fNEntries = dynamic_cast<TH1F*>(GetOutputData(1));
2108 printf("ERROR: %s not available\n",GetOutputSlot(1)->GetContainer()->GetName());
2112 fOutputPID = dynamic_cast<TList*> (GetOutputData(2));
2113 if (!fOutputPID && fOnOff[1]) {
2114 printf("ERROR: %s not available\n",GetOutputSlot(2)->GetContainer()->GetName());
2118 fOutputTrack = dynamic_cast<TList*> (GetOutputData(3));
2119 if (!fOutputTrack && fOnOff[0]) {
2120 printf("ERROR: %s not available\n",GetOutputSlot(3)->GetContainer()->GetName());