AliPhysics  master (3d17d9d)
AliAnalysisTaskSEImproveITSCVMFS.cxx
Go to the documentation of this file.
1 /*************************************************************************
2 * Copyright(c) 1998-2011, 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 
16 #include <TObjArray.h>
17 #include <TClonesArray.h>
18 #include <TGraph.h>
19 #include <TFile.h>
20 #include <TList.h>
21 #include <TNtuple.h>
22 
23 #include "AliVertex.h"
24 #include "AliVVertex.h"
25 #include "AliVEventHandler.h"
26 #include "AliESDVertex.h"
27 #include "AliESDEvent.h"
28 #include "AliVertexerTracks.h"
29 #include "AliAODEvent.h"
30 #include "AliAODTrack.h"
31 #include "AliMCEvent.h"
32 #include "AliAODMCParticle.h"
33 #include "AliExternalTrackParam.h"
36 #include "AliAODRecoCascadeHF.h"
37 #include "AliAODMCHeader.h"
38 #include "AliAnalysisVertexingHF.h"
39 #include "AliNeutralTrackParam.h"
41 #include "AliDataFile.h"
42 #include "AliAnalysisManager.h"
43 #include "AliVertexingHFUtils.h"
44 
45 //
46 // Implementation of the "hybrid-approach" for ITS upgrade studies.
47 // The tastk smears the track parameters according to estimations
48 // from single-track upgrade studies. Afterwards it recalculates
49 // the parameters of the reconstructed decays.
50 //
51 // WARNING: This will affect all tasks in a train after this one
52 // (which is typically desired, though).
53 //
54 
57  fD0ZResPCur (0),
58  fD0ZResKCur (0),
59  fD0ZResPiCur (0),
60  fD0ZResECur (0),
61  fD0RPResPCur (0),
62  fD0RPResKCur (0),
63  fD0RPResPiCur(0),
64  fD0RPResECur(0),
65  fD0RPSigmaPullRatioP(0),
66  fD0RPSigmaPullRatioK(0),
67  fD0RPSigmaPullRatioPi(0),
68  fD0RPSigmaPullRatioE(0),
69  fPt1ResPCur (0),
70  fPt1ResKCur (0),
71  fPt1ResPiCur (0),
72  fPt1ResECur (0),
73  fD0ZResPUpg (0),
74  fD0ZResKUpg (0),
75  fD0ZResPiUpg (0),
76  fD0ZResEUpg (0),
77  fD0RPResPUpg (0),
78  fD0RPResKUpg (0),
79  fD0RPResPiUpg(0),
80  fD0RPResEUpg(0),
81  fPt1ResPUpg (0),
82  fPt1ResKUpg (0),
83  fPt1ResPiUpg (0),
84  fPt1ResEUpg (0),
85  fD0ZResPCurSA (0),
86  fD0ZResKCurSA (0),
87  fD0ZResPiCurSA (0),
88  fD0ZResECurSA (0),
89  fD0RPResPCurSA (0),
90  fD0RPResKCurSA (0),
91  fD0RPResPiCurSA(0),
92  fD0RPResECurSA(0),
93  fPt1ResPCurSA (0),
94  fPt1ResKCurSA (0),
95  fPt1ResPiCurSA (0),
96  fPt1ResECurSA (0),
97  fD0ZResPUpgSA (0),
98  fD0ZResKUpgSA (0),
99  fD0ZResPiUpgSA (0),
100  fD0ZResEUpgSA (0),
101  fD0RPResPUpgSA (0),
102  fD0RPResKUpgSA (0),
103  fD0RPResPiUpgSA(0),
104  fD0RPResEUpgSA(0),
105  fPt1ResPUpgSA (0),
106  fPt1ResKUpgSA (0),
107  fPt1ResPiUpgSA (0),
108  fPt1ResEUpgSA (0),
109  // specific stuff for PbPb 2018
110  fIsPbPb2018(kFALSE)
111  // kFirst
112  ,fD0ZResPCur_PbPb2018_kFirst(0)
113  ,fD0ZResKCur_PbPb2018_kFirst(0)
114  ,fD0ZResPiCur_PbPb2018_kFirst(0)
115  ,fD0ZResECur_PbPb2018_kFirst(0)
116  ,fD0RPResPCur_PbPb2018_kFirst(0)
117  ,fD0RPResKCur_PbPb2018_kFirst(0)
118  ,fD0RPResPiCur_PbPb2018_kFirst(0)
119  ,fD0RPResECur_PbPb2018_kFirst(0)
120  ,fD0RPSigmaPullRatioP_PbPb2018_kFirst(0)
121  ,fD0RPSigmaPullRatioK_PbPb2018_kFirst(0)
122  ,fD0RPSigmaPullRatioPi_PbPb2018_kFirst(0)
123  ,fD0RPSigmaPullRatioE_PbPb2018_kFirst(0)
124  ,fPt1ResPCur_PbPb2018_kFirst(0)
125  ,fPt1ResKCur_PbPb2018_kFirst(0)
126  ,fPt1ResPiCur_PbPb2018_kFirst(0)
127  ,fPt1ResECur_PbPb2018_kFirst(0)
128  ,fD0ZResPUpg_PbPb2018_kFirst(0)
129  ,fD0ZResKUpg_PbPb2018_kFirst(0)
130  ,fD0ZResPiUpg_PbPb2018_kFirst(0)
131  ,fD0ZResEUpg_PbPb2018_kFirst(0)
132  ,fD0RPResPUpg_PbPb2018_kFirst(0)
133  ,fD0RPResKUpg_PbPb2018_kFirst(0)
134  ,fD0RPResPiUpg_PbPb2018_kFirst(0)
135  ,fD0RPResEUpg_PbPb2018_kFirst(0)
136  ,fPt1ResPUpg_PbPb2018_kFirst(0)
137  ,fPt1ResKUpg_PbPb2018_kFirst(0)
138  ,fPt1ResPiUpg_PbPb2018_kFirst(0)
139  ,fPt1ResEUpg_PbPb2018_kFirst(0)
140  ,fD0ZResPCurSA_PbPb2018_kFirst(0)
141  ,fD0ZResKCurSA_PbPb2018_kFirst(0)
142  ,fD0ZResPiCurSA_PbPb2018_kFirst(0)
143  ,fD0ZResECurSA_PbPb2018_kFirst(0)
144  ,fD0RPResPCurSA_PbPb2018_kFirst(0)
145  ,fD0RPResKCurSA_PbPb2018_kFirst(0)
146  ,fD0RPResPiCurSA_PbPb2018_kFirst(0)
147  ,fD0RPResECurSA_PbPb2018_kFirst(0)
148  ,fPt1ResPCurSA_PbPb2018_kFirst(0)
149  ,fPt1ResKCurSA_PbPb2018_kFirst(0)
150  ,fPt1ResPiCurSA_PbPb2018_kFirst(0)
151  ,fPt1ResECurSA_PbPb2018_kFirst(0)
152  ,fD0ZResPUpgSA_PbPb2018_kFirst(0)
153  ,fD0ZResKUpgSA_PbPb2018_kFirst(0)
154  ,fD0ZResPiUpgSA_PbPb2018_kFirst(0)
155  ,fD0ZResEUpgSA_PbPb2018_kFirst(0)
156  ,fD0RPResPUpgSA_PbPb2018_kFirst(0)
157  ,fD0RPResKUpgSA_PbPb2018_kFirst(0)
158  ,fD0RPResPiUpgSA_PbPb2018_kFirst(0)
159  ,fD0RPResEUpgSA_PbPb2018_kFirst(0)
160  ,fPt1ResPUpgSA_PbPb2018_kFirst(0)
161  ,fPt1ResKUpgSA_PbPb2018_kFirst(0)
162  ,fPt1ResPiUpgSA_PbPb2018_kFirst(0)
163  ,fPt1ResEUpgSA_PbPb2018_kFirst(0)
164  // kOnlySecond
165  ,fD0ZResPCur_PbPb2018_kOnlySecond(0)
166  ,fD0ZResKCur_PbPb2018_kOnlySecond(0)
167  ,fD0ZResPiCur_PbPb2018_kOnlySecond(0)
168  ,fD0ZResECur_PbPb2018_kOnlySecond(0)
169  ,fD0RPResPCur_PbPb2018_kOnlySecond(0)
170  ,fD0RPResKCur_PbPb2018_kOnlySecond(0)
171  ,fD0RPResPiCur_PbPb2018_kOnlySecond(0)
172  ,fD0RPResECur_PbPb2018_kOnlySecond(0)
173  ,fD0RPSigmaPullRatioP_PbPb2018_kOnlySecond(0)
174  ,fD0RPSigmaPullRatioK_PbPb2018_kOnlySecond(0)
175  ,fD0RPSigmaPullRatioPi_PbPb2018_kOnlySecond(0)
176  ,fD0RPSigmaPullRatioE_PbPb2018_kOnlySecond(0)
177  ,fPt1ResPCur_PbPb2018_kOnlySecond(0)
178  ,fPt1ResKCur_PbPb2018_kOnlySecond(0)
179  ,fPt1ResPiCur_PbPb2018_kOnlySecond(0)
180  ,fPt1ResECur_PbPb2018_kOnlySecond(0)
181  ,fD0ZResPUpg_PbPb2018_kOnlySecond(0)
182  ,fD0ZResKUpg_PbPb2018_kOnlySecond(0)
183  ,fD0ZResPiUpg_PbPb2018_kOnlySecond(0)
184  ,fD0ZResEUpg_PbPb2018_kOnlySecond(0)
185  ,fD0RPResPUpg_PbPb2018_kOnlySecond(0)
186  ,fD0RPResKUpg_PbPb2018_kOnlySecond(0)
187  ,fD0RPResPiUpg_PbPb2018_kOnlySecond(0)
188  ,fD0RPResEUpg_PbPb2018_kOnlySecond(0)
189  ,fPt1ResPUpg_PbPb2018_kOnlySecond(0)
190  ,fPt1ResKUpg_PbPb2018_kOnlySecond(0)
191  ,fPt1ResPiUpg_PbPb2018_kOnlySecond(0)
192  ,fPt1ResEUpg_PbPb2018_kOnlySecond(0)
193  ,fD0ZResPCurSA_PbPb2018_kOnlySecond(0)
194  ,fD0ZResKCurSA_PbPb2018_kOnlySecond(0)
195  ,fD0ZResPiCurSA_PbPb2018_kOnlySecond(0)
196  ,fD0ZResECurSA_PbPb2018_kOnlySecond(0)
197  ,fD0RPResPCurSA_PbPb2018_kOnlySecond(0)
198  ,fD0RPResKCurSA_PbPb2018_kOnlySecond(0)
199  ,fD0RPResPiCurSA_PbPb2018_kOnlySecond(0)
200  ,fD0RPResECurSA_PbPb2018_kOnlySecond(0)
201  ,fPt1ResPCurSA_PbPb2018_kOnlySecond(0)
202  ,fPt1ResKCurSA_PbPb2018_kOnlySecond(0)
203  ,fPt1ResPiCurSA_PbPb2018_kOnlySecond(0)
204  ,fPt1ResECurSA_PbPb2018_kOnlySecond(0)
205  ,fD0ZResPUpgSA_PbPb2018_kOnlySecond(0)
206  ,fD0ZResKUpgSA_PbPb2018_kOnlySecond(0)
207  ,fD0ZResPiUpgSA_PbPb2018_kOnlySecond(0)
208  ,fD0ZResEUpgSA_PbPb2018_kOnlySecond(0)
209  ,fD0RPResPUpgSA_PbPb2018_kOnlySecond(0)
210  ,fD0RPResKUpgSA_PbPb2018_kOnlySecond(0)
211  ,fD0RPResPiUpgSA_PbPb2018_kOnlySecond(0)
212  ,fD0RPResEUpgSA_PbPb2018_kOnlySecond(0)
213  ,fPt1ResPUpgSA_PbPb2018_kOnlySecond(0)
214  ,fPt1ResKUpgSA_PbPb2018_kOnlySecond(0)
215  ,fPt1ResPiUpgSA_PbPb2018_kOnlySecond(0)
216  ,fPt1ResEUpgSA_PbPb2018_kOnlySecond(0),
217  fRunInVertexing(kFALSE),
218  fImproveTracks(kTRUE),
219  fUpdateSecVertCovMat(kTRUE),
220  fUpdateSTCovMatrix(kTRUE),
221  fUpdatePulls(kTRUE),
222  fMimicData(kFALSE),
223  fIsAOD (kTRUE),
224  fSmearOnlySignal(kFALSE),
225  fMCs (0),
226  fDebugOutput (0),
227  fDebugNtuple (0),
228  fDebugVars (0),
229  fNDebug (0),
230  fImproverSuffix(0),
231  fOverridePeriodName(0),
232  fFilesOpen(kFALSE)
233 {
234  //
235  // Default constructor.
236  for(Int_t jh=0; jh<2; jh++){
237  // templates of mean (original)
238  for(Int_t ih=0; ih<4; ih++){
239  fD0RPMeanPCur[jh][ih]=0x0;
240  fD0RPMeanKCur[jh][ih]=0x0;
241  fD0RPMeanPiCur[jh][ih]=0x0;
242  fD0RPMeanECur[jh][ih]=0x0;
243  fD0RPMeanPUpg[jh][ih]=0x0;
244  fD0RPMeanKUpg[jh][ih]=0x0;
245  fD0RPMeanPiUpg[jh][ih]=0x0;
246  fD0RPMeanEUpg[jh][ih]=0x0;
247  }
248  // templates of mean for Pb-Pb 2018
249  for(UInt_t ih = 0; ih < 24; ih++)
250  {
251  fD0RPMeanPCur_PbPb2018_kFirst[jh][ih]=0x0;
252  fD0RPMeanKCur_PbPb2018_kFirst[jh][ih]=0x0;
253  fD0RPMeanPiCur_PbPb2018_kFirst[jh][ih]=0x0;
254  fD0RPMeanECur_PbPb2018_kFirst[jh][ih]=0x0;
255  fD0RPMeanPUpg_PbPb2018_kFirst[jh][ih]=0x0;
256  fD0RPMeanKUpg_PbPb2018_kFirst[jh][ih]=0x0;
257  fD0RPMeanPiUpg_PbPb2018_kFirst[jh][ih]=0x0;
258  fD0RPMeanEUpg_PbPb2018_kFirst[jh][ih]=0x0;
267  }
268 
269  }
270  //
271 }
272 
274  const char *period,
275  const char *systematic,
276  Bool_t isRunInVertexing,
277  Int_t ndebug)
278  :AliAnalysisTaskSE(name),
279  fD0ZResPCur (0),
280  fD0ZResKCur (0),
281  fD0ZResPiCur (0),
282  fD0ZResECur (0),
283  fD0RPResPCur (0),
284  fD0RPResKCur (0),
285  fD0RPResPiCur(0),
286  fD0RPResECur(0),
291  fPt1ResPCur (0),
292  fPt1ResKCur (0),
293  fPt1ResPiCur (0),
294  fPt1ResECur (0),
295  fD0ZResPUpg (0),
296  fD0ZResKUpg (0),
297  fD0ZResPiUpg (0),
298  fD0ZResEUpg (0),
299  fD0RPResPUpg (0),
300  fD0RPResKUpg (0),
301  fD0RPResPiUpg(0),
302  fD0RPResEUpg(0),
303  fPt1ResPUpg (0),
304  fPt1ResKUpg (0),
305  fPt1ResPiUpg (0),
306  fPt1ResEUpg (0),
307  fD0ZResPCurSA (0),
308  fD0ZResKCurSA (0),
309  fD0ZResPiCurSA (0),
310  fD0ZResECurSA (0),
311  fD0RPResPCurSA (0),
312  fD0RPResKCurSA (0),
313  fD0RPResPiCurSA(0),
314  fD0RPResECurSA(0),
315  fPt1ResPCurSA (0),
316  fPt1ResKCurSA (0),
317  fPt1ResPiCurSA (0),
318  fPt1ResECurSA (0),
319  fD0ZResPUpgSA (0),
320  fD0ZResKUpgSA (0),
321  fD0ZResPiUpgSA (0),
322  fD0ZResEUpgSA (0),
323  fD0RPResPUpgSA (0),
324  fD0RPResKUpgSA (0),
325  fD0RPResPiUpgSA(0),
326  fD0RPResEUpgSA(0),
327  fPt1ResPUpgSA (0),
328  fPt1ResKUpgSA (0),
329  fPt1ResPiUpgSA (0),
330  fPt1ResEUpgSA (0),
331  // specific stuff for PbPb 2018
332  fIsPbPb2018(kFALSE)
333  // kFirst
386  // kOnlySecond
439  fRunInVertexing(isRunInVertexing),
440  fImproveTracks(kTRUE),
441  fUpdateSecVertCovMat(kTRUE),
442  fUpdateSTCovMatrix(kTRUE),
443  fUpdatePulls(kTRUE),
444  fMimicData(kFALSE),
445  fIsAOD (kTRUE),
446  fSmearOnlySignal(kFALSE),
447  fMCs (0),
448  fDebugOutput (0),
449  fDebugNtuple (0),
450  fDebugVars (0),
451  fNDebug (ndebug),
452  fImproverSuffix(0),
454  fFilesOpen(kFALSE)
455 {
456  //
457  // Constructor to be used to create the task.
458  // The the URIs specify the resolution files to be used.
459  // They are expected to contain TGraphs with the resolutions
460  // for the current and the upgraded ITS (see code for details).
461  // One may also specify for how many tracks debug information
462  // is written to the output.
463  //
464  fImproverSuffix = systematic;
465  fOverridePeriodName = period;
466 
467  for(Int_t jh=0; jh<2; jh++){
468  // templates of mean (original)
469  for(Int_t ih=0; ih<4; ih++){
470  fD0RPMeanPCur[jh][ih]=0x0;
471  fD0RPMeanKCur[jh][ih]=0x0;
472  fD0RPMeanPiCur[jh][ih]=0x0;
473  fD0RPMeanECur[jh][ih]=0x0;
474  fD0RPMeanPUpg[jh][ih]=0x0;
475  fD0RPMeanKUpg[jh][ih]=0x0;
476  fD0RPMeanPiUpg[jh][ih]=0x0;
477  fD0RPMeanEUpg[jh][ih]=0x0;
478  }
479  // templates of mean for Pb-Pb 2018
480  for(UInt_t ih = 0; ih < 24; ih++)
481  {
482  fD0RPMeanPCur_PbPb2018_kFirst[jh][ih]=0x0;
483  fD0RPMeanKCur_PbPb2018_kFirst[jh][ih]=0x0;
484  fD0RPMeanPiCur_PbPb2018_kFirst[jh][ih]=0x0;
485  fD0RPMeanECur_PbPb2018_kFirst[jh][ih]=0x0;
486  fD0RPMeanPUpg_PbPb2018_kFirst[jh][ih]=0x0;
487  fD0RPMeanKUpg_PbPb2018_kFirst[jh][ih]=0x0;
488  fD0RPMeanPiUpg_PbPb2018_kFirst[jh][ih]=0x0;
489  fD0RPMeanEUpg_PbPb2018_kFirst[jh][ih]=0x0;
498  }
499  }
500 
501 
502  DefineOutput(1,TList::Class());
503 }
504 
506  //
507  // Destructor.
508  //
509  if (fDebugOutput) delete fDebugOutput;
510 }
511 
513  //
514  // Creation of user output objects.
515  //
516  fDebugOutput=new TList();
517  fDebugOutput->SetOwner();
518  fDebugOutput->SetName("debug");
519  fDebugNtuple=new TNtuple("fDebugNtuple","Smearing","pdg:ptmc:d0rpo:d0zo:pt1o:sd0rpo:sd0zo:spt1o:d0rpn:d0zn:pt1n:sd0rpn:sd0zn:spt1n:d0rpmc:d0zmc:pt1mc:pullcorr:d0zoinsigma:d0zninsigma:d0rpoinsigma:d0rpninsigma");
520  fDebugVars=new Float_t[fDebugNtuple->GetNvar()];
521 
522  fDebugOutput->Add(fDebugNtuple );
523 
532  for(Int_t j=0; j<2; j++){
533  for(Int_t i=0; i<4; i++){
534  if(fD0RPMeanPCur[j][i]) fDebugOutput->Add(fD0RPMeanPCur[j][i]);
535  if(fD0RPMeanKCur[j][i]) fDebugOutput->Add(fD0RPMeanKCur[j][i]);
536  if(fD0RPMeanPiCur[j][i]) fDebugOutput->Add(fD0RPMeanPiCur[j][i]);
537  if(fD0RPMeanECur[j][i]) fDebugOutput->Add(fD0RPMeanECur[j][i]);
538  if(fD0RPMeanPUpg[j][i]) fDebugOutput->Add(fD0RPMeanPUpg[j][i]);
539  if(fD0RPMeanKUpg[j][i]) fDebugOutput->Add(fD0RPMeanKUpg[j][i]);
540  if(fD0RPMeanPiUpg[j][i]) fDebugOutput->Add(fD0RPMeanPiUpg[j][i]);
541  if(fD0RPMeanEUpg[j][i]) fDebugOutput->Add(fD0RPMeanEUpg[j][i]);
542  }
543  }
564 
565  // stuff for PbPb 2018 periods
566  // Cur
583  for(UInt_t j = 0; j < 2; j++){
584  for(Int_t i=0; i<24; i++){
593  }
594  }
635  // New
644  for(UInt_t j = 0; j < 2; j++){
645  for(Int_t i=0; i<24; i++){
654  }
655  }
696 
697 
698  PostData(1,fDebugOutput);
699 }
700 
702  //
703  // The event loop
704  //
705  AliAODEvent *ev=0x0;
706  AliESDEvent *evesd=0x0;
707  Double_t bz=0.;
708 
709  if(fIsAOD) {
710  if(!fRunInVertexing) {
711  ev=dynamic_cast<AliAODEvent*>(InputEvent());
712  } else {
713  if(AODEvent() && IsStandardAOD()) ev = dynamic_cast<AliAODEvent*> (AODEvent());
714  }
715  if(!ev) return;
716  bz=ev->GetMagneticField();
717  if (!fFilesOpen) { // check (run-once) that files have been opened
718  OpenImproverHistos(ev);
719  if (!fFilesOpen) AliFatal("Error in opening improver files !");
720  }
721  }
722  else {
723  evesd = dynamic_cast<AliESDEvent*>(InputEvent());
724  if (!evesd) {
725  AliError("event not found. Nothing done!");
726  return;
727  }
728  bz=evesd->GetMagneticField();
729  if (!fFilesOpen) { // check (run-once) that files have been opened
730  OpenImproverHistos(evesd);
731  if (!fFilesOpen) AliFatal("Error in opening improver files !");
732  }
733  }
734 
735  if(fIsAOD) {
736 
737  fMCs=static_cast<TClonesArray*>(ev->GetList()->FindObject(AliAODMCParticle::StdBranchName()));
738  AliAODMCHeader *mcHeader = (AliAODMCHeader*)ev->GetList()->FindObject(AliAODMCHeader::StdBranchName());
739  if (!fMCs || !mcHeader) return;
740 
741  // first loop on candidates to fill them in case of reduced AODs
742  // this is done to have the same behaviour of the improver with full (pp, p-Pb) and recuced (Pb-Pb) candidates
744 
745  // D0->Kpi
746  TClonesArray *array2Prong=static_cast<TClonesArray*>(ev->GetList()->FindObject("D0toKpi"));
747  if (array2Prong) {
748  for (Int_t icand=0;icand<array2Prong->GetEntriesFast();++icand) {
749  AliAODRecoDecayHF2Prong *decay=static_cast<AliAODRecoDecayHF2Prong*>(array2Prong->At(icand));
750  vHF->GetProng(ev,decay,0); // needed to fill fAODMap in AliAnalysisVertexingHF
751  if(fSmearOnlySignal && AliVertexingHFUtils::IsCandidateInjected(decay,ev,mcHeader,fMCs)==kFALSE) continue;
752  vHF->FillRecoCand(ev,(AliAODRecoDecayHF2Prong*)decay);
753  }
754  }
755  // Dstar->Kpipi
756  TClonesArray *arrayCascade=static_cast<TClonesArray*>(ev->GetList()->FindObject("Dstar"));
757  if (arrayCascade) {
758  for (Int_t icand=0;icand<arrayCascade->GetEntriesFast();++icand) {
759  AliAODRecoCascadeHF *decayDstar=static_cast<AliAODRecoCascadeHF*>(arrayCascade->At(icand));
760  vHF->GetProng(ev,decayDstar,0); // needed to fill fAODMap in AliAnalysisVertexingHF
761  if(fSmearOnlySignal && AliVertexingHFUtils::IsCandidateInjected(decayDstar,ev,mcHeader,fMCs)==kFALSE) continue;
762  vHF->FillRecoCasc(ev,((AliAODRecoCascadeHF*)decayDstar),kTRUE);
763  }
764  }
765  // Three prong
766  TClonesArray *array3Prong=static_cast<TClonesArray*>(ev->GetList()->FindObject("Charm3Prong"));
767  if (array3Prong) {
768  for (Int_t icand=0;icand<array3Prong->GetEntriesFast();++icand) {
769  AliAODRecoDecayHF3Prong *decay=static_cast<AliAODRecoDecayHF3Prong*>(array3Prong->At(icand));
770  vHF->GetProng(ev,decay,0); // needed to fill fAODMap in AliAnalysisVertexingHF
771  if(fSmearOnlySignal && AliVertexingHFUtils::IsCandidateInjected(decay,ev,mcHeader,fMCs)==kFALSE) continue;
772  vHF->FillRecoCand(ev,(AliAODRecoDecayHF3Prong*)decay);
773  }
774  }
775 
776 
777  // Smear all tracks
778  if (fImproveTracks) {
779  for(Int_t itrack=0;itrack<ev->GetNumberOfTracks();++itrack) {
780  AliAODTrack * trk = static_cast<AliAODTrack*>(ev->GetTrack(itrack));
781  if(!trk) AliFatal("Not a standard AOD");
782  if(fSmearOnlySignal && AliVertexingHFUtils::IsTrackInjected(trk,mcHeader,fMCs)==kFALSE) continue;
783  SmearTrack(trk,bz);
784  }
785  }
786 
787  // TODO: recalculated primary vertex
788  AliVVertex *primaryVertex=ev->GetPrimaryVertex();
789 
790  // Recalculate all candidates
791  // D0->Kpi
792  if (array2Prong) {
793  for (Int_t icand=0;icand<array2Prong->GetEntriesFast();++icand) {
794  AliAODRecoDecayHF2Prong *decay=static_cast<AliAODRecoDecayHF2Prong*>(array2Prong->At(icand));
795 
796  if(fSmearOnlySignal && AliVertexingHFUtils::IsCandidateInjected(decay,ev,mcHeader,fMCs)==kFALSE) continue;
797  if(!vHF->FillRecoCand(ev,(AliAODRecoDecayHF2Prong*)decay))continue;
798 
799  // recalculate vertices
800  AliVVertex *oldSecondaryVertex=decay->GetSecondaryVtx();
801 
802  AliExternalTrackParam et1; et1.CopyFromVTrack(static_cast<AliAODTrack*>(decay->GetDaughter(0)));
803  AliExternalTrackParam et2; et2.CopyFromVTrack(static_cast<AliAODTrack*>(decay->GetDaughter(1)));
804 
805  TObjArray ta12;
806 
807  ta12.Add(&et1); ta12.Add(&et2);
808  AliESDVertex *v12 =RecalculateVertex(oldSecondaryVertex,&ta12 ,bz);
809 
810 
811  // update secondary vertex
812  Double_t pos[3];
813  Double_t covpos[6];
814  v12->GetXYZ(pos);
815  v12->GetCovMatrix(covpos);
816  decay->GetSecondaryVtx()->SetPosition(pos[0],pos[1],pos[2]);
817  if(fUpdateSecVertCovMat) decay->GetSecondaryVtx()->SetCovMatrix(covpos);
818  decay->GetSecondaryVtx()->SetChi2perNDF(v12->GetChi2toNDF());
819 
820  // update d0
821  Double_t d0z0[2],covd0z0[3];
822  Double_t d0[2],d0err[2];
823  et1.PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
824  d0[0]=d0z0[0];
825  d0err[0] = TMath::Sqrt(covd0z0[0]);
826  et2.PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
827  d0[1]=d0z0[0];
828  d0err[1] = TMath::Sqrt(covd0z0[0]);
829  decay->Setd0Prongs(2,d0);
830  decay->Setd0errProngs(2,d0err);
831  //
832 
833 
834  Double_t xdummy=0.,ydummy=0.;
835  Double_t dca;
836  dca=et1.GetDCA(&et2,bz,xdummy,ydummy);
837  decay->SetDCA(dca);
838 
839 
840 
841  Double_t px[2],py[2],pz[2];
842  for (Int_t i=0;i<2;++i) {
843  AliExternalTrackParam et;
844  et.CopyFromVTrack(static_cast<AliAODTrack*>(decay->GetDaughter(i)));
845  et.PropagateToDCA(v12,bz,100.,d0z0,covd0z0);
846  px[i]=et.Px();
847  py[i]=et.Py();
848  pz[i]=et.Pz();
849  }
850  decay->SetPxPyPzProngs(2,px,py,pz);
851  delete v12;
852  }
853  }
854 
855 
856  // Dstar->Kpipi
857  if (arrayCascade) {
858  for (Int_t icand=0;icand<arrayCascade->GetEntriesFast();++icand) {
859  AliAODRecoCascadeHF *decayDstar=static_cast<AliAODRecoCascadeHF*>(arrayCascade->At(icand));
860  if(fSmearOnlySignal && AliVertexingHFUtils::IsCandidateInjected(decayDstar,ev,mcHeader,fMCs)==kFALSE) continue;
861  if(!vHF->FillRecoCasc(ev,((AliAODRecoCascadeHF*)decayDstar),kTRUE))continue;
862  //Get D0 from D*
864 
865  // recalculate vertices
866  //AliVVertex *oldSecondaryVertex=decay->GetSecondaryVtx();
867 
868  //soft pion
869  AliExternalTrackParam et3; et3.CopyFromVTrack(static_cast<AliAODTrack*>(decayDstar->GetBachelor()));
870 
871  //track D0
872  AliNeutralTrackParam *trackD0 = new AliNeutralTrackParam(decay);
873 
875 
876  // update d0
877  Double_t d0z0[2],covd0z0[3];
878  Double_t d01[2],d01err[2];
879 
880  //the D*
881  et3.PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
882  d01[0]=d0z0[0];
883  d01err[0] = TMath::Sqrt(covd0z0[0]);
884  trackD0->PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
885  d01[1]=d0z0[0];
886  d01err[1] = TMath::Sqrt(covd0z0[0]);
887  decayDstar->Setd0Prongs(2,d01);
888  decayDstar->Setd0errProngs(2,d01err);
889 
890  // delete v12;
891  delete trackD0; trackD0=NULL;
892 
893  // a run for D*
894  Double_t px1[2],py1[2],pz1[2];
895  for (Int_t i=0;i<2;++i) {
896  const AliAODTrack *t1=static_cast<AliAODTrack*>(decayDstar->GetDaughter(i));
897  px1[i]=t1->Px();
898  py1[i]=t1->Py();
899  pz1[i]=t1->Pz();
900  }
901  decayDstar->SetPxPyPzProngs(2,px1,py1,pz1);
902 
903  }
904  }
905 
906 
907  // Three prong
908  if (array3Prong) {
909  for (Int_t icand=0;icand<array3Prong->GetEntriesFast();++icand) {
910  AliAODRecoDecayHF3Prong *decay=static_cast<AliAODRecoDecayHF3Prong*>(array3Prong->At(icand));
911  if(fSmearOnlySignal && AliVertexingHFUtils::IsCandidateInjected(decay,ev,mcHeader,fMCs)==kFALSE) continue;
912  if(!vHF->FillRecoCand(ev,(AliAODRecoDecayHF3Prong*)decay))continue;
913 
914  // recalculate vertices
915  AliVVertex *oldSecondaryVertex=decay->GetSecondaryVtx();
916  AliExternalTrackParam et1; et1.CopyFromVTrack(static_cast<AliAODTrack*>(decay->GetDaughter(0)));
917  AliExternalTrackParam et2; et2.CopyFromVTrack(static_cast<AliAODTrack*>(decay->GetDaughter(1)));
918  AliExternalTrackParam et3; et3.CopyFromVTrack(static_cast<AliAODTrack*>(decay->GetDaughter(2)));
919  TObjArray ta123,ta12,ta23;
920  ta123.Add(&et1);ta123.Add(&et2);ta123.Add(&et3);
921  ta12. Add(&et1);ta12 .Add(&et2);
922  ta23 .Add(&et2);ta23 .Add(&et3);
923  AliESDVertex *v123=RecalculateVertex(oldSecondaryVertex,&ta123,bz);
924  AliESDVertex *v12 =RecalculateVertex(oldSecondaryVertex,&ta12 ,bz);
925  AliESDVertex *v23 =RecalculateVertex(oldSecondaryVertex,&ta23 ,bz);
926 
927  // update secondary vertex
928  Double_t pos[3];
929  Double_t covpos[6];
930  v123->GetXYZ(pos);
931  v123->GetCovMatrix(covpos);
932  decay->GetSecondaryVtx()->SetPosition(pos[0],pos[1],pos[2]);
933  if(fUpdateSecVertCovMat) decay->GetSecondaryVtx()->SetCovMatrix(covpos);
934  decay->GetSecondaryVtx()->SetChi2perNDF(v123->GetChi2toNDF());
935 
936  // update d0 for all progs
937  Double_t d0z0[2],covd0z0[3];
938  Double_t d0[3],d0err[3];
939  et1.PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
940  d0[0]=d0z0[0];
941  d0err[0] = TMath::Sqrt(covd0z0[0]);
942  et2.PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
943  d0[1]=d0z0[0];
944  d0err[1] = TMath::Sqrt(covd0z0[0]);
945  et3.PropagateToDCA(primaryVertex,bz,100.,d0z0,covd0z0);
946  d0[2]=d0z0[0];
947  d0err[2] = TMath::Sqrt(covd0z0[0]);
948  decay->Setd0Prongs (3,d0 );
949  decay->Setd0errProngs(3,d0err);
950  // TODO: setter missing
951 
952  // update dca for prong combinations
953  Double_t xdummy=0.,ydummy=0.;
954  Double_t dca[3];
955  dca[0]=et1.GetDCA(&et2,bz,xdummy,ydummy);
956  dca[1]=et3.GetDCA(&et2,bz,xdummy,ydummy);
957  dca[2]=et1.GetDCA(&et3,bz,xdummy,ydummy);
958  decay->SetDCAs(3,dca);
959 
960  // update sigmavertex = dispersion
961  Float_t sigmaV=v123->GetDispersion();
962  decay->SetSigmaVert(sigmaV);
963  // update dist12 and dist23
964  primaryVertex->GetXYZ(pos);
965  decay->SetDist12toPrim(TMath::Sqrt((v12->GetX()-pos[0])*(v12->GetX()-pos[0])
966  +(v12->GetY()-pos[1])*(v12->GetY()-pos[1])
967  +(v12->GetZ()-pos[2])*(v12->GetZ()-pos[2])));
968  decay->SetDist23toPrim(TMath::Sqrt((v23->GetX()-pos[0])*(v23->GetX()-pos[0])
969  +(v23->GetY()-pos[1])*(v23->GetY()-pos[1])
970  +(v23->GetZ()-pos[2])*(v23->GetZ()-pos[2])));
971 
972 
973  Double_t px[3],py[3],pz[3];
974  for (Int_t i=0;i<3;++i) {
975  AliExternalTrackParam et;
976  et.CopyFromVTrack(static_cast<AliAODTrack*>(decay->GetDaughter(i)));
977  et.PropagateToDCA(v123,bz,100.,d0z0,covd0z0);
978  px[i]=et.Px();
979  py[i]=et.Py();
980  pz[i]=et.Pz();
981  }
982  decay->SetPxPyPzProngs(3,px,py,pz);
983 
984  delete v123;delete v12;delete v23;
985  }
986  }
987  delete vHF;
988 
989  } // end AOD
990  else {
991  //
992  // In case of ESD: only smear all tracks
993  //
994  if (!fMCEvent) return;
995  if (fImproveTracks) {
996  for(Int_t itrack=0;itrack<evesd->GetNumberOfTracks();++itrack) {
997  AliESDtrack * trk = static_cast<AliESDtrack*>(evesd->GetTrack(itrack));
998  if(!trk) AliFatal("No a standard ESD");
999  SmearTrack(trk,bz);
1000  }
1001  }
1002  }// end ESD
1003 
1004 }
1005 
1007 
1008  // flags for PbPb 2018
1009  Bool_t is_kFirst_Trk = kFALSE;
1010  Bool_t is_kOnlySecond_Trk = kFALSE;
1011 
1012  // Early exit, if this track has nothing in common with the ITS
1013  if(!fIsPbPb2018){
1014  if (!(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1))) return;
1015  }
1016  else{ // PbPb 2018 analysed
1017  // kFirst tracks
1018  if(track->HasPointOnITSLayer(0)) is_kFirst_Trk = kTRUE;
1019  // kOnlySecond tracks
1020  else if( !(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1) ) is_kOnlySecond_Trk = kTRUE;
1021  if( !is_kFirst_Trk && !is_kOnlySecond_Trk ) return;
1022  }
1023 
1024 
1025  // Check if the track was already "improved" (this is done with a trick using layer 7 (ie the 8th))
1026  if (TESTBIT(track->GetITSClusterMap(),7)) return;
1027  //
1028 
1029  // Get reconstructed track parameters
1030  AliExternalTrackParam et; et.CopyFromVTrack(track);
1031  Double_t *param=const_cast<Double_t*>(et.GetParameter());
1032 
1033 
1034  Double_t *covar=const_cast<Double_t*>(et.GetCovariance());
1035 
1036  // Get MC info
1037  Int_t imc=track->GetLabel();
1038  if (imc<=0) return;
1039  Double_t mcx[3];
1040  Double_t mcp[3];
1041  Double_t mccv[36]={0.};
1042  Short_t mcc;
1043  const AliVParticle *mc= 0x0;
1044  if(fIsAOD) {
1045  mc = static_cast<AliVParticle*>(fMCs->At(imc));
1046  }
1047  else {
1048  mc = static_cast<AliVParticle*>(fMCEvent->GetTrack(imc));
1049  }
1050  if(!mc) return;
1051  mc->XvYvZv(mcx);
1052  mc->PxPyPz(mcp);
1053  mcc=mc->Charge();
1054  AliExternalTrackParam mct(mcx,mcp,mccv,mcc);
1055  const Double_t *parammc=mct.GetParameter();
1056 //TODO: const Double_t *covermc=mct.GetCovariance();
1057  AliVertex vtx(mcx,1.,1);
1058 
1059  // Correct reference points and frames according to MC
1060  // TODO: B-Field correct?
1061  // TODO: failing propagation....
1062  et.PropagateToDCA(&vtx,bz,10.);
1063  et.Rotate(mct.GetAlpha());
1064 
1065  // Select appropriate smearing functions
1066  Double_t ptmc=TMath::Abs(mc->Pt());
1067  Double_t phimc=mc->Phi();
1068  Int_t phiBin=PhiBin(phimc);
1069  Int_t magfield=0;
1070  if(bz<0.) magfield=0;
1071  else if(bz>0.)magfield=1;
1072  Double_t sd0rpn=0.;
1073  Double_t sd0mrpn=0.;
1074  Double_t sd0zn =0.;
1075  Double_t spt1n =0.;
1076  Double_t sd0rpo=0.;
1077  Double_t sd0mrpo=0.;
1078  Double_t sd0zo =0.;
1079  Double_t spt1o =0.;
1080  Double_t pullcorr=1.;
1081  Int_t pdgcode = 0;
1082  if(fIsAOD){
1083  const AliAODMCParticle *amcpart = static_cast<const AliAODMCParticle *>(mc);
1084  if(!amcpart) return;
1085  pdgcode = amcpart->GetPdgCode();
1086  } else {
1087  const AliMCParticle *emcpart = static_cast<const AliMCParticle *>(mc);
1088  if(!emcpart) return;
1089  pdgcode = emcpart->PdgCode();
1090  }
1091 
1092  if(!fIsPbPb2018){
1093  switch (pdgcode) {
1094  case 2212: case -2212:
1095  sd0rpo=EvalGraph(ptmc,fD0RPResPCur,fD0RPResPCurSA);
1096  sd0zo =EvalGraph(ptmc,fD0ZResPCur,fD0ZResPCurSA);
1097  spt1o =EvalGraph(ptmc,fPt1ResPCur,fPt1ResPCurSA);
1098  sd0rpn=EvalGraph(ptmc,fD0RPResPUpg,fD0RPResPUpgSA);
1099  sd0zn =EvalGraph(ptmc,fD0ZResPUpg,fD0ZResPUpgSA);
1100  spt1n =EvalGraph(ptmc,fPt1ResPUpg,fPt1ResPUpgSA);
1101  sd0mrpo=EvalGraph(ptmc,fD0RPMeanPCur[magfield][phiBin],fD0RPMeanPCur[magfield][phiBin]);
1102  sd0mrpn=EvalGraph(ptmc,fD0RPMeanPUpg[magfield][phiBin],fD0RPMeanPUpg[magfield][phiBin]);
1104  break;
1105  case 321: case -321:
1106  sd0rpo=EvalGraph(ptmc,fD0RPResKCur,fD0RPResKCurSA);
1107  sd0zo =EvalGraph(ptmc,fD0ZResKCur,fD0ZResKCurSA);
1108  spt1o =EvalGraph(ptmc,fPt1ResKCur,fPt1ResKCurSA);
1109  sd0rpn=EvalGraph(ptmc,fD0RPResKUpg,fD0RPResKUpgSA);
1110  sd0zn =EvalGraph(ptmc,fD0ZResKUpg,fD0ZResKUpgSA);
1111  spt1n =EvalGraph(ptmc,fPt1ResKUpg,fPt1ResKUpgSA);
1112  sd0mrpo=EvalGraph(ptmc,fD0RPMeanKCur[magfield][phiBin],fD0RPMeanKCur[magfield][phiBin]);
1113  sd0mrpn=EvalGraph(ptmc,fD0RPMeanKUpg[magfield][phiBin],fD0RPMeanKUpg[magfield][phiBin]);
1115  break;
1116  case 211: case -211:
1118  sd0zo =EvalGraph(ptmc,fD0ZResPiCur,fD0ZResPiCurSA);
1119  spt1o =EvalGraph(ptmc,fPt1ResPiCur,fPt1ResPiCurSA);
1121  sd0zn =EvalGraph(ptmc,fD0ZResPiUpg,fD0ZResPiUpgSA);
1122  spt1n =EvalGraph(ptmc,fPt1ResPiUpg,fPt1ResPiUpgSA);
1123  sd0mrpo=EvalGraph(ptmc,fD0RPMeanPiCur[magfield][phiBin],fD0RPMeanPiCur[magfield][phiBin]);
1124  sd0mrpn=EvalGraph(ptmc,fD0RPMeanPiUpg[magfield][phiBin],fD0RPMeanPiUpg[magfield][phiBin]);
1126  break;
1127  case 11: case -11:
1128  sd0rpo=EvalGraph(ptmc,fD0RPResECur,fD0RPResECurSA);
1129  sd0zo =EvalGraph(ptmc,fD0ZResECur,fD0ZResECurSA);
1130  spt1o =EvalGraph(ptmc,fPt1ResECur,fPt1ResECurSA);
1131  sd0rpn=EvalGraph(ptmc,fD0RPResEUpg,fD0RPResEUpgSA);
1132  sd0zn =EvalGraph(ptmc,fD0ZResEUpg,fD0ZResEUpgSA);
1133  spt1n =EvalGraph(ptmc,fPt1ResEUpg,fPt1ResEUpgSA);
1134  sd0mrpo=EvalGraph(ptmc,fD0RPMeanECur[magfield][phiBin],fD0RPMeanECur[magfield][phiBin]);
1135  sd0mrpn=EvalGraph(ptmc,fD0RPMeanEUpg[magfield][phiBin],fD0RPMeanEUpg[magfield][phiBin]);
1137  break;
1138  default:
1139  return;
1140  }
1141  }
1142  else{ // PbPb 2018 periods templates
1143  // kFirst tracks
1144  if(is_kFirst_Trk){
1145  switch (pdgcode) {
1146  case 2212: case -2212:
1153  sd0mrpo=EvalGraph(ptmc,fD0RPMeanKCur_PbPb2018_kFirst[magfield][phiBin],fD0RPMeanKCur_PbPb2018_kFirst[magfield][phiBin]);
1154  sd0mrpn=EvalGraph(ptmc,fD0RPMeanKUpg_PbPb2018_kFirst[magfield][phiBin],fD0RPMeanKUpg_PbPb2018_kFirst[magfield][phiBin]);
1156  break;
1157  case 321: case -321:
1164  sd0mrpo=EvalGraph(ptmc,fD0RPMeanKCur_PbPb2018_kFirst[magfield][phiBin],fD0RPMeanKCur_PbPb2018_kFirst[magfield][phiBin]);
1165  sd0mrpn=EvalGraph(ptmc,fD0RPMeanKUpg_PbPb2018_kFirst[magfield][phiBin],fD0RPMeanKUpg_PbPb2018_kFirst[magfield][phiBin]);
1167  break;
1168  case 211: case -211:
1175  sd0mrpo=EvalGraph(ptmc,fD0RPMeanPiCur_PbPb2018_kFirst[magfield][phiBin],fD0RPMeanPiCur_PbPb2018_kFirst[magfield][phiBin]);
1176  sd0mrpn=EvalGraph(ptmc,fD0RPMeanPiUpg_PbPb2018_kFirst[magfield][phiBin],fD0RPMeanPiUpg_PbPb2018_kFirst[magfield][phiBin]);
1178  break;
1179  case 11: case -11:
1186  sd0mrpo=EvalGraph(ptmc,fD0RPMeanECur_PbPb2018_kFirst[magfield][phiBin],fD0RPMeanECur_PbPb2018_kFirst[magfield][phiBin]);
1187  sd0mrpn=EvalGraph(ptmc,fD0RPMeanEUpg_PbPb2018_kFirst[magfield][phiBin],fD0RPMeanEUpg_PbPb2018_kFirst[magfield][phiBin]);
1189  break;
1190  default:
1191  return;
1192  }
1193  }
1194  // kOnlySecond tracks
1195  else if(is_kOnlySecond_Trk){
1196  switch (pdgcode) {
1197  case 2212: case -2212:
1204  sd0mrpo=EvalGraph(ptmc,fD0RPMeanKCur_PbPb2018_kOnlySecond[magfield][phiBin],fD0RPMeanKCur_PbPb2018_kOnlySecond[magfield][phiBin]);
1205  sd0mrpn=EvalGraph(ptmc,fD0RPMeanKUpg_PbPb2018_kOnlySecond[magfield][phiBin],fD0RPMeanKUpg_PbPb2018_kOnlySecond[magfield][phiBin]);
1207  break;
1208  case 321: case -321:
1215  sd0mrpo=EvalGraph(ptmc,fD0RPMeanKCur_PbPb2018_kOnlySecond[magfield][phiBin],fD0RPMeanKCur_PbPb2018_kOnlySecond[magfield][phiBin]);
1216  sd0mrpn=EvalGraph(ptmc,fD0RPMeanKUpg_PbPb2018_kOnlySecond[magfield][phiBin],fD0RPMeanKUpg_PbPb2018_kOnlySecond[magfield][phiBin]);
1218  break;
1219  case 211: case -211:
1226  sd0mrpo=EvalGraph(ptmc,fD0RPMeanPiCur_PbPb2018_kOnlySecond[magfield][phiBin],fD0RPMeanPiCur_PbPb2018_kOnlySecond[magfield][phiBin]);
1227  sd0mrpn=EvalGraph(ptmc,fD0RPMeanPiUpg_PbPb2018_kOnlySecond[magfield][phiBin],fD0RPMeanPiUpg_PbPb2018_kOnlySecond[magfield][phiBin]);
1229  break;
1230  case 11: case -11:
1237  sd0mrpo=EvalGraph(ptmc,fD0RPMeanECur_PbPb2018_kOnlySecond[magfield][phiBin],fD0RPMeanECur_PbPb2018_kOnlySecond[magfield][phiBin]);
1238  sd0mrpn=EvalGraph(ptmc,fD0RPMeanEUpg_PbPb2018_kOnlySecond[magfield][phiBin],fD0RPMeanEUpg_PbPb2018_kOnlySecond[magfield][phiBin]);
1240  break;
1241  default:
1242  return;
1243  }
1244  }
1245  }
1246 
1247 
1248  // Use the same units (i.e. cm and GeV/c)! TODO: pt!
1249  sd0rpo*=1.e-4;
1250  sd0zo *=1.e-4;
1251  sd0rpn*=1.e-4;
1252  sd0zn *=1.e-4;
1253  sd0mrpo*=1.e-4;
1254  sd0mrpn*=1.e-4;
1255 
1256  // Apply the smearing
1257  Double_t d0zo =param [1];
1258  Double_t d0zmc =parammc[1];
1259  Double_t d0rpo =param [0];
1260  Double_t d0rpmc=parammc[0];
1261  Double_t pt1o =param [4];
1262  Double_t pt1mc =parammc[4];
1263  Double_t dd0zo =d0zo-d0zmc;
1264  Double_t dd0zn =dd0zo *(sd0zo >0. ? (sd0zn /sd0zo ) : 1.);
1265  Double_t d0zn =d0zmc+dd0zn;
1266  Double_t dd0rpo=d0rpo-d0rpmc;
1267  Double_t dd0rpn=dd0rpo*(sd0rpo>0. ? (sd0rpn/sd0rpo) : 1.);
1268  Double_t dd0mrpn=TMath::Abs(sd0mrpn)-TMath::Abs(sd0mrpo);
1269  Double_t d0rpn =d0rpmc+dd0rpn-dd0mrpn;
1270  Double_t d0zoinsigma = 0.;
1271  if(covar[0] > 0.) d0zoinsigma = d0zo/TMath::Sqrt(covar[2]);
1272  Double_t d0rpoinsigma = 0.;
1273  if(covar[2] > 0.) d0rpoinsigma = d0rpo/TMath::Sqrt(covar[0]);
1274 
1275  if(fMimicData){
1276  dd0mrpn=sd0mrpn-sd0mrpo;
1277  d0rpn =d0rpmc+dd0rpn+dd0mrpn;
1278  }
1279 
1280  Double_t dpt1o =pt1o-pt1mc;
1281  Double_t dpt1n =dpt1o *(spt1o >0. ? (spt1n /spt1o ) : 1.);
1282  Double_t pt1n =pt1mc+dpt1n;
1283  param[0]=d0rpn;
1284  param[1]=d0zn ;
1285  param[4]=pt1n ;
1286 
1287  //cov matrix update
1288  if(fUpdateSTCovMatrix){
1289  if(sd0rpo>0.) covar[0]*=(sd0rpn/sd0rpo)*(sd0rpn/sd0rpo);//yy
1290  if(sd0zo>0. && sd0rpo>0.)covar[1]*=(sd0rpn/sd0rpo)*(sd0zn/sd0zo);//yz
1291  if(sd0zo>0.) covar[2]*=(sd0zn/sd0zo)*(sd0zn/sd0zo);//zz
1292  if(sd0rpo>0.) covar[3]*=(sd0rpn/sd0rpo);//yl
1293  if(sd0zo>0.) covar[4]*=(sd0zn/sd0zo);//zl
1294  if(sd0rpo>0.) covar[6]*=(sd0rpn/sd0rpo);//ysenT
1295  if(sd0zo>0.) covar[7]*=(sd0zn/sd0zo);//zsenT
1296  if(sd0rpo>0. && spt1o>0.)covar[10]*=(sd0rpn/sd0rpo)*(spt1n/spt1o);//ypt
1297  if(sd0zo>0. && spt1o>0.) covar[11]*=(sd0zn/sd0zo)*(spt1n/spt1o);//zpt
1298  if(spt1o>0.) covar[12]*=(spt1n/spt1o);//sinPhipt
1299  if(spt1o>0.) covar[13]*=(spt1n/spt1o);//tanTpt
1300  if(spt1o>0.) covar[14]*=(spt1n/spt1o)*(spt1n/spt1o);//ptpt
1301  }
1302  if(fUpdatePulls){
1303 
1304  covar[0]*=pullcorr*pullcorr;//yy
1305  covar[1]*=pullcorr;//yz
1306  covar[3]*=pullcorr;//yl
1307  covar[6]*=pullcorr;//ysenT
1308  covar[10]*=pullcorr;//ypt
1309 
1310  }
1311 
1312  Double_t d0zninsigma = 0.;
1313  if(covar[0] > 0.) d0zninsigma = d0zn/TMath::Sqrt(covar[2]);
1314  Double_t d0rpninsigma = 0.;
1315  if(covar[2] > 0.) d0rpninsigma = d0rpn/TMath::Sqrt(covar[0]);
1316 
1317  // Copy the smeared parameters to the AOD track
1318  Double_t x[3];
1319  Double_t p[3];
1320  et.GetXYZ(x);
1321  et.GetPxPyPz(p);
1322  Double_t cv[21];
1323  et.GetCovarianceXYZPxPyPz(cv);
1324 
1325  //if(fIsPbPb2018){
1326  // printf("--- is_kFirst_Trk: %d\n", is_kFirst_Trk);
1327  // printf("--- is_kOnlySecond_Trk: %d\n", is_kOnlySecond_Trk);
1328  // for(UInt_t ibin=0; ibin<21; ibin++) printf("%f\n",cv[ibin]);
1329  // printf("\n");
1330  //}
1331 
1332  if(fIsAOD) {
1333  AliAODTrack *aodtrack = static_cast<AliAODTrack *>(track);
1334  aodtrack->SetPosition(x,kFALSE);
1335  aodtrack->SetP(p,kTRUE);
1336  aodtrack->SetCovMatrix(cv);
1337  // Mark the track as "improved" with a trick (this is done with a trick using layer 7 (ie the 8th))
1338  UChar_t itsClusterMap = aodtrack->GetITSClusterMap();
1339  SETBIT(itsClusterMap,7);
1340  aodtrack->SetITSClusterMap(itsClusterMap);
1341  //
1342 
1343  } else {
1344  AliESDtrack *esdtrack = static_cast<AliESDtrack *>(track);
1345  Short_t sign = esdtrack->Charge();
1346  esdtrack->Set(x,p,cv,sign);
1347  esdtrack->RelateToVVertex(InputEvent()->GetPrimaryVertex(), bz,100.);
1348  // Mark the track as "improved" with a trick (this is done with a trick using layer 7 (ie the 8th))
1349  UChar_t itsClusterMap = esdtrack->GetITSClusterMap();
1350  SETBIT(itsClusterMap,7);
1351  esdtrack->SetITSClusterMap(itsClusterMap);
1352  }
1353 
1354 
1355  // write out debug infos
1356  if (fDebugNtuple->GetEntriesFast()<fNDebug) {
1357  Int_t idbg=0;
1358  fDebugVars[idbg++]=pdgcode;
1359  fDebugVars[idbg++]=ptmc ;
1360  fDebugVars[idbg++]=d0rpo ;
1361  fDebugVars[idbg++]=d0zo ;
1362  fDebugVars[idbg++]=pt1o ;
1363  fDebugVars[idbg++]=sd0rpo;
1364  fDebugVars[idbg++]=sd0zo ;
1365  fDebugVars[idbg++]=spt1o ;
1366  fDebugVars[idbg++]=d0rpn ;
1367  fDebugVars[idbg++]=d0zn ;
1368  fDebugVars[idbg++]=pt1n ;
1369  fDebugVars[idbg++]=sd0rpn;
1370  fDebugVars[idbg++]=sd0zn ;
1371  fDebugVars[idbg++]=spt1n ;
1372  fDebugVars[idbg++]=d0rpmc;
1373  fDebugVars[idbg++]=d0zmc ;
1374  fDebugVars[idbg++]=pt1mc ;
1375  fDebugVars[idbg++]=pullcorr ;
1376  fDebugVars[idbg++]=d0zoinsigma ;
1377  fDebugVars[idbg++]=d0zninsigma ;
1378  fDebugVars[idbg++]=d0rpoinsigma ;
1379  fDebugVars[idbg++]=d0rpninsigma ;
1380  fDebugNtuple->Fill(fDebugVars);
1381  PostData(1,fDebugOutput);
1382  }
1383 }
1384 
1385 AliESDVertex* AliAnalysisTaskSEImproveITSCVMFS::RecalculateVertex(const AliVVertex *old,TObjArray *tracks,Double_t bField) {
1386  //
1387  // Helper function to recalculate a vertex.
1388  //
1389 
1390  static UShort_t ids[]={1,2,3}; //TODO: unsave...
1391  AliVertexerTracks vertexer(bField);
1392  vertexer.SetVtxStart(old->GetX(),old->GetY(),old->GetZ());
1393  AliESDVertex *vertex=vertexer.VertexForSelectedTracks(tracks,ids);
1394  return vertex;
1395 }
1396 
1398  //
1399  // Evaluates a TGraph without linear extrapolation. Instead the last
1400  // valid point of the graph is used when out of range.
1401  // The function assumes an ascending order of X.
1402  //
1403 
1404  if(!graph){
1405  printf("\tEvalGraph fails !\n");
1406  return 0.;
1407  }
1408 
1409  // TODO: find a pretty solution for this:
1410  Int_t n =graph->GetN();
1411  Double_t xmin=graph->GetX()[0 ];
1412  Double_t xmax=graph->GetX()[n-1];
1413  if (x<xmin) {
1414  if(!graphSA) return graph->Eval(xmin);
1415  Double_t xminSA=graphSA->GetX()[0];
1416  if(x<xminSA) return graphSA->Eval(xminSA);
1417  return graphSA->Eval(x);
1418  }
1419  if (x>xmax) return graph->Eval(xmax);
1420  return graph->Eval(x);
1421 }
1422 
1423 //________________________________________________________________________
1424 
1426  Double_t pi=TMath::Pi();
1427  if(phi>2.*pi || phi<0.) return -1;
1428 
1429  if(!fIsPbPb2018){
1430  if((phi<=(pi/4.)) || (phi>7.*(pi/4.))) return 0;
1431  if((phi>(pi/4.)) && (phi<=3.*(pi/4.))) return 1;
1432  if((phi>3.*(pi/4.)) && (phi<=5.*(pi/4.))) return 2;
1433  if((phi>(5.*pi/4.)) && (phi<=7.*(pi/4.))) return 3;
1434  }
1435  else{ // correction performed in 24 φ bins for PbPb 2018 periods
1436  Double_t width = 2.*pi/24;
1437  Int_t jBin=TMath::Floor(phi/width);
1438  return jBin; // by construction is 0<=jBin<23 since phi is in 0-2pi
1439  }
1440 
1441  return -1;
1442 }
1443 
1445  Int_t run = event->GetRunNumber();
1446 
1447  TString lProductionName = "";
1448  if (!fOverridePeriodName.EqualTo("")) { lProductionName = fOverridePeriodName; } // manual period name if present
1449  else { //otherwise determine period name automatically
1450  TString currentfilename = ((AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()->GetTree()->GetCurrentFile()))->GetName();
1451  //2016
1452  if ( run >= 252235 && run <= 252375 ) lProductionName = "LHC16d";
1453  if ( run >= 252603 && run <= 253591 ) lProductionName = "LHC16e";
1454  if ( run >= 254124 && run <= 254332 ) lProductionName = "LHC16g";
1455  if ( run >= 254378 && run <= 255469 ) lProductionName = "LHC16h";
1456  if ( run >= 256146 && run <= 256420 ) lProductionName = "LHC16j";
1457  if ( run >= 256504 && run <= 258537 ) lProductionName = "LHC16k";
1458  if ( run >= 258883 && run <= 260187 ) lProductionName = "LHC16l";
1459  if ( run >= 262395 && run <= 264035 ) lProductionName = "LHC16o";
1460  if ( run >= 264076 && run <= 264347 ) lProductionName = "LHC16p";
1461 
1462  //2017
1463  if ( run >= 270822 && run <= 270830 ) lProductionName = "LHC17e";
1464  if ( run >= 270854 && run <= 270865 ) lProductionName = "LHC17f";
1465  if ( run >= 270882 && run <= 271777 ) lProductionName = "LHC17g";
1466  if ( run >= 271868 && run <= 273103 ) lProductionName = "LHC17h";
1467  if ( run >= 273591 && run <= 274442 ) lProductionName = "LHC17i";
1468  if ( run >= 274593 && run <= 274671 ) lProductionName = "LHC17j";
1469  if ( run >= 274690 && run <= 276508 ) lProductionName = "LHC17k";
1470  if ( run >= 276551 && run <= 278216 ) lProductionName = "LHC17l";
1471  if ( run >= 278914 && run <= 280140 ) lProductionName = "LHC17m";
1472  if ( run >= 280282 && run <= 281961 ) lProductionName = "LHC17o";
1473  if ( run >= 282504 && run <= 282704 ) lProductionName = "LHC17r";
1474 
1475  //2018
1476  if ( run >= 285008 && run <= 285447 ) lProductionName = "LHC18b";
1477  if ( run >= 285466 && run <= 285958 ) lProductionName = "LHC18c_CENT";
1478  if ( run >= 285978 && run <= 286350 ) lProductionName = "LHC18d";
1479  if ( run >= 286380 && run <= 286937 ) lProductionName = "LHC18e";
1480  if ( run >= 287000 && run <= 287977 ) lProductionName = "LHC18f";
1481  if ( run >= 288619 && run <= 288750 ) lProductionName = "LHC18g";
1482  if ( run >= 288804 && run <= 288806 ) lProductionName = "LHC18h";
1483  if ( run >= 288861 && run <= 288909 ) lProductionName = "LHC18i";
1484  if ( run >= 288943 && run <= 288943 ) lProductionName = "LHC18j";
1485  if ( run >= 289165 && run <= 289201 ) lProductionName = "LHC18k";
1486  if ( run >= 289240 && run <= 289971 ) lProductionName = "LHC18l";
1487  if ( run >= 290222 && run <= 292839 ) lProductionName = "LHC18m";
1488  if ( run >= 293357 && run <= 293359 ) lProductionName = "LHC18n";
1489  if ( run >= 293368 && run <= 293898 ) lProductionName = "LHC18o";
1490  if ( run >= 294009 && run <= 294925 ) lProductionName = "LHC18p";
1491 
1492  //2017: LHC17pq
1493 
1494  if ( (run >= 282008 && run <= 282343) || (run >= 282365 && run <= 282367) ) { //check trigger cluster CENT or FAST
1495  if (currentfilename.Contains("cent")) lProductionName = "LHC17pq_cent";
1496  if (currentfilename.Contains("fast")) lProductionName = "LHC17pq_fast";
1497 }
1498 
1499  //Registered Productions : Run 2 Pb-Pb
1500  if ( run >= 244917 && run <= 246994 ) lProductionName = "LHC15o";
1501 
1502  //Registered Productions : Run 2 p-Pb
1503  if ( (run >= 265115 && run <= 265525) || (run >=267161 && run <= 267166) ) lProductionName = "LHC16qt";
1504 
1505  //Registered production: Run 2 Pb-Pb 2018 [to be uncommented when improver files avaiable]
1506  if ( run >= 295581 && run <= 296689 ) { lProductionName = "LHC18q"; fIsPbPb2018 = kTRUE; }
1507  if ( run >= 296690 && run <= 300000 ) { lProductionName = "LHC18r"; fIsPbPb2018 = kTRUE; }
1508 }
1509 
1510  if (lProductionName.EqualTo("")) {
1511  AliError("This run number has no corresponding improver file!");
1512  return;
1513  }
1514  if (fImproverSuffix.EqualTo("")) fImproverSuffix = "central"; // default path is "central"
1515 
1516 
1517  TString pathToFileCurrent = AliDataFile::GetFileName(Form("PWGHF/common/Improver/%s/%s/ITSgraphs_Current.root",lProductionName.Data(),fImproverSuffix.Data())); // find URI for improver file from CVMFS
1518 
1519  // Check access to CVMFS (will only be displayed locally)
1520  if (pathToFileCurrent.IsNull()) {
1521  AliFatal("Cannot access data files from CVMFS: please export ALICE_DATA=root://eospublic.cern.ch//eos/experiment/alice/analysis-data and run again");
1522 }
1523 
1524  TFile *resfileCur=TFile::Open(pathToFileCurrent.Data());
1525  if(resfileCur) printf("... READ ###\n");
1526 
1527  printf("\n\n===\n=== fIsPbPb2018: %s\n===\n\n",fIsPbPb2018?"kTRUE":"kFALSE");
1528  if(resfileCur) {
1529  if(!fIsPbPb2018){
1530  if(resfileCur->Get("D0RPResP" )) {
1531  fD0RPResPCur =(TGraph*)(resfileCur->Get("D0RPResP" )->Clone("D0RPResPCur" ));
1532  }
1533  if(resfileCur->Get("D0RPResK" )) {
1534  fD0RPResKCur =(TGraph*)(resfileCur->Get("D0RPResK" )->Clone("D0RPResKCur" ));
1535  }
1536  if(resfileCur->Get("D0RPResPi")) {
1537  fD0RPResPiCur=(TGraph*)(resfileCur->Get("D0RPResPi")->Clone("D0RPResPiCur"));
1538  }
1539  if(resfileCur->Get("D0RPResE")) {
1540  fD0RPResECur=(TGraph*)(resfileCur->Get("D0RPResE")->Clone("D0RPResECur"));
1541  }
1542  if(resfileCur->Get("D0RPSigmaPullRatioP" )) {
1543  fD0RPSigmaPullRatioP =(TGraph*)(resfileCur->Get("D0RPSigmaPullRatioP" ));
1544  }
1545  if(resfileCur->Get("D0RPSigmaPullRatioK" )) {
1546  fD0RPSigmaPullRatioK =(TGraph*)(resfileCur->Get("D0RPSigmaPullRatioK" ));
1547  }
1548  if(resfileCur->Get("D0RPSigmaPullRatioPi")) {
1549  fD0RPSigmaPullRatioPi=(TGraph*)(resfileCur->Get("D0RPSigmaPullRatioPi"));
1550  }
1551  if(resfileCur->Get("D0RPSigmaPullRatioE")) {
1552  fD0RPSigmaPullRatioE=(TGraph*)(resfileCur->Get("D0RPSigmaPullRatioE"));
1553  }
1554  for(Int_t j=0; j<2; j++){
1555  for(Int_t i=0; i<4; i++){
1556  if(resfileCur->Get(Form("D0RPMeanP_B%d_phi%d",j,i))) {
1557  fD0RPMeanPCur[j][i]=(TGraph*)(resfileCur->Get(Form("D0RPMeanP_B%d_phi%d",j,i))->Clone(Form("D0RPMeanPCur_B%d_phi%d",j,i)));
1558  }
1559  if(resfileCur->Get(Form("D0RPMeanK_B%d_phi%d",j,i))) {
1560  fD0RPMeanKCur[j][i]=(TGraph*)(resfileCur->Get(Form("D0RPMeanK_B%d_phi%d",j,i))->Clone(Form("D0RPMeanKCur_B%d_phi%d",j,i)));
1561  }
1562  if(resfileCur->Get(Form("D0RPMeanPi_B%d_phi%d",j,i))) {
1563  fD0RPMeanPiCur[j][i]=(TGraph*)(resfileCur->Get(Form("D0RPMeanPi_B%d_phi%d",j,i))->Clone(Form("D0RPMeanPiCur_B%d_phi%d",j,i)));
1564  }
1565  if(resfileCur->Get(Form("D0RPMeanE_B%d_phi%d",j,i))) {
1566  fD0RPMeanECur[j][i]=(TGraph*)(resfileCur->Get(Form("D0RPMeanE_B%d_phi%d",j,i))->Clone(Form("D0RPMeanECur_B%d_phi%d",j,i)));
1567  }
1568  }
1569  }
1570  if(resfileCur->Get("D0ZResP" )) {
1571  fD0ZResPCur =(TGraph*)(resfileCur->Get("D0ZResP" )->Clone("D0ZResPCur" ));
1572  }
1573  if(resfileCur->Get("D0ZResK" )) {
1574  fD0ZResKCur =(TGraph*)(resfileCur->Get("D0ZResK" )->Clone("D0ZResKCur" ));
1575  }
1576  if(resfileCur->Get("D0ZResPi" )) {
1577  fD0ZResPiCur =(TGraph*)(resfileCur->Get("D0ZResPi" )->Clone("D0ZResPiCur" ));
1578  }
1579  if(resfileCur->Get("D0ZResE" )) {
1580  fD0ZResECur =(TGraph*)(resfileCur->Get("D0ZResE" )->Clone("D0ZResECur" ));
1581  }
1582  if(resfileCur->Get("Pt1ResP" )) {
1583  fPt1ResPCur =(TGraph*)(resfileCur->Get("Pt1ResP" )->Clone("Pt1ResPCur" ));
1584  }
1585  if(resfileCur->Get("Pt1ResK" )) {
1586  fPt1ResKCur =(TGraph*)(resfileCur->Get("Pt1ResK" )->Clone("Pt1ResKCur" ));
1587  }
1588  if(resfileCur->Get("Pt1ResPi" )) {
1589  fPt1ResPiCur =(TGraph*)(resfileCur->Get("Pt1ResPi" )->Clone("Pt1ResPiCur" ));
1590  }
1591  if(resfileCur->Get("Pt1ResE" )) {
1592  fPt1ResECur =(TGraph*)(resfileCur->Get("Pt1ResE" )->Clone("Pt1ResECur" ));
1593  }
1594  if(resfileCur->Get("D0RPResPSA" )) {
1595  fD0RPResPCurSA =(TGraph*)(resfileCur->Get("D0RPResPSA" )->Clone("D0RPResPCurSA" ));
1596  }
1597  if(resfileCur->Get("D0RPResKSA" )) {
1598  fD0RPResKCurSA =(TGraph*)(resfileCur->Get("D0RPResKSA" )->Clone("D0RPResKCurSA" ));
1599  }
1600  if(resfileCur->Get("D0RPResPiSA")) {
1601  fD0RPResPiCurSA=(TGraph*)(resfileCur->Get("D0RPResPiSA")->Clone("D0RPResPiCurSA"));
1602  }
1603  if(resfileCur->Get("D0RPResESA")) {
1604  fD0RPResECurSA=(TGraph*)(resfileCur->Get("D0RPResESA")->Clone("D0RPResECurSA"));
1605  }
1606  if(resfileCur->Get("D0ZResPSA" )) {
1607  fD0ZResPCurSA =(TGraph*)(resfileCur->Get("D0ZResPSA" )->Clone("D0ZResPCurSA" ));
1608  }
1609  if(resfileCur->Get("D0ZResKSA" )) {
1610  fD0ZResKCurSA =(TGraph*)(resfileCur->Get("D0ZResKSA" )->Clone("D0ZResKCurSA" ));
1611  }
1612  if(resfileCur->Get("D0ZResPiSA" )) {
1613  fD0ZResPiCurSA =(TGraph*)(resfileCur->Get("D0ZResPiSA" )->Clone("D0ZResPiCurSA" ));
1614  }
1615  if(resfileCur->Get("D0ZResESA" )) {
1616  fD0ZResECurSA =(TGraph*)(resfileCur->Get("D0ZResESA" )->Clone("D0ZResECurSA" ));
1617  }
1618  if(resfileCur->Get("Pt1ResPSA" )) {
1619  fPt1ResPCurSA =(TGraph*)(resfileCur->Get("Pt1ResPSA" )->Clone("Pt1ResPCurSA" ));
1620  }
1621  if(resfileCur->Get("Pt1ResKSA" )) {
1622  fPt1ResKCurSA =(TGraph*)(resfileCur->Get("Pt1ResKSA" )->Clone("Pt1ResKCurSA" ));
1623  }
1624  if(resfileCur->Get("Pt1ResPiSA" )) {
1625  fPt1ResPiCurSA =(TGraph*)(resfileCur->Get("Pt1ResPiSA" )->Clone("Pt1ResPiCurSA" ));
1626  }
1627  if(resfileCur->Get("Pt1ResESA" )) {
1628  fPt1ResECurSA =(TGraph*)(resfileCur->Get("Pt1ResESA" )->Clone("Pt1ResECurSA" ));
1629  }
1630  delete resfileCur;
1631  }
1632  else // analysing PbPb 2018 periods
1633  {
1634  if(resfileCur->Get("kFirst_D0RPResP") && resfileCur->Get("kOnlySecond_D0RPResP")){
1635  fD0RPResPCur_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0RPResP")->Clone("kFirst_D0RPResPCur"));
1636  fD0RPResPCur_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0RPResP")->Clone("kOnlySecond_D0RPResPCur"));
1637  }
1638  if(resfileCur->Get("kFirst_D0RPResK") && resfileCur->Get("kOnlySecond_D0RPResK")){
1639  fD0RPResKCur_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0RPResK")->Clone("kFirst_D0RPResKCur"));
1640  fD0RPResKCur_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0RPResK")->Clone("kOnlySecond_D0RPResKCur"));
1641  }
1642  if(resfileCur->Get("kFirst_D0RPResPi") && resfileCur->Get("kOnlySecond_D0RPResPi")){
1643  fD0RPResPiCur_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0RPResPi")->Clone("kFirst_D0RPResPiCur"));
1644  fD0RPResPiCur_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0RPResPi")->Clone("kOnlySecond_D0RPResPiCur"));
1645  }
1646  if(resfileCur->Get("kFirst_D0RPResE") && resfileCur->Get("kOnlySecond_D0RPResE")){
1647  fD0RPResECur_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0RPResE")->Clone("kFirst_D0RPResECur"));
1648  fD0RPResECur_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0RPResE")->Clone("kOnlySecond_D0RPResECur"));
1649  }
1650  if(resfileCur->Get("kFirst_D0RPSigmaPullRatioP") && resfileCur->Get("kOnlySecond_D0RPSigmaPullRatioP")){
1651  fD0RPSigmaPullRatioP_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0RPSigmaPullRatioP"));
1652  fD0RPSigmaPullRatioP_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0RPSigmaPullRatioP"));
1653  }
1654  if(resfileCur->Get("kFirst_D0RPSigmaPullRatioK") && resfileCur->Get("kOnlySecond_D0RPSigmaPullRatioK")){
1655  fD0RPSigmaPullRatioK_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0RPSigmaPullRatioK"));
1656  fD0RPSigmaPullRatioK_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0RPSigmaPullRatioK"));
1657  }
1658  if(resfileCur->Get("kFirst_D0RPSigmaPullRatioPi") && resfileCur->Get("kOnlySecond_D0RPSigmaPullRatioPi")){
1659  fD0RPSigmaPullRatioPi_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0RPSigmaPullRatioPi"));
1660  fD0RPSigmaPullRatioPi_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0RPSigmaPullRatioPi"));
1661  }
1662  if(resfileCur->Get("kFirst_D0RPSigmaPullRatioE") && resfileCur->Get("kOnlySecond_D0RPSigmaPullRatioE")){
1663  fD0RPSigmaPullRatioE_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0RPSigmaPullRatioE"));
1664  fD0RPSigmaPullRatioE_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0RPSigmaPullRatioE"));
1665  }
1666  for(UInt_t j = 0; j < 2; j++)
1667  {
1668  for(Int_t i=0; i<24; i++){
1669  if(resfileCur->Get(Form("kFirst_D0RPMeanP_B%d_phi%d",j,i)) && resfileCur->Get(Form("kOnlySecond_D0RPMeanP_B%d_phi%d",j,i))){
1670  fD0RPMeanPCur_PbPb2018_kFirst[j][i]=(TGraph*)resfileCur->Get(Form("kFirst_D0RPMeanP_B%d_phi%d",j,i))->Clone(Form("kFirst_D0RPMeanPCur_B%d_phi%d",j,i));
1671  fD0RPMeanPCur_PbPb2018_kOnlySecond[j][i]=(TGraph*)resfileCur->Get(Form("kOnlySecond_D0RPMeanP_B%d_phi%d",j,i))->Clone(Form("kOnlySecond_D0RPMeanPCur_B%d_phi%d",j,i));
1672  }
1673  if(resfileCur->Get(Form("kFirst_D0RPMeanK_B%d_phi%d",j,i)) && resfileCur->Get(Form("kOnlySecond_D0RPMeanK_B%d_phi%d",j,i))){
1674  fD0RPMeanKCur_PbPb2018_kFirst[j][i]=(TGraph*)resfileCur->Get(Form("kFirst_D0RPMeanK_B%d_phi%d",j,i))->Clone(Form("kFirst_D0RPMeanKCur_B%d_phi%d",j,i));
1675  fD0RPMeanKCur_PbPb2018_kOnlySecond[j][i]=(TGraph*)resfileCur->Get(Form("kOnlySecond_D0RPMeanK_B%d_phi%d",j,i))->Clone(Form("kOnlySecond_D0RPMeanKCur_B%d_phi%d",j,i));
1676  }
1677  if(resfileCur->Get(Form("kFirst_D0RPMeanPi_B%d_phi%d",j,i)) && resfileCur->Get(Form("kOnlySecond_D0RPMeanPi_B%d_phi%d",j,i))){
1678  fD0RPMeanPiCur_PbPb2018_kFirst[j][i]=(TGraph*)resfileCur->Get(Form("kFirst_D0RPMeanPi_B%d_phi%d",j,i))->Clone(Form("kFirst_D0RPMeanPiCur_B%d_phi%d",j,i));
1679  fD0RPMeanPiCur_PbPb2018_kOnlySecond[j][i]=(TGraph*)resfileCur->Get(Form("kOnlySecond_D0RPMeanPi_B%d_phi%d",j,i))->Clone(Form("kOnlySecond_D0RPMeanPiCur_B%d_phi%d",j,i));
1680  }
1681  if(resfileCur->Get(Form("kFirst_D0RPMeanE_B%d_phi%d",j,i)) && resfileCur->Get(Form("kOnlySecond_D0RPMeanE_B%d_phi%d",j,i))){
1682  fD0RPMeanECur_PbPb2018_kFirst[j][i]=(TGraph*)resfileCur->Get(Form("kFirst_D0RPMeanE_B%d_phi%d",j,i))->Clone(Form("kFirst_D0RPMeanECur_B%d_phi%d",j,i));
1683  fD0RPMeanECur_PbPb2018_kOnlySecond[j][i]=(TGraph*)resfileCur->Get(Form("kOnlySecond_D0RPMeanE_B%d_phi%d",j,i))->Clone(Form("kOnlySecond_D0RPMeanECur_B%d_phi%d",j,i));
1684  }
1685  }
1686  }
1687  if(resfileCur->Get("kFirst_D0ZResP") && resfileCur->Get("kOnlySecond_D0ZResP")){
1688  fD0ZResPCur_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0ZResP")->Clone("kFirst_D0ZResPCur"));
1689  fD0ZResPCur_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0ZResP")->Clone("kOnlySecond_D0ZResPCur"));
1690  }
1691  if(resfileCur->Get("kFirst_D0ZResK") && resfileCur->Get("kOnlySecond_D0ZResK")){
1692  fD0ZResKCur_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0ZResK")->Clone("kFirst_D0ZResKCur"));
1693  fD0ZResKCur_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0ZResK")->Clone("kOnlySecond_D0ZResKCur"));
1694  }
1695  if(resfileCur->Get("kFirst_D0ZResPi") && resfileCur->Get("kOnlySecond_D0ZResPi")){
1696  fD0ZResPiCur_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0ZResPi")->Clone("kFirst_D0ZResPiCur"));
1697  fD0ZResPiCur_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0ZResPi")->Clone("kOnlySecond_D0ZResPiCur"));
1698  }
1699  if(resfileCur->Get("kFirst_D0ZResE") && resfileCur->Get("kOnlySecond_D0ZResE")){
1700  fD0ZResECur_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0ZResE")->Clone("kFirst_D0ZResECur"));
1701  fD0ZResECur_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0ZResE")->Clone("kOnlySecond_D0ZResECur"));
1702  }
1703  if(resfileCur->Get("kFirst_Pt1ResP") && resfileCur->Get("kOnlySecond_Pt1ResP")){
1704  fPt1ResPCur_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_Pt1ResP")->Clone("kFirst_Pt1ResPCur"));
1705  fPt1ResPCur_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_Pt1ResP")->Clone("kOnlySecond_Pt1ResPCur"));
1706  }
1707  if(resfileCur->Get("kFirst_Pt1ResK") && resfileCur->Get("kOnlySecond_Pt1ResK")){
1708  fPt1ResKCur_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_Pt1ResK")->Clone("kFirst_Pt1ResKCur"));
1709  fPt1ResKCur_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_Pt1ResK")->Clone("kOnlySecond_Pt1ResKCur"));
1710  }
1711  if(resfileCur->Get("kFirst_Pt1ResPi") && resfileCur->Get("kOnlySecond_Pt1ResPi")){
1712  fPt1ResPiCur_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_Pt1ResPi")->Clone("kFirst_Pt1ResPiCur"));
1713  fPt1ResPiCur_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_Pt1ResPi")->Clone("kOnlySecond_Pt1ResPiCur"));
1714  }
1715  if(resfileCur->Get("kFirst_Pt1ResE") && resfileCur->Get("kOnlySecond_Pt1ResE")){
1716  fPt1ResECur_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_Pt1ResE")->Clone("kFirst_Pt1ResECur"));
1717  fPt1ResECur_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_Pt1ResE")->Clone("kOnlySecond_Pt1ResECur"));
1718  }
1719  if(resfileCur->Get("kFirst_D0RPResPSA") && resfileCur->Get("kOnlySecond_D0RPResPSA")){
1720  fD0RPResPCurSA_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0RPResPSA")->Clone("kFirst_D0RPResPCurSA"));
1721  fD0RPResPCurSA_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0RPResPSA")->Clone("kOnlySecond_D0RPResPCurSA"));
1722  }
1723  if(resfileCur->Get("kFirst_D0RPResKSA") && resfileCur->Get("kOnlySecond_D0RKResPSA")){
1724  fD0RPResKCurSA_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0RPResKSA")->Clone("kFirst_D0RPResKCurSA"));
1725  fD0RPResKCurSA_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0RPResKSA")->Clone("kOnlySecond_D0RPResKCurSA"));
1726  }
1727  if(resfileCur->Get("kFirst_D0RPResPiSA") && resfileCur->Get("kOnlySecond_D0RPResPiSA")){
1728  fD0RPResPiCurSA_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0RPResPiSA")->Clone("kFirst_D0RPResPiCurSA"));
1729  fD0RPResPiCurSA_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0RPResPiSA")->Clone("kOnlySecond_D0RPResPiCurSA"));
1730  }
1731  if(resfileCur->Get("kFirst_D0RPResESA") && resfileCur->Get("kOnlySecond_D0RPResESA")){
1732  fD0RPResECurSA_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0RPResESA")->Clone("kFirst_D0RPResECurSA"));
1733  fD0RPResECurSA_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0RPResESA")->Clone("kOnlySecond_D0RPResECurSA"));
1734  }
1735  if(resfileCur->Get("kFirst_D0ZResPSA") && resfileCur->Get("kOnlySecond_D0ZResPSA")){
1736  fD0ZResPCurSA_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0ZResPSA")->Clone("kFirst_D0ZResPCurSA"));
1737  fD0ZResPCurSA_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0ZResPSA")->Clone("kOnlySecond_D0ZResPCurSA"));
1738  }
1739  if(resfileCur->Get("kFirst_D0ZResKSA") && resfileCur->Get("kOnlySecond_D0ZResKSA")){
1740  fD0ZResKCurSA_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0ZResKSA")->Clone("kFirst_D0ZResKCurSA"));
1741  fD0ZResKCurSA_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0ZResKSA")->Clone("kOnlySecond_D0ZResKCurSA"));
1742  }
1743  if(resfileCur->Get("kFirst_D0ZResPiSA") && resfileCur->Get("kOnlySecond_D0ZResPiSA")){
1744  fD0ZResPiCurSA_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0ZResPiSA")->Clone("kFirst_D0ZResPiCurSA"));
1745  fD0ZResPiCurSA_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0ZResPiSA")->Clone("kOnlySecond_D0ZResPiCurSA"));
1746  }
1747  if(resfileCur->Get("kFirst_D0ZResESA") && resfileCur->Get("kOnlySecond_D0ZResESA")){
1748  fD0ZResECurSA_PbPb2018_kFirst=(TGraph*)(resfileCur->Get("kFirst_D0ZResESA")->Clone("kFirst_D0ZResECurSA"));
1749  fD0ZResECurSA_PbPb2018_kOnlySecond=(TGraph*)(resfileCur->Get("kOnlySecond_D0ZResESA")->Clone("kOnlySecond_D0ZResECurSA"));
1750  }
1751  if(resfileCur->Get("kFirst_Pt1ResPSA") && resfileCur->Get("kOnlySecond_Pt1ResPSA")){
1752  fPt1ResPCurSA_PbPb2018_kFirst=(TGraph*) (resfileCur->Get("kFirst_Pt1ResPSA")->Clone("kFirst_Pt1ResPCurSA"));
1753  fPt1ResPCurSA_PbPb2018_kOnlySecond=(TGraph*) (resfileCur->Get("kOnlySecond_Pt1ResPSA")->Clone("kOnlySecond_Pt1ResPCurSA"));
1754  }
1755  if(resfileCur->Get("kFirst_Pt1ResKSA") && resfileCur->Get("kOnlySecond_Pt1ResKSA")){
1756  fPt1ResKCurSA_PbPb2018_kFirst=(TGraph*) (resfileCur->Get("kFirst_Pt1ResKSA")->Clone("kFirst_Pt1ResKCurSA"));
1757  fPt1ResKCurSA_PbPb2018_kOnlySecond=(TGraph*) (resfileCur->Get("kOnlySecond_Pt1ResKSA")->Clone("kOnlySecond_Pt1ResKCurSA"));
1758  }
1759  if(resfileCur->Get("kFirst_Pt1ResPiSA") && resfileCur->Get("kOnlySecond_Pt1ResPiSA")){
1760  fPt1ResPiCurSA_PbPb2018_kFirst=(TGraph*) (resfileCur->Get("kFirst_Pt1ResPiSA")->Clone("kFirst_Pt1ResPiCurSA"));
1761  fPt1ResPiCurSA_PbPb2018_kOnlySecond=(TGraph*) (resfileCur->Get("kOnlySecond_Pt1ResPiSA")->Clone("kOnlySecond_Pt1ResPiCurSA"));
1762  }
1763  if(resfileCur->Get("kFirst_Pt1ResESA") && resfileCur->Get("kOnlySecond_Pt1ResESA")){
1764  fPt1ResECurSA_PbPb2018_kFirst=(TGraph*) (resfileCur->Get("kFirst_Pt1ResESA")->Clone("kFirst_Pt1ResECurSA"));
1765  fPt1ResECurSA_PbPb2018_kOnlySecond=(TGraph*) (resfileCur->Get("kOnlySecond_Pt1ResESA")->Clone("kOnlySecond_Pt1ResECurSA"));
1766  }
1767  delete resfileCur;
1768  }
1769  }
1770 
1771  //TString resfileUpgURI = Form("alien:///alice/cern.ch/user/p/pwg_hf/common/Improver/%s/%s/ITSgraphs_NewAll-X0.3-Res4um.root",period,systematic);
1772 
1773 
1774  TString pathToFileUpgrade = AliDataFile::GetFileName(Form("PWGHF/common/Improver/%s/%s/ITSgraphs_NewAll-X0.3-Res4um.root",lProductionName.Data(),fImproverSuffix.Data())); // find URI for improver file from CVMFS
1775 
1776  TFile *resfileUpg=TFile::Open(pathToFileUpgrade.Data());
1777  printf("\n### reading file %s ...\n",pathToFileUpgrade.Data());
1778  if(resfileUpg) printf("... READ ###\n");
1779  if(resfileUpg) {
1780  if(!fIsPbPb2018){
1781  if(resfileUpg->Get("D0RPResP" )) {
1782  fD0RPResPUpg =(TGraph*)(resfileUpg->Get("D0RPResP" )->Clone("D0RPResPUpg" ));
1783  }
1784  if(resfileUpg->Get("D0RPResK" )) {
1785  fD0RPResKUpg =(TGraph*)(resfileUpg->Get("D0RPResK" )->Clone("D0RPResKUpg" ));
1786  }
1787  if(resfileUpg->Get("D0RPResPi")) {
1788  fD0RPResPiUpg=(TGraph*)(resfileUpg->Get("D0RPResPi")->Clone("D0RPResPiUpg"));
1789  }
1790  if(resfileUpg->Get("D0RPResE")) {
1791  fD0RPResEUpg=(TGraph*)(resfileUpg->Get("D0RPResE")->Clone("D0RPResEUpg"));
1792  }
1793  for(Int_t j=0; j<2; j++){
1794  for(Int_t i=0; i<4; i++){
1795  if(resfileUpg->Get(Form("D0RPMeanP_B%d_phi%d",j,i))) {
1796  fD0RPMeanPUpg[j][i]=(TGraph*)(resfileUpg->Get(Form("D0RPMeanP_B%d_phi%d",j,i))->Clone(Form("D0RPMeanPUpg_B%d_phi%d",j,i)));
1797  }
1798  if(resfileUpg->Get(Form("D0RPMeanK_B%d_phi%d",j,i))) {
1799  fD0RPMeanKUpg[j][i]=(TGraph*)(resfileUpg->Get(Form("D0RPMeanK_B%d_phi%d",j,i))->Clone(Form("D0RPMeanKUpg_B%d_phi%d",j,i)));
1800  }
1801  if(resfileUpg->Get(Form("D0RPMeanPi_B%d_phi%d",j,i))) {
1802  fD0RPMeanPiUpg[j][i]=(TGraph*)(resfileUpg->Get(Form("D0RPMeanPi_B%d_phi%d",j,i))->Clone(Form("D0RPMeanPiUpg_B%d_phi%d",j,i)));
1803  }
1804  if(resfileUpg->Get(Form("D0RPMeanE_B%d_phi%d",j,i))) {
1805  fD0RPMeanEUpg[j][i]=(TGraph*)(resfileUpg->Get(Form("D0RPMeanE_B%d_phi%d",j,i))->Clone(Form("D0RPMeanEUpg_B%d_phi%d",j,i)));
1806  }
1807  }
1808  }
1809  if(resfileUpg->Get("D0ZResP" )) {
1810  fD0ZResPUpg =(TGraph*)(resfileUpg->Get("D0ZResP" )->Clone("D0ZResPUpg" ));
1811  }
1812  if(resfileUpg->Get("D0ZResK" )) {
1813  fD0ZResKUpg =(TGraph*)(resfileUpg->Get("D0ZResK" )->Clone("D0ZResKUpg" ));
1814  }
1815  if(resfileUpg->Get("D0ZResPi" )) {
1816  fD0ZResPiUpg =(TGraph*)(resfileUpg->Get("D0ZResPi" )->Clone("D0ZResPiUpg" ));
1817  }
1818  if(resfileUpg->Get("D0ZResE" )) {
1819  fD0ZResEUpg =(TGraph*)(resfileUpg->Get("D0ZResE" )->Clone("D0ZResEUpg" ));
1820  }
1821  if(resfileUpg->Get("Pt1ResP" )) {
1822  fPt1ResPUpg =(TGraph*)(resfileUpg->Get("Pt1ResP" )->Clone("Pt1ResPUpg" ));
1823  }
1824  if(resfileUpg->Get("Pt1ResK" )) {
1825  fPt1ResKUpg =(TGraph*)(resfileUpg->Get("Pt1ResK" )->Clone("Pt1ResKUpg" ));
1826  }
1827  if(resfileUpg->Get("Pt1ResPi" )) {
1828  fPt1ResPiUpg =(TGraph*)(resfileUpg->Get("Pt1ResPi" )->Clone("Pt1ResPiUpg" ));
1829  }
1830  if(resfileUpg->Get("Pt1ResE" )) {
1831  fPt1ResEUpg =(TGraph*)(resfileUpg->Get("Pt1ResE" )->Clone("Pt1ResEUpg" ));
1832  }
1833  if(resfileUpg->Get("D0RPResPSA" )) {
1834  fD0RPResPUpgSA =(TGraph*)(resfileUpg->Get("D0RPResPSA" )->Clone("D0RPResPUpgSA" ));
1835  }
1836  if(resfileUpg->Get("D0RPResKSA" )) {
1837  fD0RPResKUpgSA =(TGraph*)(resfileUpg->Get("D0RPResKSA" )->Clone("D0RPResKUpgSA" ));
1838  }
1839  if(resfileUpg->Get("D0RPResPiSA")) {
1840  fD0RPResPiUpgSA=(TGraph*)(resfileUpg->Get("D0RPResPiSA")->Clone("D0RPResPiUpgSA"));
1841  }
1842  if(resfileUpg->Get("D0RPResESA")) {
1843  fD0RPResEUpgSA=(TGraph*)(resfileUpg->Get("D0RPResESA")->Clone("D0RPResEUpgSA"));
1844  }
1845  if(resfileUpg->Get("D0ZResPSA" )) {
1846  fD0ZResPUpgSA =(TGraph*)(resfileUpg->Get("D0ZResPSA" )->Clone("D0ZResPUpgSA" ));
1847  }
1848  if(resfileUpg->Get("D0ZResKSA" )) {
1849  fD0ZResKUpgSA =(TGraph*)(resfileUpg->Get("D0ZResKSA" )->Clone("D0ZResKUpgSA" ));
1850  }
1851  if(resfileUpg->Get("D0ZResPiSA" )) {
1852  fD0ZResPiUpgSA =(TGraph*)(resfileUpg->Get("D0ZResPiSA" )->Clone("D0ZResPiUpgSA" ));
1853  }
1854  if(resfileUpg->Get("D0ZResESA" )) {
1855  fD0ZResEUpgSA =(TGraph*)(resfileUpg->Get("D0ZResESA" )->Clone("D0ZResEUpgSA" ));
1856  }
1857  if(resfileUpg->Get("Pt1ResPSA" )) {
1858  fPt1ResPUpgSA =(TGraph*)(resfileUpg->Get("Pt1ResPSA" )->Clone("Pt1ResPUpgSA" ));
1859  }
1860  if(resfileUpg->Get("Pt1ResKSA" )) {
1861  fPt1ResKUpgSA =(TGraph*)(resfileUpg->Get("Pt1ResKSA" )->Clone("Pt1ResKUpgSA" ));
1862  }
1863  if(resfileUpg->Get("Pt1ResPiSA" )) {
1864  fPt1ResPiUpgSA =(TGraph*)(resfileUpg->Get("Pt1ResPiSA" )->Clone("Pt1ResPiUpgSA" ));
1865  }
1866  if(resfileUpg->Get("Pt1ResESA" )) {
1867  fPt1ResEUpgSA =(TGraph*)(resfileUpg->Get("Pt1ResESA" )->Clone("Pt1ResEUpgSA" ));
1868  }
1869  delete resfileUpg;
1870  }
1871  else // analysing PbPb 2018 periods
1872  {
1873  if(resfileUpg->Get("kFirst_D0RPResP") && resfileUpg->Get("kOnlySecond_D0RPResP")){
1874  fD0RPResPUpg_PbPb2018_kFirst=(TGraph*)(resfileUpg->Get("kFirst_D0RPResP")->Clone("kFirst_D0RPResPUpg"));
1875  fD0RPResPUpg_PbPb2018_kOnlySecond=(TGraph*)(resfileUpg->Get("kOnlySecond_D0RPResP")->Clone("kOnlySecond_D0RPResPUpg"));
1876  }
1877  if(resfileUpg->Get("kFirst_D0RPResK") && resfileUpg->Get("kOnlySecond_D0RPResK")){
1878  fD0RPResKUpg_PbPb2018_kFirst=(TGraph*)(resfileUpg->Get("kFirst_D0RPResK")->Clone("kFirst_D0RPResKUpg"));
1879  fD0RPResKUpg_PbPb2018_kOnlySecond=(TGraph*)(resfileUpg->Get("kOnlySecond_D0RPResK")->Clone("kOnlySecond_D0RPResKUpg"));
1880  }
1881  if(resfileUpg->Get("kFirst_D0RPResPi") && resfileUpg->Get("kOnlySecond_D0RPResPi")){
1882  fD0RPResPiUpg_PbPb2018_kFirst=(TGraph*)(resfileUpg->Get("kFirst_D0RPResPi")->Clone("kFirst_D0RPResPiUpg"));
1883  fD0RPResPiUpg_PbPb2018_kOnlySecond=(TGraph*)(resfileUpg->Get("kOnlySecond_D0RPResPi")->Clone("kOnlySecond_D0RPResPiUpg"));
1884  }
1885  if(resfileUpg->Get("kFirst_D0RPResE") && resfileUpg->Get("kOnlySecond_D0RPResE")){
1886  fD0RPResEUpg_PbPb2018_kFirst=(TGraph*)(resfileUpg->Get("kFirst_D0RPResE")->Clone("kFirst_D0RPResEUpg"));
1887  fD0RPResEUpg_PbPb2018_kOnlySecond=(TGraph*)(resfileUpg->Get("kOnlySecond_D0RPResE")->Clone("kOnlySecond_D0RPResEUpg"));
1888  }
1889  for(UInt_t j = 0; j < 2; j++){
1890  for(UInt_t i = 0; i < 24; i++){
1891  if(resfileUpg->Get(Form("kFirst_D0RPMeanP_B%d_phi%d",j,i)) && resfileUpg->Get(Form("kOnlySecond_D0RPMeanP_B%d_phi%d",j,i))){
1892  fD0RPMeanPUpg_PbPb2018_kFirst[j][i]=(TGraph*)(resfileUpg->Get(Form("kFirst_D0RPMeanP_B%d_phi%d",j,i))->Clone(Form("kFirst_D0RPMeanP_B%d_phi%d",j,i)));
1893  fD0RPMeanPUpg_PbPb2018_kOnlySecond[j][i]=(TGraph*)(resfileUpg->Get(Form("kOnlySecond_D0RPMeanP_B%d_phi%d",j,i))->Clone(Form("kOnlySecond_D0RPMeanP_B%d_phi%d",j,i)));
1894  }
1895  if(resfileUpg->Get(Form("kFirst_D0RPMeanK_B%d_phi%d",j,i)) && resfileUpg->Get(Form("kOnlySecond_D0RPMeanK_B%d_phi%d",j,i))){
1896  fD0RPMeanKUpg_PbPb2018_kFirst[j][i]=(TGraph*)(resfileUpg->Get(Form("kFirst_D0RPMeanK_B%d_phi%d",j,i))->Clone(Form("kFirst_D0RPMeanK_B%d_phi%d",j,i)));
1897  fD0RPMeanKUpg_PbPb2018_kOnlySecond[j][i]=(TGraph*)(resfileUpg->Get(Form("kOnlySecond_D0RPMeanK_B%d_phi%d",j,i))->Clone(Form("kOnlySecond_D0RPMeanK_B%d_phi%d",j,i)));
1898  }
1899  if(resfileUpg->Get(Form("kFirst_D0RPMeanPi_B%d_phi%d",j,i)) && resfileUpg->Get(Form("kOnlySecond_D0RPMeanPi_B%d_phi%d",j,i))){
1900  fD0RPMeanPiUpg_PbPb2018_kFirst[j][i]=(TGraph*)(resfileUpg->Get(Form("kFirst_D0RPMeanPi_B%d_phi%d",j,i))->Clone(Form("kFirst_D0RPMeanPi_B%d_phi%d",j,i)));
1901  fD0RPMeanPiUpg_PbPb2018_kOnlySecond[j][i]=(TGraph*)(resfileUpg->Get(Form("kOnlySecond_D0RPMeanPi_B%d_phi%d",j,i))->Clone(Form("kOnlySecond_D0RPMeanPi_B%d_phi%d",j,i)));
1902  }
1903  if(resfileUpg->Get(Form("kFirst_D0RPMeanE_B%d_phi%d",j,i)) && resfileUpg->Get(Form("kOnlySecond_D0RPMeanE_B%d_phi%d",j,i))){
1904  fD0RPMeanEUpg_PbPb2018_kFirst[j][i]=(TGraph*)(resfileUpg->Get(Form("kFirst_D0RPMeanE_B%d_phi%d",j,i))->Clone(Form("kFirst_D0RPMeanE_B%d_phi%d",j,i)));
1905  fD0RPMeanEUpg_PbPb2018_kOnlySecond[j][i]=(TGraph*)(resfileUpg->Get(Form("kOnlySecond_D0RPMeanE_B%d_phi%d",j,i))->Clone(Form("kOnlySecond_D0RPMeanE_B%d_phi%d",j,i)));
1906  }
1907  }
1908  }
1909  if(resfileUpg->Get("kFirst_D0ZResP") && resfileUpg->Get("kOnlySecond_D0ZResP")){
1910  fD0ZResPUpg_PbPb2018_kFirst=(TGraph*)(resfileUpg->Get("kFirst_D0ZResP")->Clone("kFirst_D0ZResPUpg"));
1911  fD0ZResPUpg_PbPb2018_kOnlySecond=(TGraph*)(resfileUpg->Get("kOnlySecond_D0ZResP")->Clone("kOnlySecond_D0ZResPUpg"));
1912  }
1913  if(resfileUpg->Get("kFirst_D0ZResK") && resfileUpg->Get("kOnlySecond_D0ZResK")){
1914  fD0ZResKUpg_PbPb2018_kFirst=(TGraph*)(resfileUpg->Get("kFirst_D0ZResK")->Clone("kFirst_D0ZResKUpg"));
1915  fD0ZResKUpg_PbPb2018_kOnlySecond=(TGraph*)(resfileUpg->Get("kOnlySecond_D0ZResK")->Clone("kOnlySecond_D0ZResKUpg"));
1916  }
1917  if(resfileUpg->Get("kFirst_D0ZResPi") && resfileUpg->Get("kOnlySecond_D0ZResPi")){
1918  fD0ZResPiUpg_PbPb2018_kFirst=(TGraph*)(resfileUpg->Get("kFirst_D0ZResPi")->Clone("kFirst_D0ZResPiUpg"));
1919  fD0ZResPiUpg_PbPb2018_kOnlySecond=(TGraph*)(resfileUpg->Get("kOnlySecond_D0ZResPi")->Clone("kOnlySecond_D0ZResPiUpg"));
1920  }
1921  if(resfileUpg->Get("kFirst_D0ZResE") && resfileUpg->Get("kOnlySecond_D0ZResE")){
1922  fD0ZResEUpg_PbPb2018_kFirst=(TGraph*)(resfileUpg->Get("kFirst_D0ZResE")->Clone("kFirst_D0ZResEUpg"));
1923  fD0ZResEUpg_PbPb2018_kOnlySecond=(TGraph*)(resfileUpg->Get("kOnlySecond_D0ZResE")->Clone("kOnlySecond_D0ZResEUpg"));
1924  }
1925  if(resfileUpg->Get("kFirst_Pt1ResP") && resfileUpg->Get("kOnlySecond_Pt1ResP")){
1926  fPt1ResPUpg_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_Pt1ResP")->Clone("kFirst_Pt1ResPUpg"));
1927  fPt1ResPUpg_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_Pt1ResP")->Clone("kOnlySecond_Pt1ResPUpg"));
1928  }
1929  if(resfileUpg->Get("kFirst_Pt1ResK") && resfileUpg->Get("kOnlySecond_Pt1ResK")){
1930  fPt1ResKUpg_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_Pt1ResK")->Clone("kFirst_Pt1ResKUpg"));
1931  fPt1ResKUpg_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_Pt1ResK")->Clone("kOnlySecond_Pt1ResKUpg"));
1932  }
1933  if(resfileUpg->Get("kFirst_Pt1ResPi") && resfileUpg->Get("kOnlySecond_Pt1ResPi")){
1934  fPt1ResPiUpg_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_Pt1ResPi")->Clone("kFirst_Pt1ResPiUpg"));
1935  fPt1ResPiUpg_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_Pt1ResPi")->Clone("kOnlySecond_Pt1ResPiUpg"));
1936  }
1937  if(resfileUpg->Get("kFirst_Pt1ResE") && resfileUpg->Get("kOnlySecond_Pt1ResE")){
1938  fPt1ResEUpg_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_Pt1ResE")->Clone("kFirst_Pt1ResEUpg"));
1939  fPt1ResEUpg_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_Pt1ResE")->Clone("kOnlySecond_Pt1ResEUpg"));
1940  }
1941  if(resfileUpg->Get("kFirst_D0RPResPSA") && resfileUpg->Get("kOnlySecond_D0RPResPSA")){
1942  fD0RPResPUpgSA_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_D0RPResPSA")->Clone("kFirst_D0RPResPUpgSA"));
1943  fD0RPResPUpgSA_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_D0RPResPSA")->Clone("kOnlySecond_D0RPResPUpgSA"));
1944  }
1945  if(resfileUpg->Get("kFirst_D0RPResKSA") && resfileUpg->Get("kOnlySecond_D0RPResKSA")){
1946  fD0RPResKUpgSA_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_D0RPResKSA")->Clone("kFirst_D0RPResKUpgSA"));
1947  fD0RPResKUpgSA_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_D0RPResKSA")->Clone("kOnlySecond_D0RPResKUpgSA"));
1948  }
1949  if(resfileUpg->Get("kFirst_D0RPResPiSA") && resfileUpg->Get("kOnlySecond_D0RPResPiSA")){
1950  fD0RPResPiUpgSA_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_D0RPResPiSA")->Clone("kFirst_D0RPResPiUpgSA"));
1951  fD0RPResPiUpgSA_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_D0RPResPiSA")->Clone("kOnlySecond_D0RPResPiUpgSA"));
1952  }
1953  if(resfileUpg->Get("kFirst_D0RPResESA") && resfileUpg->Get("kOnlySecond_D0RPResESA")){
1954  fD0RPResEUpgSA_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_D0RPResESA")->Clone("kFirst_D0RPResEUpgSA"));
1955  fD0RPResEUpgSA_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_D0RPResESA")->Clone("kOnlySecond_D0RPResEUpgSA"));
1956  }
1957  if(resfileUpg->Get("kFirst_D0ZResPSA") && resfileUpg->Get("kOnlyFirst_D0ZResPSA")){
1958  fD0ZResPUpgSA_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_D0ZResPSA")->Clone("kFirst_D0ZResPUpgSA"));
1959  fD0ZResPUpgSA_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_D0ZResPSA")->Clone("kOnlySecond_D0ZResPUpgSA"));
1960  }
1961  if(resfileUpg->Get("kFirst_D0ZResKSA") && resfileUpg->Get("kOnlyFirst_D0ZResKSA")){
1962  fD0ZResKUpgSA_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_D0ZResKSA")->Clone("kFirst_D0ZResKUpgSA"));
1963  fD0ZResKUpgSA_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_D0ZResKSA")->Clone("kOnlySecond_D0ZResKUpgSA"));
1964  }
1965  if(resfileUpg->Get("kFirst_D0ZResPiSA") && resfileUpg->Get("kOnlyFirst_D0ZResPiSA")){
1966  fD0ZResPiUpgSA_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_D0ZResPiSA")->Clone("kFirst_D0ZResPiUpgSA"));
1967  fD0ZResPiUpgSA_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_D0ZResPiSA")->Clone("kOnlySecond_D0ZResPiUpgSA"));
1968  }
1969  if(resfileUpg->Get("kFirst_D0ZResESA") && resfileUpg->Get("kOnlyFirst_D0ZResESA")){
1970  fD0ZResEUpgSA_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_D0ZResESA")->Clone("kFirst_D0ZResEUpgSA"));
1971  fD0ZResEUpgSA_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_D0ZResESA")->Clone("kOnlySecond_D0ZResEUpgSA"));
1972  }
1973  if(resfileUpg->Get("kFirst_Pt1ResPSA") && resfileUpg->Get("kOnlySecond_Pt1ResPSA")){
1974  fPt1ResPUpgSA_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_Pt1ResPSA")->Clone("kFirst_Pt1ResPUpgSA"));
1975  fPt1ResPUpgSA_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_Pt1ResPSA")->Clone("kOnlySecond_Pt1ResPUpgSA"));
1976  }
1977  if(resfileUpg->Get("kFirst_Pt1ResKSA") && resfileUpg->Get("kOnlySecond_Pt1ResKSA")){
1978  fPt1ResKUpgSA_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_Pt1ResKSA")->Clone("kFirst_Pt1ResKUpgSA"));
1979  fPt1ResKUpgSA_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_Pt1ResKSA")->Clone("kOnlySecond_Pt1ResKUpgSA"));
1980  }
1981  if(resfileUpg->Get("kFirst_Pt1ResPiSA") && resfileUpg->Get("kOnlySecond_Pt1ResPiSA")){
1982  fPt1ResPiUpgSA_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_Pt1ResPiSA")->Clone("kFirst_Pt1ResPiUpgSA"));
1983  fPt1ResPiUpgSA_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_Pt1ResPiSA")->Clone("kOnlySecond_Pt1ResPiUpgSA"));
1984  }
1985  if(resfileUpg->Get("kFirst_Pt1ResESA") && resfileUpg->Get("kOnlySecond_Pt1ResESA")){
1986  fPt1ResEUpgSA_PbPb2018_kFirst=(TGraph*) (resfileUpg->Get("kFirst_Pt1ResESA")->Clone("kFirst_Pt1ResEUpgSA"));
1987  fPt1ResEUpgSA_PbPb2018_kOnlySecond=(TGraph*) (resfileUpg->Get("kOnlySecond_Pt1ResESA")->Clone("kOnlySecond_Pt1ResEUpgSA"));
1988  }
1989  delete resfileUpg;
1990  }
1991 
1992  }
1993 
1994  fFilesOpen = kTRUE;
1995 }
1996 
1998 
TGraph * fD0RPResPiCur
old pt dep. d0 res. in rphi for kaons
TGraph * fD0RPMeanKCur[2][4]
old pt dep. d0 mean. in rphi for protons in 4 phi regions
AliAODTrack * GetProng(AliVEvent *event, AliAODRecoDecayHF *rd, Int_t iprong)
TGraph * fPt1ResPiUpg
new pt dep. 1/pt res. for kaons
TGraph * fD0RPResEUpg
new pt dep. d0 res. in rphi for pions
TGraph * fPt1ResECurSA
old standalone pt dep. 1/pt res. for pions
double Double_t
Definition: External.C:58
Bool_t fMimicData
flag to switch on/off the correction of the pulls
virtual void UserCreateOutputObjects()
Implementation of interface methods.
TGraph * fD0RPSigmaPullRatioE
pt dep. d0 sigma pull MC/data in rphi for pions
TGraph * fPt1ResPiUpgSA
new standalone pt dep. 1/pt res. for kaons
TGraph * fD0ZResPUpg
old pt dep. 1/pt res. for electrons
TGraph * fD0RPResPiCurSA
old standalone pt dep. d0 res. in rphi for kaons
TGraph * fD0RPResPUpgSA
new standalone pt dep. d0 res. in z for electrons
TGraph * fD0ZResPiUpg
new pt dep. d0 res. in z for kaons
TGraph * fD0ZResEUpgSA
new standalone pt dep. d0 res. in z for pions
TGraph * fPt1ResPiCur
old pt dep. 1/pt res. for kaons
TGraph * fD0RPResKCur
old pt dep. d0 res. in rphi for protons
Double_t EvalGraph(Double_t x, const TGraph *graph, const TGraph *graphSA=0) const
Helper functions.
Double_t bz
TString fOverridePeriodName
suffix for path of correction file on grid
TGraph * fPt1ResPCurSA
old standalone pt dep. d0 res. in rphi for electrons
TGraph * fPt1ResKUpg
new pt dep. 1/pt res. for protons
TGraph * fD0RPMeanKUpg[2][4]
new pt dep. d0 mean in rphi for protons in 4 phi regions
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
TGraph * fD0ZResPCurSA
new pt dep. 1/pt res. for electrons
TGraph * fD0RPMeanEUpg[2][4]
new pt dep. d0 mean in rphi for pions in 4 phi regions
TGraph * fD0RPResKCurSA
old standalone pt dep. d0 res. in rphi for protons
Bool_t FillRecoCasc(AliVEvent *event, AliAODRecoCascadeHF *rc, Bool_t isDStar, Bool_t recoSecVtx=kFALSE)
TGraph * fPt1ResPUpg
new pt dep. d0 mean in rphi for electrons in 4 phi regions
TGraph * fD0RPMeanECur[2][4]
old pt dep. d0 mean. in rphi for pions in 4 phi regions
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
TGraph * fD0ZResECurSA
old standalone pt dep. d0 res. in z for pions
float Float_t
Definition: External.C:68
TGraph * fD0ZResPiCur
old pt dep. d0 res. in z for kaons
TGraph * fD0RPResKUpg
new pt dep. d0 res. in rphi for protons
TGraph * fD0RPResPUpg
new pt dep. d0 res. in z for electrons
AliAODTrack * GetBachelor() const
TGraph * fD0ZResKUpg
new pt dep. d0 res. in z for protons
TList * fDebugOutput
! collection of debug output
TGraph * fD0ZResPiUpgSA
new standalone pt dep. d0 res. in z for kaons
Bool_t fFilesOpen
custom name for overriding auto period name
TGraph * fD0ZResEUpg
new pt dep. d0 res. in z for pions
TGraph * fD0RPMeanPiCur[2][4]
old pt dep. d0 mean. in rphi for kaons in 4 phi regions
TGraph * fPt1ResPiCurSA
old standalone pt dep. 1/pt res. for kaons
TGraph * fD0ZResPUpgSA
old standalone pt dep. 1/pt res. for electrons
TNtuple * fDebugNtuple
! debug send on output slot 1
static Bool_t IsCandidateInjected(AliAODRecoDecayHF *cand, AliAODMCHeader *header, TClonesArray *arrayMC)
TGraph * fD0RPMeanPiUpg[2][4]
new pt dep. d0 mean in rphi for kaons in 4 phi regions
Bool_t fUpdateSecVertCovMat
this is always kTRUE. kFALSE only if re-running on already improved AODs
TGraph * fPt1ResKCurSA
old standalone pt dep. 1/pt res. for protons
short Short_t
Definition: External.C:23
TGraph * fD0RPResPCurSA
old standalone pt dep. d0 res. in z for electrons
TString fImproverSuffix
Max number of debug entries into Ntuple.
TGraph * fD0RPResPiUpgSA
new standalone pt dep. d0 res. in rphi for kaons
TGraph * fPt1ResEUpg
new pt dep. 1/pt res. for pions
TGraph * fD0RPResPiUpg
new pt dep. d0 res. in rphi for kaons
decay
Definition: HFPtSpectrum.C:42
TGraph * fPt1ResPCur
old pt dep. d0 mean. in rphi for electrons in 4 phi regions
TGraph * fPt1ResECur
old pt dep. 1/pt res. for pions
static Bool_t IsTrackInjected(Int_t label, AliAODMCHeader *header, TClonesArray *arrayMC)
void Setd0errProngs(Int_t nprongs, Double_t *d0)
Bool_t fUpdatePulls
flag to switch on/off the update of the single track covariance matrix
Float_t * fDebugVars
! variables to store as degug info
TGraph * fD0ZResECur
old pt dep. d0 res. in z for pions
TGraph * fD0RPResEUpgSA
new standalone pt dep. d0 res. in rphi for pions
Bool_t fImproveTracks
flag to run hybrid task before the vertexingHF task or in standard mode
TGraph * fD0RPResECurSA
old standalone pt dep. d0 res. in rphi for pions
unsigned short UShort_t
Definition: External.C:28
TGraph * fPt1ResPUpgSA
new standalone pt dep. d0 res. in rphi for electrons
TGraph * fPt1ResEUpgSA
new standalone pt dep. 1/pt res. for pions
Bool_t fUpdateSTCovMatrix
flag to swicth on/off the modification of the sec vert cov matrix
TGraph * fD0ZResKCur
old pt dep. d0 res. in z for protons
const char Option_t
Definition: External.C:48
TGraph * fD0RPResKUpgSA
new standalone pt dep. d0 res. in rphi for protons
TGraph * fD0ZResKUpgSA
new standalone pt dep. d0 res. in z for protons
const Double_t pi
bool Bool_t
Definition: External.C:53
void SetSigmaVert(Double_t sigmaVert)
AliAODRecoDecayHF2Prong * Get2Prong() const
TGraph * fD0ZResPiCurSA
old standalone pt dep. d0 res. in z for kaons
Bool_t fIsPbPb2018
new standalone pt dep. 1/pt res. for electrons
TGraph * fD0RPMeanPCur[2][4]
pt dep. d0 sigma pull MC/data in rphi for electrons
TGraph * fD0RPSigmaPullRatioK
pt dep. d0 sigma pull MC/data in rphi for protons
void SmearTrack(AliVTrack *track, Double_t bz)
TGraph * fPt1ResKUpgSA
new standalone pt dep. 1/pt res. for protons
TGraph * fD0ZResKCurSA
old standalone pt dep. d0 res. in z for protons
TClonesArray * fMCs
flag to control whether to smear only injected signal
TGraph * fD0RPSigmaPullRatioPi
pt dep. d0 sigma pull MC/data in rphi for kaons
TGraph * fD0RPResECur
old pt dep. d0 res. in rphi for pions
TGraph * fD0RPMeanPUpg[2][4]
new pt dep. d0 res. in rphi for electrons
TGraph * fD0RPResPCur
old pt dep. d0 res. in z for electrons
TGraph * fD0RPSigmaPullRatioP
old pt dep. d0 res. in rphi for electrons
TGraph * fPt1ResKCur
old pt dep. 1/pt res. for protons
AliESDVertex * RecalculateVertex(const AliVVertex *old, TObjArray *tracks, Double_t bField)