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