Fix in AliTrackerBase::PropagateTo... routines: length integral was not correctly...
[u/mrichter/AliRoot.git] / PWGUD / dNdPt / AlidNdPtCutAnalysisPbPb.cxx
1 /**************************************************************************\r
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
3  *                                                                        *\r
4  * Author: The ALICE Off-line Project.                                    *\r
5  * Contributors are mentioned in the code where appropriate.              *\r
6  *                                                                        *\r
7  * Permission to use, copy, modify and distribute this software and its   *\r
8  * documentation strictly for non-commercial purposes is hereby granted   *\r
9  * without fee, provided that the above copyright notice appears in all   *\r
10  * copies and that both the copyright notice and this permission notice   *\r
11  * appear in the supporting documentation. The authors make no claims     *\r
12  * about the suitability of this software for any purpose. It is          *\r
13  * provided "as is" without express or implied warranty.                  *\r
14  **************************************************************************/\r
15 //------------------------------------------------------------------------------\r
16 // AlidNdPtCutAnalysisPbPb class. \r
17 //\r
18 // a. functionality:\r
19 // - fills generic cut histograms\r
20 // - generates cuts (selection criteria)\r
21 //\r
22 // b. data members:\r
23 // - generic cut histograms\r
24 // - control histograms\r
25 //\r
26 // Author: J.Otwinowski 04/11/2008 \r
27 //------------------------------------------------------------------------------\r
28 #include "TH1.h"\r
29 #include "TH2.h"\r
30 #include "TH3.h"\r
31 #include "TMatrixD.h"\r
32 \r
33 #include <TPDGCode.h>\r
34 \r
35 #include "AliHeader.h"  \r
36 #include "AliGenEventHeader.h"  \r
37 #include "AliInputEventHandler.h"  \r
38 #include "AliCentrality.h"  \r
39 #include "AliStack.h"  \r
40 #include "AliESDEvent.h"  \r
41 #include "AliMCEvent.h"  \r
42 #include "AliESDtrackCuts.h"  \r
43 #include "AliLog.h" \r
44 #include "AliTracker.h" \r
45 \r
46 #include "AlidNdPtEventCuts.h"\r
47 #include "AlidNdPtAcceptanceCuts.h"\r
48 #include "AlidNdPtBackgroundCuts.h"\r
49 #include "AlidNdPtAnalysis.h"\r
50 #include "AliPhysicsSelection.h"\r
51 \r
52 #include "AliPWG0Helper.h"\r
53 #include "AlidNdPtHelper.h"\r
54 #include "AlidNdPtCutAnalysisPbPb.h"\r
55 \r
56 using namespace std;\r
57 \r
58 ClassImp(AlidNdPtCutAnalysisPbPb)\r
59 \r
60 //_____________________________________________________________________________\r
61   AlidNdPtCutAnalysisPbPb::AlidNdPtCutAnalysisPbPb(): AlidNdPt(),\r
62   fAnalysisFolder(0),\r
63   fEventCount(0),\r
64   fRecEventHist(0),\r
65   fMCEventHist(0),\r
66   fRecMCEventHist(0),\r
67   fRecMCTrackHist(0),\r
68   fCentralityEstimator(0),\r
69   fFolderObj(0)\r
70 {\r
71   // default constructor\r
72   Init();\r
73 }\r
74 \r
75 //_____________________________________________________________________________\r
76 AlidNdPtCutAnalysisPbPb::AlidNdPtCutAnalysisPbPb(Char_t* name, Char_t* title): AlidNdPt(name,title),\r
77   fAnalysisFolder(0),\r
78   fEventCount(0),\r
79   fRecEventHist(0),\r
80   fMCEventHist(0),\r
81   fRecMCEventHist(0),\r
82   fRecMCTrackHist(0),\r
83   fCentralityEstimator(0),\r
84   fFolderObj(0)\r
85 {\r
86   // constructor\r
87   Init();\r
88 }\r
89 \r
90 //_____________________________________________________________________________\r
91 AlidNdPtCutAnalysisPbPb::~AlidNdPtCutAnalysisPbPb() {\r
92   // \r
93   if(fEventCount) delete fEventCount; fEventCount=0;\r
94   if(fRecEventHist) delete fRecEventHist; fRecEventHist=0;\r
95   if(fMCEventHist) delete fMCEventHist; fMCEventHist=0;\r
96   if(fRecMCEventHist) delete fRecMCEventHist; fRecMCEventHist=0;\r
97   if(fRecMCTrackHist) delete fRecMCTrackHist; fRecMCTrackHist=0;\r
98 \r
99   if(fAnalysisFolder) delete fAnalysisFolder; fAnalysisFolder=0;\r
100   if(fFolderObj) delete fFolderObj; fFolderObj=0;\r
101 }\r
102 \r
103 //_____________________________________________________________________________\r
104 void AlidNdPtCutAnalysisPbPb::Init(){\r
105   //\r
106   // Init histograms\r
107   //\r
108   //const Int_t ptNbins = 58; \r
109   //const Double_t ptMin = 0.; \r
110   //const Double_t ptMax = 20.; \r
111   /*\r
112   Double_t binsPt[ptNbins+1] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,18.0, 20.};\r
113   */\r
114 \r
115   // set pt bins\r
116   const Int_t ptNbins = 50;\r
117   const Double_t ptMin = 1.e-2, ptMax = 100.;\r
118   Double_t *binsPt = CreateLogAxis(ptNbins,ptMin,ptMax);\r
119 \r
120   // centrality bins\r
121   const Int_t centrNbins = 3;\r
122   const Double_t centrMin = 0, centrMax = 1;\r
123   Double_t binsCentr[centrNbins+1] = {0.0, 20., 50., 100.};\r
124 \r
125   // \r
126   Int_t binsEventCount[2]={2,2};\r
127   Double_t minEventCount[2]={0,0}; \r
128   Double_t maxEventCount[2]={2,2}; \r
129   fEventCount = new THnSparseF("fEventCount","trig vs trig+vertex",2,binsEventCount,minEventCount,maxEventCount);\r
130   fEventCount->GetAxis(0)->SetTitle("trig");\r
131   fEventCount->GetAxis(1)->SetTitle("trig+vert");\r
132   fEventCount->Sumw2();\r
133 \r
134   //Xv:Yv:Zv:ResZv:Mult\r
135   Double_t kFact = 0.1;\r
136 \r
137   Int_t binsRecEventHist[5]={80,80,100,80,150};\r
138   Double_t minRecEventHist[5]={-1.*kFact,-1.*kFact,-35.,0.,0.}; \r
139   Double_t maxRecEventHist[5]={1.*kFact,1.*kFact,35.,10.,3000.}; \r
140   fRecEventHist = new THnSparseF("fRecEventHist","Xv:Yv:Zv:ResZv:Mult",5,binsRecEventHist,minRecEventHist,maxRecEventHist);\r
141   fRecEventHist->GetAxis(0)->SetTitle("Xv (cm)");\r
142   fRecEventHist->GetAxis(1)->SetTitle("Yv (cm)");\r
143   fRecEventHist->GetAxis(2)->SetTitle("Zv (cm)");\r
144   fRecEventHist->GetAxis(3)->SetTitle("ResZv (cm)");\r
145   fRecEventHist->GetAxis(4)->SetTitle("Mult");\r
146   fRecEventHist->Sumw2();\r
147 \r
148   //Xv:Yv:Zv\r
149   Int_t binsMCEventHist[3]={80,80,100};\r
150   Double_t minMCEventHist[3]={-0.1,-0.1,-35.}; \r
151   Double_t maxMCEventHist[3]={0.1,0.1,35.}; \r
152   fMCEventHist = new THnSparseF("fMCEventHist","mcXv:mcYv:mcZv",3,binsMCEventHist,minMCEventHist,maxMCEventHist);\r
153   fMCEventHist->GetAxis(0)->SetTitle("mcXv (cm)");\r
154   fMCEventHist->GetAxis(1)->SetTitle("mcYv (cm)");\r
155   fMCEventHist->GetAxis(2)->SetTitle("mcZv (cm)");\r
156   fMCEventHist->Sumw2();\r
157 \r
158   //Xv-mcXv:Yv-mcYv:Zv-mcZv:Mult\r
159   Int_t binsRecMCEventHist[4]={100,100,100,150};\r
160   Double_t minRecMCEventHist[4]={-1.0*kFact,-1.0*kFact,-1.0*kFact,0.}; \r
161   Double_t maxRecMCEventHist[4]={1.0*kFact,1.0*kFact,1.0*kFact,3000.}; \r
162   fRecMCEventHist = new THnSparseF("fRecMCEventHist","Xv-mcXv:Yv-mcYv:Zv-mcZv:Mult",4,binsRecMCEventHist,minRecMCEventHist,maxRecMCEventHist);\r
163   fRecMCEventHist->GetAxis(0)->SetTitle("Xv-mcXv (cm)");\r
164   fRecMCEventHist->GetAxis(1)->SetTitle("Yv-mcYv (cm)");\r
165   fRecMCEventHist->GetAxis(2)->SetTitle("Zv-mcZv (cm)");\r
166   fRecMCEventHist->GetAxis(3)->SetTitle("Mult");\r
167   fRecMCEventHist->Sumw2();\r
168 \r
169   //\r
170   // THnSparse track histograms\r
171   //\r
172   //\r
173   //\r
174   //nCrossRows:chi2PerClust:chi2PerClustITS:nCrossRows/nFindableClust:fracSharedClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromConversion:isFromMaterial:isPrim:charge:centr:chi2ToTPCc\r
175   Int_t binsRecMCTrackHist[17]=  {160, 10, 70, 30, 20, 50,  50,  20,  90, ptNbins, 2, 2,  2,  2,  3,               centrNbins,100};\r
176   Double_t minRecMCTrackHist[17]={0.,  0., 0., 0., 0.,-0.5,-2.5,-1.0, 0., ptMin,   0., 0., 0., 0.,-1.,             centrMin,  0.};\r
177   Double_t maxRecMCTrackHist[17]={160.,10.,70.,1.5, 1., 0.5, 2.5, 1.0, 2.*TMath::Pi(), ptMax,  2., 2., 2., 2., 2., centrMax,  100.};\r
178 \r
179   fRecMCTrackHist = new THnSparseF("fRecMCTrackHist","nCrossRows:chi2PerClust:chi2PerClustITS:nCrossRows/nFindableClust:fracSharedClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromConversion:isFromMaterial:isPrim:charge:centr:chi2ToTPCc",17,binsRecMCTrackHist,minRecMCTrackHist,maxRecMCTrackHist);\r
180   fRecMCTrackHist->SetBinEdges(9,binsPt);\r
181   fRecMCTrackHist->SetBinEdges(15,binsCentr);\r
182 \r
183   fRecMCTrackHist->GetAxis(0)->SetTitle("nCrossRows");\r
184   fRecMCTrackHist->GetAxis(1)->SetTitle("chi2PerClust");\r
185   fRecMCTrackHist->GetAxis(2)->SetTitle("chi2PerClustITS");\r
186   fRecMCTrackHist->GetAxis(3)->SetTitle("nCrossRows/nFindableClust");\r
187   fRecMCTrackHist->GetAxis(4)->SetTitle("fracSharedClust");\r
188   fRecMCTrackHist->GetAxis(5)->SetTitle("DCAy (cm)");\r
189   fRecMCTrackHist->GetAxis(6)->SetTitle("DCAz (cm)");\r
190   fRecMCTrackHist->GetAxis(7)->SetTitle("#eta");\r
191   fRecMCTrackHist->GetAxis(8)->SetTitle("#phi (rad)");\r
192   fRecMCTrackHist->GetAxis(9)->SetTitle("p_{T} (GeV/c)");\r
193   fRecMCTrackHist->GetAxis(10)->SetTitle("hasStrangeMother");\r
194   fRecMCTrackHist->GetAxis(11)->SetTitle("isFromConversion");\r
195   fRecMCTrackHist->GetAxis(12)->SetTitle("isFromMaterial");\r
196   fRecMCTrackHist->GetAxis(13)->SetTitle("isPrim");\r
197   fRecMCTrackHist->GetAxis(14)->SetTitle("charge");\r
198   fRecMCTrackHist->GetAxis(15)->SetTitle("centrality");\r
199   fRecMCTrackHist->GetAxis(16)->SetTitle("chi2ToTPCc");\r
200   fRecMCTrackHist->Sumw2();\r
201 \r
202   // init output folder\r
203   fAnalysisFolder = CreateFolder("folderdNdPt","Analysis dNdPt Folder");\r
204 \r
205 }\r
206 \r
207 //_____________________________________________________________________________\r
208 void AlidNdPtCutAnalysisPbPb::Process(AliESDEvent *const esdEvent, AliMCEvent * const mcEvent)\r
209 {\r
210   //\r
211   // Process real and/or simulated events\r
212   //\r
213   if(!esdEvent) {\r
214     AliDebug(AliLog::kError, "esdEvent not available");\r
215     return;\r
216   }\r
217 \r
218   // get selection cuts\r
219   AlidNdPtEventCuts *evtCuts = GetEventCuts(); \r
220   AlidNdPtAcceptanceCuts *accCuts = GetAcceptanceCuts(); \r
221   AliESDtrackCuts *esdTrackCuts = GetTrackCuts(); \r
222 \r
223   if(!evtCuts || !accCuts  || !esdTrackCuts) {\r
224     AliDebug(AliLog::kError, "cuts not available");\r
225     return;\r
226   }\r
227 \r
228   // trigger selection\r
229 \r
230   Bool_t isEventTriggered = kTRUE;\r
231   AliPhysicsSelection *physicsSelection = NULL;\r
232   AliTriggerAnalysis* triggerAnalysis = NULL;\r
233 \r
234   // \r
235   AliInputEventHandler* inputHandler = (AliInputEventHandler*) AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();\r
236   if (!inputHandler)\r
237   {\r
238     Printf("ERROR: Could not receive input handler");\r
239     return;\r
240   }\r
241 \r
242   if(evtCuts->IsTriggerRequired())  \r
243   {\r
244     // always MB\r
245     isEventTriggered = inputHandler->IsEventSelected() & AliVEvent::kMB;\r
246 \r
247     physicsSelection = static_cast<AliPhysicsSelection*> (inputHandler->GetEventSelection());\r
248     if(!physicsSelection) return;\r
249     //SetPhysicsTriggerSelection(physicsSelection);\r
250 \r
251     if (isEventTriggered && (GetTrigger() == AliTriggerAnalysis::kV0AND)) {\r
252       // set trigger (V0AND)\r
253       triggerAnalysis = physicsSelection->GetTriggerAnalysis();\r
254       if(!triggerAnalysis) return;\r
255       isEventTriggered = triggerAnalysis->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
256     }\r
257   }\r
258 \r
259   // centrality determination\r
260   Float_t centralityF = -1;\r
261   AliCentrality *esdCentrality = esdEvent->GetCentrality();\r
262   centralityF = esdCentrality->GetCentralityPercentile(fCentralityEstimator.Data());\r
263 \r
264   // use MC information\r
265   AliHeader* header = 0;\r
266   AliGenEventHeader* genHeader = 0;\r
267   AliStack* stack = 0;\r
268   TArrayF vtxMC(3);\r
269 \r
270   Int_t multMCTrueTracks = 0;\r
271   if(IsUseMCInfo())\r
272   {\r
273     //\r
274     if(!mcEvent) {\r
275       AliDebug(AliLog::kError, "mcEvent not available");\r
276       return;\r
277     }\r
278     // get MC event header\r
279     header = mcEvent->Header();\r
280     if (!header) {\r
281       AliDebug(AliLog::kError, "Header not available");\r
282       return;\r
283     }\r
284     // MC particle stack\r
285     stack = mcEvent->Stack();\r
286     if (!stack) {\r
287       AliDebug(AliLog::kError, "Stack not available");\r
288       return;\r
289     }\r
290 \r
291     // get MC vertex\r
292     genHeader = header->GenEventHeader();\r
293     if (!genHeader) {\r
294       AliDebug(AliLog::kError, "Could not retrieve genHeader from Header");\r
295       return;\r
296     }\r
297     genHeader->PrimaryVertex(vtxMC);\r
298 \r
299     Double_t vMCEventHist[3]={vtxMC[0],vtxMC[1],vtxMC[2]};\r
300     fMCEventHist->Fill(vMCEventHist);\r
301 \r
302     // multipliticy of all MC primary tracks\r
303     // in Zv, pt and eta ranges)\r
304     multMCTrueTracks = AlidNdPtHelper::GetMCTrueTrackMult(mcEvent,evtCuts,accCuts);\r
305 \r
306   } // end bUseMC\r
307 \r
308   // get reconstructed vertex  \r
309   const AliESDVertex* vtxESD = 0; \r
310   if(GetAnalysisMode() == AlidNdPtHelper::kTPC) {\r
311         vtxESD = esdEvent->GetPrimaryVertexTPC();\r
312   }\r
313   else if(GetAnalysisMode() == AlidNdPtHelper::kTPCITS) {\r
314      vtxESD = esdEvent->GetPrimaryVertexTracks();\r
315   }\r
316   else {\r
317         return;\r
318   }\r
319 \r
320   if(!vtxESD) return;\r
321 \r
322   Bool_t isEventOK = evtCuts->AcceptEvent(esdEvent,mcEvent,vtxESD); \r
323   //printf("isEventOK %d, isEventTriggered %d \n",isEventOK, isEventTriggered);\r
324   //printf("GetAnalysisMode() %d \n",GetAnalysisMode());\r
325 \r
326   TObjArray *allChargedTracks=0;\r
327   Int_t multAll=0;\r
328   \r
329   //\r
330   // event counter\r
331   // \r
332   //printf("isEventOK %d, isEventTriggered %d \n",isEventOK,isEventTriggered);\r
333 \r
334   Bool_t isTrigAndVertex = isEventTriggered && isEventOK;\r
335   Double_t vEventCount[2] = { isEventTriggered, isTrigAndVertex};\r
336   fEventCount->Fill(vEventCount);\r
337 \r
338   // check event cuts\r
339   if(isEventOK && isEventTriggered)\r
340   {\r
341     // get all charged tracks\r
342     allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,GetAnalysisMode());\r
343     if(!allChargedTracks) return;\r
344 \r
345     Int_t entries = allChargedTracks->GetEntries();\r
346     for(Int_t i=0; i<entries;++i) \r
347     {\r
348       AliESDtrack *track = (AliESDtrack*)allChargedTracks->At(i);\r
349       if(!track) continue;\r
350 \r
351       if(!esdTrackCuts->AcceptTrack(track)) continue;\r
352       if(!accCuts->AcceptTrack(track)) continue;\r
353 \r
354       FillHistograms(esdEvent, track, stack, centralityF);\r
355       multAll++;\r
356 \r
357     }\r
358 \r
359     Double_t vRecEventHist[5] = {vtxESD->GetXv(),vtxESD->GetYv(),vtxESD->GetZv(),vtxESD->GetZRes(),multAll};\r
360     fRecEventHist->Fill(vRecEventHist);\r
361 \r
362     if(IsUseMCInfo()) {\r
363       Double_t vRecMCEventHist[5] = {vtxESD->GetXv()-vtxMC[0],vtxESD->GetYv()-vtxMC[1],vtxESD->GetZv()-vtxMC[2],multAll};\r
364       fRecMCEventHist->Fill(vRecMCEventHist);\r
365     }\r
366   }\r
367 \r
368   if(allChargedTracks) delete allChargedTracks; allChargedTracks = 0;\r
369 \r
370 }\r
371 \r
372 //_____________________________________________________________________________\r
373 void AlidNdPtCutAnalysisPbPb::FillHistograms(AliESDEvent *const esdEvent, AliESDtrack *const esdTrack, AliStack *const stack, Float_t centralityF) const\r
374 {\r
375   //\r
376   // Fill ESD track and MC histograms \r
377   //\r
378   if(!esdTrack) return;\r
379   if(esdTrack->Charge() == 0.) return;\r
380 \r
381   Float_t pt = esdTrack->Pt();\r
382   Float_t eta = esdTrack->Eta();\r
383   Float_t phi = esdTrack->Phi();\r
384 \r
385   Int_t nClust = 0;\r
386   if(GetAnalysisMode() == AlidNdPtHelper::kTPC) { \r
387     nClust = esdTrack->GetTPCNclsIter1();\r
388   } else {\r
389     nClust = esdTrack->GetTPCclusters(0);\r
390   }\r
391 \r
392   Float_t chi2PerCluster = 0.;\r
393   if(GetAnalysisMode() == AlidNdPtHelper::kTPC) { \r
394     if(nClust>0.) chi2PerCluster = esdTrack->GetTPCchi2Iter1()/Float_t(nClust);\r
395   } else {\r
396     chi2PerCluster = esdTrack->GetTPCchi2()/Float_t(nClust);\r
397   }\r
398 \r
399   Int_t nClustersITS = esdTrack->GetITSclusters(0);\r
400   Float_t chi2PerClusterITS = -1;\r
401   if (nClustersITS!=0) {\r
402       chi2PerClusterITS = esdTrack->GetITSchi2()/Float_t(nClustersITS);\r
403   }\r
404 \r
405   Float_t clustPerFindClust = 0.;\r
406   Int_t nFindableClust = esdTrack->GetTPCNclsF();\r
407   if(nFindableClust>0.) clustPerFindClust = Float_t(nClust)/nFindableClust;\r
408 \r
409   Float_t b[2], bCov[3];\r
410   esdTrack->GetImpactParameters(b,bCov);\r
411 \r
412   // \r
413   Float_t nCrossedRowsTPC = esdTrack->GetTPCClusterInfo(2,1);\r
414 \r
415   Float_t  ratioCrossedRowsOverFindableClustersTPC = 1.0;\r
416   if (esdTrack->GetTPCNclsF()>0) {\r
417      ratioCrossedRowsOverFindableClustersTPC = esdTrack->GetTPCClusterInfo(2,1)/esdTrack->GetTPCNclsF();\r
418   }\r
419 \r
420   //\r
421   Int_t nClustersTPCShared = esdTrack->GetTPCnclsS();\r
422   Float_t fracClustersTPCShared = -1.;\r
423   fracClustersTPCShared = Float_t(nClustersTPCShared)/Float_t(nClust);\r
424 \r
425   // \r
426   // kink idx\r
427   Int_t kinkIdx = 0;\r
428   //if(esdTrack->GetKinkIndex(0) > 0.)   isKink  = kTRUE;\r
429   if(esdTrack->GetKinkIndex(0) > 0)      kinkIdx = 1;   // kink daughter\r
430   else if(esdTrack->GetKinkIndex(0) < 0) kinkIdx = -1;  // kink mother\r
431   else kinkIdx = 0; // not kink\r
432 \r
433   //printf("esdTrack->GetKinkIndex(0) %d \n", esdTrack->GetKinkIndex(0));\r
434   //printf("esdTrack->GetKinkIndex(1) %d \n", esdTrack->GetKinkIndex(1));\r
435   //printf("esdTrack->GetKinkIndex(2) %d \n", esdTrack->GetKinkIndex(2));\r
436   //printf("kinkIdx %d \n", kinkIdx);\r
437 \r
438   Bool_t isOK = kTRUE;\r
439   AliExternalTrackParam * tpcInner = (AliExternalTrackParam *)(esdTrack->GetTPCInnerParam());\r
440   if (!tpcInner) return;\r
441   tpcInner->Rotate(esdTrack->GetAlpha());\r
442   tpcInner->PropagateTo(esdTrack->GetX(),esdEvent->GetMagneticField());\r
443         \r
444   // tpc constrained\r
445   AliExternalTrackParam * tpcInnerC = (AliExternalTrackParam *)(esdTrack->GetTPCInnerParam()->Clone());\r
446   if (!tpcInnerC) return;\r
447   tpcInnerC->Rotate(esdTrack->GetAlpha());\r
448   tpcInnerC->PropagateTo(esdTrack->GetX(),esdEvent->GetMagneticField());\r
449   Double_t dz[2],cov[3];\r
450   AliESDVertex *vtx= (AliESDVertex *)esdEvent->GetPrimaryVertex();\r
451 \r
452   if (!tpcInnerC->PropagateToDCA(vtx, esdEvent->GetMagneticField(), 3, dz, cov)) \r
453   { \r
454     if(tpcInnerC) delete tpcInnerC; \r
455     return;\r
456   }\r
457   Double_t covar[6]; vtx->GetCovMatrix(covar);\r
458   Double_t p[2]={tpcInnerC->GetParameter()[0]-dz[0],tpcInnerC->GetParameter()[1]-dz[1]};\r
459   Double_t c[3]={covar[2],0.,covar[5]};\r
460   Double_t chi2C=tpcInnerC->GetPredictedChi2(p,c);\r
461   isOK = tpcInnerC->Update(p,c);\r
462   isOK = tpcInnerC->Rotate(esdTrack->GetAlpha());\r
463   isOK = tpcInnerC->Propagate(esdTrack->GetAlpha(),esdTrack->GetX(),esdEvent->GetMagneticField());\r
464 \r
465   if(!isOK || chi2C>kVeryBig) { \r
466      if(tpcInnerC) delete tpcInnerC; \r
467      return;\r
468   }\r
469 \r
470   //\r
471   // calculate chi2 between vi and vj vectors\r
472   // with covi and covj covariance matrices\r
473   // chi2ij = (vi-vj)^(T)*(covi+covj)^(-1)*(vi-vj)\r
474   //\r
475   TMatrixD deltaT(5,1);\r
476   TMatrixD delta(1,5);\r
477   TMatrixD covarM(5,5);\r
478 \r
479   for (Int_t ipar=0; ipar<5; ipar++) deltaT(ipar,0)=tpcInnerC->GetParameter()[ipar]-esdTrack->GetParameter()[ipar];\r
480   for (Int_t ipar=0; ipar<5; ipar++) delta(0,ipar)=tpcInnerC->GetParameter()[ipar]-esdTrack->GetParameter()[ipar];\r
481 \r
482   for (Int_t ipar=0; ipar<5; ipar++) {\r
483   for (Int_t jpar=0; jpar<5; jpar++) {\r
484   Int_t index=esdTrack->GetIndex(ipar,jpar);\r
485     covarM(ipar,jpar)=esdTrack->GetCovariance()[index]+tpcInnerC->GetCovariance()[index];\r
486   }\r
487   }\r
488   TMatrixD covarMInv = covarM.Invert();\r
489   TMatrixD mat2 = covarMInv*deltaT;\r
490   TMatrixD chi2 = delta*mat2; \r
491 \r
492   //\r
493   // Fill rec vs MC information\r
494   //\r
495   Bool_t isPrim = kTRUE;\r
496   Bool_t hasStrangeMother = kFALSE;\r
497   Bool_t isFromMaterial = kFALSE;\r
498   Bool_t isFromConversion = kFALSE;\r
499 \r
500   if(IsUseMCInfo()) \r
501   {\r
502     if(!stack) return;\r
503     Int_t label = TMath::Abs(esdTrack->GetLabel()); \r
504     TParticle* particle = stack->Particle(label);\r
505     if(!particle) return;\r
506     if(particle->GetPDG() && particle->GetPDG()->Charge()==0.) return;\r
507     isPrim = stack->IsPhysicalPrimary(label);\r
508 \r
509     // check whether has stange mother\r
510     //\r
511     Int_t motherPdg = -1; \r
512     TParticle* mother = 0; \r
513        \r
514     Int_t motherLabel = particle->GetMother(0);  \r
515     if(motherLabel>0) mother = stack->Particle(motherLabel); \r
516     if(mother) motherPdg = TMath::Abs(mother->GetPdgCode()); // take abs for visualisation only \r
517     Int_t mech = particle->GetUniqueID(); // production mechanism \r
518 \r
519      // K+-, lambda, antilambda, K0s decays\r
520      if(!isPrim && mech==4 && \r
521        (TMath::Abs(motherPdg)==kKPlus || TMath::Abs(motherPdg)==kLambda0 || motherPdg==kK0Short))\r
522      {\r
523        hasStrangeMother = kTRUE;\r
524      } \r
525 \r
526      if(!isPrim && mech==5 && motherPdg==kGamma) { \r
527        isFromConversion=kTRUE; \r
528      }\r
529 \r
530      if(!isPrim && mech==13) { \r
531        isFromMaterial=kTRUE; \r
532      }\r
533   }\r
534   \r
535   // fill histo\r
536   Int_t charge = esdTrack->Charge();\r
537   Double_t vRecMCTrackHist[17] = { nCrossedRowsTPC, chi2PerCluster, chi2PerClusterITS,ratioCrossedRowsOverFindableClustersTPC, fracClustersTPCShared, b[0], b[1], eta, phi, pt, hasStrangeMother, isFromConversion, isFromMaterial, isPrim, charge, centralityF, chi2(0,0) }; \r
538   fRecMCTrackHist->Fill(vRecMCTrackHist);\r
539 \r
540   if(tpcInnerC) delete tpcInnerC;\r
541 }\r
542 \r
543 //_____________________________________________________________________________\r
544 Long64_t AlidNdPtCutAnalysisPbPb::Merge(TCollection* const list) \r
545 {\r
546   // Merge list of objects (needed by PROOF)\r
547 \r
548   if (!list)\r
549   return 0;\r
550 \r
551   if (list->IsEmpty())\r
552   return 1;\r
553 \r
554   TIterator* iter = list->MakeIterator();\r
555   TObject* obj = 0;\r
556   TObjArray* objArrayList = 0;\r
557   objArrayList = new TObjArray();\r
558 \r
559   //TList *collPhysSelection = new TList;\r
560 \r
561   // collection of generated histograms\r
562   Int_t count=0;\r
563   while((obj = iter->Next()) != 0) {\r
564     AlidNdPtCutAnalysisPbPb* entry = dynamic_cast<AlidNdPtCutAnalysisPbPb*>(obj);\r
565     if (entry == 0) continue; \r
566   \r
567     // event histo\r
568     if(GetMergeTHnSparse()) \r
569     {\r
570       fEventCount->Add(entry->fEventCount);\r
571       fRecEventHist->Add(entry->fRecEventHist);\r
572       fRecMCEventHist->Add(entry->fRecMCEventHist);\r
573       fMCEventHist->Add(entry->fMCEventHist);\r
574 \r
575       // track histo\r
576       fRecMCTrackHist->Add(entry->fRecMCTrackHist);\r
577     }\r
578 \r
579     if (entry->fFolderObj) { objArrayList->Add(entry->fFolderObj); }\r
580     \r
581   count++;\r
582   }\r
583   if (fFolderObj) { fFolderObj->Merge(objArrayList); } \r
584 \r
585   // to signal that track histos were not merged: reset\r
586   if (!GetMergeTHnSparse()) \r
587   { \r
588     // reset content \r
589     // save memory\r
590     fEventCount->Reset();\r
591     fRecEventHist->Reset();\r
592     fRecMCEventHist->Reset();\r
593     fMCEventHist->Reset();\r
594 \r
595     // track histo\r
596     fRecMCTrackHist->Reset();\r
597   }\r
598 \r
599   // delete\r
600   if (objArrayList) delete objArrayList;  objArrayList=0;\r
601 \r
602 return count;\r
603 }\r
604 \r
605 //_____________________________________________________________________________\r
606 void AlidNdPtCutAnalysisPbPb::Analyse() \r
607 {\r
608   //\r
609   // Analyse histograms\r
610   //\r
611   TH1::AddDirectory(kFALSE);\r
612   TObjArray *aFolderObj = new TObjArray;\r
613   if(!aFolderObj) return;\r
614 \r
615   TH1D *h1D = 0; \r
616   TH2D *h2D = 0; \r
617   TH3D *h3D = 0; \r
618   \r
619   //\r
620   // make event level projection\r
621   //\r
622   //THnSparseF *fEventCount; //-> trig, trig + vertex\r
623   //THnSparseF *fRecEventHist;   //-> Xv:Yv:Zv:ResZv:Mult\r
624   //THnSparseF *fMCEventHist;    //-> mcXv:mcYv:mcZv\r
625   //THnSparseF *fRecMCEventHist; //-> Xv-mcXv:Yv-mcYv:Zv-mcZv:Mult\r
626 \r
627   //\r
628   // Event counters\r
629   //\r
630   h2D = (TH2D*)fEventCount->Projection(0,1);\r
631   h2D->SetName("trig_vs_trigANDvertex");\r
632   h2D->SetTitle("trig_vs_trigANDvertex");\r
633   aFolderObj->Add(h2D);\r
634 \r
635   fEventCount->GetAxis(0)->SetRange(2,2); // triggered\r
636   h1D = (TH1D*)fEventCount->Projection(1);\r
637   h1D->SetTitle("rec. vertex for triggered events");\r
638   h1D->SetName("trigANDvertex");\r
639   h1D->SetTitle("trigANDvertex");\r
640   aFolderObj->Add(h1D);\r
641 \r
642   //\r
643   // Create rec. event histograms\r
644   //\r
645   h1D = (TH1D *)fRecEventHist->Projection(0);\r
646   h1D->SetName("rec_xv");\r
647   h1D->SetTitle("rec_xv");\r
648   aFolderObj->Add(h1D);\r
649 \r
650   h1D = (TH1D *)fRecEventHist->Projection(1);\r
651   h1D->SetName("rec_yv");\r
652   h1D->SetTitle("rec_yv");\r
653   aFolderObj->Add(h1D);\r
654 \r
655   h1D = (TH1D *)fRecEventHist->Projection(2);\r
656   h1D->SetName("rec_zv");\r
657   h1D->SetTitle("rec_zv");\r
658   aFolderObj->Add(h1D);\r
659 \r
660   h2D = (TH2D *)fRecEventHist->Projection(0,1);\r
661   h2D->SetName("rec_xv_vs_yv");\r
662   h2D->SetTitle("rec_xv_vs_yv");\r
663   aFolderObj->Add(h2D);\r
664 \r
665   h2D = (TH2D *)fRecEventHist->Projection(1,2);\r
666   h2D->SetName("rec_yv_vs_zv");\r
667   h2D->SetTitle("rec_yv_vs_zv");\r
668   aFolderObj->Add(h2D);\r
669 \r
670   h2D = (TH2D *)fRecEventHist->Projection(0,2);\r
671   h2D->SetName("rec_xv_vs_zv");\r
672   h2D->SetTitle("rec_xv_vs_zv");\r
673   aFolderObj->Add(h2D);\r
674 \r
675   h2D = (TH2D *)fRecEventHist->Projection(3,4);\r
676   h2D->SetName("rec_resZv_vs_Mult");\r
677   h2D->SetTitle("rec_resZv_vs_Mult");\r
678   aFolderObj->Add(h2D);\r
679 \r
680   //\r
681   // MC available\r
682   //\r
683   if(IsUseMCInfo()) {\r
684 \r
685   //\r
686   // Create mc event histograms\r
687   //\r
688 \r
689   h1D = (TH1D *)fMCEventHist->Projection(0);\r
690   h1D->SetName("mc_xv");\r
691   h1D->SetTitle("mc_xv");\r
692   aFolderObj->Add(h1D);\r
693 \r
694   h1D = (TH1D *)fMCEventHist->Projection(1);\r
695   h1D->SetName("mc_yv");\r
696   h1D->SetTitle("mc_yv");\r
697   aFolderObj->Add(h1D);\r
698 \r
699   h1D = (TH1D *)fMCEventHist->Projection(2);\r
700   h1D->SetName("mc_zv");\r
701   h1D->SetTitle("mc_zv");\r
702   aFolderObj->Add(h1D);\r
703 \r
704 \r
705   h2D = (TH2D *)fMCEventHist->Projection(0,1);\r
706   h2D->SetName("mc_xv_vs_yv");\r
707   h2D->SetTitle("mc_xv_vs_yv");\r
708   aFolderObj->Add(h2D);\r
709 \r
710   h2D = (TH2D *)fMCEventHist->Projection(1,2);\r
711   h2D->SetName("mc_yv_vs_zv");\r
712   h2D->SetTitle("mc_yv_vs_zv");\r
713   aFolderObj->Add(h2D);\r
714 \r
715   h2D = (TH2D *)fMCEventHist->Projection(0,2);\r
716   h2D->SetName("mc_xv_vs_zv");\r
717   h2D->SetTitle("mc_xv_vs_zv");\r
718   aFolderObj->Add(h2D);\r
719 \r
720   //\r
721   // Create rec-mc event histograms\r
722   //\r
723   h2D = (TH2D *)fRecMCEventHist->Projection(0,3);\r
724   h2D->SetName("rec_mc_deltaXv_vs_mult");\r
725   h2D->SetTitle("rec_mc_deltaXv_vs_mult");\r
726   aFolderObj->Add(h2D);\r
727 \r
728   h2D = (TH2D *)fRecMCEventHist->Projection(1,3);\r
729   h2D->SetName("rec_mc_deltaYv_vs_mult");\r
730   h2D->SetTitle("rec_mc_deltaYv_vs_mult");\r
731   aFolderObj->Add(h2D);\r
732 \r
733   h2D = (TH2D *)fRecMCEventHist->Projection(2,3);\r
734   h2D->SetName("rec_mc_deltaZv_vs_mult");\r
735   h2D->SetTitle("rec_mc_deltaZv_vs_mult");\r
736   aFolderObj->Add(h2D);\r
737 \r
738   } // end use MC info \r
739 \r
740   //\r
741   // make track level projection\r
742   //\r
743   // THnSparse track histograms\r
744   // nCrossRows:chi2PerClust:chi2PerClustITS:nCrossRows/nFindableClust:fracSharedClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromConversion:isFromMaterial:isPrim:charge:centr:chi2ToTPCc\r
745   //\r
746 \r
747   // only TH3 histograms\r
748   // x : pT : centr\r
749   Double_t minNCrossRows = 120.;\r
750   Double_t maxChi2PerClust = 4.;\r
751   Double_t maxChi2PerClustITS = 36.;\r
752   Double_t minNCrossRowsOverFindable = 0.8;\r
753   Double_t maxFracSharedClust = 0.4;\r
754   Double_t minDCAr = -0.2, maxDCAr = 0.2;\r
755   Double_t minDCAz = -2., maxDCAz = 2.;\r
756   Double_t minEta = -0.8, maxEta = 0.8;\r
757   Double_t maxChi2ToTPCc = 50;\r
758 \r
759   // only TH3 histograms\r
760   // x : pT : centr\r
761 \r
762   // set all cuts\r
763   fRecMCTrackHist->GetAxis(0)->SetRangeUser(minNCrossRows,160);\r
764   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,maxChi2PerClust-0.0001);\r
765   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,maxChi2PerClustITS-0.0001);\r
766   fRecMCTrackHist->GetAxis(3)->SetRangeUser(minNCrossRowsOverFindable,1.4999);\r
767   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,maxFracSharedClust-0.0001);\r
768   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minDCAr,maxDCAr-0.0001);\r
769   fRecMCTrackHist->GetAxis(6)->SetRangeUser(minDCAz,maxDCAz-0.0001);\r
770   fRecMCTrackHist->GetAxis(7)->SetRangeUser(minEta,maxEta-0.0001);\r
771   fRecMCTrackHist->GetAxis(16)->SetRangeUser(0.,maxChi2ToTPCc-0.0001);\r
772 \r
773   // nCrossRows \r
774   fRecMCTrackHist->GetAxis(0)->SetRangeUser(0,160);\r
775 \r
776   h3D = (TH3D *)fRecMCTrackHist->Projection(0,9,15);\r
777   h3D->SetName("rec_nCrossRows_pT_centr");\r
778   h3D->SetTitle("rec_nCrossRows_pT_centr");\r
779   aFolderObj->Add(h3D);\r
780 \r
781 \r
782   // Chi2PerClust \r
783   fRecMCTrackHist->GetAxis(0)->SetRangeUser(minNCrossRows,160);\r
784   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,10);\r
785 \r
786   h3D = (TH3D *)fRecMCTrackHist->Projection(1,9,15);\r
787   h3D->SetName("rec_Chi2PerClust_pT_centr");\r
788   h3D->SetTitle("rec_Chi2PerClust_pT_centr");\r
789   aFolderObj->Add(h3D);\r
790 \r
791 \r
792   // Chi2PerClustITS \r
793   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,maxChi2PerClust-0.0001);\r
794   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,100);\r
795 \r
796   h3D = (TH3D *)fRecMCTrackHist->Projection(2,9,15);\r
797   h3D->SetName("rec_Chi2PerClustITS_pT_centr");\r
798   h3D->SetTitle("rec_Chi2PerClustITS_pT_centr");\r
799   aFolderObj->Add(h3D);\r
800 \r
801 \r
802   // NCrossRowsOverFindable \r
803   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,maxChi2PerClustITS-0.0001);\r
804   fRecMCTrackHist->GetAxis(3)->SetRangeUser(0,1.4999);\r
805 \r
806   h3D = (TH3D *)fRecMCTrackHist->Projection(3,9,15);\r
807   h3D->SetName("rec_NCrossRowsOverFindable_pT_centr");\r
808   h3D->SetTitle("rec_NCrossRowsOverFindable_pT_centr");\r
809   aFolderObj->Add(h3D);\r
810 \r
811 \r
812   // FracSharedClust\r
813   fRecMCTrackHist->GetAxis(3)->SetRangeUser(minNCrossRowsOverFindable,1.4999);\r
814   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,0.9999);\r
815 \r
816   h3D = (TH3D *)fRecMCTrackHist->Projection(4,9,15);\r
817   h3D->SetName("rec_FracSharedClust_pT_centr");\r
818   h3D->SetTitle("rec_FracSharedClust_pT_centr");\r
819   aFolderObj->Add(h3D);\r
820 \r
821 \r
822   // DCAr\r
823   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,maxFracSharedClust-0.0001);\r
824   fRecMCTrackHist->GetAxis(5)->SetRangeUser(-10.,9.9999);\r
825 \r
826   h3D = (TH3D *)fRecMCTrackHist->Projection(5,9,15);\r
827   h3D->SetName("rec_DCAr_pT_centr");\r
828   h3D->SetTitle("rec_DCAr_pT_centr");\r
829   aFolderObj->Add(h3D);\r
830 \r
831   // DCAz\r
832   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minDCAr,maxDCAr-0.0001);\r
833   fRecMCTrackHist->GetAxis(6)->SetRangeUser(-10.,9.9999);\r
834 \r
835   h3D = (TH3D *)fRecMCTrackHist->Projection(6,9,15);\r
836   h3D->SetName("rec_DCAz_pT_centr");\r
837   h3D->SetTitle("rec_DCAz_pT_centr");\r
838   aFolderObj->Add(h3D);\r
839 \r
840   // chi2ToTPCc\r
841   fRecMCTrackHist->GetAxis(6)->SetRangeUser(minDCAz,maxDCAz-0.0001);\r
842   fRecMCTrackHist->GetAxis(16)->SetRangeUser(0,100);\r
843 \r
844   h3D = (TH3D *)fRecMCTrackHist->Projection(16,9,15);\r
845   h3D->SetName("rec_chi2ToTPCc_pT_centr");\r
846   h3D->SetTitle("rec_chi2ToTPCc_pT_centr");\r
847   aFolderObj->Add(h3D);\r
848 \r
849 \r
850   //\r
851   // MC available\r
852   //\r
853   // nCrossRows:chi2PerClust:chi2PerClustITS:nCrossRows/nFindableClust:fracSharedClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromConversion:isFromMaterial:isPrim:charge:centr:chi2ToTPCc\r
854   //\r
855 \r
856   if(IsUseMCInfo()) {\r
857   //\r
858   // only TH3 histograms \r
859   // x : pT : centr\r
860   //\r
861   // comes from week decays\r
862   //\r
863   fRecMCTrackHist->GetAxis(10)->SetRange(2,2);\r
864 \r
865   // set all cuts\r
866   fRecMCTrackHist->GetAxis(0)->SetRangeUser(minNCrossRows,160);\r
867   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,maxChi2PerClust-0.0001);\r
868   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,maxChi2PerClustITS-0.0001);\r
869   fRecMCTrackHist->GetAxis(3)->SetRangeUser(minNCrossRowsOverFindable,1.4999);\r
870   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,maxFracSharedClust-0.0001);\r
871   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minDCAr,maxDCAr-0.0001);\r
872   fRecMCTrackHist->GetAxis(6)->SetRangeUser(minDCAz,maxDCAz-0.0001);\r
873   fRecMCTrackHist->GetAxis(7)->SetRangeUser(minEta,maxEta-0.0001);\r
874   fRecMCTrackHist->GetAxis(16)->SetRangeUser(0.,maxChi2ToTPCc-0.0001);\r
875 \r
876   // nCrossRows \r
877   fRecMCTrackHist->GetAxis(0)->SetRangeUser(0,160);\r
878 \r
879   h3D = (TH3D *)fRecMCTrackHist->Projection(0,9,15);\r
880   h3D->SetName("rec_sec_strange_nCrossRows_pT_centr");\r
881   h3D->SetTitle("rec_sec_strange_nCrossRows_pT_centr");\r
882   aFolderObj->Add(h3D);\r
883 \r
884   // Chi2PerClust \r
885   fRecMCTrackHist->GetAxis(0)->SetRangeUser(minNCrossRows,160);\r
886   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,10);\r
887 \r
888   h3D = (TH3D *)fRecMCTrackHist->Projection(1,9,15);\r
889   h3D->SetName("rec_sec_strange_Chi2PerClust_pT_centr");\r
890   h3D->SetTitle("rec_sec_strange_Chi2PerClust_pT_centr");\r
891   aFolderObj->Add(h3D);\r
892 \r
893   // Chi2PerClustITS \r
894   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,maxChi2PerClust-0.0001);\r
895   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,100);\r
896 \r
897   h3D = (TH3D *)fRecMCTrackHist->Projection(2,9,15);\r
898   h3D->SetName("rec_sec_strange_Chi2PerClustITS_pT_centr");\r
899   h3D->SetTitle("rec_sec_strange_Chi2PerClustITS_pT_centr");\r
900   aFolderObj->Add(h3D);\r
901 \r
902 \r
903   // NCrossRowsOverFindable \r
904   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,maxChi2PerClustITS-0.0001);\r
905   fRecMCTrackHist->GetAxis(3)->SetRangeUser(0,1.4999);\r
906 \r
907   h3D = (TH3D *)fRecMCTrackHist->Projection(3,9,15);\r
908   h3D->SetName("rec_sec_strange_NCrossRowsOverFindable_pT_centr");\r
909   h3D->SetTitle("rec_sec_strange_NCrossRowsOverFindable_pT_centr");\r
910   aFolderObj->Add(h3D);\r
911 \r
912 \r
913   // FracSharedClust\r
914   fRecMCTrackHist->GetAxis(3)->SetRangeUser(minNCrossRowsOverFindable,1.4999);\r
915   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,0.9999);\r
916 \r
917   h3D = (TH3D *)fRecMCTrackHist->Projection(4,9,15);\r
918   h3D->SetName("rec_sec_strange_FracSharedClust_pT_centr");\r
919   h3D->SetTitle("rec_sec_strange_FracSharedClust_pT_centr");\r
920   aFolderObj->Add(h3D);\r
921 \r
922 \r
923   // DCAr\r
924   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,maxFracSharedClust-0.0001);\r
925   fRecMCTrackHist->GetAxis(5)->SetRangeUser(-10.,9.9999);\r
926 \r
927   h3D = (TH3D *)fRecMCTrackHist->Projection(5,9,15);\r
928   h3D->SetName("rec_sec_strange_DCAr_pT_centr");\r
929   h3D->SetTitle("rec_sec_strange_DCAr_pT_centr");\r
930   aFolderObj->Add(h3D);\r
931 \r
932 \r
933   // DCAz\r
934   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minDCAr,maxDCAr-0.0001);\r
935   fRecMCTrackHist->GetAxis(6)->SetRangeUser(-10.,9.9999);\r
936 \r
937   h3D = (TH3D *)fRecMCTrackHist->Projection(6,9,15);\r
938   h3D->SetName("rec_sec_strange_DCAz_pT_centr");\r
939   h3D->SetTitle("rec_sec_strange_DCAz_pT_centr");\r
940   aFolderObj->Add(h3D);\r
941 \r
942   // chi2ToTPCc\r
943   fRecMCTrackHist->GetAxis(6)->SetRangeUser(minDCAz,maxDCAz-0.0001);\r
944   fRecMCTrackHist->GetAxis(16)->SetRangeUser(0,100);\r
945 \r
946   h3D = (TH3D *)fRecMCTrackHist->Projection(16,9,15);\r
947   h3D->SetName("rec_sec_strange_chi2ToTPCc_pT_centr");\r
948   h3D->SetTitle("rec_sec_strange_chi2ToTPCc_pT_centr");\r
949   aFolderObj->Add(h3D);\r
950 \r
951 \r
952   // only TH3 histograms \r
953   // x : pT : centr\r
954   //\r
955 \r
956   // comes from conversion\r
957   //\r
958   fRecMCTrackHist->GetAxis(10)->SetRange(1,2);\r
959   fRecMCTrackHist->GetAxis(11)->SetRange(2,2);\r
960 \r
961   // set all cuts\r
962   fRecMCTrackHist->GetAxis(0)->SetRangeUser(minNCrossRows,160);\r
963   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,maxChi2PerClust-0.0001);\r
964   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,maxChi2PerClustITS-0.0001);\r
965   fRecMCTrackHist->GetAxis(3)->SetRangeUser(minNCrossRowsOverFindable,1.4999);\r
966   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,maxFracSharedClust-0.0001);\r
967   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minDCAr,maxDCAr-0.0001);\r
968   fRecMCTrackHist->GetAxis(6)->SetRangeUser(minDCAz,maxDCAz-0.0001);\r
969   fRecMCTrackHist->GetAxis(7)->SetRangeUser(minEta,maxEta-0.0001);\r
970   fRecMCTrackHist->GetAxis(16)->SetRangeUser(0.,maxChi2ToTPCc-0.0001);\r
971 \r
972   // nCrossRows \r
973   fRecMCTrackHist->GetAxis(0)->SetRangeUser(0,160);\r
974 \r
975   h3D = (TH3D *)fRecMCTrackHist->Projection(0,9,15);\r
976   h3D->SetName("rec_sec_conversion_nCrossRows_pT_centr");\r
977   h3D->SetTitle("rec_sec_conversion_nCrossRows_pT_centr");\r
978   aFolderObj->Add(h3D);\r
979 \r
980   // Chi2PerClust \r
981   fRecMCTrackHist->GetAxis(0)->SetRangeUser(minNCrossRows,160);\r
982   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,10);\r
983 \r
984   h3D = (TH3D *)fRecMCTrackHist->Projection(1,9,15);\r
985   h3D->SetName("rec_sec_conversion_Chi2PerClust_pT_centr");\r
986   h3D->SetTitle("rec_sec_conversion_Chi2PerClust_pT_centr");\r
987   aFolderObj->Add(h3D);\r
988 \r
989   // Chi2PerClustITS \r
990   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,maxChi2PerClust-0.0001);\r
991   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,100);\r
992 \r
993   h3D = (TH3D *)fRecMCTrackHist->Projection(2,9,15);\r
994   h3D->SetName("rec_sec_conversion_Chi2PerClustITS_pT_centr");\r
995   h3D->SetTitle("rec_sec_conversion_Chi2PerClustITS_pT_centr");\r
996   aFolderObj->Add(h3D);\r
997 \r
998 \r
999   // NCrossRowsOverFindable \r
1000   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,maxChi2PerClustITS-0.0001);\r
1001   fRecMCTrackHist->GetAxis(3)->SetRangeUser(0,1.4999);\r
1002 \r
1003   h3D = (TH3D *)fRecMCTrackHist->Projection(3,9,15);\r
1004   h3D->SetName("rec_sec_conversion_NCrossRowsOverFindable_pT_centr");\r
1005   h3D->SetTitle("rec_sec_conversion_NCrossRowsOverFindable_pT_centr");\r
1006   aFolderObj->Add(h3D);\r
1007 \r
1008 \r
1009   // FracSharedClust\r
1010   fRecMCTrackHist->GetAxis(3)->SetRangeUser(minNCrossRowsOverFindable,1.4999);\r
1011   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,0.9999);\r
1012 \r
1013   h3D = (TH3D *)fRecMCTrackHist->Projection(4,9,15);\r
1014   h3D->SetName("rec_sec_conversion_FracSharedClust_pT_centr");\r
1015   h3D->SetTitle("rec_sec_conversion_FracSharedClust_pT_centr");\r
1016   aFolderObj->Add(h3D);\r
1017 \r
1018 \r
1019   // DCAr\r
1020   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,maxFracSharedClust-0.0001);\r
1021   fRecMCTrackHist->GetAxis(5)->SetRangeUser(-10.,9.9999);\r
1022 \r
1023   h3D = (TH3D *)fRecMCTrackHist->Projection(5,9,15);\r
1024   h3D->SetName("rec_sec_conversion_DCAr_pT_centr");\r
1025   h3D->SetTitle("rec_sec_conversion_DCAr_pT_centr");\r
1026   aFolderObj->Add(h3D);\r
1027 \r
1028 \r
1029   // DCAz\r
1030   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minDCAr,maxDCAr-0.0001);\r
1031   fRecMCTrackHist->GetAxis(6)->SetRangeUser(-10.,9.9999);\r
1032 \r
1033   h3D = (TH3D *)fRecMCTrackHist->Projection(6,9,15);\r
1034   h3D->SetName("rec_sec_conversion_DCAz_pT_centr");\r
1035   h3D->SetTitle("rec_sec_conversion_DCAz_pT_centr");\r
1036   aFolderObj->Add(h3D);\r
1037 \r
1038   // chi2ToTPCc\r
1039   fRecMCTrackHist->GetAxis(6)->SetRangeUser(minDCAz,maxDCAz-0.0001);\r
1040   fRecMCTrackHist->GetAxis(16)->SetRangeUser(0,100);\r
1041 \r
1042   h3D = (TH3D *)fRecMCTrackHist->Projection(16,9,15);\r
1043   h3D->SetName("rec_sec_conversion_chi2ToTPCc_pT_centr");\r
1044   h3D->SetTitle("rec_sec_conversion_chi2ToTPCc_pT_centr");\r
1045   aFolderObj->Add(h3D);\r
1046 \r
1047 \r
1048 \r
1049 \r
1050 \r
1051   // comes from interaction with material\r
1052   //\r
1053   fRecMCTrackHist->GetAxis(11)->SetRange(1,2);\r
1054   fRecMCTrackHist->GetAxis(12)->SetRange(2,2);\r
1055 \r
1056   // set all cuts\r
1057   fRecMCTrackHist->GetAxis(0)->SetRangeUser(minNCrossRows,160);\r
1058   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,maxChi2PerClust-0.0001);\r
1059   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,maxChi2PerClustITS-0.0001);\r
1060   fRecMCTrackHist->GetAxis(3)->SetRangeUser(minNCrossRowsOverFindable,1.4999);\r
1061   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,maxFracSharedClust-0.0001);\r
1062   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minDCAr,maxDCAr-0.0001);\r
1063   fRecMCTrackHist->GetAxis(6)->SetRangeUser(minDCAz,maxDCAz-0.0001);\r
1064   fRecMCTrackHist->GetAxis(7)->SetRangeUser(minEta,maxEta-0.0001);\r
1065   fRecMCTrackHist->GetAxis(16)->SetRangeUser(0.,maxChi2ToTPCc-0.0001);\r
1066 \r
1067   // nCrossRows \r
1068   fRecMCTrackHist->GetAxis(0)->SetRangeUser(0,160);\r
1069 \r
1070   h3D = (TH3D *)fRecMCTrackHist->Projection(0,9,15);\r
1071   h3D->SetName("rec_sec_material_nCrossRows_pT_centr");\r
1072   h3D->SetTitle("rec_sec_material_nCrossRows_pT_centr");\r
1073   aFolderObj->Add(h3D);\r
1074 \r
1075   // Chi2PerClust \r
1076   fRecMCTrackHist->GetAxis(0)->SetRangeUser(minNCrossRows,160);\r
1077   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,10);\r
1078 \r
1079   h3D = (TH3D *)fRecMCTrackHist->Projection(1,9,15);\r
1080   h3D->SetName("rec_sec_material_Chi2PerClust_pT_centr");\r
1081   h3D->SetTitle("rec_sec_material_Chi2PerClust_pT_centr");\r
1082   aFolderObj->Add(h3D);\r
1083 \r
1084   // Chi2PerClustITS \r
1085   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,maxChi2PerClust-0.0001);\r
1086   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,100);\r
1087 \r
1088   h3D = (TH3D *)fRecMCTrackHist->Projection(2,9,15);\r
1089   h3D->SetName("rec_sec_material_Chi2PerClustITS_pT_centr");\r
1090   h3D->SetTitle("rec_sec_material_Chi2PerClustITS_pT_centr");\r
1091   aFolderObj->Add(h3D);\r
1092 \r
1093 \r
1094   // NCrossRowsOverFindable \r
1095   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,maxChi2PerClustITS-0.0001);\r
1096   fRecMCTrackHist->GetAxis(3)->SetRangeUser(0,1.4999);\r
1097 \r
1098   h3D = (TH3D *)fRecMCTrackHist->Projection(3,9,15);\r
1099   h3D->SetName("rec_sec_material_NCrossRowsOverFindable_pT_centr");\r
1100   h3D->SetTitle("rec_sec_material_NCrossRowsOverFindable_pT_centr");\r
1101   aFolderObj->Add(h3D);\r
1102 \r
1103 \r
1104   // FracSharedClust\r
1105   fRecMCTrackHist->GetAxis(3)->SetRangeUser(minNCrossRowsOverFindable,1.4999);\r
1106   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,0.9999);\r
1107 \r
1108   h3D = (TH3D *)fRecMCTrackHist->Projection(4,9,15);\r
1109   h3D->SetName("rec_sec_material_FracSharedClust_pT_centr");\r
1110   h3D->SetTitle("rec_sec_material_FracSharedClust_pT_centr");\r
1111   aFolderObj->Add(h3D);\r
1112 \r
1113 \r
1114   // DCAr\r
1115   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,maxFracSharedClust-0.0001);\r
1116   fRecMCTrackHist->GetAxis(5)->SetRangeUser(-10.,9.9999);\r
1117 \r
1118   h3D = (TH3D *)fRecMCTrackHist->Projection(5,9,15);\r
1119   h3D->SetName("rec_sec_material_DCAr_pT_centr");\r
1120   h3D->SetTitle("rec_sec_material_DCAr_pT_centr");\r
1121   aFolderObj->Add(h3D);\r
1122 \r
1123 \r
1124   // DCAz\r
1125   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minDCAr,maxDCAr-0.0001);\r
1126   fRecMCTrackHist->GetAxis(6)->SetRangeUser(-10.,9.9999);\r
1127 \r
1128   h3D = (TH3D *)fRecMCTrackHist->Projection(6,9,15);\r
1129   h3D->SetName("rec_sec_material_DCAz_pT_centr");\r
1130   h3D->SetTitle("rec_sec_material_DCAz_pT_centr");\r
1131   aFolderObj->Add(h3D);\r
1132 \r
1133   // chi2ToTPCc\r
1134   fRecMCTrackHist->GetAxis(6)->SetRangeUser(minDCAz,maxDCAz-0.0001);\r
1135   fRecMCTrackHist->GetAxis(16)->SetRangeUser(0,100);\r
1136 \r
1137   h3D = (TH3D *)fRecMCTrackHist->Projection(16,9,15);\r
1138   h3D->SetName("rec_sec_material_chi2ToTPCc_pT_centr");\r
1139   h3D->SetTitle("rec_sec_material_chi2ToTPCc_pT_centr");\r
1140   aFolderObj->Add(h3D);\r
1141 \r
1142 \r
1143 \r
1144   //\r
1145   // only TH3 histograms \r
1146   // x : pT : centr\r
1147   //\r
1148   // secondaries defined as AliStack::IsPhysicalPrimary()\r
1149   //\r
1150   fRecMCTrackHist->GetAxis(12)->SetRange(1,2);\r
1151   fRecMCTrackHist->GetAxis(13)->SetRange(1,1);\r
1152 \r
1153   // set all cuts\r
1154   fRecMCTrackHist->GetAxis(0)->SetRangeUser(minNCrossRows,160);\r
1155   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,maxChi2PerClust-0.0001);\r
1156   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,maxChi2PerClustITS-0.0001);\r
1157   fRecMCTrackHist->GetAxis(3)->SetRangeUser(minNCrossRowsOverFindable,1.4999);\r
1158   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,maxFracSharedClust-0.0001);\r
1159   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minDCAr,maxDCAr-0.0001);\r
1160   fRecMCTrackHist->GetAxis(6)->SetRangeUser(minDCAz,maxDCAz-0.0001);\r
1161   fRecMCTrackHist->GetAxis(7)->SetRangeUser(minEta,maxEta-0.0001);\r
1162   fRecMCTrackHist->GetAxis(16)->SetRangeUser(0.,maxChi2ToTPCc-0.0001);\r
1163 \r
1164   // nCrossRows \r
1165   fRecMCTrackHist->GetAxis(0)->SetRangeUser(0,160);\r
1166 \r
1167   h3D = (TH3D *)fRecMCTrackHist->Projection(0,9,15);\r
1168   h3D->SetName("rec_sec_nCrossRows_pT_centr");\r
1169   h3D->SetTitle("rec_sec_nCrossRows_pT_centr");\r
1170   aFolderObj->Add(h3D);\r
1171 \r
1172   // Chi2PerClust \r
1173   fRecMCTrackHist->GetAxis(0)->SetRangeUser(minNCrossRows,160);\r
1174   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,10);\r
1175 \r
1176   h3D = (TH3D *)fRecMCTrackHist->Projection(1,9,15);\r
1177   h3D->SetName("rec_sec_Chi2PerClust_pT_centr");\r
1178   h3D->SetTitle("rec_sec_Chi2PerClust_pT_centr");\r
1179   aFolderObj->Add(h3D);\r
1180 \r
1181   // Chi2PerClustITS \r
1182   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,maxChi2PerClust-0.0001);\r
1183   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,100);\r
1184 \r
1185   h3D = (TH3D *)fRecMCTrackHist->Projection(2,9,15);\r
1186   h3D->SetName("rec_sec_Chi2PerClustITS_pT_centr");\r
1187   h3D->SetTitle("rec_sec_Chi2PerClustITS_pT_centr");\r
1188   aFolderObj->Add(h3D);\r
1189 \r
1190 \r
1191   // NCrossRowsOverFindable \r
1192   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,maxChi2PerClustITS-0.0001);\r
1193   fRecMCTrackHist->GetAxis(3)->SetRangeUser(0,1.4999);\r
1194 \r
1195   h3D = (TH3D *)fRecMCTrackHist->Projection(3,9,15);\r
1196   h3D->SetName("rec_sec_NCrossRowsOverFindable_pT_centr");\r
1197   h3D->SetTitle("rec_sec_NCrossRowsOverFindable_pT_centr");\r
1198   aFolderObj->Add(h3D);\r
1199 \r
1200 \r
1201   // FracSharedClust\r
1202   fRecMCTrackHist->GetAxis(3)->SetRangeUser(minNCrossRowsOverFindable,1.4999);\r
1203   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,0.9999);\r
1204 \r
1205   h3D = (TH3D *)fRecMCTrackHist->Projection(4,9,15);\r
1206   h3D->SetName("rec_sec_FracSharedClust_pT_centr");\r
1207   h3D->SetTitle("rec_sec_FracSharedClust_pT_centr");\r
1208   aFolderObj->Add(h3D);\r
1209 \r
1210 \r
1211   // DCAr\r
1212   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,maxFracSharedClust-0.0001);\r
1213   fRecMCTrackHist->GetAxis(5)->SetRangeUser(-10.,9.9999);\r
1214 \r
1215   h3D = (TH3D *)fRecMCTrackHist->Projection(5,9,15);\r
1216   h3D->SetName("rec_sec_DCAr_pT_centr");\r
1217   h3D->SetTitle("rec_sec_DCAr_pT_centr");\r
1218   aFolderObj->Add(h3D);\r
1219 \r
1220 \r
1221   // DCAz\r
1222   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minDCAr,maxDCAr-0.0001);\r
1223   fRecMCTrackHist->GetAxis(6)->SetRangeUser(-10.,9.9999);\r
1224 \r
1225   h3D = (TH3D *)fRecMCTrackHist->Projection(6,9,15);\r
1226   h3D->SetName("rec_sec_DCAz_pT_centr");\r
1227   h3D->SetTitle("rec_sec_DCAz_pT_centr");\r
1228   aFolderObj->Add(h3D);\r
1229 \r
1230   // chi2ToTPCc\r
1231   fRecMCTrackHist->GetAxis(6)->SetRangeUser(minDCAz,maxDCAz-0.0001);\r
1232   fRecMCTrackHist->GetAxis(16)->SetRangeUser(0,100);\r
1233 \r
1234   h3D = (TH3D *)fRecMCTrackHist->Projection(16,9,15);\r
1235   h3D->SetName("rec_sec_chi2ToTPCc_pT_centr");\r
1236   h3D->SetTitle("rec_sec_chi2ToTPCc_pT_centr");\r
1237   aFolderObj->Add(h3D);\r
1238 \r
1239   //\r
1240   // only TH3 histograms \r
1241   // x : pT : centr\r
1242   //\r
1243   // primaries defined as AliStack::IsPhysicalPrimary()\r
1244   //\r
1245   fRecMCTrackHist->GetAxis(12)->SetRange(1,2);\r
1246   fRecMCTrackHist->GetAxis(13)->SetRange(2,2);\r
1247 \r
1248   // set all cuts\r
1249   fRecMCTrackHist->GetAxis(0)->SetRangeUser(minNCrossRows,160);\r
1250   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,maxChi2PerClust-0.0001);\r
1251   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,maxChi2PerClustITS-0.0001);\r
1252   fRecMCTrackHist->GetAxis(3)->SetRangeUser(minNCrossRowsOverFindable,1.4999);\r
1253   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,maxFracSharedClust-0.0001);\r
1254   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minDCAr,maxDCAr-0.0001);\r
1255   fRecMCTrackHist->GetAxis(6)->SetRangeUser(minDCAz,maxDCAz-0.0001);\r
1256   fRecMCTrackHist->GetAxis(7)->SetRangeUser(minEta,maxEta-0.0001);\r
1257   fRecMCTrackHist->GetAxis(16)->SetRangeUser(0.,maxChi2ToTPCc-0.0001);\r
1258 \r
1259   // nCrossRows \r
1260   fRecMCTrackHist->GetAxis(0)->SetRangeUser(0,160);\r
1261 \r
1262   h3D = (TH3D *)fRecMCTrackHist->Projection(0,9,15);\r
1263   h3D->SetName("rec_prim_nCrossRows_pT_centr");\r
1264   h3D->SetTitle("rec_prim_nCrossRows_pT_centr");\r
1265   aFolderObj->Add(h3D);\r
1266 \r
1267   // Chi2PerClust \r
1268   fRecMCTrackHist->GetAxis(0)->SetRangeUser(minNCrossRows,160);\r
1269   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,10);\r
1270 \r
1271   h3D = (TH3D *)fRecMCTrackHist->Projection(1,9,15);\r
1272   h3D->SetName("rec_prim_Chi2PerClust_pT_centr");\r
1273   h3D->SetTitle("rec_prim_Chi2PerClust_pT_centr");\r
1274   aFolderObj->Add(h3D);\r
1275 \r
1276   // Chi2PerClustITS \r
1277   fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,maxChi2PerClust-0.0001);\r
1278   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,100);\r
1279 \r
1280   h3D = (TH3D *)fRecMCTrackHist->Projection(2,9,15);\r
1281   h3D->SetName("rec_prim_Chi2PerClustITS_pT_centr");\r
1282   h3D->SetTitle("rec_prim_Chi2PerClustITS_pT_centr");\r
1283   aFolderObj->Add(h3D);\r
1284 \r
1285 \r
1286   // NCrossRowsOverFindable \r
1287   fRecMCTrackHist->GetAxis(2)->SetRangeUser(0.,maxChi2PerClustITS-0.0001);\r
1288   fRecMCTrackHist->GetAxis(3)->SetRangeUser(0,1.4999);\r
1289 \r
1290   h3D = (TH3D *)fRecMCTrackHist->Projection(3,9,15);\r
1291   h3D->SetName("rec_prim_NCrossRowsOverFindable_pT_centr");\r
1292   h3D->SetTitle("rec_prim_NCrossRowsOverFindable_pT_centr");\r
1293   aFolderObj->Add(h3D);\r
1294 \r
1295 \r
1296   // FracSharedClust\r
1297   fRecMCTrackHist->GetAxis(3)->SetRangeUser(minNCrossRowsOverFindable,1.4999);\r
1298   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,0.9999);\r
1299 \r
1300   h3D = (TH3D *)fRecMCTrackHist->Projection(4,9,15);\r
1301   h3D->SetName("rec_prim_FracSharedClust_pT_centr");\r
1302   h3D->SetTitle("rec_prim_FracSharedClust_pT_centr");\r
1303   aFolderObj->Add(h3D);\r
1304 \r
1305 \r
1306   // DCAr\r
1307   fRecMCTrackHist->GetAxis(4)->SetRangeUser(0.,maxFracSharedClust-0.0001);\r
1308   fRecMCTrackHist->GetAxis(5)->SetRangeUser(-10.,9.9999);\r
1309 \r
1310   h3D = (TH3D *)fRecMCTrackHist->Projection(5,9,15);\r
1311   h3D->SetName("rec_prim_DCAr_pT_centr");\r
1312   h3D->SetTitle("rec_prim_DCAr_pT_centr");\r
1313   aFolderObj->Add(h3D);\r
1314 \r
1315 \r
1316   // DCAz\r
1317   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minDCAr,maxDCAr-0.0001);\r
1318   fRecMCTrackHist->GetAxis(6)->SetRangeUser(-10.,9.9999);\r
1319 \r
1320   h3D = (TH3D *)fRecMCTrackHist->Projection(6,9,15);\r
1321   h3D->SetName("rec_prim_DCAz_pT_centr");\r
1322   h3D->SetTitle("rec_prim_DCAz_pT_centr");\r
1323   aFolderObj->Add(h3D);\r
1324 \r
1325   // chi2ToTPCc\r
1326   fRecMCTrackHist->GetAxis(6)->SetRangeUser(minDCAz,maxDCAz-0.0001);\r
1327   fRecMCTrackHist->GetAxis(16)->SetRangeUser(0,100);\r
1328 \r
1329   h3D = (TH3D *)fRecMCTrackHist->Projection(16,9,15);\r
1330   h3D->SetName("rec_prim_chi2ToTPCc_pT_centr");\r
1331   h3D->SetTitle("rec_prim_chi2ToTPCc_pT_centr");\r
1332   aFolderObj->Add(h3D);\r
1333 \r
1334   }\r
1335 \r
1336   // export objects to analysis folder\r
1337   fAnalysisFolder = ExportToFolder(aFolderObj);\r
1338   if(!fAnalysisFolder) {\r
1339     if(aFolderObj) delete aFolderObj;\r
1340     return;\r
1341   }\r
1342 \r
1343   // Reset setings\r
1344   \r
1345   for(Int_t ndim = 0; ndim < fEventCount->GetNdimensions(); ndim++) {\r
1346     fEventCount->GetAxis(ndim)->SetRange(1,fEventCount->GetAxis(ndim)->GetNbins());\r
1347   }\r
1348 \r
1349   for(Int_t ndim = 0; ndim < fMCEventHist->GetNdimensions(); ndim++) {\r
1350     fMCEventHist->GetAxis(ndim)->SetRange(1,fMCEventHist->GetAxis(ndim)->GetNbins());\r
1351   }\r
1352 \r
1353   for(Int_t ndim = 0; ndim < fRecMCEventHist->GetNdimensions(); ndim++) {\r
1354     fRecMCEventHist->GetAxis(ndim)->SetRange(1,fRecMCEventHist->GetAxis(ndim)->GetNbins());\r
1355   }\r
1356 \r
1357   for(Int_t ndim = 0; ndim < fRecMCTrackHist->GetNdimensions(); ndim++) \r
1358   {\r
1359     fRecMCTrackHist->GetAxis(ndim)->SetRange(1,fRecMCTrackHist->GetAxis(ndim)->GetNbins());\r
1360   }\r
1361 \r
1362   // delete only TObjArray\r
1363   //if(aFolderObj) delete aFolderObj;\r
1364 \r
1365   if (fFolderObj) delete fFolderObj;\r
1366   fFolderObj = aFolderObj;\r
1367   aFolderObj=0;\r
1368 }\r
1369 \r
1370 //_____________________________________________________________________________\r
1371 TFolder* AlidNdPtCutAnalysisPbPb::ExportToFolder(TObjArray * const array) \r
1372 {\r
1373   // recreate folder avery time and export objects to new one\r
1374   //\r
1375   AlidNdPtCutAnalysisPbPb * comp=this;\r
1376   TFolder *folder = comp->GetAnalysisFolder();\r
1377 \r
1378   TString name, title;\r
1379   TFolder *newFolder = 0;\r
1380   Int_t i = 0;\r
1381   Int_t size = array->GetSize();\r
1382 \r
1383   if(folder) { \r
1384      // get name and title from old folder\r
1385      name = folder->GetName();  \r
1386      title = folder->GetTitle();  \r
1387 \r
1388          // delete old one\r
1389      delete folder;\r
1390 \r
1391          // create new one\r
1392      newFolder = CreateFolder(name.Data(),title.Data());\r
1393      newFolder->SetOwner();\r
1394 \r
1395          // add objects to folder\r
1396      while(i < size) {\r
1397            newFolder->Add(array->At(i));\r
1398            i++;\r
1399          }\r
1400   }\r
1401 \r
1402 return newFolder;\r
1403 }\r
1404 \r
1405 //_____________________________________________________________________________\r
1406 TFolder* AlidNdPtCutAnalysisPbPb::CreateFolder(TString name,TString title) { \r
1407 // create folder for analysed histograms\r
1408 //\r
1409 TFolder *folder = 0;\r
1410   folder = new TFolder(name.Data(),title.Data());\r
1411 \r
1412   return folder;\r
1413 }\r