]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/vertexingHF/AliAnalysisTaskSEHFQA.cxx
adding proton HBT config macro
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliAnalysisTaskSEHFQA.cxx
CommitLineData
0dbb51a0 1/**************************************************************************
2 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
27de2dfb 16/* $Id$ */
17
0dbb51a0 18/////////////////////////////////////////////////////////////
19//
20// AliAnalysisTaskSE for HF quality assurance
21//
22// Author: Chiara Bianchin, chiara.bianchin@pd.infn.it
23/////////////////////////////////////////////////////////////
24
25#include <Riostream.h>
26#include <TClonesArray.h>
27#include <TCanvas.h>
28#include <TList.h>
29#include <TH1F.h>
30#include <TH2F.h>
d48d81b5 31#include <TH3F.h>
32#include <TProfile2D.h>
0dbb51a0 33#include <TDatabasePDG.h>
34
35#include <AliAnalysisDataSlot.h>
36#include <AliAnalysisDataContainer.h>
37#include "AliAnalysisManager.h"
38#include "AliESDtrack.h"
824b448a 39#include "AliESDVertex.h"
0dbb51a0 40#include "AliVertexerTracks.h"
41#include "AliPID.h"
e7af8919 42#include "AliPIDResponse.h"
0dbb51a0 43#include "AliTPCPIDResponse.h"
44#include "AliAODHandler.h"
45#include "AliAODEvent.h"
46#include "AliAODVertex.h"
47#include "AliAODTrack.h"
48#include "AliAODMCParticle.h"
a4ef4383 49#include "AliAODMCHeader.h"
0dbb51a0 50#include "AliAODRecoDecayHF2Prong.h"
51#include "AliAODRecoCascadeHF.h"
52#include "AliAnalysisVertexingHF.h"
53#include "AliAnalysisTaskSE.h"
a4ef4383 54#include "AliCounterCollection.h"
0dbb51a0 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"
ca688a98 62#include "AliRDHFCutsLctoV0.h"
a4b0ffc7 63#include "AliInputEventHandler.h"
0dbb51a0 64
d48d81b5 65#include "AliFlowEvent.h"
66#include "AliFlowTrackCuts.h"
67#include "AliFlowTrackSimple.h"
68#include "AliFlowVector.h"
69
0dbb51a0 70#include "AliAnalysisTaskSEHFQA.h"
71
c64cb1f6 72using std::cout;
73using std::endl;
74
0dbb51a0 75ClassImp(AliAnalysisTaskSEHFQA)
76
77//____________________________________________________________________________
78
79AliAnalysisTaskSEHFQA::AliAnalysisTaskSEHFQA():AliAnalysisTaskSE(),
80 fNEntries(0x0),
81 fOutputPID(0x0),
82 fOutputTrack(0x0),
a4ef4383 83 fOutputCounters(0x0),
84 fOutputCheckCentrality(0x0),
818c1271 85 fOutputEvSelection(0x0),
d48d81b5 86 fOutputFlowObs(0x0),
0dbb51a0 87 fDecayChannel(AliAnalysisTaskSEHFQA::kD0toKpi),
a4ef4383 88 fCuts(0x0),
d48d81b5 89 fFlowEvent(0x0),
90 fRFPcuts(0x0),
a4ef4383 91 fEstimator(AliRDHFCuts::kCentTRK),
19222b31 92 fReadMC(kFALSE),
5fc4893f 93 fSimpleMode(kFALSE),
0dc0101f 94 fUseSelectionBit(kTRUE),
8e4c6c96 95 fOnOff(),
96 fFillDistrTrackEffChecks(kFALSE)
0dbb51a0 97{
98 //default constructor
5fc4893f 99 fOnOff[0]=kTRUE;
100 fOnOff[1]=kTRUE;
101 fOnOff[2]=kTRUE;
818c1271 102 fOnOff[3]=kTRUE;
d48d81b5 103 fOnOff[4]=kTRUE;
0dbb51a0 104}
105
106//____________________________________________________________________________
107AliAnalysisTaskSEHFQA::AliAnalysisTaskSEHFQA(const char *name, AliAnalysisTaskSEHFQA::DecChannel ch,AliRDHFCuts* cuts):
a4ef4383 108 AliAnalysisTaskSE(name),
109 fNEntries(0x0),
110 fOutputPID(0x0),
111 fOutputTrack(0x0),
112 fOutputCounters(0x0),
113 fOutputCheckCentrality(0x0),
818c1271 114 fOutputEvSelection(0x0),
d48d81b5 115 fOutputFlowObs(0x0),
a4ef4383 116 fDecayChannel(ch),
117 fCuts(0x0),
d48d81b5 118 fFlowEvent(0x0),
119 fRFPcuts(0x0),
a4ef4383 120 fEstimator(AliRDHFCuts::kCentTRK),
19222b31 121 fReadMC(kFALSE),
5fc4893f 122 fSimpleMode(kFALSE),
19f6b9ff 123 fUseSelectionBit(kTRUE),
8e4c6c96 124 fOnOff(),
125 fFillDistrTrackEffChecks(kFALSE)
0dbb51a0 126{
127 //constructor
128
129 //SetCutObject(cuts);
130 fCuts=cuts;
131
5fc4893f 132 fOnOff[0]=kTRUE;
133 fOnOff[1]=kTRUE;
134 fOnOff[2]=kTRUE;
818c1271 135 fOnOff[3]=kTRUE;
d48d81b5 136 fOnOff[4]=kTRUE;
5fc4893f 137
0dbb51a0 138 // Output slot #1 writes into a TH1F container (number of events)
139 DefineOutput(1,TH1F::Class()); //My private output
140 // Output slot #2 writes into a TList container (PID)
5fc4893f 141 if (fOnOff[1]) DefineOutput(2,TList::Class()); //My private output
0dbb51a0 142 // Output slot #3 writes into a TList container (Tracks)
5fc4893f 143 if (fOnOff[0]) DefineOutput(3,TList::Class()); //My private output
0dbb51a0 144 // Output slot #4 writes into a AliRDHFCuts container (cuts)
145 switch(fDecayChannel){
146 case 0:
147 DefineOutput(4,AliRDHFCutsDplustoKpipi::Class()); //My private output
148 break;
149 case 1:
150 DefineOutput(4,AliRDHFCutsD0toKpi::Class()); //My private output
151 break;
152 case 2:
153 DefineOutput(4,AliRDHFCutsDStartoKpipi::Class()); //My private output
154 break;
155 case 3:
156 DefineOutput(4,AliRDHFCutsDstoKKpi::Class()); //My private output
157 break;
158 case 4:
159 DefineOutput(4,AliRDHFCutsD0toKpipipi::Class()); //My private output
160 break;
a4ef4383 161 case 5:
0dbb51a0 162 DefineOutput(4,AliRDHFCutsLctopKpi::Class()); //My private output
163 break;
ca688a98 164 case kLambdactoV0:
165 DefineOutput(4,AliRDHFCutsLctoV0::Class()); //My private output
166 break;
a4ef4383 167 }
5fc4893f 168 if (fOnOff[2]) {
169 // Output slot #5 writes into a TList container (AliCounterCollection)
170 DefineOutput(5,TList::Class()); //My private output
171 // Output slot #6 writes into a TList container (TH1F)
172 DefineOutput(6,TList::Class()); //My private output
173 }
818c1271 174
175 if(fOnOff[3]) DefineOutput(7,TList::Class()); //My private output
d48d81b5 176 if(fOnOff[4]) DefineOutput(8,TList::Class()); //My private output
818c1271 177
0dbb51a0 178}
179
180//___________________________________________________________________________
181AliAnalysisTaskSEHFQA::~AliAnalysisTaskSEHFQA()
182{
183 //destructor
a4ef4383 184 delete fNEntries;
185
186 delete fOutputPID;
187
188 delete fOutputTrack;
189
190 delete fOutputCounters;
191
192 delete fOutputCheckCentrality;
193
818c1271 194 delete fOutputEvSelection;
195
d48d81b5 196 if(fOnOff[4]) {
197 delete fOutputFlowObs;
198 delete fFlowEvent;
199 }
0dbb51a0 200}
201
202//___________________________________________________________________________
203void AliAnalysisTaskSEHFQA::Init(){
204
205 //initialization
206 if(fDebug > 1) printf("AnalysisTaskSEHFQA::Init() \n");
439ce262 207 AliRDHFCuts *copycut = 0x0;
0dbb51a0 208
209 switch(fDecayChannel){
210 case 0:
211 {
439ce262 212 copycut=new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fCuts)));
0dbb51a0 213 }
214 break;
215 case 1:
216 {
439ce262 217 copycut=new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fCuts)));
0dbb51a0 218 }
219 break;
220 case 2:
221 {
439ce262 222 copycut=new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fCuts)));
0dbb51a0 223 }
224 break;
225 case 3:
226 {
439ce262 227 copycut=new AliRDHFCutsDstoKKpi(*(static_cast<AliRDHFCutsDstoKKpi*>(fCuts)));
0dbb51a0 228 }
229 break;
230 case 4:
231 {
439ce262 232 copycut=new AliRDHFCutsD0toKpipipi(*(static_cast<AliRDHFCutsD0toKpipipi*>(fCuts)));
0dbb51a0 233 }
234 break;
235 case 5:
236 {
439ce262 237 copycut=new AliRDHFCutsLctopKpi(*(static_cast<AliRDHFCutsLctopKpi*>(fCuts)));
0dbb51a0 238 }
239 break;
ca688a98 240 case kLambdactoV0:
241 {
439ce262 242 copycut=new AliRDHFCutsLctoV0(*(static_cast<AliRDHFCutsLctoV0*>(fCuts)));
ca688a98 243 }
244 break;
0dbb51a0 245 default:
439ce262 246 AliFatal("Bad initialization for the decay channe - Exiting...");
247 break;
248 }
0dbb51a0 249
439ce262 250 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
251 if (copycut){
252 copycut->SetName(nameoutput);
253
254 // Post the data
255 PostData(4,copycut);
256 }else{
257 AliFatal("Failing initializing AliRDHFCuts object - Exiting...");
258 }
0dbb51a0 259
439ce262 260 return;
0dbb51a0 261
262}
263
264//___________________________________________________________________________
265void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
266{
267
268 //create the output container
269 if(fDebug > 1) printf("AnalysisTaskSEHFQA::UserCreateOutputObjects() \n");
270
271 //count events
272
acc33385 273 fNEntries=new TH1F(GetOutputSlot(1)->GetContainer()->GetName(), "Counts the number of events", 10,-0.5,9.5);
0dbb51a0 274 fNEntries->GetXaxis()->SetBinLabel(1,"nEventsAnal");
275 fNEntries->GetXaxis()->SetBinLabel(2,"Pile-up Rej");
276 fNEntries->GetXaxis()->SetBinLabel(3,"No VertexingHF");
9af24f46 277 fNEntries->GetXaxis()->SetBinLabel(4,"nCandidates(AnCuts)");
278 fNEntries->GetXaxis()->SetBinLabel(5,"EventsWithGoodVtx");
5fc4893f 279 //fNEntries->GetXaxis()->SetBinLabel(6,"N. of 0SMH");
1d654f7b 280 fNEntries->GetXaxis()->SetBinLabel(6,"N candidates");
a4ef4383 281 if(fReadMC){
282 fNEntries->GetXaxis()->SetBinLabel(7,"MC Cand from c");
283 fNEntries->GetXaxis()->SetBinLabel(8,"MC Cand from b");
acc33385 284 fNEntries->GetXaxis()->SetBinLabel(9,"N fake Trks");
285 fNEntries->GetXaxis()->SetBinLabel(10,"N true Trks");
a4ef4383 286 }
287
0dbb51a0 288 fNEntries->GetXaxis()->SetNdivisions(1,kFALSE);
289
290 //PID
5fc4893f 291 if(fOnOff[1]){
292 fOutputPID=new TList();
293 fOutputPID->SetOwner();
294 fOutputPID->SetName(GetOutputSlot(2)->GetContainer()->GetName());
0dbb51a0 295
5fc4893f 296 //TOF pid
5c13a4db 297 TH1F* hTOFflags=new TH1F("hTOFflags","TOF flags",7,-0.5,6.5);
b906dda8 298 hTOFflags->SetMinimum(0.);
299 hTOFflags->GetXaxis()->SetBinLabel(1,"All Tracks");
23dfe729 300 hTOFflags->GetXaxis()->SetBinLabel(2,"kTPCout");
301 hTOFflags->GetXaxis()->SetBinLabel(3,"kTOFout");
302 hTOFflags->GetXaxis()->SetBinLabel(4,"kTIME");
303 hTOFflags->GetXaxis()->SetBinLabel(5,"kTOFpid");
304 hTOFflags->GetXaxis()->SetBinLabel(6,"kTOFmismatch");
5c13a4db 305 hTOFflags->GetXaxis()->SetBinLabel(7,"kDetPidOK");
b906dda8 306
5fc4893f 307 TString hname="hTOFsig";
308 TH1F* hTOFsig=new TH1F(hname.Data(),"Distribution of TOF signal;TOF time [ps];Entries", 100, -2.e3,40.e3);
0dbb51a0 309
20baad42 310 hname="hTOFstartTimeMask";
311 TH1F* hTOFstartTimeMask=new TH1F(hname.Data(),"TOF start time mask; Mask ;Entries", 8, -0.5,7.5);
312 hTOFstartTimeMask->GetXaxis()->SetBinLabel(1,"FILL");
313 hTOFstartTimeMask->GetXaxis()->SetBinLabel(2,"TOF");
314 hTOFstartTimeMask->GetXaxis()->SetBinLabel(3,"T0A");
315 hTOFstartTimeMask->GetXaxis()->SetBinLabel(4,"TOF.and.T0A");
316 hTOFstartTimeMask->GetXaxis()->SetBinLabel(5,"T0C");
317 hTOFstartTimeMask->GetXaxis()->SetBinLabel(6,"TOF.and.T0C");
318 hTOFstartTimeMask->GetXaxis()->SetBinLabel(7,"T0AC");
319 hTOFstartTimeMask->GetXaxis()->SetBinLabel(8,"TOF.and.T0AC");
320
321 hname="hTOFstartTimeRes";
322 TH1F* hTOFstartTimeRes=new TH1F(hname.Data(),"TOF start time resolution; Resolution (ps) ;Entries", 100, 0.,300.);
323
5c13a4db 324 hname="hTOFstartTimeDistrib";
325 TH1F* hTOFstartTimeDistrib=new TH1F(hname.Data(),"TOF start time distribution; Start time ;Entries", 400, -1000.,1000.);
326
5fc4893f 327 hname="hTOFtime";
328 TH1F* hTOFtime=new TH1F(hname.Data(),"Distribution of TOF time Kaon;TOF time(Kaon) [ps];Entries", 1000, 0.,50000.);
0dbb51a0 329
5fc4893f 330 hname="hTOFtimeKaonHyptime";
b906dda8 331 TH2F* hTOFtimeKaonHyptime=new TH2F(hname.Data(),"TOFtime - timeHypothesisForKaon;p[GeV/c];TOFtime - timeHypothesisForKaon [ps]",500,0.,10.,1000,-20000.,20000.);
0dbb51a0 332
5fc4893f 333 hname="hTOFtimeKaonHyptimeAC";
b906dda8 334 TH2F* hTOFtimeKaonHyptimeAC=new TH2F(hname.Data(),"TOFtime - timeHypothesisForKaon;p[GeV/c];TOFtime - timeHypothesisForKaon [ps]",500,0.,10.,1000,-20000.,20000.);
0dbb51a0 335
5fc4893f 336 hname="hTOFsigmaKSigPid";
23dfe729 337 TH2F* hTOFsigmaKSigPid=new TH2F(hname.Data(),"(TOFsignal-timeK)/tofSigPid;p[GeV/c];(TOFsignal-timeK)/tofSigPid",500,0.,10.,400,-20,20);
0dbb51a0 338
5fc4893f 339 hname="hTOFsigmaPionSigPid";
23dfe729 340 TH2F* hTOFsigmaPionSigPid=new TH2F(hname.Data(),"(TOFsignal-time#pi)/tofSigPid;p[GeV/c];(TOFsignal-time#pi)/tofSigPid",500,0.,10.,400,-20,20);
a4ef4383 341
5fc4893f 342 hname="hTOFsigmaProtonSigPid";
23dfe729 343 TH2F* hTOFsigmaProtonSigPid=new TH2F(hname.Data(),"(TOFsignal-timep)/tofSigPid;p[GeV/c];(TOFsignal-time p)/tofSigPid",500,0.,10.,400,-20,20);
a4ef4383 344
5fc4893f 345 hname="hTOFsigPid3sigPion";
346 TH1F* hTOFsigPid3sigPion=new TH1F(hname.Data(),"TOF PID resolution (#pi) [ps]",500,0.,1000.);
a4ef4383 347
5fc4893f 348 hname="hTOFsigPid3sigKaon";
349 TH1F* hTOFsigPid3sigKaon=new TH1F(hname.Data(),"TOF PID resolution (K) [ps]",500,0.,1000.);
0dbb51a0 350
5fc4893f 351 hname="hTOFsigPid3sigProton";
352 TH1F* hTOFsigPid3sigProton=new TH1F(hname.Data(),"TOF PID resolution (p) [ps]",500,0.,1000.);
a4ef4383 353
0dbb51a0 354
5fc4893f 355 //TPC pid
356 hname="hTPCsig";
357 TH1F* hTPCsig=new TH1F(hname.Data(),"Distribution of TPC signal;TPC sig;Entries", 100, 35.,100.);
0dbb51a0 358
5fc4893f 359 hname="hTPCsigvsp";
b906dda8 360 TH2F* hTPCsigvsp=new TH2F(hname.Data(),"TPCsig vs p;TPC p[GeV/c];TPCsig",500,0.,10.,1000,35.,100.);
0dbb51a0 361
5fc4893f 362 hname="hTPCsigvspAC";
b906dda8 363 TH2F* hTPCsigvspAC=new TH2F(hname.Data(),"TPCsig vs p;TPCp[GeV/c];TPCsig",500,0.,10.,1000,35.,100.);
5fc4893f 364
365 hname="hTPCsigmaK";
b906dda8 366 TH2F* hTPCsigmaK=new TH2F(hname.Data(),"TPC Sigma for K as a function of momentum;p[GeV/c];Sigma Kaon",500,0.,10.,400,-20,20);
5fc4893f 367
368 hname="hTPCsigmaPion";
b906dda8 369 TH2F* hTPCsigmaPion=new TH2F(hname.Data(),"TPC Sigma for #pi as a function of momentum;p[GeV/c];Sigma #pi",500,0.,10.,400,-20,20);
5fc4893f 370
371 hname="hTPCsigmaProton";
b906dda8 372 TH2F* hTPCsigmaProton=new TH2F(hname.Data(),"TPC Sigma for proton as a function of momentum;p[GeV/c];Sigma Proton",500,0.,10.,400,-20,20);
5fc4893f 373
b906dda8 374 fOutputPID->Add(hTOFflags);
5fc4893f 375 fOutputPID->Add(hTOFsig);
376 fOutputPID->Add(hTPCsig);
20baad42 377 fOutputPID->Add(hTOFstartTimeMask);
378 fOutputPID->Add(hTOFstartTimeRes);
5c13a4db 379 fOutputPID->Add(hTOFstartTimeDistrib);
5fc4893f 380 fOutputPID->Add(hTOFtime);
381 fOutputPID->Add(hTOFtimeKaonHyptime);
382 fOutputPID->Add(hTOFtimeKaonHyptimeAC);
5fc4893f 383 fOutputPID->Add(hTOFsigmaKSigPid);
384 fOutputPID->Add(hTOFsigmaPionSigPid);
385 fOutputPID->Add(hTOFsigmaProtonSigPid);
386 fOutputPID->Add(hTOFsigPid3sigPion);
387 fOutputPID->Add(hTOFsigPid3sigKaon);
388 fOutputPID->Add(hTOFsigPid3sigProton);
389 fOutputPID->Add(hTPCsigvsp);
390 fOutputPID->Add(hTPCsigvspAC);
391 fOutputPID->Add(hTPCsigmaK);
392 fOutputPID->Add(hTPCsigmaPion);
393 fOutputPID->Add(hTPCsigmaProton);
24748c57 394
395 if(fReadMC){
396 //TOF
397 hname="hTOFsigmaMCKSigPid";
398 TH2F* hTOFsigmaMCKSigPid=new TH2F(hname.Data(),"(TOFsignal-timeK)/tofSigPid;p[GeV/c];(TOFsignal-timeK)/tofSigPid",500,0.,10.,400,-20,20);
399
400 hname="hTOFsigmaMCPionSigPid";
401 TH2F* hTOFsigmaMCPionSigPid=new TH2F(hname.Data(),"(TOFsignal-time#pi)/tofSigPid;p[GeV/c];(TOFsignal-time#pi)/tofSigPid",500,0.,10.,400,-20,20);
402
403 hname="hTOFsigmaMCProtonSigPid";
404 TH2F* hTOFsigmaMCProtonSigPid=new TH2F(hname.Data(),"(TOFsignal-timep)/tofSigPid;p[GeV/c];(TOFsignal-time p)/tofSigPid",500,0.,10.,400,-20,20);
405
406 //TPC
407 hname="hTPCsigmaMCK";
408 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);
409
410 hname="hTPCsigmaMCPion";
411 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);
412
413 hname="hTPCsigmaMCProton";
414 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);
415
416 fOutputPID->Add(hTOFsigmaMCKSigPid);
417 fOutputPID->Add(hTOFsigmaMCPionSigPid);
418 fOutputPID->Add(hTOFsigmaMCProtonSigPid);
419 fOutputPID->Add(hTPCsigmaMCK);
420 fOutputPID->Add(hTPCsigmaMCPion);
421 fOutputPID->Add(hTPCsigmaMCProton);
422
423 }
5fc4893f 424 }
0dbb51a0 425
426 //quality of the tracks
5fc4893f 427 if(fOnOff[0]){
428 fOutputTrack=new TList();
429 fOutputTrack->SetOwner();
430 fOutputTrack->SetName(GetOutputSlot(3)->GetContainer()->GetName());
0dbb51a0 431
5fc4893f 432 TString hname="hnClsITS";
433 TH1F* hnClsITS=new TH1F(hname.Data(),"Distribution of number of ITS clusters;nITScls;Entries",7,-0.5,6.5);
0dbb51a0 434
39dd297f 435 hname="hnClsITSselTr";
436 TH1F* hnClsITSselTr=new TH1F(hname.Data(),"Distribution of number of ITS clusters selected tracks;nITScls;Entries",7,-0.5,6.5);
437
5fc4893f 438 hname="hnClsITS-SA";
439 TH1F* hnClsITSSA=new TH1F(hname.Data(),"Distribution of number of ITS clusters(ITS-SA);nITScls;Entries",7,-0.5,6.5);
0dbb51a0 440
bc6846db 441
442 hname="hnLayerITS";
f3e1ad2f 443 TH1F* hnLayerITS=new TH1F(hname.Data(),"Number of tracks with point in layer;ITS layer;",7,-1.5,5.5);
444 hnLayerITS->GetXaxis()->SetBinLabel(1,"n tracks");
4a4aee7b 445 hnLayerITS->GetXaxis()->SetBinLabel(2,"SPDin");
446 hnLayerITS->GetXaxis()->SetBinLabel(3,"SPDout");
447 hnLayerITS->GetXaxis()->SetBinLabel(4,"SDDin");
448 hnLayerITS->GetXaxis()->SetBinLabel(5,"SDDout");
449 hnLayerITS->GetXaxis()->SetBinLabel(6,"SSDin");
450 hnLayerITS->GetXaxis()->SetBinLabel(7,"SSDout");
bc6846db 451
452 hname="hnLayerITSsa";
f3e1ad2f 453 TH1F* hnLayerITSsa=new TH1F(hname.Data(),"Number of tracks with point in layer;ITS layer;",7,-1.5,5.5);
454 hnLayerITSsa->GetXaxis()->SetBinLabel(1,"n tracks");
4a4aee7b 455 hnLayerITSsa->GetXaxis()->SetBinLabel(2,"SPDin");
456 hnLayerITSsa->GetXaxis()->SetBinLabel(3,"SPDout");
457 hnLayerITSsa->GetXaxis()->SetBinLabel(4,"SDDin");
458 hnLayerITSsa->GetXaxis()->SetBinLabel(5,"SDDout");
459 hnLayerITSsa->GetXaxis()->SetBinLabel(6,"SSDin");
460 hnLayerITSsa->GetXaxis()->SetBinLabel(7,"SSDout");
f3e1ad2f 461
5fc4893f 462 hname="hnClsSPD";
463 TH1F* hnClsSPD=new TH1F(hname.Data(),"Distribution of number of SPD clusters;nSPDcls;Entries",3,-0.5,2.5);
0dbb51a0 464
5fc4893f 465 hname="hptGoodTr";
466 TH1F* hptGoodTr=new TH1F(hname.Data(),"Pt distribution of 'good' tracks;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
467 hptGoodTr->SetTitleOffset(1.3,"Y");
0dbb51a0 468
824b448a 469 if(!fSimpleMode){
470 hname="hptGoodTrFromDaugh";
471 TH1F* hptGoodTrFromDaugh=new TH1F(hname.Data(),"Pt distribution of 'good' candidate's daughters;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
472 hptGoodTrFromDaugh->SetTitleOffset(1.3,"Y");
473 fOutputTrack->Add(hptGoodTrFromDaugh);
474 }
475
5fc4893f 476 hname="hdistrGoodTr";
824b448a 477 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);
5fc4893f 478 hdistrGoodTr->SetTitleOffset(1.3,"Y");
0dbb51a0 479
824b448a 480 hname="hdistrSelTr";
481 TH1F* hdistrSelTr=new TH1F(hname.Data(),"Distribution of number of Selected tracks per event;no.good-tracks/ev;Entries",4000,-0.5,3999.5);
482 hdistrSelTr->SetTitleOffset(1.3,"Y");
483
ba3a678d 484 hname="hd0dau";
485 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);
4563d678 486
ba3a678d 487 hname="hd0zdau";
488 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);
489
490 hname="hd0TracksSPDin";
491 TH1F* hd0TracksSPDin=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks kITSrefit, SPDinner; d_{0rphi}[cm];Entries",200,-0.5,0.5);
492
493 hname="hd0TracksSPDany";
494 TH1F* hd0TracksSPDany=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks kITSrefit, SPDany; d_{0rphi}[cm];Entries",200,-0.5,0.5);
495
496 hname="hd0TracksFilterBit4";
497 TH1F* hd0TracksFilterBit4=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks FilterBit4; d_{0rphi}[cm];Entries",200,-0.5,0.5);
498
499 hname="hd0TracksTPCITSSPDany";
500 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);
0dbb51a0 501
5230fd6a 502
8e4c6c96 503 if(fFillDistrTrackEffChecks){
504 hname="hPtDaughters";
7d690084 505 TH1F *hPtDaughters=new TH1F(hname.Data(),"p_{T} distributions of the daughter tracks;p_{T} [GeV/c];Entries",200,0.,20.);
5230fd6a 506
8e4c6c96 507 hname="hPhiDaughters";
508 TH1F *hPhiDaughters=new TH1F(hname.Data(),"#phi distribution of the daughter tracks;#phi [rad];Entries",100,0.,2*(TMath::Pi()));
5230fd6a 509
8e4c6c96 510 hname="hEtaDaughters";
511 TH1F *hEtaDaughters=new TH1F(hname.Data(),"#eta distribution of the daughter tracks;#eta;Entries",80,-2.,2.);
5230fd6a 512
8e4c6c96 513 hname="hEtavsPhiDaughters";
514 TH2F *hEtavsPhiDaughters=new TH2F(hname.Data(),"#eta vs #phi distribution of the daughter tracks;#phi;#eta",100,0.,2*(TMath::Pi()),80,-2.,2.);
5230fd6a 515
8e4c6c96 516 hname="hNTPCclsvsPtDaughters";
7d690084 517 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);
5230fd6a 518
8e4c6c96 519 hname="hNTPCclsvsPhiDaughters";
7d690084 520 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);
521
8e4c6c96 522 hname="hNTPCclsvsEtaDaughters";
7d690084 523 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);
524
525 hname="hNTPCCrossedRowsvsPtDaughters";
526 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);
527
528 hname="hNTPCCrossedRowsvsPhiDaughters";
529 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);
530
531 hname="hNTPCCrossedRowsvsEtaDaughters";
532 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);
5230fd6a 533
8e4c6c96 534 hname="hRatioCRowsOverFclsvsPtDaughters";
7d690084 535 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.);
5230fd6a 536
8e4c6c96 537 hname="hRatioCRowsOverFclsvsPhiDaughters";
538 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.);
5230fd6a 539
8e4c6c96 540 hname="hRatioCRowsOverFclsvsEtaDaughters";
541 TH2F *hRatioCRowsOverFclsvsEtaDaughters=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #eta distribution of the daughter tracks;#eta;CRows/FCls",80,-2.,2.,100,0.,1.);
5230fd6a 542
8e4c6c96 543 hname="hNITSclsvsPtDaughters";
7d690084 544 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);
5230fd6a 545
8e4c6c96 546 hname="hNITSclsvsPhiDaughters";
547 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);
5230fd6a 548
8e4c6c96 549 hname="hNITSclsvsEtaDaughters";
550 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);
5230fd6a 551
8e4c6c96 552 hname="hSPDclsDaughters";
553 TH1I *hSPDclsDaughters = new TH1I(hname.Data(),"N SPD points distrubution; ;Entries",4,0,4);
554 hSPDclsDaughters->GetXaxis()->SetBinLabel(1, "no SPD");
555 hSPDclsDaughters->GetXaxis()->SetBinLabel(2, "kOnlyFirst");
556 hSPDclsDaughters->GetXaxis()->SetBinLabel(3, "kOnlySecond");
557 hSPDclsDaughters->GetXaxis()->SetBinLabel(4, "kBoth");
558
559 hname="hPtAllTracks";
7d690084 560 TH1F *hPtAllTracks=new TH1F(hname.Data(),"p_{T} distributions of the AOD tracks (ID>0);p_{T} [GeV/c];Entries",200,0.,20.);
5230fd6a 561
8e4c6c96 562 hname="hPhiAllTracks";
563 TH1F *hPhiAllTracks=new TH1F(hname.Data(),"#phi distribution of the AOD tracks (ID>0);#phi [rad];Entries",100,0.,2*(TMath::Pi()));
5230fd6a 564
8e4c6c96 565 hname="hEtaAllTracks";
566 TH1F *hEtaAllTracks=new TH1F(hname.Data(),"#eta distribution of the AOD tracks (ID>0);#eta;Entries",80,-2.,2.);
5230fd6a 567
8e4c6c96 568 hname="hEtavsPhiAllTracks";
569 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.);
5230fd6a 570
8e4c6c96 571 hname="hNTPCclsvsPtAllTracks";
7d690084 572 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);
5230fd6a 573
8e4c6c96 574 hname="hNTPCclsvsPhiAllTracks";
7d690084 575 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);
576
8e4c6c96 577 hname="hNTPCclsvsEtaAllTracks";
7d690084 578 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);
579
580 hname="hNTPCCrossedRowsvsPtAllTracks";
581 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);
582
583 hname="hNTPCCrossedRowsvsPhiAllTracks";
584 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);
585
586 hname="hNTPCCrossedRowsvsEtaAllTracks";
587 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);
5230fd6a 588
8e4c6c96 589 hname="hRatioCRowsOverFclsvsPtAllTracks";
7d690084 590 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.);
5230fd6a 591
8e4c6c96 592 hname="hRatioCRowsOverFclsvsPhiAllTracks";
593 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.);
5230fd6a 594
8e4c6c96 595 hname="hRatioCRowsOverFclsvsEtaAllTracks";
596 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.);
5230fd6a 597
8e4c6c96 598 hname="hNITSclsvsPtAllTracks";
7d690084 599 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);
5230fd6a 600
8e4c6c96 601 hname="hNITSclsvsPhiAllTracks";
602 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);
5230fd6a 603
8e4c6c96 604 hname="hNITSclsvsEtaAllTracks";
605 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);
5230fd6a 606
8e4c6c96 607 hname="hSPDclsAllTracks";
608 TH1I *hSPDclsAllTracks = new TH1I(hname.Data(),"N SPD points distrubution AOD tracks (ID>0); ;Entries",4,0,4);
609 hSPDclsAllTracks->GetXaxis()->SetBinLabel(1, "no SPD");
610 hSPDclsAllTracks->GetXaxis()->SetBinLabel(2, "kOnlyFirst");
611 hSPDclsAllTracks->GetXaxis()->SetBinLabel(3, "kOnlySecond");
612 hSPDclsAllTracks->GetXaxis()->SetBinLabel(4, "kBoth");
613
614 fOutputTrack->Add(hPtDaughters);
615 fOutputTrack->Add(hPhiDaughters);
616 fOutputTrack->Add(hEtaDaughters);
617 fOutputTrack->Add(hEtavsPhiDaughters);
618 fOutputTrack->Add(hNTPCclsvsPtDaughters);
619 fOutputTrack->Add(hNTPCclsvsPhiDaughters);
620 fOutputTrack->Add(hNTPCclsvsEtaDaughters);
7d690084 621 fOutputTrack->Add(hNTPCCrossedRowsvsPtDaughters);
622 fOutputTrack->Add(hNTPCCrossedRowsvsPhiDaughters);
623 fOutputTrack->Add(hNTPCCrossedRowsvsEtaDaughters);
8e4c6c96 624 fOutputTrack->Add(hRatioCRowsOverFclsvsPtDaughters);
625 fOutputTrack->Add(hRatioCRowsOverFclsvsPhiDaughters);
626 fOutputTrack->Add(hRatioCRowsOverFclsvsEtaDaughters);
627 fOutputTrack->Add(hNITSclsvsPtDaughters);
628 fOutputTrack->Add(hNITSclsvsPhiDaughters);
629 fOutputTrack->Add(hNITSclsvsEtaDaughters);
630 fOutputTrack->Add(hSPDclsDaughters);
631 fOutputTrack->Add(hPtAllTracks);
632 fOutputTrack->Add(hPhiAllTracks);
633 fOutputTrack->Add(hEtaAllTracks);
634 fOutputTrack->Add(hEtavsPhiAllTracks);
635 fOutputTrack->Add(hNTPCclsvsPtAllTracks);
636 fOutputTrack->Add(hNTPCclsvsPhiAllTracks);
637 fOutputTrack->Add(hNTPCclsvsEtaAllTracks);
7d690084 638 fOutputTrack->Add(hNTPCCrossedRowsvsPtAllTracks);
639 fOutputTrack->Add(hNTPCCrossedRowsvsPhiAllTracks);
640 fOutputTrack->Add(hNTPCCrossedRowsvsEtaAllTracks);
8e4c6c96 641 fOutputTrack->Add(hRatioCRowsOverFclsvsPtAllTracks);
642 fOutputTrack->Add(hRatioCRowsOverFclsvsPhiAllTracks);
643 fOutputTrack->Add(hRatioCRowsOverFclsvsEtaAllTracks);
644 fOutputTrack->Add(hNITSclsvsPtAllTracks);
645 fOutputTrack->Add(hNITSclsvsPhiAllTracks);
646 fOutputTrack->Add(hNITSclsvsEtaAllTracks);
647 fOutputTrack->Add(hSPDclsAllTracks);
5230fd6a 648
8e4c6c96 649 }
650
5fc4893f 651 fOutputTrack->Add(hnClsITS);
39dd297f 652 fOutputTrack->Add(hnClsITSselTr);
5fc4893f 653 fOutputTrack->Add(hnClsITSSA);
bc6846db 654 fOutputTrack->Add(hnLayerITS);
655 fOutputTrack->Add(hnLayerITSsa);
5fc4893f 656 fOutputTrack->Add(hnClsSPD);
657 fOutputTrack->Add(hptGoodTr);
658 fOutputTrack->Add(hdistrGoodTr);
824b448a 659 fOutputTrack->Add(hdistrSelTr);
ba3a678d 660 fOutputTrack->Add(hd0TracksSPDin);
661 fOutputTrack->Add(hd0TracksSPDany);
662 fOutputTrack->Add(hd0TracksFilterBit4);
663 fOutputTrack->Add(hd0TracksTPCITSSPDany);
664 fOutputTrack->Add(hd0dau);
665 fOutputTrack->Add(hd0zdau);
8e4c6c96 666
acc33385 667
5fc4893f 668 if(fReadMC){
669 hname="hdistrFakeTr";
670 TH1F* hdistrFakeTr=new TH1F(hname.Data(),"Distribution of number of fake tracks per event;no.fake-tracks/ev;Entries",4000,-0.5,3999.5);
824b448a 671 hdistrFakeTr->SetTitleOffset(1.3,"Y");
acc33385 672
5fc4893f 673 hname="hd0f";
674 TH1F* hd0f=new TH1F(hname.Data(),"Impact parameter distribution of fake tracks;d_{0}[cm];Entries/10^{3} cm",200,-0.1,0.1);
acc33385 675
5fc4893f 676 hname="hptFakeTr";
677 TH1F* hptFakeTr=new TH1F(hname.Data(),"Pt distribution of fake tracks;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
ad42e35b 678 hptFakeTr->SetTitleOffset(1.3,"Y");
824b448a 679 if(!fSimpleMode){
680 hname="hptFakeTrFromDaugh";
681 TH1F* hptFakeTrFromDaugh=new TH1F(hname.Data(),"Pt distribution of fake tracks from daughters;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
682 hptFakeTrFromDaugh->SetTitleOffset(1.3,"Y");
683 fOutputTrack->Add(hptFakeTrFromDaugh);
684 }
acc33385 685
5fc4893f 686 fOutputTrack->Add(hptFakeTr);
687 fOutputTrack->Add(hdistrFakeTr);
688 fOutputTrack->Add(hd0f);
689
690 }
acc33385 691 }
692
0dbb51a0 693
5fc4893f 694 if(fOnOff[2] && fCuts->GetUseCentrality()){
a4ef4383 695
696 //Centrality (Counters)
697 fOutputCounters=new TList();
698 fOutputCounters->SetOwner();
699 fOutputCounters->SetName(GetOutputSlot(5)->GetContainer()->GetName());
700
701 AliCounterCollection *stdEstimator=new AliCounterCollection("stdEstimator");
702 stdEstimator->AddRubric("run",500000);
5fc4893f 703 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");
a4ef4383 704 stdEstimator->Init();
705 AliCounterCollection *secondEstimator=new AliCounterCollection("secondEstimator");
706 secondEstimator->AddRubric("run",500000);
5fc4893f 707 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");
a4ef4383 708 secondEstimator->Init();
1b765719 709
a4ef4383 710 fOutputCounters->Add(stdEstimator);
711 fOutputCounters->Add(secondEstimator);
1b765719 712
a4ef4383 713 //Centrality (Checks)
714 fOutputCheckCentrality=new TList();
715 fOutputCheckCentrality->SetOwner();
716 fOutputCheckCentrality->SetName(GetOutputSlot(6)->GetContainer()->GetName());
717
5fc4893f 718 TString hname="hNtrackletsIn";
a4ef4383 719 TH1F* hNtrackletsIn=new TH1F(hname.Data(),"Number of tracklets in Centrality range;ntracklets;Entries",5000,-0.5,4999.5);
720
721 hname="hMultIn";
722 TH1F* hMultIn=new TH1F(hname.Data(),"Multiplicity;multiplicity in Centrality range;Entries",10000,-0.5,9999.5);
723
724 hname="hNtrackletsOut";
725 TH1F* hNtrackletsOut=new TH1F(hname.Data(),"Number of tracklets out of Centrality range;ntracklets;Entries",5000,-0.5,4999.5);
726
727 hname="hMultOut";
728 TH1F* hMultOut=new TH1F(hname.Data(),"Multiplicity out of Centrality range;multiplicity;Entries",10000,-0.5,9999.5);
729
ac0c2841 730 hname="hMultvsPercentile";
7a5f2502 731 TH2F* hMultvsPercentile=new TH2F(hname.Data(),"Multiplicity vs Percentile;multiplicity;percentile",10000,-0.5,9999.5,240,-10.,110);
ac0c2841 732
7a5f2502 733 hname="hntrklvsPercentile";
734 TH2F* hntrklvsPercentile=new TH2F(hname.Data(),"N tracklets vs Percentile;ntracklets;percentile",5000,-0.5,4999.5,240,-10.,110);
23dfe729 735
138e0d89 736 hname="hnTPCTracksvsPercentile";
737 TH2F* hnTPCTracksvsPercentile=new TH2F(hname.Data(),"N TPC tracks vs Percentile;nTPCTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
738
739 hname="hnTPCITSTracksvsPercentile";
740 TH2F* hnTPCITSTracksvsPercentile=new TH2F(hname.Data(),"N TPC+ITS tracks vs Percentile;nTPCITSTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
741
742 hname="hnTPCITS1SPDTracksvsPercentile";
743 TH2F* hnTPCITS1SPDTracksvsPercentile=new TH2F(hname.Data(),"N TPC+ITS+1SPD tracks vs Percentile;nTPCITS1SPDTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
744
b68a0f6a 745 hname="hV0MultiplicityPercentile";
746 TH2F*hV0MultiplicityPercentile = new TH2F(hname.Data(),"V0 Multiplicity vs Percentile;V0 multiplicity;percentile",1000,-0.5,9999.5,120,-10.,110);
747
748 hname="hV0MultiplicityNtrackletsIn";
749 TH2F*hV0MultiplicityNtrackletsIn = new TH2F(hname.Data(),"V0 Multiplicity vs Number of tracklets in the CC;V0 multiplicity;percentile",1000,-0.5,9999.5,5000,-0.5,4999.5);
750
751 hname="hStdPercentileSPDPercentile";
752 TH2F* hStdPercentileSPDPercentile = new TH2F(hname.Data(),"Std estimator Percentile Vs SPD Percentile;Std estimator percentile;SPD percentile",120,-10.,110,120,-10.,110);
753
a4ef4383 754 fOutputCheckCentrality->Add(hNtrackletsIn);
755 fOutputCheckCentrality->Add(hNtrackletsOut);
756 fOutputCheckCentrality->Add(hMultIn);
757 fOutputCheckCentrality->Add(hMultOut);
ac0c2841 758 fOutputCheckCentrality->Add(hMultvsPercentile);
7a5f2502 759 fOutputCheckCentrality->Add(hntrklvsPercentile);
138e0d89 760 fOutputCheckCentrality->Add(hnTPCTracksvsPercentile);
761 fOutputCheckCentrality->Add(hnTPCITSTracksvsPercentile);
762 fOutputCheckCentrality->Add(hnTPCITS1SPDTracksvsPercentile);
b68a0f6a 763 fOutputCheckCentrality->Add(hV0MultiplicityPercentile);
764 fOutputCheckCentrality->Add(hV0MultiplicityNtrackletsIn);
765 fOutputCheckCentrality->Add(hStdPercentileSPDPercentile);
82f89d0d 766
767 PostData(6,fOutputCheckCentrality);
768
a4ef4383 769 } else{
5fc4893f 770 if(fOnOff[0]){
771 TString hname="hNtracklets";
772 TH1F* hNtracklets=new TH1F(hname.Data(),"Number of tracklets;ntracklets;Entries",5000,-0.5,4999.5);
773
774 hname="hMult";
775 TH1F* hMult=new TH1F(hname.Data(),"Multiplicity;multiplicity;Entries",10000,-0.5,9999.5);
776 fOutputTrack->Add(hNtracklets);
777 fOutputTrack->Add(hMult);
778 }
a4ef4383 779 }
780
818c1271 781 //event selection (z vertex for the moment)
782 if(fOnOff[3]){
783 fOutputEvSelection=new TList();
784 fOutputEvSelection->SetOwner();
785 fOutputEvSelection->SetName(GetOutputSlot(7)->GetContainer()->GetName());
786 AliCounterCollection *evselection=new AliCounterCollection("evselection");
787 evselection->AddRubric("run",500000);
788 evselection->AddRubric("evnonsel","zvtx");
789 evselection->Init();
790
b25dd7e3 791 TH1F* hxvtx=new TH1F("hxvtx", "Distribution of x_{VTX};x_{VTX} [cm];Entries",800,-1,1);
792 TH1F* hyvtx=new TH1F("hyvtx", "Distribution of y_{VTX};y_{VTX} [cm];Entries",800,-1,1);
793 TH1F* hzvtx=new TH1F("hzvtx", "Distribution of z_{VTX};z_{VTX} [cm];Entries",800,-30,30);
794 TH1F* hxvtxSelEv=new TH1F("hxvtxSelEv", "Distribution of x_{VTX} Selected Ev;x_{VTX} [cm];Entries",800,-1,1);
795 TH1F* hyvtxSelEv=new TH1F("hyvtxSelEv", "Distribution of y_{VTX} Selected Ev;y_{VTX} [cm];Entries",800,-1,1);
796 TH1F* hzvtxSelEv=new TH1F("hzvtxSelEv", "Distribution of z_{VTX} Selected Ev;z_{VTX} [cm];Entries",800,-30,30);
6c66ddad 797 TH1F* hWhichVert=new TH1F("hWhichVert","Vertex Type",4,-1.5,2.5);
798 hWhichVert->GetXaxis()->SetBinLabel(1,"Not found");
799 hWhichVert->GetXaxis()->SetBinLabel(2,"Track");
800 hWhichVert->GetXaxis()->SetBinLabel(3,"SPD-3D");
801 hWhichVert->GetXaxis()->SetBinLabel(4,"SPD-z");
802 TH1F* hWhichVertSelEv=new TH1F("hWhichVertSelEv","Vertex Type",4,-1.5,2.5);
803 hWhichVertSelEv->GetXaxis()->SetBinLabel(1,"Not found");
804 hWhichVertSelEv->GetXaxis()->SetBinLabel(2,"Track");
805 hWhichVertSelEv->GetXaxis()->SetBinLabel(3,"SPD-3D");
806 hWhichVertSelEv->GetXaxis()->SetBinLabel(4,"SPD-z");
23dfe729 807
1340a059 808 TH2F* hTrigCent=new TH2F("hTrigCent","Centrality vs. Trigger types",13,-1.5,11.5,12,-10,110);
23dfe729 809 hTrigCent->GetXaxis()->SetBinLabel(1,"All");
2a844546 810 hTrigCent->GetXaxis()->SetBinLabel(2,"kAny");
811 hTrigCent->GetXaxis()->SetBinLabel(3,"kMB");
812 hTrigCent->GetXaxis()->SetBinLabel(4,"kINT7");
813 hTrigCent->GetXaxis()->SetBinLabel(5,"kCINT5");
814 hTrigCent->GetXaxis()->SetBinLabel(6,"kCent");
815 hTrigCent->GetXaxis()->SetBinLabel(7,"kSemiCent");
816 hTrigCent->GetXaxis()->SetBinLabel(8,"kEMC1+7");
817 hTrigCent->GetXaxis()->SetBinLabel(9,"kEMCJET+GAMMA");
818 hTrigCent->GetXaxis()->SetBinLabel(10,"Muons");
819 hTrigCent->GetXaxis()->SetBinLabel(11,"PHOS");
1340a059 820 hTrigCent->GetXaxis()->SetBinLabel(12,"HighMult");
821 hTrigCent->GetXaxis()->SetBinLabel(13,"Others");
2a844546 822
1340a059 823 TH2F* hTrigMul=new TH2F("hTrigMul","Multiplicity vs. Trigger types",13,-1.5,11.5,100,0.,10000.);
23dfe729 824 hTrigMul->GetXaxis()->SetBinLabel(1,"All");
2a844546 825 hTrigMul->GetXaxis()->SetBinLabel(2,"kAny");
826 hTrigMul->GetXaxis()->SetBinLabel(3,"kMB");
827 hTrigMul->GetXaxis()->SetBinLabel(4,"kINT7");
828 hTrigMul->GetXaxis()->SetBinLabel(5,"kCINT5");
829 hTrigMul->GetXaxis()->SetBinLabel(6,"kCent");
830 hTrigMul->GetXaxis()->SetBinLabel(7,"kSemiCent");
831 hTrigMul->GetXaxis()->SetBinLabel(8,"kEMC1+7");
832 hTrigMul->GetXaxis()->SetBinLabel(9,"kEMCJET+GAMMA");
833 hTrigMul->GetXaxis()->SetBinLabel(10,"Muons");
834 hTrigMul->GetXaxis()->SetBinLabel(11,"PHOS");
1340a059 835 hTrigMul->GetXaxis()->SetBinLabel(12,"HighMult");
836 hTrigMul->GetXaxis()->SetBinLabel(13,"Others");
2a844546 837
1340a059 838 TH2F* hTrigCentSel=new TH2F("hTrigCentSel","Trigger types",13,-1.5,11.5,12,-10,110);
23dfe729 839 hTrigCentSel->GetXaxis()->SetBinLabel(1,"All");
2a844546 840 hTrigCentSel->GetXaxis()->SetBinLabel(2,"kAny");
841 hTrigCentSel->GetXaxis()->SetBinLabel(3,"kMB");
842 hTrigCentSel->GetXaxis()->SetBinLabel(4,"kINT7");
843 hTrigCentSel->GetXaxis()->SetBinLabel(5,"kCINT5");
844 hTrigCentSel->GetXaxis()->SetBinLabel(6,"kCent");
845 hTrigCentSel->GetXaxis()->SetBinLabel(7,"kSemiCent");
846 hTrigCentSel->GetXaxis()->SetBinLabel(8,"kEMC1+7");
847 hTrigCentSel->GetXaxis()->SetBinLabel(9,"kEMCJET+GAMMA");
848 hTrigCentSel->GetXaxis()->SetBinLabel(10,"Muons");
849 hTrigCentSel->GetXaxis()->SetBinLabel(11,"PHOS");
1340a059 850 hTrigCentSel->GetXaxis()->SetBinLabel(12,"HighMult");
851 hTrigCentSel->GetXaxis()->SetBinLabel(13,"Others");
23dfe729 852
1b765719 853 AliCounterCollection *trigCounter=new AliCounterCollection("trigCounter");
854 trigCounter->AddRubric("run",500000);
3dfe174d 855 trigCounter->AddRubric("triggerType","All/Any/MB/Cent/SemiCent/EMCAL/MUON/NoPhysSelMUON/NoPhysSelEvNot7/NoPhysSelCMUP1/NoPhysSelMB/NoPhysSelCent/NoPhysSelSemiCent/CINT7");
1b765719 856 trigCounter->Init();
857
1d654f7b 858 TH1F* hWhyEvRejected=new TH1F("hWhyEvRejected", "Why Event rejected",6,-0.5,5.5);
859
860 hWhyEvRejected->GetXaxis()->SetBinLabel(1,"pileup");
861 hWhyEvRejected->GetXaxis()->SetBinLabel(2,"centrality");
862 hWhyEvRejected->GetXaxis()->SetBinLabel(3,"Vertex (more reasons)");
863 hWhyEvRejected->GetXaxis()->SetBinLabel(4,"trigger");
864 hWhyEvRejected->GetXaxis()->SetBinLabel(5,"z vertex out");
865 hWhyEvRejected->GetXaxis()->SetBinLabel(6,"physics sel");
866
867
818c1271 868 fOutputEvSelection->Add(evselection);
6c66ddad 869 fOutputEvSelection->Add(hxvtx);
870 fOutputEvSelection->Add(hyvtx);
818c1271 871 fOutputEvSelection->Add(hzvtx);
6c66ddad 872 fOutputEvSelection->Add(hxvtxSelEv);
873 fOutputEvSelection->Add(hyvtxSelEv);
874 fOutputEvSelection->Add(hzvtxSelEv);
875 fOutputEvSelection->Add(hWhichVert);
876 fOutputEvSelection->Add(hWhichVertSelEv);
23dfe729 877 fOutputEvSelection->Add(hTrigCent);
878 fOutputEvSelection->Add(hTrigMul);
879 fOutputEvSelection->Add(hTrigCentSel);
1b765719 880 fOutputEvSelection->Add(trigCounter);
1d654f7b 881 fOutputEvSelection->Add(hWhyEvRejected);
882
818c1271 883 }
d48d81b5 884 if(fOnOff[4]){ // FLOW OBSERVABLES
885 fOutputFlowObs=new TList();
886 fOutputFlowObs->SetOwner();
887 fOutputFlowObs->SetName(GetOutputSlot(8)->GetContainer()->GetName());
888
889 fFlowEvent = new AliFlowEvent(3000);
890 fRFPcuts = new AliFlowTrackCuts("rfpCuts");
891
65274ad6 892 TH2F *hFEvents = new TH2F("hFlowEvents","FlowEvent Selection",7,0,7,7,-10,60);
d48d81b5 893 hFEvents->GetXaxis()->SetBinLabel(1,"REACHED");
894 hFEvents->GetXaxis()->SetBinLabel(2,"TRIGGERED");
65274ad6 895 hFEvents->GetXaxis()->SetBinLabel(3,"kMB");
896 hFEvents->GetXaxis()->SetBinLabel(4,"kCent");
897 hFEvents->GetXaxis()->SetBinLabel(5,"kSemiC");
898 hFEvents->GetXaxis()->SetBinLabel(6,"Triggered + vtx cut");
899 hFEvents->GetXaxis()->SetBinLabel(7,"UnexpectedBehaviour");
d48d81b5 900 fOutputFlowObs->Add(hFEvents);
901
902 TProfile2D *hQ[3];
903 TH2F *hAngleQ[3];
904 TH3F *hPhiEta[3];
905 TString ref[3] = {"FB1","FB128","VZE"};
906 Int_t etabin[3] = {40,40,20};
907 Int_t etamax[3] = { 1, 1, 5};
908 for(Int_t i=0; i<3; ++i) {
909 hQ[i]= new TProfile2D( Form("h%s_Q",ref[i].Data()),
910 Form("Q_{2} components for %s",ref[i].Data()),
911 4,0,4,12,0,60,"s");
912 hQ[i]->GetXaxis()->SetBinLabel(1,"Qx^{-}");
913 hQ[i]->GetXaxis()->SetBinLabel(2,"Qy^{-}");
914 hQ[i]->GetXaxis()->SetBinLabel(3,"Qx^{+}");
915 hQ[i]->GetXaxis()->SetBinLabel(4,"Qy^{+}");
916 hQ[i]->GetYaxis()->SetTitle("Centrality");
917 fOutputFlowObs->Add(hQ[i]);
918
919 hAngleQ[i] = new TH2F( Form("h%s_AngleQ",ref[i].Data()),
920 Form("#Psi_{2} for %s",ref[i].Data()),
921 72,0,TMath::Pi(),12,0,60);
922 hAngleQ[i]->GetXaxis()->SetTitle( Form("#Psi_{2}^{%s}",ref[i].Data()) );
923 hAngleQ[i]->GetYaxis()->SetTitle("Centrality");
924 fOutputFlowObs->Add(hAngleQ[i]);
925
926 hPhiEta[i] = new TH3F( Form("h%s_PhiEta",ref[i].Data()),
927 Form("Eta vs Phi for %s",ref[i].Data()),
65274ad6 928 144,0,TMath::TwoPi(),etabin[i],-1.0*etamax[i],+1.0*etamax[i],12,0,60);
d48d81b5 929 hPhiEta[i]->GetXaxis()->SetTitle("Phi");
930 hPhiEta[i]->GetYaxis()->SetTitle("Eta");
931 hPhiEta[i]->GetZaxis()->SetTitle("Centrality");
932 fOutputFlowObs->Add(hPhiEta[i]);
933
934 }
935 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);
936 hTPCVZE_AngleQ->GetXaxis()->SetTitle("#Psi_{2}^{TPC}");
937 hTPCVZE_AngleQ->GetYaxis()->SetTitle("#Psi_{2}^{VZE}");
938 hTPCVZE_AngleQ->GetZaxis()->SetTitle("Centrality");
939 fOutputFlowObs->Add(hTPCVZE_AngleQ);
65274ad6 940
941 TH2F *hCentVsMultRPS = new TH2F("hCentVsMultRPS", " Centrality Vs. Multiplicity RPs",5000, 0, 5000.,12,0,60 );
942 hCentVsMultRPS->GetXaxis()->SetTitle("Multiplicity RPs");
943 hCentVsMultRPS->GetYaxis()->SetTitle("Centrality");
944 fOutputFlowObs->Add(hCentVsMultRPS);
d48d81b5 945 }
e7af8919 946
a578b2da 947 /*
e7af8919 948 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
949 AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
950 AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
951 if (fCuts->GetIsUsePID() && fDecayChannel==kLambdactoV0) {
952 fCuts->GetPidHF()->SetPidResponse(pidResp);
89b8ddf3 953 AliRDHFCutsLctoV0* lccuts=dynamic_cast<AliRDHFCutsLctoV0*>(fCuts);
954 if(lccuts){
955 lccuts->GetPidV0pos()->SetPidResponse(pidResp);
956 lccuts->GetPidV0neg()->SetPidResponse(pidResp);
957 fCuts->GetPidHF()->SetOldPid(kFALSE);
958 lccuts->GetPidV0pos()->SetOldPid(kFALSE);
959 lccuts->GetPidV0neg()->SetOldPid(kFALSE);
960 }
e7af8919 961 }
a578b2da 962 */
e7af8919 963
0dbb51a0 964 // Post the data
965 PostData(1,fNEntries);
d48d81b5 966
5fc4893f 967 if(fOnOff[1]) PostData(2,fOutputPID);
968 if(fOnOff[0]) PostData(3,fOutputTrack);
0dbb51a0 969 PostData(4,fCuts);
5fc4893f 970 if(fOnOff[2]) PostData(5,fOutputCounters);
818c1271 971 if(fOnOff[3]) PostData(7,fOutputEvSelection);
d48d81b5 972 if(fOnOff[4]) PostData(8,fOutputFlowObs);
818c1271 973
5fc4893f 974 if(!fOnOff[0] && !fOnOff[1] && !fOnOff[2]) AliError("Nothing will be filled!");
0dbb51a0 975}
976
977//___________________________________________________________________________
978void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
979{
980 // Execute analysis for current event
981
982 AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
983 if(fDebug>2) printf("Analysing decay %d\n",fDecayChannel);
984 // Post the data already here
985 PostData(1,fNEntries);
5fc4893f 986 if(fOnOff[1]) PostData(2,fOutputPID);
987 if(fOnOff[0]) PostData(3,fOutputTrack);
0dbb51a0 988 PostData(4,fCuts);
5fc4893f 989 if(fOnOff[2]) {
990 PostData(5,fOutputCounters);
991 if(fCuts->GetUseCentrality()) PostData(6,fOutputCheckCentrality);
992 }
0dbb51a0 993
994 TClonesArray *arrayProng =0;
995 Int_t pdg=0;
a4ef4383 996 Int_t *pdgdaughters=0x0;
997
0dbb51a0 998 if(!aod && AODEvent() && IsStandardAOD()) {
999 // In case there is an AOD handler writing a standard AOD, use the AOD
1000 // event in memory rather than the input (ESD) event.
1001 aod = dynamic_cast<AliAODEvent*> (AODEvent());
1002 // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
1003 // have to taken from the AOD event hold by the AliAODExtension
1004 AliAODHandler* aodHandler = (AliAODHandler*)
1005 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
1006 if(aodHandler->GetExtensions()) {
1007
1008 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
1009 AliAODEvent *aodFromExt = ext->GetAOD();
1010
1011
1012
1013 switch(fDecayChannel){
1014 case 0:
1015 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1016 pdg=411;
a4ef4383 1017 if(fReadMC){
1018 pdgdaughters =new Int_t[3];
1019 pdgdaughters[0]=211;//pi
1020 pdgdaughters[1]=321;//K
1021 pdgdaughters[2]=211;//pi
1022 }
0dbb51a0 1023 break;
1024 case 1:
1025 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
1026 pdg=421;
a4ef4383 1027 if(fReadMC){
1028 pdgdaughters =new Int_t[2];
1029 pdgdaughters[0]=211;//pi
1030 pdgdaughters[1]=321;//K
1031 }
0dbb51a0 1032 break;
1033 case 2:
1034 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar");
1035 pdg=413;
a4ef4383 1036 if(fReadMC){
fb9311e8 1037 pdgdaughters =new Int_t[3];
a4ef4383 1038 pdgdaughters[1]=211;//pi
1039 pdgdaughters[0]=321;//K
1040 pdgdaughters[2]=211;//pi (soft?)
1041 }
0dbb51a0 1042 break;
1043 case 3:
1044 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1045 pdg=431;
a4ef4383 1046 if(fReadMC){
1047 pdgdaughters =new Int_t[3];
1048 pdgdaughters[0]=321;//K
1049 pdgdaughters[1]=321;//K
1050 pdgdaughters[2]=211;//pi
1051 }
0dbb51a0 1052 break;
1053 case 4:
1054 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm4Prong");
1055 pdg=421;
a4ef4383 1056 if(fReadMC){
1057 pdgdaughters =new Int_t[4];
1058 pdgdaughters[0]=321;
1059 pdgdaughters[1]=211;
1060 pdgdaughters[2]=211;
1061 pdgdaughters[3]=211;
1062 }
0dbb51a0 1063 break;
1064 case 5:
1065 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
1066 pdg=4122;
a4ef4383 1067 if(fReadMC){
1068 pdgdaughters =new Int_t[3];
1069 pdgdaughters[0]=2212;//p
1070 pdgdaughters[1]=321;//K
1071 pdgdaughters[2]=211;//pi
1072 }
0dbb51a0 1073 break;
ca688a98 1074 case kLambdactoV0:
e7af8919 1075 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("CascadesHF");
ca688a98 1076 pdg=4122;
1077 if(fReadMC){
1078 pdgdaughters =new Int_t[3];
1079 pdgdaughters[0]=2212;//p
1080 pdgdaughters[1]=211;//pi
1081 pdgdaughters[2]=211;//pi
1082 }
1083 break;
0dbb51a0 1084 }
1085 }
dc222f77 1086 } else if(aod) {
0dbb51a0 1087 switch(fDecayChannel){
1088 case 0:
1089 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1090 pdg=411;
a4ef4383 1091 if(fReadMC){
1092 pdgdaughters =new Int_t[3];
1093 pdgdaughters[0]=211;//pi
1094 pdgdaughters[1]=321;//K
1095 pdgdaughters[2]=211;//pi
1096 }
0dbb51a0 1097 break;
1098 case 1:
1099 arrayProng=(TClonesArray*)aod->GetList()->FindObject("D0toKpi");
1100 pdg=421;
a4ef4383 1101 if(fReadMC){
1102 pdgdaughters =new Int_t[2];
1103 pdgdaughters[0]=211;//pi
1104 pdgdaughters[1]=321;//K
1105 }
0dbb51a0 1106 break;
1107 case 2:
1108 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Dstar");
1109 pdg=413;
a4ef4383 1110 if(fReadMC){
24bcb2f3 1111 pdgdaughters =new Int_t[3];
a4ef4383 1112 pdgdaughters[1]=211;//pi
1113 pdgdaughters[0]=321;//K
1114 pdgdaughters[2]=211;//pi (soft?)
1115 }
0dbb51a0 1116 break;
1117 case 3:
1118 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1119 pdg=431;
a4ef4383 1120 if(fReadMC){
1121 pdgdaughters =new Int_t[3];
1122 pdgdaughters[0]=321;//K
1123 pdgdaughters[1]=321;//K
1124 pdgdaughters[2]=211;//pi
1125 }
0dbb51a0 1126 break;
1127 case 4:
1128 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm4Prong");
1129 pdg=421;
a4ef4383 1130 if(fReadMC){
1131 pdgdaughters =new Int_t[4];
1132 pdgdaughters[0]=321;
1133 pdgdaughters[1]=211;
1134 pdgdaughters[2]=211;
1135 pdgdaughters[3]=211;
1136 }
0dbb51a0 1137 break;
1138 case 5:
1139 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
1140 pdg=4122;
a4ef4383 1141 if(fReadMC){
1142 pdgdaughters =new Int_t[3];
1143 pdgdaughters[0]=2212;//p
1144 pdgdaughters[1]=321;//K
1145 pdgdaughters[2]=211;//pi
1146 }
0dbb51a0 1147 break;
ca688a98 1148 case kLambdactoV0:
e7af8919 1149 arrayProng=(TClonesArray*)aod->GetList()->FindObject("CascadesHF");
ca688a98 1150 pdg=4122;
1151 if(fReadMC){
1152 pdgdaughters =new Int_t[3];
1153 pdgdaughters[0]=2212;//p
1154 pdgdaughters[1]=211;//pi
1155 pdgdaughters[2]=211;//pi
1156 }
1157 break;
0dbb51a0 1158 }
1159 }
19222b31 1160 Bool_t isSimpleMode=fSimpleMode;
0dbb51a0 1161 if(!arrayProng) {
5c13a4db 1162 AliInfo("Branch not found! The output will contain only track related histograms\n");
0dbb51a0 1163 isSimpleMode=kTRUE;
9af24f46 1164 fNEntries->Fill(2);
0dbb51a0 1165 }
1166
a4ef4383 1167 TClonesArray *mcArray = 0;
1168 AliAODMCHeader *mcHeader = 0;
1169
3655ecf2 1170 if(!aod) {
1171 delete [] pdgdaughters;
1172 return;
1173 }
1174
a4ef4383 1175 //check if MC
1176 if(fReadMC) {
1177 // load MC particles
1178 mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
1179 if(!mcArray) {
1180 printf("AliAnalysisTaskSEHFQA::UserExec: MC particles branch not found!\n");
fb9311e8 1181 delete [] pdgdaughters;
a4ef4383 1182 return;
1183 }
1184
1185 // load MC header
1186 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
1187 if(!mcHeader) {
1188 printf("AliAnalysisTaskSEHFQA::UserExec: MC header branch not found!\n");
fb9311e8 1189 delete [] pdgdaughters;
a4ef4383 1190 return;
1191 }
1192 }
23dfe729 1193
1194
1195 UInt_t evSelMask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1196 Double_t centrality=fCuts->GetCentrality(aod);
1197 Double_t multiplicity=aod->GetHeader()->GetRefMultiplicity();
17531bbd 1198 Int_t runNumber = aod->GetRunNumber();
5e67f11a 1199 TString trigClass=aod->GetFiredTriggerClasses();
138e0d89 1200 Int_t nAODtracks=aod->GetNTracks();
1201 Int_t nSelTracksTPCOnly=0;
1202 Int_t nSelTracksTPCITS=0;
1203 Int_t nSelTracksTPCITS1SPD=0;
1204
1205 for (Int_t k=0;k<nAODtracks;k++){
1206 AliAODTrack* track=aod->GetTrack(k);
1207 if(track->GetID()<0) continue;
1208 Int_t nclsTot=0,nclsSPD=0;
1209 for(Int_t l=0;l<6;l++) {
1210 if(TESTBIT(track->GetITSClusterMap(),l)) {
1211 nclsTot++; if(l<2) nclsSPD++;
1212 }
1213 }
1214 UShort_t nTPCClus=track->GetTPCClusterMap().CountBits();
1215 if(TMath::Abs(track->Eta())<0.8 && nTPCClus>=70 && track->GetStatus()&AliESDtrack::kTPCrefit){
1216 if(track->TestFilterBit(1)) nSelTracksTPCOnly++;
1217 if(track->GetStatus()&AliESDtrack::kITSrefit){
1218 nSelTracksTPCITS++;
1219 if(nclsSPD>0) nSelTracksTPCITS1SPD++;
1220 }
1221 }
1222 }
1223
d48d81b5 1224 if(fOnOff[4]) {
1225 FillFlowObs(aod);
1226 PostData(8,fOutputFlowObs);
1227 }
1b765719 1228 if(fOnOff[3]){
1229 TH2F* hTrigC=(TH2F*)fOutputEvSelection->FindObject("hTrigCent");
1230 TH2F* hTrigM=(TH2F*)fOutputEvSelection->FindObject("hTrigMul");
1231 AliCounterCollection* trigCount=(AliCounterCollection*)fOutputEvSelection->FindObject("trigCounter");
17531bbd 1232
2a844546 1233 hTrigC->Fill(-1.,centrality);
1234 hTrigM->Fill(-1.,multiplicity);
da3b34af 1235 trigCount->Count(Form("triggerType:All/Run:%d",runNumber));
5e67f11a 1236 if(evSelMask==0){
1237 if(aod->GetEventType()!=7){
1238 trigCount->Count(Form("triggerType:NoPhysSelEvNot7/Run:%d",runNumber));
1239 }else if(trigClass.Contains("CMUP1")){
1240 trigCount->Count(Form("triggerType:NoPhysSelCMUP1/Run:%d",runNumber));
1241 }else if(trigClass.Contains("MUON")){
1242 trigCount->Count(Form("triggerType:NoPhysSelMUON/Run:%d",runNumber));
1243 }else if(trigClass.Contains("CPBI2_B1-B") || trigClass.Contains(" CPBI2WU_B1-B")){
1244 trigCount->Count(Form("triggerType:NoPhysSelMB/Run:%d",runNumber));
1245 }else if(trigClass.Contains("CCENT") || trigClass.Contains("CVHN")){
1246 trigCount->Count(Form("triggerType:NoPhysSelCent/Run:%d",runNumber));
1247 }else if(trigClass.Contains("CSEMI") || trigClass.Contains("CVLN")){
1248 trigCount->Count(Form("triggerType:NoPhysSelSemiCent/Run:%d",runNumber));
1249 }
1250 }
2a844546 1251 if(evSelMask & AliVEvent::kAny){
1252 hTrigC->Fill(0.,centrality);
1253 hTrigM->Fill(0.,multiplicity);
1254 trigCount->Count(Form("triggerType:Any/Run:%d",runNumber));
1255 }
1b765719 1256 if(evSelMask & AliVEvent::kMB){
1257 hTrigC->Fill(1.,centrality);
1258 hTrigM->Fill(1.,multiplicity);
1259 trigCount->Count(Form("triggerType:MB/Run:%d",runNumber));
1260 }
1261 if(evSelMask & AliVEvent::kINT7){
1262 hTrigC->Fill(2.,centrality);
1263 hTrigM->Fill(2.,multiplicity);
3dfe174d 1264 trigCount->Count(Form("triggerType:CINT7/Run:%d",runNumber));
1b765719 1265 }
1266 if(evSelMask & AliVEvent::kCINT5){
1267 hTrigC->Fill(3.,centrality);
1268 hTrigM->Fill(3.,multiplicity);
1269 }
1270 if(evSelMask & AliVEvent::kCentral){
1271 hTrigC->Fill(4.,centrality);
1272 hTrigM->Fill(4.,multiplicity);
1273 trigCount->Count(Form("triggerType:Cent/Run:%d",runNumber));
1274 }
1275 if(evSelMask & AliVEvent::kSemiCentral){
1276 hTrigC->Fill(5.,centrality);
1277 hTrigM->Fill(5.,multiplicity);
1278 trigCount->Count(Form("triggerType:SemiCent/Run:%d",runNumber));
1279 }
1280 if(evSelMask & (AliVEvent::kEMC1 | AliVEvent::kEMC7)){
1281 hTrigC->Fill(6.,centrality);
1282 hTrigM->Fill(6.,multiplicity);
1283 }
1284 if(evSelMask & (AliVEvent::kEMCEJE | AliVEvent::kEMCEGA)){
1285 hTrigC->Fill(7.,centrality);
1286 hTrigM->Fill(7.,multiplicity);
1287 trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
1288 }
1289 if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) | (AliVEvent::kMUS7 | AliVEvent::kMUON))){
1290 hTrigC->Fill(8.,centrality);
1291 hTrigM->Fill(8.,multiplicity);
5e67f11a 1292 trigCount->Count(Form("triggerType:MUON/Run:%d",runNumber));
1b765719 1293 }
1294 if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)){
1295 hTrigC->Fill(9.,centrality);
1296 hTrigM->Fill(9.,multiplicity);
1297 }
1340a059 1298 if(evSelMask & (AliVEvent::kHighMult)){
1b765719 1299 hTrigC->Fill(10.,centrality);
1300 hTrigM->Fill(10.,multiplicity);
1301 }
1340a059 1302 if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)){
1303 hTrigC->Fill(11.,centrality);
1304 hTrigM->Fill(11.,multiplicity);
1305 }
23dfe729 1306 }
1307
1308
0dbb51a0 1309 // fix for temporary bug in ESDfilter
1310 // the AODs with null vertex pointer didn't pass the PhysSel
3655ecf2 1311 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001) {
1312 delete [] pdgdaughters;
1313 return;
1314 }
0dbb51a0 1315
1316 // count event
1317 fNEntries->Fill(0);
9af24f46 1318
1319 //count events with good vertex
1320 // AOD primary vertex
1321 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
824b448a 1322
1323 Double_t pos[3],cov[6];
1324 vtx1->GetXYZ(pos);
1325 vtx1->GetCovarianceMatrix(cov);
1326 const AliESDVertex vESD(pos,cov,100.,100);
1327
9af24f46 1328 TString primTitle = vtx1->GetTitle();
1329 if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0) fNEntries->Fill(4);
1330
a3aa1279 1331 // trigger class for PbPb C0SMH-B-NOPF-ALLNOTRD, C0SMH-B-NOPF-ALL
5fc4893f 1332 //TString trigclass=aod->GetFiredTriggerClasses();
1333 //if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL")) fNEntries->Fill(5); //tmp
a3aa1279 1334
818c1271 1335
23dfe729 1336
1337
2a844546 1338 Bool_t evSelbyCentrality=kTRUE,evSelected=kTRUE,evSelByVertex=kTRUE,evselByPileup=kTRUE,evSelByPS=kTRUE;
1d654f7b 1339
7f241934 1340 TH1F* hWhyEvRejected=0x0;
1341 if(fOnOff[3]){
1342 hWhyEvRejected=(TH1F*)fOutputEvSelection->FindObject("hWhyEvRejected");
1343 }
1d654f7b 1344
0dbb51a0 1345 //select event
1346 if(!fCuts->IsEventSelected(aod)) {
82f89d0d 1347 evSelected=kFALSE;
ba3a678d 1348 if(fCuts->IsEventRejectedDueToPileupSPD()) {
7f241934 1349 if(hWhyEvRejected) hWhyEvRejected->Fill(1);
ba3a678d 1350 evselByPileup=kFALSE;
1351 }// rejected for pileup
1352 if(fCuts->IsEventRejectedDueToCentrality()) {
7f241934 1353 if(hWhyEvRejected) hWhyEvRejected->Fill(2);
ba3a678d 1354 evSelbyCentrality=kFALSE; //rejected by centrality
1d654f7b 1355 }
439ce262 1356 if(fCuts->IsEventRejectedDueToNotRecoVertex() ||
1357 fCuts->IsEventRejectedDueToVertexContributors() ||
1358 fCuts->IsEventRejectedDueToZVertexOutsideFiducialRegion()){
1359 evSelByVertex=kFALSE;
7f241934 1360 if(hWhyEvRejected) hWhyEvRejected->Fill(3);
1361 }
1362 if(fCuts->IsEventRejectedDueToTrigger()){
1363 if(hWhyEvRejected) hWhyEvRejected->Fill(4);
ba3a678d 1364 }
7f241934 1365 if(fCuts->IsEventRejectedDueToZVertexOutsideFiducialRegion()) {
1366 if(fOnOff[3]) ((AliCounterCollection*)fOutputEvSelection->FindObject("evselection"))->Count(Form("evnonsel:zvtx/Run:%d",runNumber));
1367 if(hWhyEvRejected) hWhyEvRejected->Fill(5);
439ce262 1368 }
ba3a678d 1369 if(fCuts->IsEventRejectedDuePhysicsSelection()) {
1370 evSelByPS=kFALSE;
7f241934 1371 if(hWhyEvRejected) hWhyEvRejected->Fill(6);
1d654f7b 1372 }
0dbb51a0 1373 }
ba3a678d 1374 if(evSelected && fOnOff[3]){
23dfe729 1375 TH2F* hTrigS=(TH2F*)fOutputEvSelection->FindObject("hTrigCentSel");
2a844546 1376 hTrigS->Fill(-1.,centrality);
23dfe729 1377
2a844546 1378 if(evSelMask & AliVEvent::kAny) hTrigS->Fill(0.,centrality);
23dfe729 1379 if(evSelMask & AliVEvent::kMB) hTrigS->Fill(1.,centrality);
1380 if(evSelMask & AliVEvent::kINT7) hTrigS->Fill(2.,centrality);
1381 if(evSelMask & AliVEvent::kCINT5) hTrigS->Fill(3.,centrality);
1382 if(evSelMask & AliVEvent::kCentral) hTrigS->Fill(4.,centrality);
1383 if(evSelMask & AliVEvent::kSemiCentral) hTrigS->Fill(5.,centrality);
1384 if(evSelMask & (AliVEvent::kEMC1 | AliVEvent::kEMC7)) hTrigS->Fill(6.,centrality);
1385 if(evSelMask & (AliVEvent::kEMCEJE | AliVEvent::kEMCEGA)) hTrigS->Fill(7.,centrality);
1386 if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) | (AliVEvent::kMUS7 | AliVEvent::kMUON))) hTrigS->Fill(8.,centrality);
1387 if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)) hTrigS->Fill(9.,centrality);
1340a059 1388 if(evSelMask & (AliVEvent::kHighMult)) hTrigS->Fill(10.,centrality);
1389 if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)) hTrigS->Fill(11.,centrality);
23dfe729 1390 }
1391
2a844546 1392 if(evSelected || (!evSelbyCentrality && evSelByVertex && evselByPileup && evSelByPS)){ //events selected or not selected because of centrality
5fc4893f 1393 if(fOnOff[2] && fCuts->GetUseCentrality()){
818c1271 1394
ac0c2841 1395 Float_t stdCentf=fCuts->GetCentrality(aod);
1396 Int_t stdCent = (Int_t)(stdCentf+0.5);
5fc4893f 1397 Float_t secondCentf =fCuts->GetCentrality(aod,fEstimator);
1398 Int_t secondCent = (Int_t)(secondCentf+0.5);
82f89d0d 1399 Int_t mincent=stdCent-stdCent%10;
b68a0f6a 1400 AliAODVZERO *vzeroAOD = (AliAODVZERO*)aod->GetVZEROData();
1401 Float_t vzeroMult = vzeroAOD->GetMTotV0A() + vzeroAOD->GetMTotV0C();
1402 AliCentrality *aodcent = aod->GetCentrality();
1403 Float_t spdCentf = aodcent->GetCentralityPercentile("CL1");
5fc4893f 1404 if(stdCentf==-1) {
5587ae1a 1405 mincent=-10;
5fc4893f 1406 stdCent=-1;
1407 }
c40c91c6 1408 if(mincent==100)mincent--;
82f89d0d 1409 ((AliCounterCollection*)fOutputCounters->FindObject("stdEstimator"))->Count(Form("centralityclass:%d_%d/Run:%d",mincent,mincent+10,runNumber));
5fc4893f 1410
82f89d0d 1411 mincent=secondCent-secondCent%10;
5fc4893f 1412 if(secondCentf==-1) {
5587ae1a 1413 mincent=-10;
5fc4893f 1414 secondCent=-1;
1415 }
c40c91c6 1416 if(mincent==100)mincent--;
82f89d0d 1417 ((AliCounterCollection*)fOutputCounters->FindObject("secondEstimator"))->Count(Form("centralityclass:%d_%d/Run:%d",mincent,mincent+10,runNumber));
1418
1419 if(stdCent<fCuts->GetMinCentrality() || stdCent>fCuts->GetMaxCentrality()){
1420 ((TH1F*)fOutputCheckCentrality->FindObject("hNtrackletsOut"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
1421 ((TH1F*)fOutputCheckCentrality->FindObject("hMultOut"))->Fill(aod->GetHeader()->GetRefMultiplicity());
1422 }else{
1423 ((TH1F*)fOutputCheckCentrality->FindObject("hNtrackletsIn"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
1424 ((TH1F*)fOutputCheckCentrality->FindObject("hMultIn"))->Fill(aod->GetHeader()->GetRefMultiplicity());
1425 }
ac0c2841 1426 ((TH2F*)fOutputCheckCentrality->FindObject("hMultvsPercentile"))->Fill(aod->GetHeader()->GetRefMultiplicity(),stdCentf);
7a5f2502 1427 ((TH2F*)fOutputCheckCentrality->FindObject("hntrklvsPercentile"))->Fill(aod->GetTracklets()->GetNumberOfTracklets(),stdCentf);
138e0d89 1428 ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCTracksvsPercentile"))->Fill(nSelTracksTPCOnly,stdCentf);
1429 ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCITSTracksvsPercentile"))->Fill(nSelTracksTPCITS,stdCentf);
1430 ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCITS1SPDTracksvsPercentile"))->Fill(nSelTracksTPCITS1SPD,stdCentf);
b68a0f6a 1431 ((TH2F*)fOutputCheckCentrality->FindObject("hV0MultiplicityPercentile"))->Fill(vzeroMult,stdCentf);
1432 ((TH2F*)fOutputCheckCentrality->FindObject("hV0MultiplicityNtrackletsIn"))->Fill(vzeroMult,aod->GetTracklets()->GetNumberOfTracklets());
1433 ((TH2F*)fOutputCheckCentrality->FindObject("hStdPercentileSPDPercentile"))->Fill(stdCentf,spdCentf);
0dbb51a0 1434
82f89d0d 1435 PostData(6,fOutputCheckCentrality);
1436
1437 } else{
5fc4893f 1438 if(fOnOff[0]){
1439 ((TH1F*)fOutputTrack->FindObject("hNtracklets"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
1440 ((TH1F*)fOutputTrack->FindObject("hMult"))->Fill(aod->GetHeader()->GetRefMultiplicity());
1441 }
a4ef4383 1442 }
82f89d0d 1443 }
1444
818c1271 1445 if(fOnOff[3]){
1446 const AliVVertex *vertex = aod->GetPrimaryVertex();
6c66ddad 1447 Double_t xvtx=vertex->GetX();
1448 Double_t yvtx=vertex->GetY();
818c1271 1449 Double_t zvtx=vertex->GetZ();
6c66ddad 1450 Int_t vtxTyp=0;
1451 if(vertex->GetNContributors()<=0) vtxTyp=-1;
1452 TString title=vertex->GetTitle();
1453 if(title.Contains("Z")) vtxTyp=3;
1454 if(title.Contains("3D")) vtxTyp=2;
1455 ((TH1F*)fOutputEvSelection->FindObject("hxvtx"))->Fill(xvtx);
1456 ((TH1F*)fOutputEvSelection->FindObject("hyvtx"))->Fill(yvtx);
818c1271 1457 ((TH1F*)fOutputEvSelection->FindObject("hzvtx"))->Fill(zvtx);
6c66ddad 1458 ((TH1F*)fOutputEvSelection->FindObject("hWhichVert"))->Fill(vtxTyp);
1459 if(evSelected){
1460 ((TH1F*)fOutputEvSelection->FindObject("hxvtxSelEv"))->Fill(xvtx);
1461 ((TH1F*)fOutputEvSelection->FindObject("hyvtxSelEv"))->Fill(yvtx);
1462 ((TH1F*)fOutputEvSelection->FindObject("hzvtxSelEv"))->Fill(zvtx);
1463 ((TH1F*)fOutputEvSelection->FindObject("hWhichVertSelEv"))->Fill(vtxTyp);
1464 }
818c1271 1465 }
1466
82f89d0d 1467 if(!evSelected) {
1468 delete [] pdgdaughters;
1469 return; //discard all events not selected (vtx and/or centrality)
a4ef4383 1470 }
1471
818c1271 1472
476db98d 1473 AliAODPidHF* pidHF=fCuts->GetPidHF();
362242bf 1474 if(!pidHF) {
1475 delete [] pdgdaughters;
1476 return;
1477 }
5c13a4db 1478 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
1479 AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
1480 AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
1481
4940d5bf 1482 //AliPIDResponse* respF=pidHF->GetPidResponse();
476db98d 1483 AliTPCPIDResponse* tpcres=new AliTPCPIDResponse();
4940d5bf 1484 Bool_t oldPID=pidHF->GetOldPid();
1485 if(oldPID){
70e398d3 1486 Double_t alephParameters[5];
1487 pidHF->GetTPCBetheBlochParams(alephParameters);
1488 tpcres->SetBetheBlochParameters(alephParameters[0],alephParameters[1],alephParameters[2],alephParameters[3],alephParameters[4]);
1489 }
476db98d 1490
1491
0dbb51a0 1492 Int_t ntracks=0;
824b448a 1493 Int_t isGoodTrack=0, isFakeTrack=0, isSelTrack=0;
0dbb51a0 1494
1495 if(aod) ntracks=aod->GetNTracks();
1496
5fc4893f 1497 if(fOnOff[0] || fOnOff[1]){
1498 //loop on tracks in the event
1499 for (Int_t k=0;k<ntracks;k++){
1500 AliAODTrack* track=aod->GetTrack(k);
5c13a4db 1501
1502 // Track selection cuts
138e0d89 1503 if(track->GetID()<0) continue;
ba3a678d 1504 Double_t d0z0[2],covd0z0[3];
1505 track->PropagateToDCA(vtx1,aod->GetMagneticField(),99999.,d0z0,covd0z0);
1506 if(track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){
1507 ((TH1F*)fOutputTrack->FindObject("hd0TracksFilterBit4"))->Fill(d0z0[0]);
1508 }
5c13a4db 1509 ULong_t trStatus=track->GetStatus();
ba3a678d 1510 if(trStatus&AliESDtrack::kITSrefit){
1511 if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)){
1512 ((TH1F*)fOutputTrack->FindObject("hd0TracksSPDany"))->Fill(d0z0[0]);
1513 if(track->HasPointOnITSLayer(0)){
1514 ((TH1F*)fOutputTrack->FindObject("hd0TracksSPDin"))->Fill(d0z0[0]);
1515 }
1516 }
1517 }
1518
1519 Bool_t selTrack=kTRUE;
1520 if (!((trStatus & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||
5c13a4db 1521 !((trStatus & AliVTrack::kITSrefit) == AliVTrack::kITSrefit)){
1522 selTrack=kFALSE;
1523 }
ba3a678d 1524
5c13a4db 1525 Float_t nCrossedRowsTPC = track->GetTPCClusterInfo(2,1);
1526 Float_t ratioCrossedRowsOverFindableClustersTPC = 1.0;
1527 if (track->GetTPCNclsF()>0) {
1528 ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC/track->GetTPCNclsF();
1529 }
1530 if ( nCrossedRowsTPC<70 || ratioCrossedRowsOverFindableClustersTPC<.8 ){
1531 selTrack=kFALSE;
1532 }
ba3a678d 1533 if(selTrack){
1534 if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)){
1535 ((TH1F*)fOutputTrack->FindObject("hd0TracksTPCITSSPDany"))->Fill(d0z0[0]);
1536 }
1537 }
5230fd6a 1538
5fc4893f 1539 AliAODPid *pid = track->GetDetPid();
138e0d89 1540 if(!pid && fDebug>1) cout<<"No AliAODPid found"<<endl;
5fc4893f 1541
138e0d89 1542 if(pid && fOnOff[1]){
5fc4893f 1543 Double_t times[AliPID::kSPECIES];
1544 pid->GetIntegratedTimes(times);
0dbb51a0 1545
5fc4893f 1546 Double_t tofRes[AliPID::kSPECIES];
1547 pid->GetTOFpidResolution(tofRes);
1548
1549 //check TOF
b906dda8 1550 TH1F* htmpfl=((TH1F*)fOutputPID->FindObject("hTOFflags"));
1551 htmpfl->Fill(0.);
5c13a4db 1552 if (trStatus&AliESDtrack::kTPCout) htmpfl->Fill(1.);
1553 if (trStatus&AliESDtrack::kTOFout) htmpfl->Fill(2.);
1554 if (trStatus&AliESDtrack::kTIME) htmpfl->Fill(3.);
1555 if (trStatus&AliESDtrack::kTOFpid) htmpfl->Fill(4.);
1556 if (trStatus&AliESDtrack::kTOFmismatch) htmpfl->Fill(5.);
1557
1558 Bool_t isTOFok=kFALSE;
1559 if(pidResp){
1560 Double_t prob[AliPID::kSPECIES];
1561 if(pidResp->ComputeTOFProbability(track,AliPID::kSPECIES,prob)==AliPIDResponse::kDetPidOk){
1562 isTOFok=kTRUE;
1563 htmpfl->Fill(6.);
1564 }
1565 }
ba3a678d 1566
5c13a4db 1567 if(selTrack && isTOFok){
20baad42 1568 Double_t tofTime=pid->GetTOFsignal();
1569 AliTOFHeader* tofH=(AliTOFHeader*)aod->GetTOFHeader();
1570 if (tofH && (TMath::Abs(tofRes[0]) <= 1.E-16) ) { // new AOD
1571 // with new AOD we need to retrieve startTime, subtract it and retrieve correctly TOF PID resolutions *PA*
5c13a4db 1572 AliTOFPIDResponse tofResp=pidResp->GetTOFResponse();
20baad42 1573 Double_t startTime = tofResp.GetStartTime(track->P());
1574 Float_t startTimeRes = tofResp.GetStartTimeRes(track->P());
1575 Int_t startTimeMask = tofResp.GetStartTimeMask(track->P());
5c13a4db 1576 ((TH1F*)fOutputPID->FindObject("hTOFstartTimeDistrib"))->Fill(startTime);
20baad42 1577 ((TH1F*)fOutputPID->FindObject("hTOFstartTimeMask"))->Fill(startTimeMask);
1578 ((TH1F*)fOutputPID->FindObject("hTOFstartTimeRes"))->Fill(startTimeRes);
1579 tofTime-=startTime;
ea6f40e6 1580 for (Int_t type=0;type<AliPID::kSPECIES;type++) tofRes[type]=tofResp.GetExpectedSigma(track->P(),times[type],AliPID::ParticleMassZ(type));
20baad42 1581 }
5fc4893f 1582 ((TH1F*)fOutputPID->FindObject("hTOFtime"))->Fill(times[AliPID::kProton]);
20baad42 1583 ((TH2F*)fOutputPID->FindObject("hTOFtimeKaonHyptime"))->Fill(track->P(),tofTime-times[3]); //3 is kaon
1584 ((TH1F*)fOutputPID->FindObject("hTOFsig"))->Fill(tofTime);
5fc4893f 1585 if (pid->GetTOFsignal()< 0) ((TH1F*)fOutputPID->FindObject("hTOFsig"))->Fill(-1);
1586
4940d5bf 1587 Double_t nsigma[3]={-10,-10,-10};
5c13a4db 1588 nsigma[0]=pidResp->NumberOfSigmasTOF(track,AliPID::kPion);
1589 nsigma[1]=pidResp->NumberOfSigmasTOF(track,AliPID::kKaon);
1590 nsigma[2]=pidResp->NumberOfSigmasTOF(track,AliPID::kProton);
4940d5bf 1591
1592 ((TH2F*)fOutputPID->FindObject("hTOFsigmaKSigPid"))->Fill(track->P(),nsigma[1]);
1593 ((TH2F*)fOutputPID->FindObject("hTOFsigmaPionSigPid"))->Fill(track->P(),nsigma[0]);
1594 ((TH2F*)fOutputPID->FindObject("hTOFsigmaProtonSigPid"))->Fill(track->P(),nsigma[2]);
1595 if(fReadMC){
1596 Int_t label=track->GetLabel();
1597 if(label<=0) continue;
1598 AliMCParticle* mcpart=(AliMCParticle*)mcArray->At(label);
1599 if(mcpart){
1600 Int_t abspdgcode=TMath::Abs(mcpart->PdgCode());
1601 if(abspdgcode==211) ((TH2F*)fOutputPID->FindObject("hTOFsigmaMCPionSigPid"))->Fill(track->P(),nsigma[0]);
1602 if(abspdgcode==321) ((TH2F*)fOutputPID->FindObject("hTOFsigmaMCKSigPid"))->Fill(track->P(),nsigma[1]);
1603 if(abspdgcode==2212) ((TH2F*)fOutputPID->FindObject("hTOFsigmaMCProtonSigPid"))->Fill(track->P(),nsigma[2]);
24748c57 1604
24748c57 1605 }
4940d5bf 1606 }
24748c57 1607
4940d5bf 1608 for (Int_t iS=2; iS<5; iS++){ //we plot TOF Pid resolution for 3-sigma identified particles
1609 if ( TMath::Abs(nsigma[iS-2])<3.){
1610 switch (iS) {
1611 case AliPID::kPion:
1612 ((TH1F*)fOutputPID->FindObject("hTOFsigPid3sigPion"))->Fill(tofRes[iS]);
1613 break;
1614 case AliPID::kKaon:
1615 ((TH1F*)fOutputPID->FindObject("hTOFsigPid3sigKaon"))->Fill(tofRes[iS]);
1616 break;
1617 case AliPID::kProton:
1618 ((TH1F*)fOutputPID->FindObject("hTOFsigPid3sigProton"))->Fill(tofRes[iS]);
1619 break;
1620 default:
1621 break;
5fc4893f 1622 }
a4ef4383 1623 }
1624 }
5fc4893f 1625 }//if TOF status
4940d5bf 1626 //}
ba3a678d 1627
5fc4893f 1628 if(pidHF && pidHF->CheckStatus(track,"TPC")){
476db98d 1629
5fc4893f 1630 Double_t TPCp=pid->GetTPCmomentum();
1631 Double_t TPCsignal=pid->GetTPCsignal();
1632 ((TH1F*)fOutputPID->FindObject("hTPCsig"))->Fill(TPCsignal);
1633 ((TH1F*)fOutputPID->FindObject("hTPCsigvsp"))->Fill(TPCp,TPCsignal);
1634 //if (pidHF->IsKaonRaw(track, "TOF"))
4940d5bf 1635 Double_t nsigma[3]={-10,-10,-10};
1636 pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kPion,nsigma[0]);
1637 pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kKaon,nsigma[1]);
1638 pidHF->GetnSigmaTPC(track,(Int_t)AliPID::kProton,nsigma[2]);
24748c57 1639
4940d5bf 1640 ((TH2F*)fOutputPID->FindObject("hTPCsigmaK"))->Fill(TPCp,nsigma[1]);
1641
1642 ((TH2F*)fOutputPID->FindObject("hTPCsigmaPion"))->Fill(TPCp,nsigma[0]);
1643 ((TH2F*)fOutputPID->FindObject("hTPCsigmaProton"))->Fill(TPCp,nsigma[2]);
1644
24748c57 1645 if(fReadMC){
1646 Int_t label=track->GetLabel();
1647 if(label<=0) continue;
1648 AliMCParticle* mcpart=(AliMCParticle*)mcArray->At(label);
1649 if(mcpart){
1650 Int_t abspdgcode=TMath::Abs(mcpart->PdgCode());
1651 if(abspdgcode==211) ((TH2F*)fOutputPID->FindObject("hTPCsigmaMCPion"))->Fill(track->P(),nsigma[0]);
1652 if(abspdgcode==321) ((TH2F*)fOutputPID->FindObject("hTPCsigmaMCK"))->Fill(track->P(),nsigma[1]);
1653 if(abspdgcode==2212) ((TH2F*)fOutputPID->FindObject("hTPCsigmaMCProton"))->Fill(track->P(),nsigma[2]);
1654
1655 }
1656
1657 }
1658
1659
5fc4893f 1660 }//if TPC status
1661 } //end PID histograms
1662
1663 Int_t nclsTot=0,nclsSPD=0;
1664
1665 //check clusters of the tracks
1666 if(fOnOff[0]){
1667
bc6846db 1668 ((TH1F*)fOutputTrack->FindObject("hnLayerITS"))->Fill(-1);
5fc4893f 1669 for(Int_t l=0;l<6;l++) {
1670 if(TESTBIT(track->GetITSClusterMap(),l)) {
bc6846db 1671 ((TH1F*)fOutputTrack->FindObject("hnLayerITS"))->Fill(l);
5fc4893f 1672 nclsTot++; if(l<2) nclsSPD++;
1673 }
1674 }
1675 ((TH1F*)fOutputTrack->FindObject("hnClsITS"))->Fill(nclsTot);
1676 ((TH1F*)fOutputTrack->FindObject("hnClsSPD"))->Fill(nclsSPD);
5230fd6a 1677
8e4c6c96 1678 if(fFillDistrTrackEffChecks && track->GetStatus()&AliESDtrack::kITSrefit &&
1679 track->GetStatus()&AliESDtrack::kTPCrefit){
1680
1681 ((TH1F*)fOutputTrack->FindObject("hPtAllTracks"))->Fill(track->Pt());
1682 ((TH1F*)fOutputTrack->FindObject("hPhiAllTracks"))->Fill(track->Phi());
1683 ((TH1F*)fOutputTrack->FindObject("hEtaAllTracks"))->Fill(track->Eta());
1684 ((TH2F*)fOutputTrack->FindObject("hEtavsPhiAllTracks"))->Fill(track->Phi(),track->Eta());
1685 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPtAllTracks"))->Fill(track->Pt(),track->GetTPCNcls());
1686 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPhiAllTracks"))->Fill(track->Phi(),track->GetTPCNcls());
1687 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsEtaAllTracks"))->Fill(track->Eta(),track->GetTPCNcls());
7d690084 1688
1689 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPtAllTracks"))->Fill(track->Pt(),nCrossedRowsTPC);
1690 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPhiAllTracks"))->Fill(track->Phi(),nCrossedRowsTPC);
1691 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsEtaAllTracks"))->Fill(track->Eta(),nCrossedRowsTPC);
1692
8e4c6c96 1693 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPtAllTracks"))->Fill(track->Pt(),ratioCrossedRowsOverFindableClustersTPC);
1694 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPhiAllTracks"))->Fill(track->Phi(),ratioCrossedRowsOverFindableClustersTPC);
1695 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsEtaAllTracks"))->Fill(track->Eta(),ratioCrossedRowsOverFindableClustersTPC);
1696
1697 if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
1698 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(0);
1699 }
1700 if(track->HasPointOnITSLayer(0) && !(track->HasPointOnITSLayer(1))){ //kOnlyFirst
1701 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(1);
1702 }
1703 if(!(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1)){ //kOnlySecond
1704 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(2);
1705 }
1706 if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)){ //kBoth
1707 ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(3);
1708 }
1709 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPtAllTracks"))->Fill(track->Pt(), nclsTot);
1710 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPhiAllTracks"))->Fill(track->Phi(), nclsTot);
1711 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsEtaAllTracks"))->Fill(track->Eta(), nclsTot);
1712
1713 }
5230fd6a 1714
39dd297f 1715 if(track->Pt()>0.3 &&
1716 TMath::Abs(track->Eta())<0.8 &&
1717 track->GetStatus()&AliESDtrack::kITSrefit &&
1718 track->GetStatus()&AliESDtrack::kTPCrefit &&
1719 nclsSPD>0){
1720 ((TH1F*)fOutputTrack->FindObject("hnClsITSselTr"))->Fill(nclsTot);
1721 }
5fc4893f 1722 if(!(track->GetStatus()&AliESDtrack::kTPCin) && track->GetStatus()&AliESDtrack::kITSrefit && !(track->GetStatus()&AliESDtrack::kITSpureSA)){//tracks retrieved in the ITS and not reconstructed in the TPC
1723 ((TH1F*)fOutputTrack->FindObject("hnClsITS-SA"))->Fill(nclsTot);
bc6846db 1724 ((TH1F*)fOutputTrack->FindObject("hnLayerITS"))->Fill(-1);
1725 for(Int_t l=0;l<6;l++) {
1726 if(TESTBIT(track->GetITSClusterMap(),l)) {
1727 ((TH1F*)fOutputTrack->FindObject("hnLayerITSsa"))->Fill(l);
1728 }
1729 }
acc33385 1730 }
5fc4893f 1731 Int_t label=0;
1732 if(fReadMC){
1733 label=track->GetLabel();
1734 if (label<0)fNEntries->Fill(8);
1735 else fNEntries->Fill(9);
acc33385 1736 }
0dbb51a0 1737
5fc4893f 1738
824b448a 1739 if (track->Pt()>0.3 &&
1740 track->GetStatus()&AliESDtrack::kTPCrefit &&
1741 track->GetStatus()&AliESDtrack::kITSrefit &&
1742 /*nclsTot>3 &&*/
1743 nclsSPD>0) {//count good tracks
5fc4893f 1744
ba3a678d 1745
824b448a 1746 if(fReadMC && label<0) {
1747 ((TH1F*)fOutputTrack->FindObject("hptFakeTr"))->Fill(track->Pt());
1748 isFakeTrack++;
1749 } else {
1750 ((TH1F*)fOutputTrack->FindObject("hptGoodTr"))->Fill(track->Pt());
1751 isGoodTrack++;
ad42e35b 1752 }
824b448a 1753 }
1754 if(fCuts->IsDaughterSelected(track,&vESD,fCuts->GetTrackCuts())){
1755 isSelTrack++;
1756 }//select tracks for our analyses
818c1271 1757 } //fill track histos
5fc4893f 1758 } //end loop on tracks
0dbb51a0 1759
4940d5bf 1760 //fill once per event
5fc4893f 1761 if(fOnOff[0]){
1762 if (fReadMC) ((TH1F*)fOutputTrack->FindObject("hdistrFakeTr"))->Fill(isFakeTrack);
1763 ((TH1F*)fOutputTrack->FindObject("hdistrGoodTr"))->Fill(isGoodTrack);
824b448a 1764 ((TH1F*)fOutputTrack->FindObject("hdistrSelTr"))->Fill(isSelTrack);
5fc4893f 1765 }
0dbb51a0 1766
5fc4893f 1767 if(!isSimpleMode){
1768 // loop over candidates
1769 Int_t nCand = arrayProng->GetEntriesFast();
1770 Int_t ndaugh=3;
1771 if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpi) ndaugh=2;
1772 if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpipipi) ndaugh=4;
1773
1774 for (Int_t iCand = 0; iCand < nCand; iCand++) {
1775 AliAODRecoDecayHF *d = (AliAODRecoDecayHF*)arrayProng->UncheckedAt(iCand);
19f6b9ff 1776 if(fUseSelectionBit && d->GetSelectionMap()) {
5fc4893f 1777 if(fDecayChannel==AliAnalysisTaskSEHFQA::kD0toKpi && !d->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) continue; //skip the D0 from Dstar
1778 if(fDecayChannel==AliAnalysisTaskSEHFQA::kDplustoKpipi && !d->HasSelectionBit(AliRDHFCuts::kDplusCuts)) continue; //skip the 3 prong !D+
1779 }
acc33385 1780
5fc4893f 1781 if(fReadMC){
e7af8919 1782
1783 Int_t labD = -1;
1784 if (fDecayChannel==AliAnalysisTaskSEHFQA::kLambdactoV0 && (dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0()) {
1785
4b4ca79e 1786 Int_t pdgDgLctoV0bachelor[2]={2212,310};
e7af8919 1787 Int_t pdgDgV0toDaughters[2]={211,211};
4b4ca79e 1788 Int_t mcLabelK0S = (dynamic_cast<AliAODRecoCascadeHF*>(d))->MatchToMC(pdg,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,mcArray,kTRUE); // Lc->K0S+p and cc
1789 pdgDgLctoV0bachelor[1]=3122, pdgDgLctoV0bachelor[0]=211;
e7af8919 1790 pdgDgV0toDaughters[0]=2212, pdgDgV0toDaughters[1]=211;
4b4ca79e 1791 Int_t mcLabelLambda = (dynamic_cast<AliAODRecoCascadeHF*>(d))->MatchToMC(pdg,pdgDgLctoV0bachelor[1],pdgDgLctoV0bachelor,pdgDgV0toDaughters,mcArray,kTRUE); // Lc->Lambda+pi and cc
e7af8919 1792 if (mcLabelK0S!=-1 || mcLabelLambda!=-1) AliInfo(Form("mcLabelK0S=%d - mcLabelLambda=%d",mcLabelK0S,mcLabelLambda));
1793
1794 if (mcLabelK0S!=-1 && mcLabelLambda!=-1)
1795 AliInfo("Strange: current Lc->V0+bachelor candidate has two MC different labels!");
1796 else if (mcLabelK0S>-1 && mcLabelLambda==-1)
1797 labD = mcLabelK0S;
1798 else if (mcLabelLambda>-1 && mcLabelK0S==-1)
1799 labD = mcLabelLambda;
1800 }
1801 else
1802 labD = d->MatchToMC(pdg,mcArray,ndaugh,pdgdaughters);
1803
5fc4893f 1804 if(labD>=0){
1805 AliAODMCParticle *partD = (AliAODMCParticle*)mcArray->At(labD);
1806 Int_t label=partD->GetMother();
1807 AliAODMCParticle *mot = (AliAODMCParticle*)mcArray->At(label);
1808 while(label>=0){//get first mother
1809 mot = (AliAODMCParticle*)mcArray->At(label);
1810 label=mot->GetMother();
1811 }
24748c57 1812 if(mot){
1813 Int_t pdgMotCode = mot->GetPdgCode();
5fc4893f 1814
24748c57 1815 if(TMath::Abs(pdgMotCode)==4) fNEntries->Fill(6); //from primary charm
1816 if(TMath::Abs(pdgMotCode)==5) fNEntries->Fill(7); //from beauty
1817 }
acc33385 1818 }
5fc4893f 1819 }//end MC
1d654f7b 1820 fNEntries->Fill(5); //count the candidates (data and MC)
5fc4893f 1821
1822 for(Int_t id=0;id<ndaugh;id++){
5fc4893f 1823 //other histograms to be filled when the cut object is given
e7af8919 1824 AliAODTrack* track=0;
1825
1826 if (fDecayChannel==AliAnalysisTaskSEHFQA::kLambdactoV0 && (dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0()) {
1827 if (id==0)
1828 track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->GetBachelor();
1829 else if (id==1)
1830 track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0PositiveTrack();
1831 else if (id==2)
1832 track=(AliAODTrack*)(dynamic_cast<AliAODRecoCascadeHF*>(d))->Getv0NegativeTrack();
1833 }
1834 else
1835 track=(AliAODTrack*)d->GetDaughter(id);
5fc4893f 1836
1837 //track quality
1838
1839 if (fCuts->IsInFiducialAcceptance(d->Pt(),d->Y(pdg)) && fCuts->IsSelected(d,AliRDHFCuts::kTracks,aod)) {
1840
1841 Int_t label=0;
1842 if(fReadMC)label=track->GetLabel();
ad42e35b 1843 if(fOnOff[0]){
818c1271 1844
ad42e35b 1845 if(fReadMC && label<0) {
1846 isFakeTrack++;
824b448a 1847 ((TH1F*)fOutputTrack->FindObject("hptFakeTrFromDaugh"))->Fill(track->Pt());
5fc4893f 1848
ad42e35b 1849 ((TH1F*)fOutputTrack->FindObject("hd0f"))->Fill(d->Getd0Prong(id));
1850 } else {
824b448a 1851 ((TH1F*)fOutputTrack->FindObject("hptGoodTrFromDaugh"))->Fill(track->Pt());
ba3a678d 1852 ((TH1F*)fOutputTrack->FindObject("hd0dau"))->Fill(d->Getd0Prong(id));
4563d678 1853 Double_t d0rphiz[2],covd0[3];
1854 Bool_t isDCA=track->PropagateToDCA(aod->GetPrimaryVertex(),aod->GetMagneticField(),9999.,d0rphiz,covd0);
ba3a678d 1855 if(isDCA) ((TH1F*)fOutputTrack->FindObject("hd0zdau"))->Fill(d0rphiz[1]);
ad42e35b 1856 }
818c1271 1857 }
5fc4893f 1858 if (fCuts->IsSelected(d,AliRDHFCuts::kAll,aod) && fOnOff[1]){
1d654f7b 1859 fNEntries->Fill(3); //candidates passing analysis cuts
5230fd6a 1860
8e4c6c96 1861 if(fFillDistrTrackEffChecks){
1862 Int_t nITScls = 0;
1863 Int_t nSPDcls = 0;
1864 Double_t nTPCCrossedRows = track->GetTPCClusterInfo(2,1);
7d690084 1865 Double_t ratioCrossedRowsOverFcls = 1.0;
1866 if(track->GetTPCNclsF()>0){
1867 ratioCrossedRowsOverFcls = (nTPCCrossedRows)/(track->GetTPCNclsF());
1868 }
8e4c6c96 1869 for(Int_t l=0;l<6;l++) {
1870 if(TESTBIT(track->GetITSClusterMap(),l)) {
1871 nITScls++; if(l<2) nSPDcls++;
1872 }
1873 }
1874
1875 ((TH1F*)fOutputTrack->FindObject("hPtDaughters"))->Fill(track->Pt());
1876 ((TH1F*)fOutputTrack->FindObject("hPhiDaughters"))->Fill(track->Phi());
1877 ((TH1F*)fOutputTrack->FindObject("hEtaDaughters"))->Fill(track->Eta());
1878 ((TH2F*)fOutputTrack->FindObject("hEtavsPhiDaughters"))->Fill(track->Phi(),track->Eta());
1879
1880 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPtDaughters"))->Fill(track->Pt(),track->GetTPCNcls());
1881 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPhiDaughters"))->Fill(track->Phi(),track->GetTPCNcls());
1882 ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsEtaDaughters"))->Fill(track->Eta(),track->GetTPCNcls());
7d690084 1883
1884 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPtDaughters"))->Fill(track->Pt(),nTPCCrossedRows);
1885 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPhiDaughters"))->Fill(track->Phi(),nTPCCrossedRows);
1886 ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsEtaDaughters"))->Fill(track->Eta(),nTPCCrossedRows);
8e4c6c96 1887
1888 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPtDaughters"))->Fill(track->Pt(),ratioCrossedRowsOverFcls);
1889 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPhiDaughters"))->Fill(track->Phi(),ratioCrossedRowsOverFcls);
1890 ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsEtaDaughters"))->Fill(track->Eta(),ratioCrossedRowsOverFcls);
1891
1892 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPtDaughters"))->Fill(track->Pt(), nITScls);
1893 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPhiDaughters"))->Fill(track->Phi(), nITScls);
1894 ((TH2F*)fOutputTrack->FindObject("hNITSclsvsEtaDaughters"))->Fill(track->Eta(), nITScls);
1895 if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
1896 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(0);
1897 }
1898 if(track->HasPointOnITSLayer(0) && !(track->HasPointOnITSLayer(1))){ //kOnlyFirst
1899 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(1);
1900 }
1901 if(!(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1)){ //kOnlySecond
1902 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(2);
1903 }
1904 if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)){ //kBoth
1905 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(3);
1906 }
1907 }
1908
5230fd6a 1909
1910 AliAODPid *pid = track->GetDetPid();
138e0d89 1911 if(pid){
1912 Double_t times[5];
1913 pid->GetIntegratedTimes(times);
20baad42 1914 if(pidHF && pidHF->CheckStatus(track,"TOF")){
1915 Double_t tofTime=pid->GetTOFsignal();
1916 AliTOFHeader* tofH=(AliTOFHeader*)aod->GetTOFHeader();
1917 Double_t tofRes[AliPID::kSPECIES];
1918 pid->GetTOFpidResolution(tofRes);
1919 if (tofH && (TMath::Abs(tofRes[0]) <= 1.E-16) ) { // new AOD
1920 AliTOFPIDResponse tofResp=pidHF->GetPidResponse()->GetTOFResponse();
1921 Double_t startTime=tofResp.GetStartTime(track->P());
1922 tofTime-=startTime;
1923 }
1924 ((TH2F*)fOutputPID->FindObject("hTOFtimeKaonHyptimeAC"))->Fill(track->P(),tofTime-times[AliPID::kKaon]);
1925 }
138e0d89 1926 if(pidHF && pidHF->CheckStatus(track,"TPC")) ((TH2F*)fOutputPID->FindObject("hTPCsigvspAC"))->Fill(pid->GetTPCmomentum(),pid->GetTPCsignal());
1927 }
1d654f7b 1928
5fc4893f 1929 } //end analysis cuts
1930 } //end acceptance and track cuts
1931 } //end loop on tracks in the candidate
1932 } //end loop on candidates
824b448a 1933
5fc4893f 1934 }
1935 } //end if on pid or track histograms
fb9311e8 1936
476db98d 1937 delete tpcres;
fb9311e8 1938 delete [] pdgdaughters;
a4ef4383 1939 PostData(1,fNEntries);
5fc4893f 1940 if(fOnOff[1]) PostData(2,fOutputPID);
1941 if(fOnOff[0]) PostData(3,fOutputTrack);
a4ef4383 1942 PostData(4,fCuts);
5fc4893f 1943 if(fOnOff[2]) PostData(5,fOutputCounters);
1944 //Post data 6 done in case of centrality on
82f89d0d 1945
0dbb51a0 1946}
1947
d48d81b5 1948//____________________________________________________________________________
1949void AliAnalysisTaskSEHFQA::FillFlowObs(AliAODEvent *aod){
1950 //fills the flow observables
65274ad6 1951 Double_t cc;
1952 cc = fCuts->GetCentrality(aod);
1953 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(0., cc);
d48d81b5 1954
1955 UInt_t mask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1956 UInt_t trigger=AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral;
d48d81b5 1957 if(mask & trigger) {
65274ad6 1958 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(1.,cc); // fired
1959 if (mask & AliVEvent::kMB) ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(2.,cc);
1960 if (mask & AliVEvent::kCentral) ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(3.,cc);
1961 if (mask & AliVEvent::kSemiCentral) ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(4.,cc);
d48d81b5 1962 Bool_t rejected=false;
d48d81b5 1963 if(cc<0 || cc>60) rejected=true;
1964 const AliVVertex *vertex = aod->GetPrimaryVertex();
1965 Double_t zvtx=vertex->GetZ();
65274ad6 1966 if(TMath::Abs(zvtx)>fCuts->GetMaxVtxZ()) rejected=true;
d48d81b5 1967 if(rejected) return; //not interesting for flow QA
1968 } else {
1969 return;
1970 }
1971
1972 // event accepted
65274ad6 1973 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(5.,cc);
d48d81b5 1974 fRFPcuts->SetParamType(AliFlowTrackCuts::kGlobal);
1975 fRFPcuts->SetPtRange(0.2,5.);
1976 fRFPcuts->SetEtaRange(-0.8,0.8);
1977 fRFPcuts->SetMinNClustersTPC(70);
1978 fRFPcuts->SetMinChi2PerClusterTPC(0.2);
1979 fRFPcuts->SetMaxChi2PerClusterTPC(4.0);
1980 fRFPcuts->SetAcceptKinkDaughters(kFALSE);
1981 fRFPcuts->SetEvent(aod);
1982
1983 TString ref[3] = {"FB1","FB128","VZE"};
1984 Double_t psi[3];
1985 for(Int_t i=0; i!=3; ++i) {
1986 if(i==0) { // switching to bit 1
1987 fRFPcuts->SetMinimalTPCdedx(10.);
1988 fRFPcuts->SetAODfilterBit(1);
1989 } else { // switching to bit 128
1990 fRFPcuts->SetMinimalTPCdedx(-1);
1991 fRFPcuts->SetAODfilterBit(128);
1992 }
1993 if(i>1) {
1994 fRFPcuts->SetParamType(AliFlowTrackCuts::kV0);
1995 fRFPcuts->SetEtaRange(-5,+5);
1996 fRFPcuts->SetPhiMin(0);
1997 fRFPcuts->SetPhiMax(TMath::TwoPi());
1998 }
1999 fFlowEvent->Fill(fRFPcuts,fRFPcuts);
2000 fFlowEvent->TagSubeventsInEta(-5,0,0,+5);
65274ad6 2001 // getting informationt
d48d81b5 2002 AliFlowVector vQ, vQaQb[2];
2003 fFlowEvent->Get2Qsub(vQaQb,2);
2004 vQ = vQaQb[0]+vQaQb[1];
2005 Double_t dMa=vQaQb[0].GetMult();
2006 Double_t dMb=vQaQb[1].GetMult();
2007 if( dMa<2 || dMb<2 ) {
65274ad6 2008 ((TH2F*) fOutputFlowObs->FindObject("hFlowEvents"))->Fill(6.,cc); //???
d48d81b5 2009 continue;
2010 }
2011 psi[i] = vQ.Phi()/2;
2012 // publishing
2013 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(0,cc,vQaQb[0].X()/dMa,dMa); // Qx-
2014 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(1,cc,vQaQb[0].Y()/dMa,dMa); // Qy-
2015 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(2,cc,vQaQb[1].X()/dMb,dMb); // Qx+
2016 ((TProfile2D*) fOutputFlowObs->FindObject( Form("h%s_Q",ref[i].Data())))->Fill(3,cc,vQaQb[1].Y()/dMb,dMb); // Qy+
2017 ((TH2F*) fOutputFlowObs->FindObject( Form("h%s_AngleQ",ref[i].Data()) ))->Fill(psi[i],cc); // Psi
2018 AliFlowTrackSimple *track;
2019 for(Int_t t=0; t!=fFlowEvent->NumberOfTracks(); ++t) {
2020 track = (AliFlowTrackSimple*) fFlowEvent->GetTrack(t);
2021 if(!track) continue;
2022 if(!track->InRPSelection()) continue;
2023 ((TH3F*) fOutputFlowObs->FindObject( Form("h%s_PhiEta",ref[i].Data()) ))->Fill(track->Phi(),track->Eta(),cc,track->Weight()); //PhiEta
2024 }
65274ad6 2025
2026 //histo filled only for TPCFB1
2027 if (i==0) {
2028 ((TH2F*) fOutputFlowObs->FindObject("hCentVsMultRPS"))->Fill(fFlowEvent->GetNumberOfRPs(),cc);
2029 }
d48d81b5 2030 }
2031 // TPC vs VZERO
2032 ((TH3F*) fOutputFlowObs->FindObject( "hTPCVZE_AngleQ" ))->Fill(psi[0],psi[2],cc);
2033}
2034
a4ef4383 2035//____________________________________________________________________________
0dbb51a0 2036void AliAnalysisTaskSEHFQA::Terminate(Option_t */*option*/){
2037 //terminate analysis
2038
2039 fNEntries = dynamic_cast<TH1F*>(GetOutputData(1));
2040 if(!fNEntries){
2041 printf("ERROR: %s not available\n",GetOutputSlot(1)->GetContainer()->GetName());
2042 return;
2043 }
2044
2045 fOutputPID = dynamic_cast<TList*> (GetOutputData(2));
5fc4893f 2046 if (!fOutputPID && fOnOff[1]) {
0dbb51a0 2047 printf("ERROR: %s not available\n",GetOutputSlot(2)->GetContainer()->GetName());
2048 return;
2049 }
2050
2051 fOutputTrack = dynamic_cast<TList*> (GetOutputData(3));
5fc4893f 2052 if (!fOutputTrack && fOnOff[0]) {
0dbb51a0 2053 printf("ERROR: %s not available\n",GetOutputSlot(3)->GetContainer()->GetName());
2054 return;
2055 }
2056
2057}
2058