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