]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/JetTasks/AliPWG4HighPtQATPConly.cxx
First implementation of EMCAL trigger QA from Nicola Arbor
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliPWG4HighPtQATPConly.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, 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 //-----------------------------------------------------------------------
17 // This class compares the global reconstruction with the TPConly 
18 // reconstruction
19 // Momentum resolution is stored as function of track cuts and pt.
20 // Output: Histograms for different set of cuts
21 //-----------------------------------------------------------------------
22 // Author : Marta Verweij - UU
23 //-----------------------------------------------------------------------
24
25 #ifndef ALIPWG4HIGHPTQATPCONLY_CXX
26 #define ALIPWG4HIGHPTQATPCONLY_CXX
27
28 #include "AliPWG4HighPtQATPConly.h"
29
30 #include "TVector3.h"
31 #include <iostream>
32 #include "TH1.h"
33 #include "TH2.h"
34 #include "TH3.h"
35 #include "TList.h"
36 #include "TChain.h"
37 #include "TH3F.h"
38 #include <Bytes.h>
39 #include <TTree.h>
40
41 #include "AliAnalysisManager.h"
42 #include "AliESDInputHandler.h"
43 #include "AliESDtrack.h"
44 #include "AliESDfriend.h"
45 #include "AliESDfriendTrack.h"
46 #include "AliESDtrackCuts.h"
47 #include "AliExternalTrackParam.h"
48 #include "AliLog.h"
49 //#include "AliAnalysisHelperJetTasks.h"
50
51 #include "TH1I.h"
52
53 using namespace std; //required for resolving the 'cout' symbol
54
55 ClassImp(AliPWG4HighPtQATPConly)
56
57 AliPWG4HighPtQATPConly::AliPWG4HighPtQATPConly(): AliAnalysisTask("AliPWG4HighPtQATPConly", ""), 
58   fESD(0), 
59   fESDfriend(0), 
60   fVtx(0x0),
61   fCutType(1),
62   fTrackCuts(0), 
63   fTrackCutsITS(0),
64   fPtMax(100.),
65   fNEventAll(0),
66   fNEventSel(0),
67   fNEventReject(0),
68   fPtAll(0),
69   fPtSel(0),
70   fPtAllminPtTPCvsPtAll(0),
71   fPtAllminPtTPCvsPtAllEtaPos(0),
72   fPtAllminPtTPCvsPtAllEtaNeg(0),
73   fPtAllminPtTPCvsPtAllNPointTPC(0),
74   fPtAllminPtTPCvsPtAllDCAR(0),
75   fPtAllminPtTPCvsPtAllDCAZ(0),
76   fPtAllminPtTPCvsPtAllPhi(0),
77   fPtAllminPtTPCvsPtAllNPointITS(0),
78   fPtAllminPtTPCvsPtAllNSigmaToVertex(0),
79   fPtAllminPtTPCvsPtAllChi2C(0),
80   fPtAllminPtTPCvsPtAllRel1PtUncertainty(0),
81   fPtAllminPtTPCvsPtAllChi2PerNClusTPC(0),
82   fPtAllminPtTPCvsPtAllChi2PerNClusITS(0),
83   fPtAllminPtTPCvsNPointTPCPhi(0),
84   fPtAllminPtTPCvsNPointITSPhi(0),
85   fPtAllminPtTPCvsRel1PtUncertaintyPhi(0),
86   fEtaPhiOutliers(0),
87   fPtSelITSouter(0),
88   fPtITSouterminPtTPCvsPtAll(0),
89   fPtITSouterminPtTPCvsPtAllEtaPos(0),
90   fPtITSouterminPtTPCvsPtAllEtaNeg(0),
91   fPtITSouterminPtTPCvsPtAllNPointTPC(0),
92   fPtITSouterminPtTPCvsPtAllDCAR(0),
93   fPtITSouterminPtTPCvsPtAllDCAZ(0),
94   fPtITSouterminPtTPCvsPtAllPhi(0),
95   fPtITSouterminPtTPCvsPtAllNPointITS(0),
96   fPtITSouterminPtTPCvsPtAllNSigmaToVertex(0),
97   fPtITSouterminPtTPCvsPtAllChi2C(0),
98   fPtITSouterminPtTPCvsPtAllRel1PtUncertainty(0),
99   fPtITSouterminPtTPCvsPtAllChi2PerNClusTPC(0),
100   fPtITSouterminPtTPCvsPtAllChi2PerNClusITS(0),
101   fPtAllminPtTPCvsPtAllITSLayer0(0),
102   fPtAllminPtTPCvsPtAllITSLayer1(0),
103   fPtAllminPtTPCvsPtAllITSLayer2(0),
104   fPtAllminPtTPCvsPtAllITSLayer3(0),
105   fPtAllminPtTPCvsPtAllITSLayer4(0),
106   fPtAllminPtTPCvsPtAllITSLayer5(0),
107   fPtAllminPtTPCvsPtAllNoSPD(0),
108   fPtAllminPtTPCvsPtAllNoSDD(0),
109   fPtAllminPtTPCvsPtAllNoSSD(0),
110   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer0(0),
111   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer1(0),
112   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer2(0),
113   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer3(0),
114   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer4(0),
115   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer5(0),
116   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSPD(0),
117   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSDD(0),
118   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSSD(0),
119   fHistList(0),
120   fPtAllTPC(0),
121   fPtSelTPC(0),
122   fPtSelTPCITS(0),
123   fHistListTPC(0),
124   fPtSelITS(0),
125   fPtITSminPtTPCvsPtITS(0),
126   fPtITSminPtTPCvsPtITSEtaPos(0),
127   fPtITSminPtTPCvsPtITSEtaNeg(0),
128   fPtITSminPtTPCvsPtITSNPointTPC(0),
129   fPtITSminPtTPCvsPtITSDCAR(0),
130   fPtITSminPtTPCvsPtITSDCAZ(0),
131   fPtITSminPtTPCvsPtITSPhi(0),
132   fPtITSminPtTPCvsPtITSNPointITS(0),
133   fPtITSminPtTPCvsPtITSNSigmaToVertex(0),
134   fPtITSminPtTPCvsPtITSChi2C(0),
135   fPtITSminPtTPCvsPtITSRel1PtUncertainty(0),
136   fPtITSminPtTPCvsPtITSChi2PerNClusTPC(0),
137   fPtITSminPtTPCvsPtITSChi2PerNClusITS(0),
138   fPtITSminPtTPCvsNPointTPCPhi(0),
139   fPtITSminPtTPCvsNPointITSPhi(0),
140   fPtITSminPtTPCvsRel1PtUncertaintyPhi(0),
141   fPtRel1PtUncertaintyChi2PerClusTPC(0),
142   fHistListITS(0)
143   
144 {
145
146 }
147 //________________________________________________________________________
148 AliPWG4HighPtQATPConly::AliPWG4HighPtQATPConly(const char *name): 
149   AliAnalysisTask(name, ""), 
150   fESD(0),
151   fESDfriend(0), 
152   fVtx(0x0),
153   fCutType(1),  
154   fTrackCuts(),
155   fTrackCutsITS(),
156   fPtMax(100.),
157   fNEventAll(0),
158   fNEventSel(0),
159   fNEventReject(0),
160   fPtAll(0),
161   fPtSel(0),
162   fPtAllminPtTPCvsPtAll(0),
163   fPtAllminPtTPCvsPtAllEtaPos(0),
164   fPtAllminPtTPCvsPtAllEtaNeg(0),
165   fPtAllminPtTPCvsPtAllNPointTPC(0),
166   fPtAllminPtTPCvsPtAllDCAR(0),
167   fPtAllminPtTPCvsPtAllDCAZ(0),
168   fPtAllminPtTPCvsPtAllPhi(0),
169   fPtAllminPtTPCvsPtAllNPointITS(0),
170   fPtAllminPtTPCvsPtAllNSigmaToVertex(0),
171   fPtAllminPtTPCvsPtAllChi2C(0),
172   fPtAllminPtTPCvsPtAllRel1PtUncertainty(0),
173   fPtAllminPtTPCvsPtAllChi2PerNClusTPC(0),
174   fPtAllminPtTPCvsPtAllChi2PerNClusITS(0),
175   fPtAllminPtTPCvsNPointTPCPhi(0),
176   fPtAllminPtTPCvsNPointITSPhi(0),
177   fPtAllminPtTPCvsRel1PtUncertaintyPhi(0),
178   fEtaPhiOutliers(0),
179   fPtSelITSouter(0),
180   fPtITSouterminPtTPCvsPtAll(0),
181   fPtITSouterminPtTPCvsPtAllEtaPos(0),
182   fPtITSouterminPtTPCvsPtAllEtaNeg(0),
183   fPtITSouterminPtTPCvsPtAllNPointTPC(0),
184   fPtITSouterminPtTPCvsPtAllDCAR(0),
185   fPtITSouterminPtTPCvsPtAllDCAZ(0),
186   fPtITSouterminPtTPCvsPtAllPhi(0),
187   fPtITSouterminPtTPCvsPtAllNPointITS(0),
188   fPtITSouterminPtTPCvsPtAllNSigmaToVertex(0),
189   fPtITSouterminPtTPCvsPtAllChi2C(0),
190   fPtITSouterminPtTPCvsPtAllRel1PtUncertainty(0),
191   fPtITSouterminPtTPCvsPtAllChi2PerNClusTPC(0),
192   fPtITSouterminPtTPCvsPtAllChi2PerNClusITS(0),
193   fPtAllminPtTPCvsPtAllITSLayer0(0),
194   fPtAllminPtTPCvsPtAllITSLayer1(0),
195   fPtAllminPtTPCvsPtAllITSLayer2(0),
196   fPtAllminPtTPCvsPtAllITSLayer3(0),
197   fPtAllminPtTPCvsPtAllITSLayer4(0),
198   fPtAllminPtTPCvsPtAllITSLayer5(0),
199   fPtAllminPtTPCvsPtAllNoSPD(0),
200   fPtAllminPtTPCvsPtAllNoSDD(0),
201   fPtAllminPtTPCvsPtAllNoSSD(0),
202   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer0(0),
203   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer1(0),
204   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer2(0),
205   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer3(0),
206   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer4(0),
207   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer5(0),
208   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSPD(0),
209   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSDD(0),
210   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSSD(0),
211   fHistList(0),
212   fPtAllTPC(0),
213   fPtSelTPC(0),
214   fPtSelTPCITS(0),
215   fHistListTPC(0),
216   fPtSelITS(0),
217   fPtITSminPtTPCvsPtITS(0),
218   fPtITSminPtTPCvsPtITSEtaPos(0),
219   fPtITSminPtTPCvsPtITSEtaNeg(0),
220   fPtITSminPtTPCvsPtITSNPointTPC(0),
221   fPtITSminPtTPCvsPtITSDCAR(0),
222   fPtITSminPtTPCvsPtITSDCAZ(0),
223   fPtITSminPtTPCvsPtITSPhi(0),
224   fPtITSminPtTPCvsPtITSNPointITS(0),
225   fPtITSminPtTPCvsPtITSNSigmaToVertex(0),
226   fPtITSminPtTPCvsPtITSChi2C(0),
227   fPtITSminPtTPCvsPtITSRel1PtUncertainty(0),
228   fPtITSminPtTPCvsPtITSChi2PerNClusTPC(0),
229   fPtITSminPtTPCvsPtITSChi2PerNClusITS(0),
230   fPtITSminPtTPCvsNPointTPCPhi(0),
231   fPtITSminPtTPCvsNPointITSPhi(0),
232   fPtITSminPtTPCvsRel1PtUncertaintyPhi(0),
233   fPtRel1PtUncertaintyChi2PerClusTPC(0),
234   fHistListITS(0)
235 {
236   //
237   // Constructor. Initialization of Inputs and Outputs
238   //
239   Info("AliPWG4HighPtQATPConly","Calling Constructor");
240   // Input slot #0 works with a TChain ESD
241   DefineInput(0, TChain::Class());
242   // Output slot #0, #1, #2 and #3 writes into a TList
243   DefineOutput(0, TList::Class());
244   DefineOutput(1, TList::Class());
245   DefineOutput(2, TList::Class());
246   // Output slot #4 and #5 writes into a AliESDtrackCuts
247   DefineOutput(3, AliESDtrackCuts::Class());
248   DefineOutput(4, AliESDtrackCuts::Class());
249
250 }
251
252 //________________________________________________________________________
253 void AliPWG4HighPtQATPConly::LocalInit()
254 {
255   //
256   // Only called once at beginning
257   //
258   PostData(3,fTrackCuts);
259   PostData(4,fTrackCutsITS);
260 }
261
262 //________________________________________________________________________
263 void AliPWG4HighPtQATPConly::ConnectInputData(Option_t *) 
264 {
265   // Connect ESD here
266   // Called once
267   AliDebug(2,Form(">> AliPWG4HighPtSpectra::ConnectInputData \n"));
268   TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
269   if (!tree) {
270     AliDebug(2,Form( "ERROR: Could not read chain from input slot 0 \n"));
271     return;
272   } 
273   
274   AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
275   
276   if (!esdH) {
277     AliDebug(2,Form("ERROR: Could not get ESDInputHandler")); 
278     return;
279   } else
280     fESD = esdH->GetEvent();
281  
282   fESDfriend = esdH->GetESDfriend();
283  
284 }
285
286 //________________________________________________________________________
287 void AliPWG4HighPtQATPConly::CreateOutputObjects() {
288   //Create output objects
289   AliDebug(2,Form(">> AliPWG4HighPtQATPConly::CreateOutputObjects \n")); 
290
291   Bool_t oldStatus = TH1::AddDirectoryStatus();
292   TH1::AddDirectory(kFALSE); 
293
294   OpenFile(0);
295   fHistList = new TList();
296   fHistList->SetOwner(kTRUE);
297   OpenFile(1);
298   fHistListTPC = new TList();
299   fHistListTPC->SetOwner(kTRUE);
300   OpenFile(2);
301   fHistListITS = new TList();
302   fHistListITS->SetOwner(kTRUE);
303
304   Int_t fgkNPhiBins=18;
305   Float_t kMinPhi = 0.;
306   Float_t kMaxPhi = 2.*TMath::Pi();
307   Double_t *binsPhi=new Double_t[fgkNPhiBins+1];
308   for(Int_t i=0; i<=fgkNPhiBins; i++) binsPhi[i]=(Double_t)kMinPhi + (kMaxPhi-kMinPhi)/fgkNPhiBins*(Double_t)i ;
309   
310   Float_t fgkPtMin=0.;
311   Float_t fgkPtMax=fPtMax;
312
313   Float_t ptBinEdges[2][2];
314   ptBinEdges[0][0] = 10.;
315   ptBinEdges[0][1] = 1.;
316   ptBinEdges[1][0] = 20.;
317   ptBinEdges[1][1] = 2.;
318   Float_t binWidth3 = 5.;
319   if(fPtMax>100.) {
320     ptBinEdges[0][0] = 100.;
321     ptBinEdges[0][1] = 5.;
322     ptBinEdges[1][0] = 300.;
323     ptBinEdges[1][1] = 10.;
324     binWidth3 = 20.;
325   }
326
327   const Float_t ptmin1 =  fgkPtMin;
328   const Float_t ptmax1 =  ptBinEdges[0][0];
329   const Float_t ptmin2 =  ptmax1 ;
330   const Float_t ptmax2 =  ptBinEdges[1][0];
331   const Float_t ptmin3 =  ptmax2 ;
332   const Float_t ptmax3 =  fgkPtMax;
333   const Int_t nbin11 = (int)((ptmax1-ptmin1)/ptBinEdges[0][1]);
334   const Int_t nbin12 = (int)((ptmax2-ptmin2)/ptBinEdges[1][1])+nbin11;
335   const Int_t nbin13 = (int)((ptmax3-ptmin3)/binWidth3)+nbin12;
336   Int_t fgkNPtBins=nbin13;
337   //Create array with low edges of each bin
338   Double_t *binsPt=new Double_t[fgkNPtBins+1];
339   for(Int_t i=0; i<=fgkNPtBins; i++) {
340     if(i<=nbin11) binsPt[i]=(Double_t)ptmin1 + (ptmax1-ptmin1)/nbin11*(Double_t)i ;  
341     if(i<=nbin12 && i>nbin11) binsPt[i]=(Double_t)ptmin2 + (ptmax2-ptmin2)/(nbin12-nbin11)*((Double_t)i-(Double_t)nbin11) ;  
342     if(i<=nbin13 && i>nbin12) binsPt[i]=(Double_t)ptmin3 + (ptmax3-ptmin3)/(nbin13-nbin12)*((Double_t)i-(Double_t)nbin12) ;  
343   }
344
345   Float_t fgkChi2PerClusMin = 0.;
346   Float_t fgkChi2PerClusMax = 4.;
347   Int_t fgkNChi2PerClusBins = (int)(fgkChi2PerClusMax*10.);
348   Double_t *binsChi2PerClus=new Double_t[fgkNChi2PerClusBins+1];
349   for(Int_t i=0; i<=fgkNChi2PerClusBins; i++) binsChi2PerClus[i]=(Double_t)fgkChi2PerClusMin + (fgkChi2PerClusMax-fgkChi2PerClusMin)/fgkNChi2PerClusBins*(Double_t)i ;
350
351   Int_t fgkNResPtBins=80;
352   Float_t fgkResPtMin = -1.;
353   Float_t fgkResPtMax = 1.;
354   Double_t *binsResPt=new Double_t[fgkNResPtBins+1];
355   for(Int_t i=0; i<=fgkNResPtBins; i++) binsResPt[i]=(Double_t)fgkResPtMin + (fgkResPtMax-fgkResPtMin)/fgkNResPtBins*(Double_t)i ;
356
357   Int_t fgkNEtaBins=20;
358   Float_t fgkEtaMin = -1.;
359   Float_t fgkEtaMax = 1.;
360   Double_t *binsEta=new Double_t[fgkNEtaBins+1];
361   for(Int_t i=0; i<=fgkNEtaBins; i++) binsEta[i]=(Double_t)fgkEtaMin + (fgkEtaMax-fgkEtaMin)/fgkNEtaBins*(Double_t)i ;
362
363   Int_t fgkNNPointTPCBins=80;
364   Float_t fgkNPointTPCMin = 0.5;
365   Float_t fgkNPointTPCMax = 160.5;
366   Double_t *binsNPointTPC=new Double_t[fgkNNPointTPCBins+1];
367   for(Int_t i=0; i<=fgkNNPointTPCBins; i++) binsNPointTPC[i]=(Double_t)fgkNPointTPCMin + (fgkNPointTPCMax-fgkNPointTPCMin)/fgkNNPointTPCBins*(Double_t)i ;
368
369   Int_t fgkNDCARBins=80;
370   Float_t fgkDCARMin = -0.2;
371   Float_t fgkDCARMax = 0.2;
372   Double_t *binsDCAR=new Double_t[fgkNDCARBins+1];
373   for(Int_t i=0; i<=fgkNDCARBins; i++) binsDCAR[i]=(Double_t)fgkDCARMin + (fgkDCARMax-fgkDCARMin)/fgkNDCARBins*(Double_t)i ;
374
375   Int_t fgkNDCAZBins=80;
376   Float_t fgkDCAZMin = -2.;
377   Float_t fgkDCAZMax = 2.;
378   Double_t *binsDCAZ=new Double_t[fgkNDCAZBins+1];
379   for(Int_t i=0; i<=fgkNDCAZBins; i++) binsDCAZ[i]=(Double_t)fgkDCAZMin + (fgkDCAZMax-fgkDCAZMin)/fgkNDCAZBins*(Double_t)i ;
380
381   Int_t fgkNNPointITSBins=9;
382   Float_t fgkNPointITSMin = -0.5;
383   Float_t fgkNPointITSMax = 8.5;
384   Double_t *binsNPointITS=new Double_t[fgkNNPointITSBins+1];
385   for(Int_t i=0; i<=fgkNNPointITSBins; i++) binsNPointITS[i]=(Double_t)fgkNPointITSMin + (fgkNPointITSMax-fgkNPointITSMin)/fgkNNPointITSBins*(Double_t)i ;
386
387   Int_t fgkNNSigmaToVertexBins=40;
388   Float_t fgkNSigmaToVertexMin = 0.;
389   Float_t fgkNSigmaToVertexMax = 8.;
390   Double_t *binsNSigmaToVertex=new Double_t[fgkNNSigmaToVertexBins+1];
391   for(Int_t i=0; i<=fgkNNSigmaToVertexBins; i++) binsNSigmaToVertex[i]=(Double_t)fgkNSigmaToVertexMin + (fgkNSigmaToVertexMax-fgkNSigmaToVertexMin)/fgkNNSigmaToVertexBins*(Double_t)i ;
392
393   Int_t fgkNChi2CBins=20;
394   Float_t fgkChi2CMin = 0.;
395   Float_t fgkChi2CMax = 10.;
396   Double_t *binsChi2C=new Double_t[fgkNChi2CBins+1];
397   for(Int_t i=0; i<=fgkNChi2CBins; i++) binsChi2C[i]=(Double_t)fgkChi2CMin + (fgkChi2CMax-fgkChi2CMin)/fgkNChi2CBins*(Double_t)i ;
398  
399   Int_t fgkNRel1PtUncertaintyBins=30;
400   Float_t fgkRel1PtUncertaintyMin = 0.;
401   Float_t fgkRel1PtUncertaintyMax = 0.3;
402   Double_t *binsRel1PtUncertainty=new Double_t[fgkNRel1PtUncertaintyBins+1];
403   for(Int_t i=0; i<=fgkNRel1PtUncertaintyBins; i++) binsRel1PtUncertainty[i]=(Double_t)fgkRel1PtUncertaintyMin + (fgkRel1PtUncertaintyMax-fgkRel1PtUncertaintyMin)/fgkNRel1PtUncertaintyBins*(Double_t)i ;
404
405   fNEventAll = new TH1F("fNEventAll","NEventAll",1,-0.5,0.5);
406   fHistList->Add(fNEventAll);
407   fNEventSel = new TH1F("fNEventSel","NEvent Selected for analysis",1,-0.5,0.5);
408   fHistList->Add(fNEventSel);
409   fNEventReject = new TH1F("fNEventReject","Reason events are rejectected for analysis",20,0,20);
410   //Set labels
411   fNEventReject->Fill("noESD",0);
412   fNEventReject->Fill("Trigger",0);
413   fNEventReject->Fill("noMCEvent",0);
414   fNEventReject->Fill("NTracks<2",0);
415   fNEventReject->Fill("noVTX",0);
416   fNEventReject->Fill("VtxStatus",0);
417   fNEventReject->Fill("NCont<2",0);
418   fNEventReject->Fill("ZVTX>10",0);
419   fHistList->Add(fNEventReject);
420
421   fPtAll = new TH1F("fPtAll","PtAll",fgkNPtBins, binsPt);
422   fHistList->Add(fPtAll);
423   fPtSel = new TH1F("fPtSel","PtSel",fgkNPtBins, binsPt);
424   fHistList->Add(fPtSel);
425  
426   fPtAllminPtTPCvsPtAll = new TH2F("fPtAllminPtTPCvsPtAll","PtAllminPtTPCvsPtAll",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt);
427   fPtAllminPtTPCvsPtAll->SetXTitle("p_{t}^{Global}");
428   fPtAllminPtTPCvsPtAll->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
429   fHistList->Add(fPtAllminPtTPCvsPtAll);
430   
431   fPtAllminPtTPCvsPtAllEtaPos = new TH3F("fPtAllminPtTPCvsPtAllEtaPos","PtAllminPtTPCvsPtAllEtaPos",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNEtaBins,binsEta);
432   fPtAllminPtTPCvsPtAllEtaPos->SetXTitle("p_{t}^{Global}");
433   fPtAllminPtTPCvsPtAllEtaPos->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
434   fPtAllminPtTPCvsPtAllEtaPos->SetZTitle("#eta");
435   fHistList->Add(fPtAllminPtTPCvsPtAllEtaPos);
436
437   fPtAllminPtTPCvsPtAllEtaNeg = new TH3F("fPtAllminPtTPCvsPtAllEtaNeg","PtAllminPtTPCvsPtAllEtaNeg",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNEtaBins,binsEta);
438   fPtAllminPtTPCvsPtAllEtaNeg->SetXTitle("p_{t}^{Global}");
439   fPtAllminPtTPCvsPtAllEtaNeg->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
440   fPtAllminPtTPCvsPtAllEtaNeg->SetZTitle("#eta");
441   fHistList->Add(fPtAllminPtTPCvsPtAllEtaNeg);
442
443   fPtAllminPtTPCvsPtAllNPointTPC = new TH3F("fPtAllminPtTPCvsPtAllNPointTPC","PtAllminPtTPCvsPtAllNPointTPC",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNNPointTPCBins,binsNPointTPC);
444   fPtAllminPtTPCvsPtAllNPointTPC->SetXTitle("p_{t}^{Global}");
445   fPtAllminPtTPCvsPtAllNPointTPC->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
446   fPtAllminPtTPCvsPtAllNPointTPC->SetZTitle("N_{point,TPC}");
447   fHistList->Add(fPtAllminPtTPCvsPtAllNPointTPC);
448
449   fPtAllminPtTPCvsPtAllDCAR = new TH3F("fPtAllminPtTPCvsPtAllDCAR","PtAllminPtTPCvsPtAllDCAR",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNDCARBins,binsDCAR);
450   fPtAllminPtTPCvsPtAllDCAR->SetXTitle("p_{t}^{Global}");
451   fPtAllminPtTPCvsPtAllDCAR->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
452   fPtAllminPtTPCvsPtAllDCAR->SetZTitle("DCA_{R}");
453   fHistList->Add(fPtAllminPtTPCvsPtAllDCAR);
454
455   fPtAllminPtTPCvsPtAllDCAZ = new TH3F("fPtAllminPtTPCvsPtAllDCAZ","PtAllminPtTPCvsPtAllDCAZ",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNDCAZBins,binsDCAZ);
456   fPtAllminPtTPCvsPtAllDCAZ->SetXTitle("p_{t}^{Global}");
457   fPtAllminPtTPCvsPtAllDCAZ->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
458   fPtAllminPtTPCvsPtAllDCAZ->SetZTitle("DCA_{Z}");
459   fHistList->Add(fPtAllminPtTPCvsPtAllDCAZ);
460
461   fPtAllminPtTPCvsPtAllPhi = new TH3F("fPtAllminPtTPCvsPtAllPhi","PtAllminPtTPCvsPtAllPhi",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNPhiBins,binsPhi);
462   fPtAllminPtTPCvsPtAllPhi->SetXTitle("p_{t}^{Global}");
463   fPtAllminPtTPCvsPtAllPhi->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
464   fPtAllminPtTPCvsPtAllPhi->SetZTitle("#phi");
465   fHistList->Add(fPtAllminPtTPCvsPtAllPhi);
466
467   fPtAllminPtTPCvsPtAllNPointITS = new TH3F("fPtAllminPtTPCvsPtAllNPointITS","PtAllminPtTPCvsPtAllNPointITS",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNNPointITSBins,binsNPointITS);
468   fPtAllminPtTPCvsPtAllNPointITS->SetXTitle("p_{t}^{Global}");
469   fPtAllminPtTPCvsPtAllNPointITS->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
470   fPtAllminPtTPCvsPtAllNPointITS->SetZTitle("N_{point,ITS}");
471   fHistList->Add(fPtAllminPtTPCvsPtAllNPointITS);
472   
473   fPtAllminPtTPCvsPtAllNSigmaToVertex = new TH3F("fPtAllminPtTPCvsPtAllNSigmaToVertex","PtAllminPtTPCvsPtAllNSigmaToVertex",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNNSigmaToVertexBins,binsNSigmaToVertex);
474   fPtAllminPtTPCvsPtAllNSigmaToVertex->SetXTitle("p_{t}^{Global}");
475   fPtAllminPtTPCvsPtAllNSigmaToVertex->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
476   fPtAllminPtTPCvsPtAllNSigmaToVertex->SetZTitle("N#sigma to vertex");
477   fHistList->Add(fPtAllminPtTPCvsPtAllNSigmaToVertex);
478
479   fPtAllminPtTPCvsPtAllChi2C = new TH3F("fPtAllminPtTPCvsPtAllChi2C","PtAllminPtTPCvsPtAllChi2C",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2CBins,binsChi2C);
480   fPtAllminPtTPCvsPtAllChi2C->SetXTitle("p_{t}^{Global}");
481   fPtAllminPtTPCvsPtAllChi2C->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
482   fPtAllminPtTPCvsPtAllChi2C->SetZTitle("Constrained #chi^{2}");
483   fHistList->Add(fPtAllminPtTPCvsPtAllChi2C);
484
485   fPtAllminPtTPCvsPtAllRel1PtUncertainty = new TH3F("fPtAllminPtTPCvsPtAllRel1PtUncertainty","PtAllminPtTPCvsPtAllRel1PtUncertainty",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty);
486   fPtAllminPtTPCvsPtAllRel1PtUncertainty->SetXTitle("p_{t}^{Global}");
487   fPtAllminPtTPCvsPtAllRel1PtUncertainty->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
488   fPtAllminPtTPCvsPtAllRel1PtUncertainty->SetZTitle("Rel1PtUncertainty");
489   fHistList->Add(fPtAllminPtTPCvsPtAllRel1PtUncertainty);
490
491   fPtAllminPtTPCvsPtAllChi2PerNClusTPC = new TH3F("fPtAllminPtTPCvsPtAllChi2PerNClusTPC","PtAllminPtTPCvsPtAllChi2PerNClusTPC",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
492   fPtAllminPtTPCvsPtAllChi2PerNClusTPC->SetXTitle("p_{t}^{Global}");
493   fPtAllminPtTPCvsPtAllChi2PerNClusTPC->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
494   fPtAllminPtTPCvsPtAllChi2PerNClusTPC->SetZTitle("#chi^{2}/(2*NClusTPC-5)");
495   fHistList->Add(fPtAllminPtTPCvsPtAllChi2PerNClusTPC);
496
497   fPtAllminPtTPCvsPtAllChi2PerNClusITS = new TH3F("fPtAllminPtTPCvsPtAllChi2PerNClusITS","PtAllminPtTPCvsPtAllChi2PerNClusITS",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
498   fPtAllminPtTPCvsPtAllChi2PerNClusITS->SetXTitle("p_{t}^{Global}");
499   fPtAllminPtTPCvsPtAllChi2PerNClusITS->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
500   fPtAllminPtTPCvsPtAllChi2PerNClusITS->SetZTitle("#chi^{2}/(2*NClusITS-5)");
501   fHistList->Add(fPtAllminPtTPCvsPtAllChi2PerNClusITS);
502
503   fPtAllminPtTPCvsNPointTPCPhi = new TH3F("fPtAllminPtTPCvsNPointTPCPhi","PtAllminPtTPCvsNPointTPCPhi",fgkNResPtBins,binsResPt,fgkNNPointTPCBins,binsNPointTPC,fgkNPhiBins,binsPhi);
504   fPtAllminPtTPCvsNPointTPCPhi->SetXTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
505   fPtAllminPtTPCvsNPointTPCPhi->SetYTitle("N_{point,TPC}");
506   fPtAllminPtTPCvsNPointTPCPhi->SetZTitle("#phi");
507   fHistList->Add(fPtAllminPtTPCvsNPointTPCPhi);
508
509   fPtAllminPtTPCvsNPointITSPhi = new TH3F("fPtAllminPtTPCvsNPointITSPhi","PtAllminPtTPCvsNPointITSPhi",fgkNResPtBins,binsResPt,fgkNNPointITSBins,binsNPointITS,fgkNPhiBins,binsPhi);
510   fPtAllminPtTPCvsNPointITSPhi->SetXTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
511   fPtAllminPtTPCvsNPointITSPhi->SetYTitle("N_{point,ITS}");
512   fPtAllminPtTPCvsNPointITSPhi->SetZTitle("#phi");
513   fHistList->Add(fPtAllminPtTPCvsNPointITSPhi);
514
515   fPtAllminPtTPCvsRel1PtUncertaintyPhi = new TH3F("fPtAllminPtTPCvsRel1PtUncertaintyPhi","PtAllminPtTPCvsRel1PtUncertaintyPhi",fgkNResPtBins,binsResPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNPhiBins,binsPhi);
516   fPtAllminPtTPCvsRel1PtUncertaintyPhi->SetXTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
517   fPtAllminPtTPCvsRel1PtUncertaintyPhi->SetYTitle("Rel1PtUncertainty");
518   fPtAllminPtTPCvsRel1PtUncertaintyPhi->SetZTitle("#phi");
519   fHistList->Add(fPtAllminPtTPCvsRel1PtUncertaintyPhi);
520
521   fEtaPhiOutliers = new TH2F("fEtaPhiOutliers","PtAllminPtTPCvsPtAll",20, -1.,1.,fgkNPhiBins,binsPhi);
522   fEtaPhiOutliers->SetXTitle("#eta");
523   fEtaPhiOutliers->SetYTitle("#phi");
524   fHistList->Add(fEtaPhiOutliers);
525
526   //Global vs ITSouter-TPCinner
527   fPtSelITSouter = new TH1F("fPtSelITSouter","PtSelITSouter",fgkNPtBins,binsPt);
528   fHistList->Add(fPtSelITSouter);
529   
530   fPtITSouterminPtTPCvsPtAll = new TH2F("fPtITSouterminPtTPCvsPtAll","PtITSouterminPtTPCvsPtAll",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt);
531   fPtITSouterminPtTPCvsPtAll->SetXTitle("p_{t}^{Global}");
532   fPtITSouterminPtTPCvsPtAll->SetYTitle("(1/p_{t}^{ITSouter}-1/p_{t}^{TPCinner})/(1/p_{t}^{ITSouter})");
533   fHistList->Add(fPtITSouterminPtTPCvsPtAll);
534   
535   fPtITSouterminPtTPCvsPtAllEtaPos = new TH3F("fPtITSouterminPtTPCvsPtAllEtaPos","PtITSouterminPtTPCvsPtAllEtaPos",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNEtaBins,binsEta);
536   fPtITSouterminPtTPCvsPtAllEtaPos->SetXTitle("p_{t}^{Global}");
537   fPtITSouterminPtTPCvsPtAllEtaPos->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
538   fHistList->Add(fPtITSouterminPtTPCvsPtAllEtaPos);
539
540   fPtITSouterminPtTPCvsPtAllEtaNeg = new TH3F("fPtITSouterminPtTPCvsPtAllEtaNeg","PtITSouterminPtTPCvsPtAllEtaNeg",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNEtaBins,binsEta);
541   fPtITSouterminPtTPCvsPtAllEtaNeg->SetXTitle("p_{t}^{Global}");
542   fPtITSouterminPtTPCvsPtAllEtaNeg->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
543   fHistList->Add(fPtITSouterminPtTPCvsPtAllEtaNeg);
544
545   fPtITSouterminPtTPCvsPtAllNPointTPC = new TH3F("fPtITSouterminPtTPCvsPtAllNPointTPC","PtITSouterminPtTPCvsPtAllNPointTPC",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNNPointTPCBins,binsNPointTPC);
546   fPtITSouterminPtTPCvsPtAllNPointTPC->SetXTitle("p_{t}^{Global}");
547   fPtITSouterminPtTPCvsPtAllNPointTPC->SetYTitle("(1/p_{t}^{ITSouter}-1/p_{t}^{TPCinner})/(1/p_{t}^{ITSouter})");
548   fPtITSouterminPtTPCvsPtAllNPointTPC->SetZTitle("N_{point,TPC}");
549   fHistList->Add(fPtITSouterminPtTPCvsPtAllNPointTPC);
550
551   fPtITSouterminPtTPCvsPtAllDCAR = new TH3F("fPtITSouterminPtTPCvsPtAllDCAR","PtITSouterminPtTPCvsPtAllDCAR",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNDCARBins,binsDCAR);
552   fPtITSouterminPtTPCvsPtAllDCAR->SetXTitle("p_{t}^{Global}");
553   fPtITSouterminPtTPCvsPtAllDCAR->SetYTitle("(1/p_{t}^{ITSouter}-1/p_{t}^{TPCinner})/(1/p_{t}^{ITSouter})");
554   fPtITSouterminPtTPCvsPtAllDCAR->SetZTitle("DCA_{R}");
555   fHistList->Add(fPtITSouterminPtTPCvsPtAllDCAR);
556
557   fPtITSouterminPtTPCvsPtAllDCAZ = new TH3F("fPtITSouterminPtTPCvsPtAllDCAZ","PtITSouterminPtTPCvsPtAllDCAZ",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNDCAZBins,binsDCAZ);
558   fPtITSouterminPtTPCvsPtAllDCAZ->SetXTitle("p_{t}^{Global}");
559   fPtITSouterminPtTPCvsPtAllDCAZ->SetYTitle("(1/p_{t}^{ITSouter}-1/p_{t}^{TPCinner})/(1/p_{t}^{ITSouter})");
560   fPtITSouterminPtTPCvsPtAllDCAZ->SetZTitle("DCA_{Z}");
561   fHistList->Add(fPtITSouterminPtTPCvsPtAllDCAZ);
562
563   fPtITSouterminPtTPCvsPtAllPhi = new TH3F("fPtITSouterminPtTPCvsPtAllPhi","PtITSouterminPtTPCvsPtAllPhi",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNPhiBins,binsPhi);
564   fPtITSouterminPtTPCvsPtAllPhi->SetXTitle("p_{t}^{Global}");
565   fPtITSouterminPtTPCvsPtAllPhi->SetYTitle("(1/p_{t}^{ITSouter}-1/p_{t}^{TPCinner})/(1/p_{t}^{ITSouter})");
566   fPtITSouterminPtTPCvsPtAllPhi->SetZTitle("#phi");
567   fHistList->Add(fPtITSouterminPtTPCvsPtAllPhi);
568
569   fPtITSouterminPtTPCvsPtAllNPointITS = new TH3F("fPtITSouterminPtTPCvsPtAllNPointITS","PtITSouterminPtTPCvsPtAllNPointITS",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNNPointITSBins,binsNPointITS);
570   fPtITSouterminPtTPCvsPtAllNPointITS->SetXTitle("p_{t}^{Global}");
571   fPtITSouterminPtTPCvsPtAllNPointITS->SetYTitle("(1/p_{t}^{ITSouter}-1/p_{t}^{TPCinner})/(1/p_{t}^{ITSouter})");
572   fPtITSouterminPtTPCvsPtAllNPointITS->SetZTitle("N_{point,ITS}");
573   fHistList->Add(fPtITSouterminPtTPCvsPtAllNPointITS);
574   
575   fPtITSouterminPtTPCvsPtAllNSigmaToVertex = new TH3F("fPtITSouterminPtTPCvsPtAllNSigmaToVertex","PtITSouterminPtTPCvsPtAllNSigmaToVertex",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNNSigmaToVertexBins,binsNSigmaToVertex);
576   fPtITSouterminPtTPCvsPtAllNSigmaToVertex->SetXTitle("p_{t}^{Global}");
577   fPtITSouterminPtTPCvsPtAllNSigmaToVertex->SetYTitle("(1/p_{t}^{ITSouter}-1/p_{t}^{TPCinner})/(1/p_{t}^{ITSouter})");
578   fPtITSouterminPtTPCvsPtAllNSigmaToVertex->SetZTitle("N#sigma to vertex");
579   fHistList->Add(fPtITSouterminPtTPCvsPtAllNSigmaToVertex);
580
581   fPtITSouterminPtTPCvsPtAllChi2C = new TH3F("fPtITSouterminPtTPCvsPtAllChi2C","PtITSouterminPtTPCvsPtAllChi2C",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2CBins,binsChi2C);
582   fPtITSouterminPtTPCvsPtAllChi2C->SetXTitle("p_{t}^{Global}");
583   fPtITSouterminPtTPCvsPtAllChi2C->SetYTitle("(1/p_{t}^{ITSouter}-1/p_{t}^{TPCinner})/(1/p_{t}^{ITSouter})");
584   fPtITSouterminPtTPCvsPtAllChi2C->SetZTitle("Constrained #chi^{2}");
585   fHistList->Add(fPtITSouterminPtTPCvsPtAllChi2C);
586
587   fPtITSouterminPtTPCvsPtAllRel1PtUncertainty = new TH3F("fPtITSouterminPtTPCvsPtAllRel1PtUncertainty","PtITSouterminPtTPCvsPtAllRel1PtUncertainty",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty);
588   fPtITSouterminPtTPCvsPtAllRel1PtUncertainty->SetXTitle("p_{t}^{Global}");
589   fPtITSouterminPtTPCvsPtAllRel1PtUncertainty->SetYTitle("(1/p_{t}^{ITSouter}-1/p_{t}^{TPCinner})/(1/p_{t}^{ITSouter})");
590   fPtITSouterminPtTPCvsPtAllRel1PtUncertainty->SetZTitle("Rel1PtUncertainty");
591   fHistList->Add(fPtITSouterminPtTPCvsPtAllRel1PtUncertainty);
592
593   fPtITSouterminPtTPCvsPtAllChi2PerNClusTPC = new TH3F("fPtITSouterminPtTPCvsPtAllChi2PerNClusTPC","PtITSouterminPtTPCvsPtAllChi2PerNClusTPC",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
594   fPtITSouterminPtTPCvsPtAllChi2PerNClusTPC->SetXTitle("p_{t}^{Global}");
595   fPtITSouterminPtTPCvsPtAllChi2PerNClusTPC->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
596   fPtITSouterminPtTPCvsPtAllChi2PerNClusTPC->SetZTitle("#chi^{2}/(2*NClusTPC-5)");
597   fHistList->Add(fPtITSouterminPtTPCvsPtAllChi2PerNClusTPC);
598
599   fPtITSouterminPtTPCvsPtAllChi2PerNClusITS = new TH3F("fPtITSouterminPtTPCvsPtAllChi2PerNClusITS","PtITSouterminPtTPCvsPtAllChi2PerNClusITS",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
600   fPtITSouterminPtTPCvsPtAllChi2PerNClusITS->SetXTitle("p_{t}^{Global}");
601   fPtITSouterminPtTPCvsPtAllChi2PerNClusITS->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
602   fPtITSouterminPtTPCvsPtAllChi2PerNClusITS->SetZTitle("#chi^{2}/(2*NClusITS-5)");
603   fHistList->Add(fPtITSouterminPtTPCvsPtAllChi2PerNClusITS);
604
605   //As function of ITS layers
606   fPtAllminPtTPCvsPtAllITSLayer0 = new TH2F("fPtAllminPtTPCvsPtAllITSLayer0","PtglobminPtTPCvsPtAllITSLayer0",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt);
607   fPtAllminPtTPCvsPtAllITSLayer0->SetXTitle("p_{t}^{Global}");
608   fPtAllminPtTPCvsPtAllITSLayer0->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
609   fHistList->Add(fPtAllminPtTPCvsPtAllITSLayer0);
610
611   fPtAllminPtTPCvsPtAllITSLayer1 = new TH2F("fPtAllminPtTPCvsPtAllITSLayer1","PtglobminPtTPCvsPtAllITSLayer1",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt);
612   fPtAllminPtTPCvsPtAllITSLayer1->SetXTitle("p_{t}^{Global}");
613   fPtAllminPtTPCvsPtAllITSLayer1->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
614   fHistList->Add(fPtAllminPtTPCvsPtAllITSLayer1);
615
616   fPtAllminPtTPCvsPtAllITSLayer2 = new TH2F("fPtAllminPtTPCvsPtAllITSLayer2","PtglobminPtTPCvsPtAllITSLayer2",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt);
617   fPtAllminPtTPCvsPtAllITSLayer2->SetXTitle("p_{t}^{Global}");
618   fPtAllminPtTPCvsPtAllITSLayer2->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
619   fHistList->Add(fPtAllminPtTPCvsPtAllITSLayer2);
620
621   fPtAllminPtTPCvsPtAllITSLayer3 = new TH2F("fPtAllminPtTPCvsPtAllITSLayer3","PtglobminPtTPCvsPtAllITSLayer3",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt);
622   fPtAllminPtTPCvsPtAllITSLayer3->SetXTitle("p_{t}^{Global}");
623   fPtAllminPtTPCvsPtAllITSLayer3->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
624   fHistList->Add(fPtAllminPtTPCvsPtAllITSLayer3);
625
626   fPtAllminPtTPCvsPtAllITSLayer4 = new TH2F("fPtAllminPtTPCvsPtAllITSLayer4","PtglobminPtTPCvsPtAllITSLayer4",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt);
627   fPtAllminPtTPCvsPtAllITSLayer4->SetXTitle("p_{t}^{Global}");
628   fPtAllminPtTPCvsPtAllITSLayer4->SetYTitle("(1/p_{t}^{glob}-1/p_{t}^{TPCinner})/(1/p_{t}^{glob})");
629   fHistList->Add(fPtAllminPtTPCvsPtAllITSLayer4);
630
631   fPtAllminPtTPCvsPtAllITSLayer5 = new TH2F("fPtAllminPtTPCvsPtAllITSLayer5","PtglobminPtTPCvsPtAllITSLayer5",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt);
632   fPtAllminPtTPCvsPtAllITSLayer5->SetXTitle("p_{t}^{Global}");
633   fPtAllminPtTPCvsPtAllITSLayer5->SetYTitle("(1/p_{t}^{glob}-1/p_{t}^{TPCinner})/(1/p_{t}^{glob})");
634   fHistList->Add(fPtAllminPtTPCvsPtAllITSLayer5);
635
636   fPtAllminPtTPCvsPtAllNoSPD = new TH2F("fPtAllminPtTPCvsPtAllNoSPD","PtglobminPtTPCvsPtAllNoSPD",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt);
637   fPtAllminPtTPCvsPtAllNoSPD->SetXTitle("p_{t}^{Global}");
638   fPtAllminPtTPCvsPtAllNoSPD->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
639   fHistList->Add(fPtAllminPtTPCvsPtAllNoSPD);
640
641   fPtAllminPtTPCvsPtAllNoSDD = new TH2F("fPtAllminPtTPCvsPtAllNoSDD","PtGlobalminPtTPCvsPtAllNoSDD",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt);
642   fPtAllminPtTPCvsPtAllNoSDD->SetXTitle("p_{t}^{Global}");
643   fPtAllminPtTPCvsPtAllNoSDD->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
644   fHistList->Add(fPtAllminPtTPCvsPtAllNoSDD);
645
646   fPtAllminPtTPCvsPtAllNoSSD = new TH2F("fPtAllminPtTPCvsPtAllNoSSD","PtGlobalminPtTPCvsPtAllNoSSD",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt);
647   fPtAllminPtTPCvsPtAllNoSSD->SetXTitle("p_{t}^{Global}");
648   fPtAllminPtTPCvsPtAllNoSSD->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
649   fHistList->Add(fPtAllminPtTPCvsPtAllNoSSD);
650
651   //
652   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer0 = new TH3F("fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer0","PtGlobalminPtTPCvsPtAllChi2PerNClusITSLayer0",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
653   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer0->SetXTitle("p_{t}^{Global}");
654   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer0->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
655   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer0->SetZTitle("#chi^{2}/NPointITS");
656   fHistList->Add(fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer0);
657
658   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer1 = new TH3F("fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer1","PtGlobalminPtTPCvsPtAllChi2PerNClusITSLayer1",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
659   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer1->SetXTitle("p_{t}^{Global}");
660   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer1->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
661   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer1->SetZTitle("#chi^{2}/NPointITS");
662   fHistList->Add(fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer1);
663
664   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer2 = new TH3F("fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer2","PtGlobalminPtTPCvsPtAllChi2PerNClusITSLayer2",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
665   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer2->SetXTitle("p_{t}^{Global}");
666   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer2->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
667   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer2->SetZTitle("#chi^{2}/NPointITS");
668   fHistList->Add(fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer2);
669
670   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer3 = new TH3F("fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer3","PtGlobalminPtTPCvsPtAllChi2PerNClusITSLayer3",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
671   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer3->SetXTitle("p_{t}^{Global}");
672   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer3->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
673   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer3->SetZTitle("#chi^{2}/NPointITS");
674   fHistList->Add(fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer3);
675
676   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer4 = new TH3F("fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer4","PtGlobalminPtTPCvsPtAllChi2PerNClusITSLayer4",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
677   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer4->SetXTitle("p_{t}^{Global}");
678   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer4->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
679   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer4->SetZTitle("#chi^{2}/NPointITS");
680   fHistList->Add(fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer4);
681
682   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer5 = new TH3F("fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer5","PtGlobalminPtTPCvsPtAllChi2PerNClusITSLayer5",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
683   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer5->SetXTitle("p_{t}^{Global}");
684   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer5->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
685   fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer5->SetZTitle("#chi^{2}/NPointITS");
686   fHistList->Add(fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer5);
687
688   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSPD = new TH3F("fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSPD","PtGlobalminPtTPCvsPtAllChi2PerNClusITSNoSPD",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
689   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSPD->SetXTitle("p_{t}^{Global}");
690   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSPD->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
691   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSPD->SetZTitle("#chi^{2}/(2*NPointITS-5)");
692   fHistList->Add(fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSPD);
693
694   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSDD = new TH3F("fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSDD","PtGlobalminPtTPCvsPtAllChi2PerNClusITSNoSDD",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
695   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSDD->SetXTitle("p_{t}^{Global}");
696   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSDD->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
697   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSDD->SetZTitle("#chi^{2}/(2*NPointITS-5)");
698   fHistList->Add(fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSDD);
699
700   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSSD = new TH3F("fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSSD","PtGlobalminPtTPCvsPtAllChi2PerNClusITSNoSSD",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
701   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSSD->SetXTitle("p_{t}^{Global}");
702   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSSD->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPCinner})/(1/p_{t}^{Global})");
703   fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSSD->SetZTitle("#chi^{2}/(2*NPointITS-5)");
704   fHistList->Add(fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSSD);
705
706
707   //ITSrefit
708   fPtSelITS = new TH1F("fPtSelITSrefit","PtSel",fgkNPtBins, binsPt);
709   fHistListITS->Add(fPtSelITS);
710   
711   fPtITSminPtTPCvsPtITS = new TH2F("fPtITSminPtTPCvsPtITS","PtITSminPtTPCvsPtITS",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt);
712   fPtITSminPtTPCvsPtITS->SetXTitle("p_{t}^{Global}");
713   fPtITSminPtTPCvsPtITS->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
714   fHistListITS->Add(fPtITSminPtTPCvsPtITS);
715
716   fPtITSminPtTPCvsPtITSEtaPos = new TH3F("fPtITSminPtTPCvsPtITSEtaPos","PtITSminPtTPCvsPtITSEtaPos",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNEtaBins,binsEta);
717   fPtITSminPtTPCvsPtITSEtaPos->SetXTitle("p_{t}^{Global}");
718   fPtITSminPtTPCvsPtITSEtaPos->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
719   fHistListITS->Add(fPtITSminPtTPCvsPtITSEtaPos);
720
721   fPtITSminPtTPCvsPtITSEtaNeg = new TH3F("fPtITSminPtTPCvsPtITSEtaNeg","PtITSminPtTPCvsPtITSEtaNeg",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNEtaBins,binsEta);
722   fPtITSminPtTPCvsPtITSEtaNeg->SetXTitle("p_{t}^{Global}");
723   fPtITSminPtTPCvsPtITSEtaNeg->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
724   fHistListITS->Add(fPtITSminPtTPCvsPtITSEtaNeg);
725   
726   fPtITSminPtTPCvsPtITSNPointTPC = new TH3F("fPtITSminPtTPCvsPtITSNPointTPC","PtITSminPtTPCvsPtITSNPointTPC",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNNPointTPCBins,binsNPointTPC);
727   fPtITSminPtTPCvsPtITSNPointTPC->SetXTitle("p_{t}^{Global}");
728   fPtITSminPtTPCvsPtITSNPointTPC->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
729   fPtITSminPtTPCvsPtITSNPointTPC->SetZTitle("N_{point,TPC}");
730   fHistListITS->Add(fPtITSminPtTPCvsPtITSNPointTPC);
731
732   fPtITSminPtTPCvsPtITSDCAR = new TH3F("fPtITSminPtTPCvsPtITSDCAR","PtITSminPtTPCvsPtITSDCAR",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNDCARBins,binsDCAR);
733   fPtITSminPtTPCvsPtITSDCAR->SetXTitle("p_{t}^{Global}");
734   fPtITSminPtTPCvsPtITSDCAR->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
735   fPtITSminPtTPCvsPtITSDCAR->SetZTitle("DCA_{R}");
736   fHistListITS->Add(fPtITSminPtTPCvsPtITSDCAR);
737   
738   fPtITSminPtTPCvsPtITSDCAZ = new TH3F("fPtITSminPtTPCvsPtITSDCAZ","PtITSminPtTPCvsPtITSDCAZ",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNDCAZBins,binsDCAZ);
739   fPtITSminPtTPCvsPtITSDCAZ->SetXTitle("p_{t}^{Global}");
740   fPtITSminPtTPCvsPtITSDCAZ->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
741   fPtITSminPtTPCvsPtITSDCAZ->SetZTitle("DCA_{Z}");
742   fHistListITS->Add(fPtITSminPtTPCvsPtITSDCAZ);
743   
744   fPtITSminPtTPCvsPtITSPhi = new TH3F("fPtITSminPtTPCvsPtITSPhi","PtITSminPtTPCvsPtITSPhi",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNPhiBins,binsPhi);
745   fPtITSminPtTPCvsPtITSPhi->SetXTitle("p_{t}^{Global}");
746   fPtITSminPtTPCvsPtITSPhi->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
747   fPtITSminPtTPCvsPtITSPhi->SetZTitle("#phi");
748   fHistListITS->Add(fPtITSminPtTPCvsPtITSPhi);
749   
750   fPtITSminPtTPCvsPtITSNPointITS = new TH3F("fPtITSminPtTPCvsPtITSNPointITS","PtITSminPtTPCvsPtITSNPointITS",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNNPointITSBins,binsNPointITS);
751   fPtITSminPtTPCvsPtITSNPointITS->SetXTitle("p_{t}^{Global}");
752   fPtITSminPtTPCvsPtITSNPointITS->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
753   fPtITSminPtTPCvsPtITSNPointITS->SetZTitle("N_{point,ITS}");
754   fHistListITS->Add(fPtITSminPtTPCvsPtITSNPointITS); 
755   
756   fPtITSminPtTPCvsPtITSNSigmaToVertex = new TH3F("fPtITSminPtTPCvsPtITSNSigmaToVertex","PtITSminPtTPCvsPtITSNSigmaToVertex",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNNSigmaToVertexBins,binsNSigmaToVertex);
757   fPtITSminPtTPCvsPtITSNSigmaToVertex->SetXTitle("p_{t}^{Global}");
758   fPtITSminPtTPCvsPtITSNSigmaToVertex->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
759   fPtITSminPtTPCvsPtITSNSigmaToVertex->SetZTitle("N#sigma to vertex");
760   fHistListITS->Add(fPtITSminPtTPCvsPtITSNSigmaToVertex);
761
762   fPtITSminPtTPCvsPtITSChi2C = new TH3F("fPtITSminPtTPCvsPtITSChi2C","PtITSminPtTPCvsPtITSChi2C",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2CBins,binsChi2C);
763   fPtITSminPtTPCvsPtITSChi2C->SetXTitle("p_{t}^{Global}");
764   fPtITSminPtTPCvsPtITSChi2C->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
765   fPtITSminPtTPCvsPtITSChi2C->SetZTitle("Constrained #chi^{2}");
766   fHistListITS->Add(fPtITSminPtTPCvsPtITSChi2C);
767
768   fPtITSminPtTPCvsPtITSRel1PtUncertainty = new TH3F("fPtITSminPtTPCvsPtITSRel1PtUncertainty","PtITSminPtTPCvsPtITSRel1PtUncertainty",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty);
769   fPtITSminPtTPCvsPtITSRel1PtUncertainty->SetXTitle("p_{t}^{Global}");
770   fPtITSminPtTPCvsPtITSRel1PtUncertainty->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
771   fPtITSminPtTPCvsPtITSRel1PtUncertainty->SetZTitle("Rel1PtUncertainty");
772   fHistListITS->Add(fPtITSminPtTPCvsPtITSRel1PtUncertainty);
773
774   fPtITSminPtTPCvsPtITSChi2PerNClusTPC = new TH3F("fPtITSminPtTPCvsPtITSChi2PerNClusTPC","PtITSminPtTPCvsPtITSChi2PerNClusTPC",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
775   fPtITSminPtTPCvsPtITSChi2PerNClusTPC->SetXTitle("p_{t}^{Global}");
776   fPtITSminPtTPCvsPtITSChi2PerNClusTPC->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
777   fPtITSminPtTPCvsPtITSChi2PerNClusTPC->SetZTitle("#chi^{2}/(2*NClusTPC-5)");
778   fHistListITS->Add(fPtITSminPtTPCvsPtITSChi2PerNClusTPC);
779
780   fPtITSminPtTPCvsPtITSChi2PerNClusITS = new TH3F("fPtITSminPtTPCvsPtITSChi2PerNClusITS","PtITSminPtTPCvsPtITSChi2PerNClusITS",fgkNPtBins, binsPt,fgkNResPtBins,binsResPt,fgkNChi2PerClusBins,binsChi2PerClus);
781   fPtITSminPtTPCvsPtITSChi2PerNClusITS->SetXTitle("p_{t}^{Global}");
782   fPtITSminPtTPCvsPtITSChi2PerNClusITS->SetYTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
783   fPtITSminPtTPCvsPtITSChi2PerNClusITS->SetZTitle("#chi^{2}/(2*NClusITS-5)");
784   fHistListITS->Add(fPtITSminPtTPCvsPtITSChi2PerNClusITS);
785
786   fPtITSminPtTPCvsNPointTPCPhi = new TH3F("fPtITSminPtTPCvsNPointTPCPhi","PtITSminPtTPCvsNPointTPCPhi",fgkNResPtBins,binsResPt,fgkNNPointTPCBins,binsNPointTPC,fgkNPhiBins,binsPhi);
787   fPtITSminPtTPCvsNPointTPCPhi->SetXTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
788   fPtITSminPtTPCvsNPointTPCPhi->SetYTitle("N_{point,TPC}");
789   fPtITSminPtTPCvsNPointTPCPhi->SetZTitle("#phi");
790   fHistListITS->Add(fPtITSminPtTPCvsNPointTPCPhi);
791
792   fPtITSminPtTPCvsNPointITSPhi = new TH3F("fPtITSminPtTPCvsNPointITSPhi","PtITSminPtTPCvsNPointITSPhi",fgkNResPtBins,binsResPt,fgkNNPointITSBins,binsNPointITS,fgkNPhiBins,binsPhi);
793   fPtITSminPtTPCvsNPointITSPhi->SetXTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
794   fPtITSminPtTPCvsNPointITSPhi->SetYTitle("N_{point,ITS}");
795   fPtITSminPtTPCvsNPointITSPhi->SetZTitle("#phi");
796   fHistListITS->Add(fPtITSminPtTPCvsNPointITSPhi);
797
798   fPtITSminPtTPCvsRel1PtUncertaintyPhi = new TH3F("fPtITSminPtTPCvsRel1PtUncertaintyPhi","PtITSminPtTPCvsRel1PtUncertaintyPhi",fgkNResPtBins,binsResPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNPhiBins,binsPhi);
799   fPtITSminPtTPCvsRel1PtUncertaintyPhi->SetXTitle("(1/p_{t}^{Global}-1/p_{t}^{TPC})/(1/p_{t}^{Global})");
800   fPtITSminPtTPCvsRel1PtUncertaintyPhi->SetYTitle("Rel1PtUncertainty");
801   fPtITSminPtTPCvsRel1PtUncertaintyPhi->SetZTitle("#phi");
802   fHistListITS->Add(fPtITSminPtTPCvsRel1PtUncertaintyPhi);
803
804   fPtRel1PtUncertaintyChi2PerClusTPC = new TH3F("fPtRel1PtUncertaintyChi2PerClusTPC","PtITSminPtTPCvsPtITSRel1PtUncertainty",fgkNPtBins, binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNChi2PerClusBins,binsChi2PerClus);
805   fPtRel1PtUncertaintyChi2PerClusTPC->SetXTitle("p_{t}^{global}");
806   fPtRel1PtUncertaintyChi2PerClusTPC->SetYTitle("Rel1PtUncertainty");
807   fPtRel1PtUncertaintyChi2PerClusTPC->SetZTitle("#chi^{2}/(2*N_{clusters}^{TPC}-5)");
808   fHistListITS->Add(fPtRel1PtUncertaintyChi2PerClusTPC);
809
810   fPtAllTPC = new TH1F("fPtAllTPC","PtAll",fgkNPtBins,binsPt);
811   fHistListTPC->Add(fPtAllTPC);
812   fPtSelTPC = new TH1F("fPtSelTPC","PtSel",fgkNPtBins,binsPt);
813   fHistListTPC->Add(fPtSelTPC);
814   fPtSelTPCITS = new TH1F("fPtSelTPCITS","PtSel",fgkNPtBins,binsPt);
815   fHistListTPC->Add(fPtSelTPCITS);
816
817   TH1::AddDirectory(oldStatus);   
818
819   PostData(0, fHistList);
820   PostData(1, fHistListTPC);
821   PostData(2, fHistListITS);
822
823   if(binsPhi) delete [] binsPhi;
824   if(binsChi2PerClus) delete [] binsChi2PerClus;
825   if(binsPt) delete [] binsPt;
826   if(binsResPt) delete [] binsResPt;
827   if(binsNPointTPC) delete [] binsNPointTPC;
828   if(binsDCAR) delete [] binsDCAR;
829   if(binsDCAZ) delete [] binsDCAZ;
830   if(binsNPointITS) delete [] binsNPointITS;
831   if(binsNSigmaToVertex) delete [] binsNSigmaToVertex;
832   if(binsChi2C) delete [] binsChi2C;
833   if(binsEta) delete [] binsEta;
834   if(binsRel1PtUncertainty) delete [] binsRel1PtUncertainty;
835
836
837 }
838
839 //________________________________________________________________________
840 Bool_t AliPWG4HighPtQATPConly::SelectEvent() {
841   //
842   // Decide if event should be selected for analysis
843   //
844
845   // Checks following requirements:
846   // - fESD available
847   // - trigger info from AliPhysicsSelection
848   // - number of reconstructed tracks > 1
849   // - primary vertex reconstructed
850   // - z-vertex < 10 cm
851
852   Bool_t selectEvent = kTRUE;
853
854   //fESD object available?
855   if (!fESD) {
856     AliDebug(2,Form("ERROR: fInputEvent not available\n"));
857     fNEventReject->Fill("noESD",1);
858     selectEvent = kFALSE;
859     return selectEvent;
860   }
861
862   //Trigger
863   UInt_t isSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
864   if(!(isSelected&AliVEvent::kMB)) { //Select collison candidates
865     AliDebug(2,Form(" Trigger Selection: event REJECTED ... "));
866     fNEventReject->Fill("Trigger",1);
867     selectEvent = kFALSE;
868     return selectEvent;
869   }
870
871   //Check if number of reconstructed tracks is larger than 1
872   if(!fESD->GetNumberOfTracks() || fESD->GetNumberOfTracks()<2)  {
873     fNEventReject->Fill("NTracks<2",1);
874     selectEvent = kFALSE;
875     return selectEvent;
876   }
877
878   //Check if vertex is reconstructed
879   fVtx = fESD->GetPrimaryVertexSPD();
880
881   if(!fVtx) {
882     fNEventReject->Fill("noVTX",1);
883     selectEvent = kFALSE;
884     return selectEvent;
885   }
886    
887   if(!fVtx->GetStatus()) {
888     fNEventReject->Fill("VtxStatus",1);
889     selectEvent = kFALSE;
890     return selectEvent;
891   }
892   
893   // Need vertex cut
894   //  TString vtxName(fVtx->GetName());
895   if(fVtx->GetNContributors()<2) {
896     fNEventReject->Fill("NCont<2",1);
897     selectEvent = kFALSE;
898     return selectEvent;
899   }
900   
901   //Check if z-vertex < 10 cm
902   double primVtx[3];
903   fVtx->GetXYZ(primVtx);
904   if(TMath::Sqrt(primVtx[0]*primVtx[0] + primVtx[1]*primVtx[1])>1. || TMath::Abs(primVtx[2]>10.)){
905     fNEventReject->Fill("ZVTX>10",1);
906     selectEvent = kFALSE;
907     return selectEvent;
908   }
909
910   AliDebug(2,Form("Vertex title %s, status %d, nCont %d\n",fVtx->GetTitle(), fVtx->GetStatus(), fVtx->GetNContributors()));
911
912   return selectEvent;
913 }
914
915 //________________________________________________________________________
916 void AliPWG4HighPtQATPConly::Exec(Option_t *) {  
917   // Main loop
918   // Called for each event
919   AliDebug(2,Form(">> AliPWG4HighPtQATPConly::Exec \n"));  
920
921   // All events without selection
922   fNEventAll->Fill(0.);
923
924   if(!SelectEvent()) {
925     // Post output data
926     PostData(0, fHistList);
927     PostData(1, fHistListTPC);
928     PostData(2, fHistListITS);
929     return;
930   }
931
932   // Selected events for analysis
933   fNEventSel->Fill(0.);
934
935   Int_t nTracks = fESD->GetNumberOfTracks();
936   AliDebug(2,Form("nTracks %d\n", nTracks));
937   for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
938
939     AliESDtrack *track = fESD->GetTrack(iTrack);
940     if(!track) continue;
941     AliExternalTrackParam *trackTPC = (AliExternalTrackParam *)track->GetTPCInnerParam();
942     if(!trackTPC) continue;
943     const AliESDfriendTrack* constfriendtrack = 0x0;
944     if(fESDfriend && fESDfriend->TestSkipBit()==kFALSE) constfriendtrack = track->GetFriendTrack();
945  
946     Float_t pt = track->Pt();
947     Float_t ptTPC = trackTPC->Pt();
948     Float_t phi = track->Phi();
949     Float_t dca2D = 0.;
950     Float_t dcaZ = 0.;
951
952     track->GetImpactParameters(dca2D,dcaZ);
953
954     UChar_t itsMap = track->GetITSClusterMap();
955     Int_t nPointITS = 0;
956     for (Int_t i=0; i < 6; i++) {
957       if (itsMap & (1 << i))
958         nPointITS ++;
959     }
960     double mom[3] = {0.,0.,0.};
961     track->GetPxPyPz(mom);
962     double momTPC[3] = {0.,0.,0.};
963     trackTPC->GetPxPyPz(momTPC);
964     Float_t nSigmaToVertex = fTrackCuts->GetSigmaToVertex(track);// Calculates the number of sigma to the vertex for a track.
965     Float_t chi2C = track->GetConstrainedChi2();
966     Float_t relUncertainty1Pt = TMath::Sqrt(TMath::Abs(track->GetSigma1Pt2()))*pt;
967     Float_t chi2PerClusterTPC = -1.;
968     Float_t nClustersTPC = track->GetTPCNcls();
969     if(nClustersTPC>0.) chi2PerClusterTPC = track->GetTPCchi2()/(2.*nClustersTPC-5.);
970     Float_t chi2PerNPointITS = -1.;
971     if(nPointITS>3) chi2PerNPointITS = track->GetITSchi2()/(2.*(float)nPointITS-5.);
972
973     fPtAll->Fill(pt);
974     fPtAllTPC->Fill(ptTPC);
975
976     if (fTrackCuts->AcceptTrack(track)) {
977       fPtSel->Fill(pt);
978       fPtSelTPC->Fill(ptTPC);
979       if(ptTPC==0. || pt==0.) continue;
980       fPtAllminPtTPCvsPtAll->Fill(pt,(1./pt-1./ptTPC)/(1./pt) );
981
982       if(track->GetSign()>0.) fPtAllminPtTPCvsPtAllEtaPos->Fill(pt,(1./pt-1./ptTPC)/(1./pt),track->Eta());
983       if(track->GetSign()<0.) fPtAllminPtTPCvsPtAllEtaNeg->Fill(pt,(1./pt-1./ptTPC)/(1./pt),track->Eta());
984
985       fPtAllminPtTPCvsPtAllNPointTPC->Fill(pt,(1./pt-1./ptTPC)/(1./pt),nClustersTPC);
986       fPtAllminPtTPCvsPtAllDCAR->Fill(pt,(1./pt-1./ptTPC)/(1./pt),dca2D);
987       fPtAllminPtTPCvsPtAllDCAZ->Fill(pt,(1./pt-1./ptTPC)/(1./pt),dcaZ);
988       fPtAllminPtTPCvsPtAllPhi->Fill(pt,(1./pt-1./ptTPC)/(1./pt),phi);
989       fPtAllminPtTPCvsPtAllNPointITS->Fill(pt,(1./pt-1./ptTPC)/(1./pt),nPointITS);
990       fPtAllminPtTPCvsPtAllNSigmaToVertex->Fill(pt,(1./pt-1./ptTPC)/(1./pt),nSigmaToVertex);
991       fPtAllminPtTPCvsPtAllChi2C->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2C);
992       fPtAllminPtTPCvsPtAllRel1PtUncertainty->Fill(pt,(1./pt-1./ptTPC)/(1./pt),relUncertainty1Pt);
993       fPtAllminPtTPCvsPtAllChi2PerNClusTPC->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerClusterTPC);
994       if(nPointITS>3) fPtAllminPtTPCvsPtAllChi2PerNClusITS->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerNPointITS);
995       fPtAllminPtTPCvsNPointTPCPhi->Fill((1./pt-1./ptTPC)/(1./pt),nClustersTPC,phi);
996       fPtAllminPtTPCvsNPointITSPhi->Fill((1./pt-1./ptTPC)/(1./pt),nPointITS,phi);
997       fPtAllminPtTPCvsRel1PtUncertaintyPhi->Fill((1./pt-1./ptTPC)/(1./pt),relUncertainty1Pt,phi);
998       fPtRel1PtUncertaintyChi2PerClusTPC->Fill(pt,relUncertainty1Pt,chi2PerClusterTPC);
999
1000       if(TMath::Abs((1./pt-1./ptTPC)/(1./pt))>0.8) fEtaPhiOutliers->Fill(track->Eta(),phi);
1001       
1002       if(track->HasPointOnITSLayer(0)) {
1003         fPtAllminPtTPCvsPtAllITSLayer0->Fill(pt,(1./pt-1./ptTPC)/(1./pt));
1004         if(nPointITS>3) fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer0->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerNPointITS);
1005       }
1006       if(!track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)) {
1007         fPtAllminPtTPCvsPtAllITSLayer1->Fill(pt,(1./pt-1./ptTPC)/(1./pt));
1008         if(nPointITS>3) fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer1->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerNPointITS);
1009       }
1010       if(!track->HasPointOnITSLayer(0) && !track->HasPointOnITSLayer(1) && track->HasPointOnITSLayer(2)) {
1011         fPtAllminPtTPCvsPtAllITSLayer2->Fill(pt,(1./pt-1./ptTPC)/(1./pt));
1012         if(nPointITS>3) fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer2->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerNPointITS);
1013       }
1014       if(!track->HasPointOnITSLayer(0) && !track->HasPointOnITSLayer(1) && !track->HasPointOnITSLayer(2) && track->HasPointOnITSLayer(3)) {
1015         fPtAllminPtTPCvsPtAllITSLayer3->Fill(pt,(1./pt-1./ptTPC)/(1./pt));
1016         if(nPointITS>3) fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer3->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerNPointITS);
1017       }
1018       if(!track->HasPointOnITSLayer(0) && !track->HasPointOnITSLayer(1) && !track->HasPointOnITSLayer(2) && !track->HasPointOnITSLayer(3) && track->HasPointOnITSLayer(4)) {
1019         fPtAllminPtTPCvsPtAllITSLayer4->Fill(pt,(1./pt-1./ptTPC)/(1./pt));
1020         if(nPointITS>3) fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer4->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerNPointITS);
1021       }
1022       if(!track->HasPointOnITSLayer(0) && !track->HasPointOnITSLayer(1) && !track->HasPointOnITSLayer(2) && !track->HasPointOnITSLayer(3) && !track->HasPointOnITSLayer(4) && track->HasPointOnITSLayer(5)) {
1023         fPtAllminPtTPCvsPtAllITSLayer5->Fill(pt,(1./pt-1./ptTPC)/(1./pt));
1024         if(nPointITS>3) fPtAllminPtTPCvsPtAllChi2PerNClusITSLayer5->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerNPointITS);
1025       }
1026
1027       if(!track->HasPointOnITSLayer(0) && !track->HasPointOnITSLayer(1)) {
1028         fPtAllminPtTPCvsPtAllNoSPD->Fill(pt,(1./pt-1./ptTPC)/(1./pt));
1029         if(nPointITS>3) fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSPD->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerNPointITS);
1030       }
1031       if(!track->HasPointOnITSLayer(2) && !track->HasPointOnITSLayer(3)) {
1032         fPtAllminPtTPCvsPtAllNoSDD->Fill(pt,(1./pt-1./ptTPC)/(1./pt));
1033         if(nPointITS>3) fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSDD->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerNPointITS);
1034       }
1035       if(!track->HasPointOnITSLayer(4) && !track->HasPointOnITSLayer(5)) {
1036         fPtAllminPtTPCvsPtAllNoSSD->Fill(pt,(1./pt-1./ptTPC)/(1./pt));
1037         if(nPointITS>3) fPtAllminPtTPCvsPtAllChi2PerNClusITSNoSSD->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerNPointITS);
1038       }
1039
1040       if (constfriendtrack) { 
1041         AliESDfriendTrack friendtrack(*constfriendtrack);
1042         if (friendtrack.GetITSOut()) {
1043           AliExternalTrackParam trackITSouter(*(friendtrack.GetITSOut())); 
1044           Float_t ptITSouter = trackITSouter.Pt();
1045           if(ptITSouter==0.) continue;
1046           fPtSelITSouter->Fill(ptITSouter);
1047           fPtITSouterminPtTPCvsPtAll->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter) );
1048
1049           if(trackITSouter.GetSign()>0.) fPtITSouterminPtTPCvsPtAllEtaPos->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter),trackITSouter.Eta());
1050           if(trackITSouter.GetSign()<0.) fPtITSouterminPtTPCvsPtAllEtaNeg->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter),trackITSouter.Eta());
1051
1052           fPtITSouterminPtTPCvsPtAllNPointTPC->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter),nClustersTPC);
1053           fPtITSouterminPtTPCvsPtAllDCAR->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter),dca2D);
1054           fPtITSouterminPtTPCvsPtAllDCAZ->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter),dcaZ);
1055           fPtITSouterminPtTPCvsPtAllPhi->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter),phi);
1056           fPtITSouterminPtTPCvsPtAllNPointITS->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter),nPointITS);
1057           fPtITSouterminPtTPCvsPtAllNSigmaToVertex->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter),nSigmaToVertex);
1058           fPtITSouterminPtTPCvsPtAllChi2C->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter),chi2C);
1059           fPtITSouterminPtTPCvsPtAllRel1PtUncertainty->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter),relUncertainty1Pt);
1060           fPtITSouterminPtTPCvsPtAllChi2PerNClusTPC->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter),chi2PerClusterTPC);
1061           if(nPointITS>3) fPtITSouterminPtTPCvsPtAllChi2PerNClusITS->Fill(pt,(1./ptITSouter-1./ptTPC)/(1./ptITSouter),chi2PerNPointITS);
1062
1063         }
1064       }
1065     }//fTrackCuts selection
1066     
1067     
1068     //ITSrefit selection
1069     if (fTrackCutsITS->AcceptTrack(track) || fTrackCuts->AcceptTrack(track)) {
1070       
1071       fPtSelITS->Fill(pt);
1072       fPtSelTPCITS->Fill(ptTPC);
1073       fPtITSminPtTPCvsPtITS->Fill(pt,(1./pt-1./ptTPC)/(1./pt) );
1074       if(track->GetSign()>0.) fPtITSminPtTPCvsPtITSEtaPos->Fill(pt,(1./pt-1./ptTPC)/(1./pt),track->Eta());
1075       if(track->GetSign()<0.) fPtITSminPtTPCvsPtITSEtaNeg->Fill(pt,(1./pt-1./ptTPC)/(1./pt),track->Eta());
1076       fPtITSminPtTPCvsPtITSNPointTPC->Fill(pt,(1./pt-1./ptTPC)/(1./pt),nClustersTPC);
1077       fPtITSminPtTPCvsPtITSDCAR->Fill(pt,(1./pt-1./ptTPC)/(1./pt),dca2D);
1078       fPtITSminPtTPCvsPtITSDCAZ->Fill(pt,(1./pt-1./ptTPC)/(1./pt),dcaZ);
1079       fPtITSminPtTPCvsPtITSPhi->Fill(pt,(1./pt-1./ptTPC)/(1./pt),phi);
1080       fPtITSminPtTPCvsPtITSNPointITS->Fill(pt,(1./pt-1./ptTPC)/(1./pt),nPointITS);
1081       fPtITSminPtTPCvsPtITSNSigmaToVertex->Fill(pt,(1./pt-1./ptTPC)/(1./pt),nSigmaToVertex);
1082       fPtITSminPtTPCvsPtITSChi2C->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2C);
1083       fPtITSminPtTPCvsPtITSRel1PtUncertainty->Fill(pt,(1./pt-1./ptTPC)/(1./pt),relUncertainty1Pt);
1084       fPtITSminPtTPCvsPtITSChi2PerNClusTPC->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerClusterTPC);
1085       if(nPointITS>3) fPtITSminPtTPCvsPtITSChi2PerNClusITS->Fill(pt,(1./pt-1./ptTPC)/(1./pt),chi2PerNPointITS);
1086       fPtITSminPtTPCvsNPointTPCPhi->Fill((1./pt-1./ptTPC)/(1./pt),nClustersTPC,phi);
1087       fPtITSminPtTPCvsNPointITSPhi->Fill((1./pt-1./ptTPC)/(1./pt),nPointITS,phi);
1088       fPtITSminPtTPCvsRel1PtUncertaintyPhi->Fill((1./pt-1./ptTPC)/(1./pt),relUncertainty1Pt,phi);
1089
1090     }//fTrackCutsITS loop
1091       
1092   }//ESD track loop
1093    
1094   // Post output data
1095   PostData(0, fHistList);
1096   PostData(1, fHistListTPC);
1097   PostData(2, fHistListITS);
1098
1099 }
1100
1101 //________________________________________________________________________
1102 void AliPWG4HighPtQATPConly::Terminate(Option_t *)
1103 {
1104   //
1105   // Terminate
1106   //
1107
1108 }
1109
1110 #endif