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="hntrklvsPercentile01AllEv";
782 TH2F* hntrklvsPercentile01AllEv=new TH2F(hname.Data(),"N tracklets vs Percentile |#eta|<1 - All Events;ntracklets;percentile",5000,-0.5,4999.5,240,-10.,110);
784 hname="hnTPCTracksvsPercentile";
785 TH2F* hnTPCTracksvsPercentile=new TH2F(hname.Data(),"N TPC tracks vs Percentile;nTPCTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
787 hname="hnTPCITSTracksvsPercentile";
788 TH2F* hnTPCITSTracksvsPercentile=new TH2F(hname.Data(),"N TPC+ITS tracks vs Percentile;nTPCITSTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
790 hname="hnTPCITS1SPDTracksvsPercentile";
791 TH2F* hnTPCITS1SPDTracksvsPercentile=new TH2F(hname.Data(),"N TPC+ITS+1SPD tracks vs Percentile;nTPCITS1SPDTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
793 hname="hStdEstimSignalPercentile";
794 TH2F*hStdEstimSignalPercentile = new TH2F(hname.Data(),"Std estimator signal vs Percentile;Std estimator signal;percentile",1000,-0.5,9999.5,120,-10.,110);
796 hname="hStdEstimSignalNtrackletsIn";
797 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);
799 hname="hStdEstimSignal";
800 TH1F*hStdEstimSignal = new TH1F(hname.Data(),"Std estimator signal",700,0,1400);
802 hname="hStdPercentileSecondPercentile";
803 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);
805 hname="hStdSignalSecondSignal";
806 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);
808 fOutputCheckCentrality->Add(hNtrackletsIn);
809 fOutputCheckCentrality->Add(hNtrackletsOut);
810 fOutputCheckCentrality->Add(hMultIn);
811 fOutputCheckCentrality->Add(hMultOut);
812 fOutputCheckCentrality->Add(hMultvsPercentile);
813 fOutputCheckCentrality->Add(hntrklvsPercentile);
814 fOutputCheckCentrality->Add(hntrklvsPercentile01);
815 fOutputCheckCentrality->Add(hntrklvsPercentile01AllEv);
816 fOutputCheckCentrality->Add(hnTPCTracksvsPercentile);
817 fOutputCheckCentrality->Add(hnTPCITSTracksvsPercentile);
818 fOutputCheckCentrality->Add(hnTPCITS1SPDTracksvsPercentile);
819 fOutputCheckCentrality->Add(hStdEstimSignalPercentile);
820 fOutputCheckCentrality->Add(hStdEstimSignal);
821 fOutputCheckCentrality->Add(hStdEstimSignalNtrackletsIn);
822 fOutputCheckCentrality->Add(hStdPercentileSecondPercentile);
823 fOutputCheckCentrality->Add(hStdSignalSecondSignal);
825 PostData(6,fOutputCheckCentrality);
829 TString hname="hNtracklets";
830 TH1F* hNtracklets=new TH1F(hname.Data(),"Number of tracklets;ntracklets;Entries",5000,-0.5,4999.5);
831 hname="hNtracklets01";
832 TH1F* hNtracklets01=new TH1F(hname.Data(),"Number of tracklets |#eta|<1;ntracklets;Entries",5000,-0.5,4999.5);
833 hname="hNtracklets01AllEv";
834 TH1F* hNtracklets01AllEv=new TH1F(hname.Data(),"Number of tracklets |#eta|<1 - All events;ntracklets;Entries",5000,-0.5,4999.5);
836 TH1F* hMult=new TH1F(hname.Data(),"Multiplicity;multiplicity;Entries",10000,-0.5,9999.5);
838 TH1F* hMultFBit4=new TH1F(hname.Data(),"Multiplicity (global+tracklet) with filter bit 4;multiplicity;Entries",10000,-0.5,9999.5);
840 TH1F* hMultC05=new TH1F(hname.Data(),"Multiplicity (global+tracklet) in |#eta|<0.5;multiplicity;Entries",10000,-0.5,9999.5);
842 TH1F* hMultC08=new TH1F(hname.Data(),"Multiplicity (global+tracklet) in |#eta|<0.8;multiplicity;Entries",10000,-0.5,9999.5);
844 fOutputTrack->Add(hNtracklets);
845 fOutputTrack->Add(hNtracklets01);
846 fOutputTrack->Add(hNtracklets01AllEv);
847 fOutputTrack->Add(hMult);
848 fOutputTrack->Add(hMultFBit4);
849 fOutputTrack->Add(hMultC05);
850 fOutputTrack->Add(hMultC08);
854 //event selection (z vertex for the moment)
856 fOutputEvSelection=new TList();
857 fOutputEvSelection->SetOwner();
858 fOutputEvSelection->SetName(GetOutputSlot(7)->GetContainer()->GetName());
859 AliCounterCollection *evselection=new AliCounterCollection("evselection");
860 evselection->AddRubric("run",500000);
861 evselection->AddRubric("evnonsel","zvtx");
864 TH1F* hxvtx=new TH1F("hxvtx", "Distribution of x_{VTX};x_{VTX} [cm];Entries",800,-1,1);
865 TH1F* hyvtx=new TH1F("hyvtx", "Distribution of y_{VTX};y_{VTX} [cm];Entries",800,-1,1);
866 TH1F* hzvtx=new TH1F("hzvtx", "Distribution of z_{VTX};z_{VTX} [cm];Entries",800,-30,30);
867 TH1F* hxvtxSelEv=new TH1F("hxvtxSelEv", "Distribution of x_{VTX} Selected Ev;x_{VTX} [cm];Entries",800,-1,1);
868 TH1F* hyvtxSelEv=new TH1F("hyvtxSelEv", "Distribution of y_{VTX} Selected Ev;y_{VTX} [cm];Entries",800,-1,1);
869 TH1F* hzvtxSelEv=new TH1F("hzvtxSelEv", "Distribution of z_{VTX} Selected Ev;z_{VTX} [cm];Entries",800,-30,30);
870 TH1F* hWhichVert=new TH1F("hWhichVert","Vertex Type",4,-1.5,2.5);
871 hWhichVert->GetXaxis()->SetBinLabel(1,"Not found");
872 hWhichVert->GetXaxis()->SetBinLabel(2,"Track");
873 hWhichVert->GetXaxis()->SetBinLabel(3,"SPD-3D");
874 hWhichVert->GetXaxis()->SetBinLabel(4,"SPD-z");
875 TH1F* hWhichVertSelEv=new TH1F("hWhichVertSelEv","Vertex Type",4,-1.5,2.5);
876 hWhichVertSelEv->GetXaxis()->SetBinLabel(1,"Not found");
877 hWhichVertSelEv->GetXaxis()->SetBinLabel(2,"Track");
878 hWhichVertSelEv->GetXaxis()->SetBinLabel(3,"SPD-3D");
879 hWhichVertSelEv->GetXaxis()->SetBinLabel(4,"SPD-z");
881 TH2F* hTrigCent=new TH2F("hTrigCent","Centrality vs. Trigger types",24,-1.5,22.5,12,-10,110);
882 hTrigCent->GetXaxis()->SetBinLabel(1,"All");
883 hTrigCent->GetXaxis()->SetBinLabel(2,"kAny");
884 hTrigCent->GetXaxis()->SetBinLabel(3,"kMB");
885 hTrigCent->GetXaxis()->SetBinLabel(4,"kINT7");
886 hTrigCent->GetXaxis()->SetBinLabel(5,"kINT8");
887 hTrigCent->GetXaxis()->SetBinLabel(6,"kCINT5");
888 hTrigCent->GetXaxis()->SetBinLabel(7,"kCent");
889 hTrigCent->GetXaxis()->SetBinLabel(8,"kSemiCent");
890 hTrigCent->GetXaxis()->SetBinLabel(9,"kEMC1");
891 hTrigCent->GetXaxis()->SetBinLabel(10,"kEMC7");
892 hTrigCent->GetXaxis()->SetBinLabel(11,"kEMC8");
893 hTrigCent->GetXaxis()->SetBinLabel(12,"kEMCJET7");
894 hTrigCent->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
895 hTrigCent->GetXaxis()->SetBinLabel(14,"kEMCJET8");
896 hTrigCent->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
897 hTrigCent->GetXaxis()->SetBinLabel(16,"Muons");
898 hTrigCent->GetXaxis()->SetBinLabel(17,"PHOS");
899 hTrigCent->GetXaxis()->SetBinLabel(18,"TRD");
900 hTrigCent->GetXaxis()->SetBinLabel(19,"TRDHJT");
901 hTrigCent->GetXaxis()->SetBinLabel(20,"TRDHSE");
902 hTrigCent->GetXaxis()->SetBinLabel(21,"HighMult");
903 hTrigCent->GetXaxis()->SetBinLabel(22,"SPI7");
904 hTrigCent->GetXaxis()->SetBinLabel(23,"SPI8");
905 hTrigCent->GetXaxis()->SetBinLabel(24,"Others");
907 TH2F* hTrigMul=new TH2F("hTrigMul","Multiplicity vs. Trigger types",24,-1.5,22.5,1000,0.,10000.);
908 hTrigMul->GetXaxis()->SetBinLabel(1,"All");
909 hTrigMul->GetXaxis()->SetBinLabel(2,"kAny");
910 hTrigMul->GetXaxis()->SetBinLabel(3,"kMB");
911 hTrigMul->GetXaxis()->SetBinLabel(4,"kINT7");
912 hTrigMul->GetXaxis()->SetBinLabel(5,"kINT8");
913 hTrigMul->GetXaxis()->SetBinLabel(6,"kCINT5");
914 hTrigMul->GetXaxis()->SetBinLabel(7,"kCent");
915 hTrigMul->GetXaxis()->SetBinLabel(8,"kSemiCent");
916 hTrigMul->GetXaxis()->SetBinLabel(9,"kEMC1");
917 hTrigMul->GetXaxis()->SetBinLabel(10,"kEMC7");
918 hTrigMul->GetXaxis()->SetBinLabel(11,"kEMC8");
919 hTrigMul->GetXaxis()->SetBinLabel(12,"kEMCJET7");
920 hTrigMul->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
921 hTrigMul->GetXaxis()->SetBinLabel(14,"kEMCJET8");
922 hTrigMul->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
923 hTrigMul->GetXaxis()->SetBinLabel(16,"Muons");
924 hTrigMul->GetXaxis()->SetBinLabel(17,"PHOS");
925 hTrigMul->GetXaxis()->SetBinLabel(18,"TRD");
926 hTrigMul->GetXaxis()->SetBinLabel(19,"TRDHJT");
927 hTrigMul->GetXaxis()->SetBinLabel(20,"TRDHSE");
928 hTrigMul->GetXaxis()->SetBinLabel(21,"HighMult");
929 hTrigMul->GetXaxis()->SetBinLabel(22,"SPI7");
930 hTrigMul->GetXaxis()->SetBinLabel(23,"SPI8");
931 hTrigMul->GetXaxis()->SetBinLabel(24,"Others");
933 TH2F* hTrigCentSel=new TH2F("hTrigCentSel","Trigger types",24,-1.5,22.5,12,-10,110);
934 hTrigCentSel->GetXaxis()->SetBinLabel(1,"All");
935 hTrigCentSel->GetXaxis()->SetBinLabel(2,"kAny");
936 hTrigCentSel->GetXaxis()->SetBinLabel(3,"kMB");
937 hTrigCentSel->GetXaxis()->SetBinLabel(4,"kINT7");
938 hTrigCentSel->GetXaxis()->SetBinLabel(5,"kINT8");
939 hTrigCentSel->GetXaxis()->SetBinLabel(6,"kCINT5");
940 hTrigCentSel->GetXaxis()->SetBinLabel(7,"kCent");
941 hTrigCentSel->GetXaxis()->SetBinLabel(8,"kSemiCent");
942 hTrigCentSel->GetXaxis()->SetBinLabel(9,"kEMC1");
943 hTrigCentSel->GetXaxis()->SetBinLabel(10,"kEMC7");
944 hTrigCentSel->GetXaxis()->SetBinLabel(11,"kEMC8");
945 hTrigCentSel->GetXaxis()->SetBinLabel(12,"kEMCJET7");
946 hTrigCentSel->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
947 hTrigCentSel->GetXaxis()->SetBinLabel(14,"kEMCJET8");
948 hTrigCentSel->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
949 hTrigCentSel->GetXaxis()->SetBinLabel(16,"Muons");
950 hTrigCentSel->GetXaxis()->SetBinLabel(17,"PHOS");
951 hTrigCentSel->GetXaxis()->SetBinLabel(18,"TRD");
952 hTrigCentSel->GetXaxis()->SetBinLabel(19,"TRDHJT");
953 hTrigCentSel->GetXaxis()->SetBinLabel(20,"TRDHSE");
954 hTrigCentSel->GetXaxis()->SetBinLabel(21,"HighMult");
955 hTrigCentSel->GetXaxis()->SetBinLabel(22,"SPI7");
956 hTrigCentSel->GetXaxis()->SetBinLabel(23,"SPI8");
957 hTrigCentSel->GetXaxis()->SetBinLabel(24,"Others");
959 TH2F* hTrigMulSel=new TH2F("hTrigMulSel","Multiplicity after selection vs. Trigger types",24,-1.5,22.5,1000,0.,10000.);
960 hTrigMulSel->GetXaxis()->SetBinLabel(1,"All");
961 hTrigMulSel->GetXaxis()->SetBinLabel(2,"kAny");
962 hTrigMulSel->GetXaxis()->SetBinLabel(3,"kMB");
963 hTrigMulSel->GetXaxis()->SetBinLabel(4,"kINT7");
964 hTrigMulSel->GetXaxis()->SetBinLabel(5,"kINT8");
965 hTrigMulSel->GetXaxis()->SetBinLabel(6,"kCINT5");
966 hTrigMulSel->GetXaxis()->SetBinLabel(7,"kCent");
967 hTrigMulSel->GetXaxis()->SetBinLabel(8,"kSemiCent");
968 hTrigMulSel->GetXaxis()->SetBinLabel(9,"kEMC1");
969 hTrigMulSel->GetXaxis()->SetBinLabel(10,"kEMC7");
970 hTrigMulSel->GetXaxis()->SetBinLabel(11,"kEMC8");
971 hTrigMulSel->GetXaxis()->SetBinLabel(12,"kEMCJET7");
972 hTrigMulSel->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
973 hTrigMulSel->GetXaxis()->SetBinLabel(14,"kEMCJET8");
974 hTrigMulSel->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
975 hTrigMulSel->GetXaxis()->SetBinLabel(16,"Muons");
976 hTrigMulSel->GetXaxis()->SetBinLabel(17,"PHOS");
977 hTrigMulSel->GetXaxis()->SetBinLabel(18,"TRD");
978 hTrigMulSel->GetXaxis()->SetBinLabel(19,"TRDHJT");
979 hTrigMulSel->GetXaxis()->SetBinLabel(20,"TRDHSE");
980 hTrigMulSel->GetXaxis()->SetBinLabel(21,"HighMult");
981 hTrigMulSel->GetXaxis()->SetBinLabel(22,"SPI7");
982 hTrigMulSel->GetXaxis()->SetBinLabel(23,"SPI8");
983 hTrigMulSel->GetXaxis()->SetBinLabel(24,"Others");
985 AliCounterCollection *trigCounter=new AliCounterCollection("trigCounter");
986 trigCounter->AddRubric("run",500000);
987 trigCounter->AddRubric("triggerType","All/Any/MB/Cent/SemiCent/EMCAL/MUON/NoPhysSelMUON/NoPhysSelEvNot7/NoPhysSelCMUP1/NoPhysSelMB/NoPhysSelCent/NoPhysSelSemiCent/CINT7/INT8");
990 AliCounterCollection *trigCounter2=new AliCounterCollection("trigCounter2");
991 trigCounter2->AddRubric("run",500000);
992 trigCounter2->AddRubric("triggerType","All/Any/MB/CINT7/INT8/NoPhysSelEvNot7/NoPhysSelMB/HighMult/SPI7/SPI8/EMC1/EMC7/EMC8/EMCJET7/EMCJET8/EMCGAMMA/TRD/TRDHJT/TRDHSE");
993 trigCounter2->Init();
995 TH1F* hWhyEvRejected=new TH1F("hWhyEvRejected", "Why Event rejected",7,-1.5,5.5);
997 hWhyEvRejected->GetXaxis()->SetBinLabel(1,"N events");
998 hWhyEvRejected->GetXaxis()->SetBinLabel(2,"pileup");
999 hWhyEvRejected->GetXaxis()->SetBinLabel(3,"centrality");
1000 hWhyEvRejected->GetXaxis()->SetBinLabel(4,"Vertex not found");
1001 hWhyEvRejected->GetXaxis()->SetBinLabel(5,"trigger");
1002 hWhyEvRejected->GetXaxis()->SetBinLabel(6,"z vertex out of 10 cm");
1003 hWhyEvRejected->GetXaxis()->SetBinLabel(7,"physics sel");
1006 fOutputEvSelection->Add(evselection);
1007 fOutputEvSelection->Add(hxvtx);
1008 fOutputEvSelection->Add(hyvtx);
1009 fOutputEvSelection->Add(hzvtx);
1010 fOutputEvSelection->Add(hxvtxSelEv);
1011 fOutputEvSelection->Add(hyvtxSelEv);
1012 fOutputEvSelection->Add(hzvtxSelEv);
1013 fOutputEvSelection->Add(hWhichVert);
1014 fOutputEvSelection->Add(hWhichVertSelEv);
1015 fOutputEvSelection->Add(hTrigCent);
1016 fOutputEvSelection->Add(hTrigMul);
1017 fOutputEvSelection->Add(hTrigMulSel);
1018 fOutputEvSelection->Add(hTrigCentSel);
1019 fOutputEvSelection->Add(trigCounter);
1020 fOutputEvSelection->Add(trigCounter2);
1021 fOutputEvSelection->Add(hWhyEvRejected);
1024 if(fOnOff[4]){ // FLOW OBSERVABLES
1025 fOutputFlowObs=new TList();
1026 fOutputFlowObs->SetOwner();
1027 fOutputFlowObs->SetName(GetOutputSlot(8)->GetContainer()->GetName());
1029 fFlowEvent = new AliFlowEvent(3000);
1030 fRFPcuts = new AliFlowTrackCuts("rfpCuts");
1032 TH2F *hFEvents = new TH2F("hFlowEvents","FlowEvent Selection",7,0,7,7,-10,60);
1033 hFEvents->GetXaxis()->SetBinLabel(1,"REACHED");
1034 hFEvents->GetXaxis()->SetBinLabel(2,"TRIGGERED");
1035 hFEvents->GetXaxis()->SetBinLabel(3,"kMB");
1036 hFEvents->GetXaxis()->SetBinLabel(4,"kCent");
1037 hFEvents->GetXaxis()->SetBinLabel(5,"kSemiC");
1038 hFEvents->GetXaxis()->SetBinLabel(6,"Triggered + vtx cut");
1039 hFEvents->GetXaxis()->SetBinLabel(7,"UnexpectedBehaviour");
1040 fOutputFlowObs->Add(hFEvents);
1045 TString ref[3] = {"FB1","FB128","VZE"};
1046 Int_t etabin[3] = {40,40,20};
1047 Int_t etamax[3] = { 1, 1, 5};
1048 for(Int_t i=0; i<3; ++i) {
1049 hQ[i]= new TProfile2D( Form("h%s_Q",ref[i].Data()),
1050 Form("Q_{2} components for %s",ref[i].Data()),
1052 hQ[i]->GetXaxis()->SetBinLabel(1,"Qx^{-}");
1053 hQ[i]->GetXaxis()->SetBinLabel(2,"Qy^{-}");
1054 hQ[i]->GetXaxis()->SetBinLabel(3,"Qx^{+}");
1055 hQ[i]->GetXaxis()->SetBinLabel(4,"Qy^{+}");
1056 hQ[i]->GetYaxis()->SetTitle("Centrality");
1057 fOutputFlowObs->Add(hQ[i]);
1059 hAngleQ[i] = new TH2F( Form("h%s_AngleQ",ref[i].Data()),
1060 Form("#Psi_{2} for %s",ref[i].Data()),
1061 72,0,TMath::Pi(),12,0,60);
1062 hAngleQ[i]->GetXaxis()->SetTitle( Form("#Psi_{2}^{%s}",ref[i].Data()) );
1063 hAngleQ[i]->GetYaxis()->SetTitle("Centrality");
1064 fOutputFlowObs->Add(hAngleQ[i]);
1066 hPhiEta[i] = new TH3F( Form("h%s_PhiEta",ref[i].Data()),
1067 Form("Eta vs Phi for %s",ref[i].Data()),
1068 144,0,TMath::TwoPi(),etabin[i],-1.0*etamax[i],+1.0*etamax[i],12,0,60);
1069 hPhiEta[i]->GetXaxis()->SetTitle("Phi");
1070 hPhiEta[i]->GetYaxis()->SetTitle("Eta");
1071 hPhiEta[i]->GetZaxis()->SetTitle("Centrality");
1072 fOutputFlowObs->Add(hPhiEta[i]);
1075 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);
1076 hTPCVZE_AngleQ->GetXaxis()->SetTitle("#Psi_{2}^{TPC}");
1077 hTPCVZE_AngleQ->GetYaxis()->SetTitle("#Psi_{2}^{VZE}");
1078 hTPCVZE_AngleQ->GetZaxis()->SetTitle("Centrality");
1079 fOutputFlowObs->Add(hTPCVZE_AngleQ);
1081 TH2F *hCentVsMultRPS = new TH2F("hCentVsMultRPS", " Centrality Vs. Multiplicity RPs",5000, 0, 5000.,12,0,60 );
1082 hCentVsMultRPS->GetXaxis()->SetTitle("Multiplicity RPs");
1083 hCentVsMultRPS->GetYaxis()->SetTitle("Centrality");
1084 fOutputFlowObs->Add(hCentVsMultRPS);
1088 PostData(1,fNEntries);
1090 if(fOnOff[1]) PostData(2,fOutputPID);
1091 if(fOnOff[0]) PostData(3,fOutputTrack);
1093 if(fOnOff[2]) PostData(5,fOutputCounters);
1094 if(fOnOff[3]) PostData(7,fOutputEvSelection);
1095 if(fOnOff[4]) PostData(8,fOutputFlowObs);
1097 if(!fOnOff[0] && !fOnOff[1] && !fOnOff[2]) AliError("Nothing will be filled!");
1100 //___________________________________________________________________________
1101 void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
1103 // Execute analysis for current event
1105 AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
1106 if(fDebug>2) printf("Analysing decay %d\n",fDecayChannel);
1107 // Post the data already here
1108 PostData(1,fNEntries);
1109 if(fOnOff[1]) PostData(2,fOutputPID);
1110 if(fOnOff[0]) PostData(3,fOutputTrack);
1113 PostData(5,fOutputCounters);
1114 if(fCuts->GetUseCentrality()) PostData(6,fOutputCheckCentrality);
1117 TClonesArray *arrayProng =0;
1119 Int_t *pdgdaughters=0x0;
1121 if(!aod && AODEvent() && IsStandardAOD()) {
1122 // In case there is an AOD handler writing a standard AOD, use the AOD
1123 // event in memory rather than the input (ESD) event.
1124 aod = dynamic_cast<AliAODEvent*> (AODEvent());
1125 // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
1126 // have to taken from the AOD event hold by the AliAODExtension
1127 AliAODHandler* aodHandler = (AliAODHandler*)
1128 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1129 if(aodHandler->GetExtensions()) {
1131 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
1132 AliAODEvent *aodFromExt = ext->GetAOD();
1136 switch(fDecayChannel){
1138 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1141 pdgdaughters =new Int_t[3];
1142 pdgdaughters[0]=211;//pi
1143 pdgdaughters[1]=321;//K
1144 pdgdaughters[2]=211;//pi
1148 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
1151 pdgdaughters =new Int_t[2];
1152 pdgdaughters[0]=211;//pi
1153 pdgdaughters[1]=321;//K
1157 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar");
1160 pdgdaughters =new Int_t[3];
1161 pdgdaughters[1]=211;//pi
1162 pdgdaughters[0]=321;//K
1163 pdgdaughters[2]=211;//pi (soft?)
1167 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1170 pdgdaughters =new Int_t[3];
1171 pdgdaughters[0]=321;//K
1172 pdgdaughters[1]=321;//K
1173 pdgdaughters[2]=211;//pi
1177 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm4Prong");
1180 pdgdaughters =new Int_t[4];
1181 pdgdaughters[0]=321;
1182 pdgdaughters[1]=211;
1183 pdgdaughters[2]=211;
1184 pdgdaughters[3]=211;
1188 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1191 pdgdaughters =new Int_t[3];
1192 pdgdaughters[0]=2212;//p
1193 pdgdaughters[1]=321;//K
1194 pdgdaughters[2]=211;//pi
1198 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("CascadesHF");
1201 pdgdaughters =new Int_t[3];
1202 pdgdaughters[0]=2212;//p
1203 pdgdaughters[1]=211;//pi
1204 pdgdaughters[2]=211;//pi
1210 switch(fDecayChannel){
1212 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1215 pdgdaughters =new Int_t[3];
1216 pdgdaughters[0]=211;//pi
1217 pdgdaughters[1]=321;//K
1218 pdgdaughters[2]=211;//pi
1222 arrayProng=(TClonesArray*)aod->GetList()->FindObject("D0toKpi");
1225 pdgdaughters =new Int_t[2];
1226 pdgdaughters[0]=211;//pi
1227 pdgdaughters[1]=321;//K
1231 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Dstar");
1234 pdgdaughters =new Int_t[3];
1235 pdgdaughters[1]=211;//pi
1236 pdgdaughters[0]=321;//K
1237 pdgdaughters[2]=211;//pi (soft?)
1241 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1244 pdgdaughters =new Int_t[3];
1245 pdgdaughters[0]=321;//K
1246 pdgdaughters[1]=321;//K
1247 pdgdaughters[2]=211;//pi
1251 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm4Prong");
1254 pdgdaughters =new Int_t[4];
1255 pdgdaughters[0]=321;
1256 pdgdaughters[1]=211;
1257 pdgdaughters[2]=211;
1258 pdgdaughters[3]=211;
1262 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1265 pdgdaughters =new Int_t[3];
1266 pdgdaughters[0]=2212;//p
1267 pdgdaughters[1]=321;//K
1268 pdgdaughters[2]=211;//pi
1272 arrayProng=(TClonesArray*)aod->GetList()->FindObject("CascadesHF");
1275 pdgdaughters =new Int_t[3];
1276 pdgdaughters[0]=2212;//p
1277 pdgdaughters[1]=211;//pi
1278 pdgdaughters[2]=211;//pi
1283 Bool_t isSimpleMode=fSimpleMode;
1285 AliInfo("Branch not found! The output will contain only track related histograms\n");
1290 TClonesArray *mcArray = 0;
1291 AliAODMCHeader *mcHeader = 0;
1294 delete [] pdgdaughters;
1300 // load MC particles
1301 mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1303 printf("AliAnalysisTaskSEHFQA::UserExec: MC particles branch not found!\n");
1304 delete [] pdgdaughters;
1309 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1311 printf("AliAnalysisTaskSEHFQA::UserExec: MC header branch not found!\n");
1312 delete [] pdgdaughters;
1318 UInt_t evSelMask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1319 Double_t centrality=fCuts->GetCentrality(aod);
1320 Double_t multiplicity=aod->GetHeader()->GetRefMultiplicity();
1321 Int_t runNumber = aod->GetRunNumber();
1322 TString trigClass=aod->GetFiredTriggerClasses();
1323 Int_t nAODtracks=aod->GetNTracks();
1324 Int_t nSelTracksTPCOnly=0;
1325 Int_t nSelTracksTPCITS=0;
1326 Int_t nSelTracksTPCITS1SPD=0;
1327 Int_t ntracksFBit4=0;
1329 AliTRDTriggerAnalysis trdSelection;
1330 trdSelection.CalcTriggers(aod);
1333 if(aod->GetTriggerMask()==0 &&
1334 (runNumber>=195344 && runNumber<=195677)){
1335 AliDebug(3,"Event rejected because of null trigger mask");
1336 delete [] pdgdaughters;
1341 for (Int_t k=0;k<nAODtracks;k++){
1342 AliAODTrack* track=aod->GetTrack(k);
1343 if(track->GetID()<0) continue;
1344 Int_t nclsTot=0,nclsSPD=0;
1345 for(Int_t l=0;l<6;l++) {
1346 if(TESTBIT(track->GetITSClusterMap(),l)) {
1347 nclsTot++; if(l<2) nclsSPD++;
1350 UShort_t nTPCClus=track->GetTPCClusterMap().CountBits();
1351 if(TMath::Abs(track->Eta())<0.8 && nTPCClus>=70 && track->GetStatus()&AliESDtrack::kTPCrefit){
1352 if(track->TestFilterBit(1)) nSelTracksTPCOnly++;
1353 if(track->GetStatus()&AliESDtrack::kITSrefit){
1355 if(nclsSPD>0) nSelTracksTPCITS1SPD++;
1358 if(track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){
1365 PostData(8,fOutputFlowObs);
1368 TH2F* hTrigC=(TH2F*)fOutputEvSelection->FindObject("hTrigCent");
1369 TH2F* hTrigM=(TH2F*)fOutputEvSelection->FindObject("hTrigMul");
1370 AliCounterCollection* trigCount=(AliCounterCollection*)fOutputEvSelection->FindObject("trigCounter");
1371 AliCounterCollection* trigCount2=(AliCounterCollection*)fOutputEvSelection->FindObject("trigCounter2");
1373 hTrigC->Fill(-1.,centrality);
1374 hTrigM->Fill(-1.,multiplicity);
1375 trigCount->Count(Form("triggerType:All/Run:%d",runNumber));
1376 trigCount2->Count(Form("triggerType:All/Run:%d",runNumber));
1378 if(aod->GetEventType()!=7 || trigClass.Contains("BEAMB")){
1379 trigCount->Count(Form("triggerType:NoPhysSelEvNot7/Run:%d",runNumber));
1380 trigCount2->Count(Form("triggerType:NoPhysSelEvNot7/Run:%d",runNumber));
1381 }else if(trigClass.Contains("CMUP1")){
1382 trigCount->Count(Form("triggerType:NoPhysSelCMUP1/Run:%d",runNumber));
1383 }else if(trigClass.Contains("MUON")){
1384 trigCount->Count(Form("triggerType:NoPhysSelMUON/Run:%d",runNumber));
1385 }else if(trigClass.Contains("CPBI2_B1-B") || trigClass.Contains(" CPBI2WU_B1-B")){
1386 trigCount->Count(Form("triggerType:NoPhysSelMB/Run:%d",runNumber));
1387 trigCount2->Count(Form("triggerType:NoPhysSelMB/Run:%d",runNumber));
1388 }else if(trigClass.Contains("CCENT") || trigClass.Contains("CVHN")){
1389 trigCount->Count(Form("triggerType:NoPhysSelCent/Run:%d",runNumber));
1390 }else if(trigClass.Contains("CSEMI") || trigClass.Contains("CVLN")){
1391 trigCount->Count(Form("triggerType:NoPhysSelSemiCent/Run:%d",runNumber));
1394 if(evSelMask & AliVEvent::kAny){
1395 hTrigC->Fill(0.,centrality);
1396 hTrigM->Fill(0.,multiplicity);
1397 trigCount->Count(Form("triggerType:Any/Run:%d",runNumber));
1398 trigCount2->Count(Form("triggerType:Any/Run:%d",runNumber));
1400 if(evSelMask & AliVEvent::kMB){
1401 hTrigC->Fill(1.,centrality);
1402 hTrigM->Fill(1.,multiplicity);
1403 trigCount->Count(Form("triggerType:MB/Run:%d",runNumber));
1404 trigCount2->Count(Form("triggerType:MB/Run:%d",runNumber));
1406 if(evSelMask & AliVEvent::kINT7){
1407 hTrigC->Fill(2.,centrality);
1408 hTrigM->Fill(2.,multiplicity);
1409 trigCount->Count(Form("triggerType:CINT7/Run:%d",runNumber));
1410 trigCount2->Count(Form("triggerType:CINT7/Run:%d",runNumber));
1412 if(evSelMask & AliVEvent::kINT8){
1413 hTrigC->Fill(3.,centrality);
1414 hTrigM->Fill(3.,multiplicity);
1415 trigCount->Count(Form("triggerType:INT8/Run:%d",runNumber));
1416 trigCount2->Count(Form("triggerType:INT8/Run:%d",runNumber));
1418 if(evSelMask & AliVEvent::kCINT5){
1419 hTrigC->Fill(4.,centrality);
1420 hTrigM->Fill(4.,multiplicity);
1422 if(evSelMask & AliVEvent::kCentral){
1423 hTrigC->Fill(5.,centrality);
1424 hTrigM->Fill(5.,multiplicity);
1425 trigCount->Count(Form("triggerType:Cent/Run:%d",runNumber));
1427 if(evSelMask & AliVEvent::kSemiCentral){
1428 hTrigC->Fill(6.,centrality);
1429 hTrigM->Fill(6.,multiplicity);
1430 trigCount->Count(Form("triggerType:SemiCent/Run:%d",runNumber));
1433 if(evSelMask & AliVEvent::kEMC1){
1434 hTrigC->Fill(7.,centrality);
1435 hTrigM->Fill(7.,multiplicity);
1436 trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1437 trigCount2->Count(Form("triggerType:EMC1/Run:%d",runNumber));
1439 if((evSelMask & AliVEvent::kEMC7) && trigClass.Contains("CEMC7")){
1440 hTrigC->Fill(8.,centrality);
1441 hTrigM->Fill(8.,multiplicity);
1442 trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1443 trigCount2->Count(Form("triggerType:EMC7/Run:%d",runNumber));
1445 if((evSelMask & AliVEvent::kEMC8) && trigClass.Contains("CEMC8")){
1446 hTrigC->Fill(9.,centrality);
1447 hTrigM->Fill(9.,multiplicity);
1448 trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1449 trigCount2->Count(Form("triggerType:EMC8/Run:%d",runNumber));
1451 if(evSelMask & AliVEvent::kEMCEJE){
1452 trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1453 if(trigClass.Contains("CEMC7EJE")) {
1454 trigCount2->Count(Form("triggerType:EMCJET7/Run:%d",runNumber));
1455 hTrigC->Fill(10.,centrality);
1456 hTrigM->Fill(10.,multiplicity);
1459 else if(trigClass.Contains("CEMC8EJE")) {
1460 trigCount2->Count(Form("triggerType:EMCJET8/Run:%d",runNumber));
1461 hTrigC->Fill(12.,centrality);
1462 hTrigM->Fill(12.,multiplicity);
1465 if(evSelMask & AliVEvent::kEMCEGA){
1466 if(trigClass.Contains("CEMC7EGA")) {
1467 hTrigC->Fill(11.,centrality);
1468 hTrigM->Fill(11.,multiplicity);
1469 } else if (trigClass.Contains("CEMC8EGA")){
1470 hTrigC->Fill(13.,centrality);
1471 hTrigM->Fill(13.,multiplicity);
1474 trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1475 trigCount2->Count(Form("triggerType:EMCGAMMA/Run:%d",runNumber));
1477 if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) | (AliVEvent::kMUS7 | AliVEvent::kMUON))){
1478 hTrigC->Fill(14.,centrality);
1479 hTrigM->Fill(14.,multiplicity);
1480 trigCount->Count(Form("triggerType:MUON/Run:%d",runNumber));
1482 if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)){
1483 hTrigC->Fill(15.,centrality);
1484 hTrigM->Fill(15.,multiplicity);
1486 if(evSelMask & (AliVEvent::kTRD)){
1487 hTrigC->Fill(16.,centrality);
1488 hTrigM->Fill(16.,multiplicity);
1489 trigCount2->Count(Form("triggerType:TRD/Run:%d",runNumber));
1491 if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHJT)){
1492 hTrigC->Fill(17.,centrality);
1493 hTrigM->Fill(17.,multiplicity);
1494 trigCount2->Count(Form("triggerType:TRDHJT/Run:%d",runNumber));
1496 if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHSE)){
1497 hTrigC->Fill(18.,centrality);
1498 hTrigM->Fill(18.,multiplicity);
1499 trigCount2->Count(Form("triggerType:TRDHSE/Run:%d",runNumber));
1501 if(evSelMask & (AliVEvent::kHighMult)){
1502 hTrigC->Fill(19.,centrality);
1503 hTrigM->Fill(19.,multiplicity);
1504 trigCount2->Count(Form("triggerType:HighMult/Run:%d",runNumber));
1506 if(evSelMask & AliVEvent::kSPI7){
1507 if(trigClass.Contains("CSPI7")) {
1508 hTrigC->Fill(20.,centrality);
1509 hTrigM->Fill(20.,multiplicity);
1510 trigCount2->Count(Form("triggerType:SPI7/Run:%d",runNumber));
1513 if(evSelMask & AliVEvent::kSPI){
1514 if(trigClass.Contains("CSPI8")) {
1515 hTrigC->Fill(21.,centrality);
1516 hTrigM->Fill(21.,multiplicity);
1517 trigCount2->Count(Form("triggerType:SPI8/Run:%d",runNumber));
1520 if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)){
1521 hTrigC->Fill(22.,centrality);
1522 hTrigM->Fill(22.,multiplicity);
1527 // fix for temporary bug in ESDfilter
1528 // the AODs with null vertex pointer didn't pass the PhysSel
1529 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001) {
1530 delete [] pdgdaughters;
1537 //count events with good vertex
1538 // AOD primary vertex
1539 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
1541 Double_t pos[3],cov[6];
1543 vtx1->GetCovarianceMatrix(cov);
1544 const AliESDVertex vESD(pos,cov,100.,100);
1546 TString primTitle = vtx1->GetTitle();
1547 if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0) fNEntries->Fill(4);
1549 // trigger class for PbPb C0SMH-B-NOPF-ALLNOTRD, C0SMH-B-NOPF-ALL
1550 //TString trigclass=aod->GetFiredTriggerClasses();
1551 //if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL")) fNEntries->Fill(5); //tmp
1556 Bool_t evSelbyCentrality=kTRUE,evSelected=kTRUE,evSelByVertex=kTRUE,evselByPileup=kTRUE,evSelByPS=kTRUE;
1558 TH1F* hWhyEvRejected=0x0;
1560 hWhyEvRejected=(TH1F*)fOutputEvSelection->FindObject("hWhyEvRejected");
1561 if(hWhyEvRejected) hWhyEvRejected->Fill(-1);
1565 if(!fCuts->IsEventSelected(aod)) {
1567 if(fCuts->IsEventRejectedDueToPileup()) {
1568 if(hWhyEvRejected) hWhyEvRejected->Fill(0);
1569 evselByPileup=kFALSE;
1570 }// rejected for pileup
1571 if(fCuts->IsEventRejectedDueToCentrality()) {
1572 if(hWhyEvRejected) hWhyEvRejected->Fill(1);
1573 evSelbyCentrality=kFALSE; //rejected by centrality
1575 if(fCuts->IsEventRejectedDueToNotRecoVertex() ||
1576 fCuts->IsEventRejectedDueToVertexContributors()){
1577 evSelByVertex=kFALSE;
1578 if(hWhyEvRejected) hWhyEvRejected->Fill(2);
1580 if(fCuts->IsEventRejectedDueToTrigger()){
1581 if(hWhyEvRejected) hWhyEvRejected->Fill(3);
1583 if(fCuts->IsEventRejectedDueToZVertexOutsideFiducialRegion()) {
1584 evSelByVertex=kFALSE;
1585 if(fOnOff[3]) ((AliCounterCollection*)fOutputEvSelection->FindObject("evselection"))->Count(Form("evnonsel:zvtx/Run:%d",runNumber));
1586 if(hWhyEvRejected) hWhyEvRejected->Fill(4);
1588 if(fCuts->IsEventRejectedDuePhysicsSelection()) {
1590 if(hWhyEvRejected) hWhyEvRejected->Fill(5);
1593 if(evSelected && fOnOff[3]){
1594 TH2F* hTrigS=(TH2F*)fOutputEvSelection->FindObject("hTrigCentSel");
1595 TH2F* hTrigSM=(TH2F*)fOutputEvSelection->FindObject("hTrigMulSel");
1596 hTrigS->Fill(-1.,centrality);
1597 hTrigSM->Fill(-1.,multiplicity);
1598 if(evSelMask & AliVEvent::kAny) {
1599 hTrigS->Fill(0.,centrality);
1600 hTrigSM->Fill(0.,multiplicity);}
1601 if(evSelMask & AliVEvent::kMB) {
1602 hTrigS->Fill(1.,centrality);
1603 hTrigSM->Fill(1.,multiplicity);}
1604 if(evSelMask & AliVEvent::kINT7){
1605 hTrigS->Fill(2.,centrality);
1606 hTrigSM->Fill(2.,multiplicity);}
1607 if(evSelMask & AliVEvent::kINT8){
1608 hTrigS->Fill(3.,centrality);
1609 hTrigSM->Fill(3.,multiplicity);}
1610 if(evSelMask & AliVEvent::kCINT5){
1611 hTrigS->Fill(4.,centrality);
1612 hTrigSM->Fill(4.,multiplicity);}
1613 if(evSelMask & AliVEvent::kCentral){
1614 hTrigS->Fill(5.,centrality);
1615 hTrigSM->Fill(5.,multiplicity);}
1616 if(evSelMask & AliVEvent::kSemiCentral){
1617 hTrigS->Fill(6.,centrality);
1618 hTrigSM->Fill(6.,multiplicity);}
1619 if(evSelMask & AliVEvent::kEMC1){
1620 hTrigS->Fill(7.,centrality);
1621 hTrigSM->Fill(7.,multiplicity);
1623 if((evSelMask & AliVEvent::kEMC7) && trigClass.Contains("CEMC7")){
1624 hTrigS->Fill(8.,centrality);
1625 hTrigSM->Fill(8.,multiplicity);
1627 if((evSelMask & AliVEvent::kEMC8) && trigClass.Contains("CEMC8")){
1628 hTrigS->Fill(9.,centrality);
1629 hTrigSM->Fill(9.,multiplicity);
1631 if((evSelMask & AliVEvent::kEMCEJE) && trigClass.Contains("CEMC7EJE")){
1632 hTrigS->Fill(10.,centrality);
1633 hTrigSM->Fill(10.,multiplicity);
1635 if((evSelMask & AliVEvent::kEMCEGA) && trigClass.Contains("CEMC7EGA")){
1636 hTrigS->Fill(11.,centrality);
1637 hTrigSM->Fill(11.,multiplicity);
1639 if((evSelMask & AliVEvent::kEMCEJE) && trigClass.Contains("CEMC8EJE")){
1640 hTrigS->Fill(12.,centrality);
1641 hTrigSM->Fill(12.,multiplicity);
1643 if((evSelMask & AliVEvent::kEMCEGA) && trigClass.Contains("CEMC8EGA")){
1644 hTrigS->Fill(13.,centrality);
1645 hTrigSM->Fill(13.,multiplicity);
1647 if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) | (AliVEvent::kMUS7 | AliVEvent::kMUON))){
1648 hTrigS->Fill(14.,centrality);
1649 hTrigSM->Fill(14.,multiplicity);}
1650 if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)){
1651 hTrigS->Fill(15.,centrality);
1652 hTrigSM->Fill(15.,multiplicity);}
1653 if(evSelMask & (AliVEvent::kTRD)){
1654 hTrigS->Fill(16.,centrality);
1655 hTrigSM->Fill(16.,multiplicity);
1657 if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHJT)){
1658 hTrigS->Fill(17.,centrality);
1659 hTrigSM->Fill(17.,multiplicity);
1661 if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHSE)){
1662 hTrigS->Fill(18.,centrality);
1663 hTrigSM->Fill(18.,multiplicity);
1665 if(evSelMask & (AliVEvent::kHighMult)){
1666 hTrigS->Fill(19.,centrality);
1667 hTrigSM->Fill(19.,multiplicity);}
1668 if(evSelMask & AliVEvent::kSPI7){
1669 if(trigClass.Contains("CSPI7")) {
1670 hTrigS->Fill(20.,centrality);
1671 hTrigSM->Fill(20.,multiplicity);
1674 if(evSelMask & AliVEvent::kSPI){
1675 if(trigClass.Contains("CSPI8")) {
1676 hTrigS->Fill(21.,centrality);
1677 hTrigSM->Fill(21.,multiplicity);
1680 if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)){
1681 hTrigS->Fill(22.,centrality);
1682 hTrigSM->Fill(22.,multiplicity);}
1685 if(evSelected || (!evSelbyCentrality && evSelByVertex && evselByPileup && evSelByPS)){ //events selected or not selected because of centrality
1686 if(fOnOff[2] && fCuts->GetUseCentrality()){
1688 Float_t stdCentf=fCuts->GetCentrality(aod);
1689 Int_t stdCent = (Int_t)(stdCentf+0.5);
1690 Float_t secondCentf =fCuts->GetCentrality(aod,fEstimator);
1691 Int_t secondCent = (Int_t)(secondCentf+0.5);
1692 Int_t mincent=stdCent-stdCent%10;
1693 Float_t stdSignal = 0.;
1694 Float_t secondSignal = 0.;
1695 AliAODVZERO *vzeroAOD = (AliAODVZERO*)aod->GetVZEROData();
1696 AliAODZDC *zdcAOD = (AliAODZDC*)aod->GetZDCData();
1697 const Double_t *towerZNASignal = zdcAOD->GetZNATowerEnergy();
1698 switch(fCuts->GetUseCentrality())
1700 case AliRDHFCuts::kCentV0M:
1701 stdSignal = vzeroAOD->GetMTotV0A() + vzeroAOD->GetMTotV0C();
1703 case AliRDHFCuts::kCentV0A:
1704 stdSignal = vzeroAOD->GetMTotV0A();
1706 case AliRDHFCuts::kCentZNA:
1707 stdSignal = towerZNASignal[0];
1715 case AliRDHFCuts::kCentV0M:
1716 secondSignal = vzeroAOD->GetMTotV0A() + vzeroAOD->GetMTotV0C();
1718 case AliRDHFCuts::kCentV0A:
1719 secondSignal = vzeroAOD->GetMTotV0A();
1721 case AliRDHFCuts::kCentZNA:
1722 secondSignal = towerZNASignal[0];
1728 //AliCentrality *aodcent = aod->GetCentrality();
1729 // Float_t spdCentf = aodcent->GetCentralityPercentile("CL1");
1734 if(mincent==100)mincent--;
1735 ((AliCounterCollection*)fOutputCounters->FindObject("stdEstimator"))->Count(Form("centralityclass:%d_%d/Run:%d",mincent,mincent+10,runNumber));
1737 mincent=secondCent-secondCent%10;
1738 if(secondCentf==-1) {
1742 if(mincent==100)mincent--;
1743 ((AliCounterCollection*)fOutputCounters->FindObject("secondEstimator"))->Count(Form("centralityclass:%d_%d/Run:%d",mincent,mincent+10,runNumber));
1745 if(stdCent<fCuts->GetMinCentrality() || stdCent>fCuts->GetMaxCentrality()){
1746 ((TH1F*)fOutputCheckCentrality->FindObject("hNtrackletsOut"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
1747 ((TH1F*)fOutputCheckCentrality->FindObject("hMultOut"))->Fill(aod->GetHeader()->GetRefMultiplicity());
1749 ((TH1F*)fOutputCheckCentrality->FindObject("hNtrackletsIn"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
1750 ((TH1F*)fOutputCheckCentrality->FindObject("hMultIn"))->Fill(aod->GetHeader()->GetRefMultiplicity());
1752 ((TH2F*)fOutputCheckCentrality->FindObject("hMultvsPercentile"))->Fill(aod->GetHeader()->GetRefMultiplicity(),stdCentf);
1753 ((TH2F*)fOutputCheckCentrality->FindObject("hntrklvsPercentile"))->Fill(aod->GetTracklets()->GetNumberOfTracklets(),stdCentf);
1754 ((TH2F*)fOutputCheckCentrality->FindObject("hntrklvsPercentile01"))->Fill(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.),stdCentf);
1755 ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCTracksvsPercentile"))->Fill(nSelTracksTPCOnly,stdCentf);
1756 ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCITSTracksvsPercentile"))->Fill(nSelTracksTPCITS,stdCentf);
1757 ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCITS1SPDTracksvsPercentile"))->Fill(nSelTracksTPCITS1SPD,stdCentf);
1758 ((TH2F*)fOutputCheckCentrality->FindObject("hStdEstimSignalPercentile"))->Fill(stdSignal,stdCentf);
1759 ((TH1F*)fOutputCheckCentrality->FindObject("hStdEstimSignal"))->Fill(stdSignal);
1760 ((TH2F*)fOutputCheckCentrality->FindObject("hStdEstimSignalNtrackletsIn"))->Fill(stdSignal,aod->GetTracklets()->GetNumberOfTracklets());
1761 ((TH2F*)fOutputCheckCentrality->FindObject("hStdPercentileSecondPercentile"))->Fill(stdCentf,secondCentf);
1762 ((TH2F*)fOutputCheckCentrality->FindObject("hStdSignalSecondSignal"))->Fill(stdSignal,secondSignal);
1764 PostData(6,fOutputCheckCentrality);
1768 ((TH1F*)fOutputTrack->FindObject("hNtracklets"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
1769 ((TH1F*)fOutputTrack->FindObject("hNtracklets01"))->Fill(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.));
1770 ((TH1F*)fOutputTrack->FindObject("hMult"))->Fill(aod->GetHeader()->GetRefMultiplicity());
1771 ((TH1F*)fOutputTrack->FindObject("hMultFBit4"))->Fill(ntracksFBit4);
1772 ((TH1F*)fOutputTrack->FindObject("hMultComb05"))->Fill(aod->GetHeader()->GetRefMultiplicityComb05());
1773 ((TH1F*)fOutputTrack->FindObject("hMultComb08"))->Fill(aod->GetHeader()->GetRefMultiplicityComb08());
1778 if(evSelected || (!evSelbyCentrality && evSelByVertex && evselByPileup && evSelByPS) || (!evSelByVertex && evselByPileup && evSelByPS)){ //events selected or not selected because of centrality
1779 if(fOnOff[2] && fCuts->GetUseCentrality()){
1780 ((TH2F*)fOutputCheckCentrality->FindObject("hntrklvsPercentile01AllEv"))->Fill(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.),fCuts->GetCentrality(aod));
1783 ((TH1F*)fOutputTrack->FindObject("hNtracklets01AllEv"))->Fill(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.));
1789 const AliVVertex *vertex = aod->GetPrimaryVertex();
1790 Double_t xvtx=vertex->GetX();
1791 Double_t yvtx=vertex->GetY();
1792 Double_t zvtx=vertex->GetZ();
1794 if(vertex->GetNContributors()<=0) vtxTyp=-1;
1795 TString title=vertex->GetTitle();
1796 if(title.Contains("Z")) vtxTyp=2;
1797 if(title.Contains("3D")) vtxTyp=1;
1798 ((TH1F*)fOutputEvSelection->FindObject("hxvtx"))->Fill(xvtx);
1799 ((TH1F*)fOutputEvSelection->FindObject("hyvtx"))->Fill(yvtx);
1800 ((TH1F*)fOutputEvSelection->FindObject("hzvtx"))->Fill(zvtx);
1801 ((TH1F*)fOutputEvSelection->FindObject("hWhichVert"))->Fill(vtxTyp);
1803 ((TH1F*)fOutputEvSelection->FindObject("hxvtxSelEv"))->Fill(xvtx);
1804 ((TH1F*)fOutputEvSelection->FindObject("hyvtxSelEv"))->Fill(yvtx);
1805 ((TH1F*)fOutputEvSelection->FindObject("hzvtxSelEv"))->Fill(zvtx);
1806 ((TH1F*)fOutputEvSelection->FindObject("hWhichVertSelEv"))->Fill(vtxTyp);
1811 delete [] pdgdaughters;
1812 return; //discard all events not selected (vtx and/or centrality)
1816 AliAODPidHF* pidHF=fCuts->GetPidHF();
1818 delete [] pdgdaughters;
1821 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
1822 AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
1823 AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
1825 //AliPIDResponse* respF=pidHF->GetPidResponse();
1826 AliTPCPIDResponse* tpcres=new AliTPCPIDResponse();
1827 Bool_t oldPID=pidHF->GetOldPid();
1829 Double_t alephParameters[5];
1830 pidHF->GetTPCBetheBlochParams(alephParameters);
1831 tpcres->SetBetheBlochParameters(alephParameters[0],alephParameters[1],alephParameters[2],alephParameters[3],alephParameters[4]);
1836 Int_t isGoodTrack=0, isFakeTrack=0, isSelTrack=0;
1838 if(aod) ntracks=aod->GetNTracks();
1840 if(fOnOff[0] || fOnOff[1]){
1841 //loop on tracks in the event
1842 for (Int_t k=0;k<ntracks;k++){
1843 AliAODTrack* track=aod->GetTrack(k);
1845 // Track selection cuts
1846 if(track->GetID()<0) continue;
1847 Double_t d0z0[2],covd0z0[3];
1848 if(!track->PropagateToDCA(vtx1,aod->GetMagneticField(),99999.,d0z0,covd0z0)) continue;
1849 if(track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){
1850 ((TH1F*)fOutputTrack->FindObject("hd0TracksFilterBit4"))->Fill(d0z0[0]);
1852 ULong_t trStatus=track->GetStatus();
1853 if(trStatus&AliESDtrack::kITSrefit){
1854 if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)){
1855 ((TH1F*)fOutputTrack->FindObject("hd0TracksSPDany"))->Fill(d0z0[0]);
1856 if(track->HasPointOnITSLayer(0)){
1857 ((TH1F*)fOutputTrack->FindObject("hd0TracksSPDin"))->Fill(d0z0[0]);
1862 Bool_t selTrack=kTRUE;
1863 if (!((trStatus & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||
1864 !((trStatus & AliVTrack::kITSrefit) == AliVTrack::kITSrefit)){
1867 if(!track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){ // BIT(4) standard cuts with very loose DCA
1870 if(TMath::Abs(track->Eta())>0.9){
1873 Float_t nCrossedRowsTPC = track->GetTPCClusterInfo(2,1);
1874 Float_t ratioCrossedRowsOverFindableClustersTPC = 1.0;
1875 if (track->GetTPCNclsF()>0) {
1876 ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC/track->GetTPCNclsF();
1880 if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)){
1881 ((TH1F*)fOutputTrack->FindObject("hd0TracksTPCITSSPDany"))->Fill(d0z0[0]);
1885 AliAODPid *pid = track->GetDetPid();
1886 if(!pid && fDebug>1) cout<<"No AliAODPid found"<<endl;
1888 if(pid && fOnOff[1]){
1889 Double_t times[AliPID::kSPECIES];
1890 pid->GetIntegratedTimes(times);
1892 Double_t tofRes[AliPID::kSPECIES];
1893 pid->GetTOFpidResolution(tofRes);
1896 TH1F* htmpfl=((TH1F*)fOutputPID->FindObject("hTOFflags"));
1898 if (trStatus&AliESDtrack::kTPCout) htmpfl->Fill(1.);
1899 if (trStatus&AliESDtrack::kTOFout) htmpfl->Fill(2.);
1900 if (trStatus&AliESDtrack::kTIME) htmpfl->Fill(3.);
1901 if (trStatus&AliESDtrack::kTOFpid) htmpfl->Fill(4.);
1902 if (trStatus&AliESDtrack::kTOFmismatch) htmpfl->Fill(5.);
1904 Bool_t isTOFok=kFALSE;
1906 Double_t prob[AliPID::kSPECIES];
1907 if(pidResp->ComputeTOFProbability(track,AliPID::kSPECIES,prob)==AliPIDResponse::kDetPidOk){
1913 if(selTrack && isTOFok){
1914 Double_t tofTime=pid->GetTOFsignal();
1915 AliTOFHeader* tofH=(AliTOFHeader*)aod->GetTOFHeader();
1916 if (tofH && (TMath::Abs(tofRes[0]) <= 1.E-16) ) { // new AOD
1917 // with new AOD we need to retrieve startTime, subtract it and retrieve correctly TOF PID resolutions *PA*
1918 AliTOFPIDResponse tofResp=pidResp->GetTOFResponse();
1919 Double_t startTime = tofResp.GetStartTime(track->P());
1920 Float_t startTimeRes = tofResp.GetStartTimeRes(track->P());
1921 Int_t startTimeMask = tofResp.GetStartTimeMask(track->P());
1922 ((TH1F*)fOutputPID->FindObject("hTOFstartTimeDistrib"))->Fill(startTime);
1923 ((TH1F*)fOutputPID->FindObject("hTOFstartTimeMask"))->Fill(startTimeMask);
1924 ((TH1F*)fOutputPID->FindObject("hTOFstartTimeRes"))->Fill(startTimeRes);
1926 for (Int_t type=0;type<AliPID::kSPECIES;type++) tofRes[type]=tofResp.GetExpectedSigma(track->P(),times[type],AliPID::ParticleMassZ(type));
1928 ((TH1F*)fOutputPID->FindObject("hTOFtime"))->Fill(times[AliPID::kProton]);
1929 ((TH2F*)fOutputPID->FindObject("hTOFtimeKaonHyptime"))->Fill(track->P(),tofTime-times[3]); //3 is kaon
1930 ((TH1F*)fOutputPID->FindObject("hTOFsig"))->Fill(tofTime);
1931 if (pid->GetTOFsignal()< 0) ((TH1F*)fOutputPID->FindObject("hTOFsig"))->Fill(-1);
1933 Double_t nsigma[3]={-10,-10,-10};
1934 nsigma[0]=pidResp->NumberOfSigmasTOF(track,AliPID::kPion);
1935 nsigma[1]=pidResp->NumberOfSigmasTOF(track,AliPID::kKaon);
1936 nsigma[2]=pidResp->NumberOfSigmasTOF(track,AliPID::kProton);
1938 ((TH2F*)fOutputPID->FindObject("hTOFsigmaKSigPid"))->Fill(track->P(),nsigma[1]);
1939 ((TH2F*)fOutputPID->FindObject("hTOFsigmaPionSigPid"))->Fill(track->P(),nsigma[0]);
1940 ((TH2F*)fOutputPID->FindObject("hTOFsigmaProtonSigPid"))->Fill(track->P(),nsigma[2]);
1942 Int_t label=track->GetLabel();
1943 if(label<=0) continue;
1944 AliMCParticle* mcpart=(AliMCParticle*)mcArray->At(label);
1946 Int_t abspdgcode=TMath::Abs(mcpart->PdgCode());
1947 if(abspdgcode==211) ((TH2F*)fOutputPID->FindObject("hTOFsigmaMCPionSigPid"))->Fill(track->P(),nsigma[0]);
1948 if(abspdgcode==321) ((TH2F*)fOutputPID->FindObject("hTOFsigmaMCKSigPid"))->Fill(track->P(),nsigma[1]);
1949 if(abspdgcode==2212) ((TH2F*)fOutputPID->FindObject("hTOFsigmaMCProtonSigPid"))->Fill(track->P(),nsigma[2]);
1954 for (Int_t iS=2; iS<5; iS++){ //we plot TOF Pid resolution for 3-sigma identified particles
1955 if ( TMath::Abs(nsigma[iS-2])<3.){
1958 ((TH1F*)fOutputPID->FindObject("hTOFsigPid3sigPion"))->Fill(tofRes[iS]);
1961 ((TH1F*)fOutputPID->FindObject("hTOFsigPid3sigKaon"))->Fill(tofRes[iS]);
1963 case AliPID::kProton:
1964 ((TH1F*)fOutputPID->FindObject("hTOFsigPid3sigProton"))->Fill(tofRes[iS]);
1974 if(pidHF && pidHF->CheckStatus(track,"TPC") && selTrack){
1976 Double_t TPCp=pid->GetTPCmomentum();
1977 Double_t TPCsignal=pid->GetTPCsignal();
1978 UShort_t TPCsignalN=pid->GetTPCsignalN();
1979 ((TH1F*)fOutputPID->FindObject("hTPCsig"))->Fill(TPCsignal);
1980 ((TH1F*)fOutputPID->FindObject("hTPCsigvsp"))->Fill(TPCp,TPCsignal);
1981 //if (pidHF->IsKaonRaw(track, "TOF"))
1982 Double_t nsigma[3]={-10,-10,-10};
1983 pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kPion,nsigma[0]);
1984 pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kKaon,nsigma[1]);
1985 pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kProton,nsigma[2]);
1987 ((TH2F*)fOutputPID->FindObject("hTPCsigmaK"))->Fill(TPCp,nsigma[1]);
1989 ((TH2F*)fOutputPID->FindObject("hTPCsigmaPion"))->Fill(TPCp,nsigma[0]);
1990 ((TH2F*)fOutputPID->FindObject("hTPCsigmaProton"))->Fill(TPCp,nsigma[2]);
1993 Int_t label=track->GetLabel();
1994 if(label<=0) continue;
1995 AliMCParticle* mcpart=(AliMCParticle*)mcArray->At(label);
1997 Int_t abspdgcode=TMath::Abs(mcpart->PdgCode());
1998 if(abspdgcode==211) ((TH2F*)fOutputPID->FindObject("hTPCsigmaMCPion"))->Fill(track->P(),nsigma[0]);
1999 if(abspdgcode==321) ((TH2F*)fOutputPID->FindObject("hTPCsigmaMCK"))->Fill(track->P(),nsigma[1]);
2000 if(abspdgcode==2212) ((TH2F*)fOutputPID->FindObject("hTPCsigmaMCProton"))->Fill(track->P(),nsigma[2]);
2005 if(fFillDistrTrackEffChecks && track->GetStatus()&AliESDtrack::kITSrefit && track->GetStatus()&AliESDtrack::kTPCrefit){
2006 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPtAllTracks"))->Fill(track->Pt(),(Float_t)TPCsignalN);
2007 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPhiAllTracks"))->Fill(track->Phi(),(Float_t)TPCsignalN);
2008 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsEtaAllTracks"))->Fill(track->Eta(),(Float_t)TPCsignalN);
2012 } //end PID histograms
2014 Int_t nclsTot=0,nclsSPD=0;
2016 //check clusters of the tracks
2019 ((TH1F*)fOutputTrack->FindObject("hnLayerITS"))->Fill(-1);
2020 for(Int_t l=0;l<6;l++) {
2021 if(TESTBIT(track->GetITSClusterMap(),l)) {
2022 ((TH1F*)fOutputTrack->FindObject("hnLayerITS"))->Fill(l);
2023 nclsTot++; if(l<2) nclsSPD++;
2026 ((TH1F*)fOutputTrack->FindObject("hnClsITS"))->Fill(nclsTot);
2027 ((TH1F*)fOutputTrack->FindObject("hnClsSPD"))->Fill(nclsSPD);
2029 if(fFillDistrTrackEffChecks && track->GetStatus()&AliESDtrack::kITSrefit && track->GetStatus()&AliESDtrack::kTPCrefit){
2031 ((TH1F*)fOutputTrack->FindObject("hPtAllTracks"))->Fill(track->Pt());
2032 ((TH1F*)fOutputTrack->FindObject("hPhiAllTracks"))->Fill(track->Phi());
2033 ((TH1F*)fOutputTrack->FindObject("hEtaAllTracks"))->Fill(track->Eta());
2034 ((TH2F*)fOutputTrack->FindObject("hEtavsPhiAllTracks"))->Fill(track->Phi(),track->Eta());
2035 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPtAllTracks"))->Fill(track->Pt(),track->GetTPCNcls());
2036 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPhiAllTracks"))->Fill(track->Phi(),track->GetTPCNcls());
2037 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsEtaAllTracks"))->Fill(track->Eta(),track->GetTPCNcls());
2039 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPtAllTracks"))->Fill(track->Pt(),nCrossedRowsTPC);
2040 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPhiAllTracks"))->Fill(track->Phi(),nCrossedRowsTPC);
2041 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsEtaAllTracks"))->Fill(track->Eta(),nCrossedRowsTPC);
2043 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPtAllTracks"))->Fill(track->Pt(),ratioCrossedRowsOverFindableClustersTPC);
2044 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPhiAllTracks"))->Fill(track->Phi(),ratioCrossedRowsOverFindableClustersTPC);
2045 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsEtaAllTracks"))->Fill(track->Eta(),ratioCrossedRowsOverFindableClustersTPC);
2047 if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
2048 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(0);
2050 if(track->HasPointOnITSLayer(0) && !(track->HasPointOnITSLayer(1))){ //kOnlyFirst
2051 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(1);
2053 if(!(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1)){ //kOnlySecond
2054 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(2);
2056 if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)){ //kBoth
2057 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(3);
2059 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPtAllTracks"))->Fill(track->Pt(), nclsTot);
2060 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPhiAllTracks"))->Fill(track->Phi(), nclsTot);
2061 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsEtaAllTracks"))->Fill(track->Eta(), nclsTot);
2065 if(track->Pt()>0.3 &&
2066 TMath::Abs(track->Eta())<0.8 &&
2067 track->GetStatus()&AliESDtrack::kITSrefit &&
2068 track->GetStatus()&AliESDtrack::kTPCrefit &&
2070 ((TH1F*)fOutputTrack->FindObject("hnClsITSselTr"))->Fill(nclsTot);
2072 if(!(track->GetStatus()&AliESDtrack::kTPCin) && track->GetStatus()&AliESDtrack::kITSrefit && !(track->GetStatus()&AliESDtrack::kITSpureSA)){//tracks retrieved in the ITS and not reconstructed in the TPC
2073 ((TH1F*)fOutputTrack->FindObject("hnClsITS-SA"))->Fill(nclsTot);
2074 ((TH1F*)fOutputTrack->FindObject("hnLayerITS"))->Fill(-1);
2075 for(Int_t l=0;l<6;l++) {
2076 if(TESTBIT(track->GetITSClusterMap(),l)) {
2077 ((TH1F*)fOutputTrack->FindObject("hnLayerITSsa"))->Fill(l);
2083 label=track->GetLabel();
2084 if (label<0)fNEntries->Fill(8);
2085 else fNEntries->Fill(9);
2089 if (track->Pt()>0.3 &&
2090 track->GetStatus()&AliESDtrack::kTPCrefit &&
2091 track->GetStatus()&AliESDtrack::kITSrefit &&
2093 nclsSPD>0) {//count good tracks
2096 if(fReadMC && label<0) {
2097 ((TH1F*)fOutputTrack->FindObject("hptFakeTr"))->Fill(track->Pt());
2100 ((TH1F*)fOutputTrack->FindObject("hptGoodTr"))->Fill(track->Pt());
2104 if(fCuts->IsDaughterSelected(track,&vESD,fCuts->GetTrackCuts())){
2106 }//select tracks for our analyses
2109 } //fill track histos
2110 } //end loop on tracks
2112 //fill once per event
2114 if (fReadMC) ((TH1F*)fOutputTrack->FindObject("hdistrFakeTr"))->Fill(isFakeTrack);
2115 ((TH1F*)fOutputTrack->FindObject("hdistrGoodTr"))->Fill(isGoodTrack);
2116 ((TH1F*)fOutputTrack->FindObject("hdistrSelTr"))->Fill(isSelTrack);
2120 // loop over candidates
2121 Int_t nCand = arrayProng->GetEntriesFast();
2123 if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpi) ndaugh=2;
2124 if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpipipi) ndaugh=4;
2126 for (Int_t iCand = 0; iCand < nCand; iCand++) {
2127 AliAODRecoDecayHF *d = (AliAODRecoDecayHF*)arrayProng->UncheckedAt(iCand);
2128 if(fUseSelectionBit && d->GetSelectionMap()) {
2129 if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpi && !d->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) continue; //skip the D0 from Dstar
2130 if(fDecayChannel==AliAnalysisTaskSEHFQA::kDplustoKpipi && !d->HasSelectionBit(AliRDHFCuts::kDplusCuts)) continue; //skip the 3 prong !D+
2136 if (fDecayChannel==AliAnalysisTaskSEHFQA::kLambdactoV0 && (dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0()) {
2138 Int_t pdgDgLctoV0bachelor[2]={2212,310};
2139 Int_t pdgDgV0toDaughters[2]={211,211};
2140 Int_t mcLabelK0S = (dynamic_cast<AliAODRecoCascadeHF*>(d))->MatchToMC(pdg,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,mcArray,kTRUE); // Lc->K0S+p and cc
2141 pdgDgLctoV0bachelor[1]=3122, pdgDgLctoV0bachelor[0]=211;
2142 pdgDgV0toDaughters[0]=2212, pdgDgV0toDaughters[1]=211;
2143 Int_t mcLabelLambda = (dynamic_cast<AliAODRecoCascadeHF*>(d))->MatchToMC(pdg,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,mcArray,kTRUE); // Lc->Lambda+pi and cc
2144 if (mcLabelK0S!=-1 || mcLabelLambda!=-1) AliInfo(Form("mcLabelK0S=%d - mcLabelLambda=%d",mcLabelK0S,mcLabelLambda));
2146 if (mcLabelK0S!=-1 && mcLabelLambda!=-1)
2147 AliInfo("Strange: current Lc->V0+bachelor candidate has two MC different labels!");
2148 else if (mcLabelK0S>-1 && mcLabelLambda==-1)
2150 else if (mcLabelLambda>-1 && mcLabelK0S==-1)
2151 labD = mcLabelLambda;
2154 labD = d->MatchToMC(pdg,mcArray,ndaugh,pdgdaughters);
2157 AliAODMCParticle *partD = (AliAODMCParticle*)mcArray->At(labD);
2158 Int_t label=partD->GetMother();
2159 AliAODMCParticle *mot = (AliAODMCParticle*)mcArray->At(label);
2160 while(label>=0){//get first mother
2161 mot = (AliAODMCParticle*)mcArray->At(label);
2162 label=mot->GetMother();
2165 Int_t pdgMotCode = mot->GetPdgCode();
2167 if(TMath::Abs(pdgMotCode)==4) fNEntries->Fill(6); //from primary charm
2168 if(TMath::Abs(pdgMotCode)==5) fNEntries->Fill(7); //from beauty
2172 fNEntries->Fill(5); //count the candidates (data and MC)
2174 for(Int_t id=0;id<ndaugh;id++){
2175 //other histograms to be filled when the cut object is given
2176 AliAODTrack* track=0;
2178 if (fDecayChannel==AliAnalysisTaskSEHFQA::kLambdactoV0 && (dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0()) {
2180 track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->GetBachelor();
2182 track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0PositiveTrack();
2184 track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0NegativeTrack();
2187 track=(AliAODTrack*)d->GetDaughter(id);
2191 if (fCuts->IsInFiducialAcceptance(d->Pt(),d->Y(pdg)) && fCuts->IsSelected(d,AliRDHFCuts::kTracks,aod)) {
2194 if(fReadMC)label=track->GetLabel();
2197 if(fReadMC && label<0) {
2199 ((TH1F*)fOutputTrack->FindObject("hptFakeTrFromDaugh"))->Fill(track->Pt());
2201 ((TH1F*)fOutputTrack->FindObject("hd0f"))->Fill(d->Getd0Prong(id));
2203 ((TH1F*)fOutputTrack->FindObject("hptGoodTrFromDaugh"))->Fill(track->Pt());
2204 ((TH1F*)fOutputTrack->FindObject("hd0dau"))->Fill(d->Getd0Prong(id));
2205 Double_t phidaughter = d->PhiProng(id);
2206 if(phidaughter<0) phidaughter=2.0*TMath::Pi()+phidaughter;
2207 ((TH2F*)fOutputTrack->FindObject("hd0dauphi"))->Fill(phidaughter, d->Getd0Prong(id));
2208 Double_t d0rphiz[2],covd0[3];
2209 Bool_t isDCA=track->PropagateToDCA(aod->GetPrimaryVertex(),aod->GetMagneticField(),9999.,d0rphiz,covd0);
2211 ((TH1F*)fOutputTrack->FindObject("hd0zdau"))->Fill(d0rphiz[1]);
2212 ((TH2F*)fOutputTrack->FindObject("hd0zdauphi"))->Fill(phidaughter,d0rphiz[1]);
2218 if(fFillDistrTrackEffChecks){
2220 Double_t nTPCCrossedRows = track->GetTPCClusterInfo(2,1);
2221 Double_t ratioCrossedRowsOverFcls = 1.0;
2222 if(track->GetTPCNclsF()>0){
2223 ratioCrossedRowsOverFcls = (nTPCCrossedRows)/(track->GetTPCNclsF());
2225 for(Int_t l=0;l<6;l++) {
2226 if(TESTBIT(track->GetITSClusterMap(),l)) {
2231 ((TH1F*)fOutputTrack->FindObject("hPtDaughters"))->Fill(track->Pt());
2232 ((TH1F*)fOutputTrack->FindObject("hPhiDaughters"))->Fill(track->Phi());
2233 ((TH1F*)fOutputTrack->FindObject("hEtaDaughters"))->Fill(track->Eta());
2234 ((TH2F*)fOutputTrack->FindObject("hEtavsPhiDaughters"))->Fill(track->Phi(),track->Eta());
2236 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPtDaughters"))->Fill(track->Pt(),track->GetTPCNcls());
2237 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPhiDaughters"))->Fill(track->Phi(),track->GetTPCNcls());
2238 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsEtaDaughters"))->Fill(track->Eta(),track->GetTPCNcls());
2240 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPtDaughters"))->Fill(track->Pt(),nTPCCrossedRows);
2241 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPhiDaughters"))->Fill(track->Phi(),nTPCCrossedRows);
2242 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsEtaDaughters"))->Fill(track->Eta(),nTPCCrossedRows);
2244 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPtDaughters"))->Fill(track->Pt(),ratioCrossedRowsOverFcls);
2245 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPhiDaughters"))->Fill(track->Phi(),ratioCrossedRowsOverFcls);
2246 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsEtaDaughters"))->Fill(track->Eta(),ratioCrossedRowsOverFcls);
2248 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPtDaughters"))->Fill(track->Pt(), nITScls);
2249 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPhiDaughters"))->Fill(track->Phi(), nITScls);
2250 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsEtaDaughters"))->Fill(track->Eta(), nITScls);
2251 if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
2252 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(0);
2254 if(track->HasPointOnITSLayer(0) && !(track->HasPointOnITSLayer(1))){ //kOnlyFirst
2255 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(1);
2257 if(!(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1)){ //kOnlySecond
2258 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(2);
2260 if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)){ //kBoth
2261 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(3);
2266 AliAODPid *pid = track->GetDetPid();
2268 if(pidHF && pidHF->CheckStatus(track,"TPC")){
2269 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPtDaughters"))->Fill(track->Pt(),pid->GetTPCsignalN());
2270 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPhiDaughters"))->Fill(track->Phi(),pid->GetTPCsignalN());
2271 ((TH2F*)fOutputPID->FindObject("hTPCsigNvsEtaDaughters"))->Fill(track->Eta(),pid->GetTPCsignalN());
2278 if (fCuts->IsSelected(d,AliRDHFCuts::kAll,aod) && fOnOff[1]){
2279 fNEntries->Fill(3); //candidates passing analysis cuts
2281 AliAODPid *pid = track->GetDetPid();
2284 pid->GetIntegratedTimes(times);
2285 if(pidHF && pidHF->CheckStatus(track,"TOF")){
2286 Double_t tofTime=pid->GetTOFsignal();
2287 AliTOFHeader* tofH=(AliTOFHeader*)aod->GetTOFHeader();
2288 Double_t tofRes[AliPID::kSPECIES];
2289 pid->GetTOFpidResolution(tofRes);
2290 if (tofH && (TMath::Abs(tofRes[0]) <= 1.E-16) ) { // new AOD
2291 AliTOFPIDResponse tofResp=pidHF->GetPidResponse()->GetTOFResponse();
2292 Double_t startTime=tofResp.GetStartTime(track->P());
2295 ((TH2F*)fOutputPID->FindObject("hTOFtimeKaonHyptimeAC"))->Fill(track->P(),tofTime-times[AliPID::kKaon]);
2297 if(pidHF && pidHF->CheckStatus(track,"TPC")) ((TH2F*)fOutputPID->FindObject("hTPCsigvspAC"))->Fill(pid->GetTPCmomentum(),pid->GetTPCsignal());
2300 } //end analysis cuts
2301 } //end acceptance and track cuts
2302 } //end loop on tracks in the candidate
2303 } //end loop on candidates
2306 } //end if on pid or track histograms
2309 delete [] pdgdaughters;
2310 PostData(1,fNEntries);
2311 if(fOnOff[1]) PostData(2,fOutputPID);
2312 if(fOnOff[0]) PostData(3,fOutputTrack);
2314 if(fOnOff[2]) PostData(5,fOutputCounters);
2315 //Post data 6 done in case of centrality on
2319 //____________________________________________________________________________
2320 void AliAnalysisTaskSEHFQA::FillFlowObs(AliAODEvent *aod){
2321 //fills the flow observables
2323 cc = fCuts->GetCentrality(aod);
2324 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(0., cc);
2326 UInt_t mask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
2327 UInt_t trigger=AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral;
2328 if(mask & trigger) {
2329 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(1.,cc); // fired
2330 if (mask & AliVEvent::kMB) ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(2.,cc);
2331 if (mask & AliVEvent::kCentral) ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(3.,cc);
2332 if (mask & AliVEvent::kSemiCentral) ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(4.,cc);
2333 Bool_t rejected=false;
2334 if(cc<0 || cc>60) rejected=true;
2335 const AliVVertex *vertex = aod->GetPrimaryVertex();
2336 Double_t zvtx=vertex->GetZ();
2337 if(TMath::Abs(zvtx)>fCuts->GetMaxVtxZ()) rejected=true;
2338 if(rejected) return; //not interesting for flow QA
2344 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(5.,cc);
2345 fRFPcuts->SetParamType(AliFlowTrackCuts::kGlobal);
2346 fRFPcuts->SetPtRange(0.2,5.);
2347 fRFPcuts->SetEtaRange(-0.8,0.8);
2348 fRFPcuts->SetMinNClustersTPC(70);
2349 fRFPcuts->SetMinChi2PerClusterTPC(0.2);
2350 fRFPcuts->SetMaxChi2PerClusterTPC(4.0);
2351 fRFPcuts->SetAcceptKinkDaughters(kFALSE);
2352 fRFPcuts->SetEvent(aod);
2354 TString ref[3] = {"FB1","FB128","VZE"};
2356 for(Int_t i=0; i!=3; ++i) {
2357 if(i==0) { // switching to bit 1
2358 fRFPcuts->SetMinimalTPCdedx(10.);
2359 fRFPcuts->SetAODfilterBit(1);
2360 } else { // switching to bit 128
2361 fRFPcuts->SetMinimalTPCdedx(-1);
2362 fRFPcuts->SetAODfilterBit(128);
2365 fRFPcuts->SetParamType(AliFlowTrackCuts::kVZERO);
2366 fRFPcuts->SetEtaRange(-5,+5);
2367 fRFPcuts->SetPhiMin(0);
2368 fRFPcuts->SetPhiMax(TMath::TwoPi());
2370 fFlowEvent->Fill(fRFPcuts,fRFPcuts);
2371 fFlowEvent->TagSubeventsInEta(-5,0,0,+5);
2372 // getting informationt
2373 AliFlowVector vQ, vQaQb[2];
2374 fFlowEvent->Get2Qsub(vQaQb,2);
2375 vQ = vQaQb[0]+vQaQb[1];
2376 Double_t dMa=vQaQb[0].GetMult();
2377 Double_t dMb=vQaQb[1].GetMult();
2378 if( dMa<2 || dMb<2 ) {
2379 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(6.,cc); //???
2382 psi[i] = vQ.Phi()/2;
2384 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(0,cc,vQaQb[0].X()/dMa,dMa); // Qx-
2385 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(1,cc,vQaQb[0].Y()/dMa,dMa); // Qy-
2386 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(2,cc,vQaQb[1].X()/dMb,dMb); // Qx+
2387 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(3,cc,vQaQb[1].Y()/dMb,dMb); // Qy+
2388 ((TH2F*) fOutputFlowObs->FindObject( Form("h%s_AngleQ",ref[i].Data()) ))->Fill(psi[i],cc); // Psi
2389 AliFlowTrackSimple *track;
2390 for(Int_t t=0; t!=fFlowEvent->NumberOfTracks(); ++t) {
2391 track = (AliFlowTrackSimple*) fFlowEvent->GetTrack(t);
2392 if(!track) continue;
2393 if(!track->InRPSelection()) continue;
2394 ((TH3F*) fOutputFlowObs->FindObject( Form("h%s_PhiEta",ref[i].Data()) ))->Fill(track->Phi(),track->Eta(),cc,track->Weight()); //PhiEta
2397 //histo filled only for TPCFB1
2399 ((TH2F*) fOutputFlowObs->FindObject("hCentVsMultRPS"))->Fill(fFlowEvent->GetNumberOfRPs(),cc);
2403 ((TH3F*) fOutputFlowObs->FindObject( "hTPCVZE_AngleQ" ))->Fill(psi[0],psi[2],cc);
2406 //____________________________________________________________________________
2407 void AliAnalysisTaskSEHFQA::Terminate(Option_t */*option*/){
2408 //terminate analysis
2410 fNEntries = dynamic_cast<TH1F*>(GetOutputData(1));
2412 printf("ERROR: %s not available\n",GetOutputSlot(1)->GetContainer()->GetName());
2416 fOutputPID = dynamic_cast<TList*> (GetOutputData(2));
2417 if (!fOutputPID && fOnOff[1]) {
2418 printf("ERROR: %s not available\n",GetOutputSlot(2)->GetContainer()->GetName());
2422 fOutputTrack = dynamic_cast<TList*> (GetOutputData(3));
2423 if (!fOutputTrack && fOnOff[0]) {
2424 printf("ERROR: %s not available\n",GetOutputSlot(3)->GetContainer()->GetName());