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