]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/AliComparisonDCA.cxx
PreReading of MC information on demand.
[u/mrichter/AliRoot.git] / PWG1 / AliComparisonDCA.cxx
CommitLineData
3baa4bfd 1//------------------------------------------------------------------------------
2// Implementation of AliComparisonDCA class. It keeps information from
3// comparison of reconstructed and MC particle tracks. In addtion,
4// it keeps selection cuts used during comparison. The comparison
5// information is stored in the ROOT histograms. Analysis of these
6// histograms can be done by using Analyse() class function. The result of
7// the analysis (histograms/graphs) are stored in the folder
8// which is a data member of AliComparisonDCA.
9//
10// Author: J.Otwinowski 04/02/2008
11//------------------------------------------------------------------------------
12
13/*
14
15 // after running comparison task, read the file, and get component
b4126c69 16 gROOT->LoadMacro("$ALICE_ROOT/PWG1/Macros/LoadMyLibs.C");
17 LoadMyLibs();
3baa4bfd 18 TFile f("Output.root");
35771050 19 //AliComparisonDCA * compObj = (AliComparisonDCA*)f.Get("AliComparisonDCA");
20 AliComparisonDCA * compObj = (AliComparisonDCA*)cOutput->FindObject("AliComparisonDCA");
3baa4bfd 21
b4126c69 22 // Analyse comparison data
3baa4bfd 23 compObj->Analyse();
24
25 // the output histograms/graphs will be stored in the folder "folderDCA"
26 compObj->GetAnalysisFolder()->ls("*");
27
28 // user can save whole comparison object (or only folder with anlysed histograms)
29 // in the seperate output file (e.g.)
30 TFile fout("Analysed_DCA.root","recreate");
31 compObj->Write(); // compObj->GetAnalysisFolder()->Write();
32 fout.Close();
33
34*/
35
7b392278 36#include <TAxis.h>
37#include <TCanvas.h>
38#include <TGraph.h>
39#include <TGraph2D.h>
40#include <TH1.h>
71a14197 41
7b392278 42#include "AliComparisonDCA.h"
3baa4bfd 43#include "AliESDEvent.h"
7b392278 44#include "AliESDRecInfo.h"
3baa4bfd 45#include "AliESDVertex.h"
7b392278 46#include "AliLog.h"
3baa4bfd 47#include "AliMCInfo.h"
7b392278 48#include "AliMCInfoCuts.h"
49#include "AliMathBase.h"
50#include "AliRecInfoCuts.h"
51#include "AliTracker.h"
3baa4bfd 52
53using namespace std;
54
55ClassImp(AliComparisonDCA)
56
57//_____________________________________________________________________________
58AliComparisonDCA::AliComparisonDCA():
3baa4bfd 59 AliComparisonObject("AliComparisonDCA"),
60
61 // DCA histograms
71a14197 62 fDCAHisto(0),
63 /*
64 fD0TanSPtTPCITS(0),
65 fD1TanSPtTPCITS(0),
66 fD0TanSPt(0),
67 fD1TanSPt(0),
68 fD0TanSPtTPC(0),
69 fD1TanSPtTPC(0),
70 */
71
72 // Cuts
73 fCutsRC(0),
74 fCutsMC(0),
75
76 // histogram folder
77 fAnalysisFolder(0)
78{
79 // default constructor
80}
81
82//_____________________________________________________________________________
83AliComparisonDCA::AliComparisonDCA(Char_t* name="AliComparisonDCA", Char_t* title="AliComparisonDCA",Int_t analysisMode=0, Bool_t hptGenerator=kFALSE):
84 AliComparisonObject(name,title),
85
86 // DCA histograms
87 fDCAHisto(0),
88 /*
35771050 89 fD0TanSPtTPCITS(0),
90 fD1TanSPtTPCITS(0),
91 fD0TanSPt(0),
92 fD1TanSPt(0),
93 fD0TanSPtTPC(0),
94 fD1TanSPtTPC(0),
71a14197 95 */
3baa4bfd 96
97 // Cuts
98 fCutsRC(0),
99 fCutsMC(0),
100
101 // histogram folder
102 fAnalysisFolder(0)
103{
71a14197 104 // named constructor
105
106 SetAnalysisMode(analysisMode);
107 SetHptGenerator(hptGenerator);
3baa4bfd 108 Init();
3baa4bfd 109}
110
71a14197 111
3baa4bfd 112//_____________________________________________________________________________
113AliComparisonDCA::~AliComparisonDCA()
114{
71a14197 115 // destructor
116 if(fDCAHisto) delete fDCAHisto; fDCAHisto=0;
117 /*
35771050 118 if(fD0TanSPtTPCITS) delete fD0TanSPtTPCITS; fD0TanSPtTPCITS=0;
119 if(fD1TanSPtTPCITS) delete fD1TanSPtTPCITS; fD1TanSPtTPCITS=0;
120 if(fD0TanSPt) delete fD0TanSPt; fD0TanSPt=0;
121 if(fD1TanSPt) delete fD1TanSPt; fD1TanSPt=0;
122 if(fD0TanSPtTPC) delete fD0TanSPtTPC; fD0TanSPtTPC=0;
123 if(fD1TanSPtTPC) delete fD1TanSPtTPC; fD1TanSPtTPC=0;
71a14197 124 */
3baa4bfd 125 if(fAnalysisFolder) delete fAnalysisFolder; fAnalysisFolder=0;
126
127}
128
129//_____________________________________________________________________________
130void AliComparisonDCA::Init()
131{
132 // DCA histograms
71a14197 133
134 Int_t nPBins = 31;
135 Double_t binsP[32] = {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.7,0.8,0.9,1.0,1.2,1.4,1.6,1.8,2.0,2.25,2.5,2.75,3.,3.5,4.,5.,6.,8.,10.};
136 Double_t pMin = 0., pMax = 10.;
137
138 if(IsHptGenerator() == kTRUE) {
139 nPBins = 100;
140 pMin = 0.; pMax = 100.;
141 }
142
143 //dca_r, dca_z, eta, pt
144 Int_t binsQA[4] = {100,100,20,nPBins};
145 Double_t xminQA[4] = {-10.,-10.,-1., pMin};
146 Double_t xmaxQA[4] = {10.,10.,1., pMax};
147
148 fDCAHisto = new THnSparseF("fDCAHisto","dca_r:dca_z:eta:pt",4,binsQA,xminQA,xmaxQA);
149 if(!IsHptGenerator()) fDCAHisto->SetBinEdges(3,binsP);
150
151 fDCAHisto->GetAxis(0)->SetTitle("dca_r (cm)");
152 fDCAHisto->GetAxis(1)->SetTitle("dca_z (cm)");
153 fDCAHisto->GetAxis(2)->SetTitle("eta");
154 fDCAHisto->GetAxis(3)->SetTitle("pt (GeV/c)");
155 fDCAHisto->Sumw2();
156
157 /*
35771050 158 fD0TanSPtTPCITS = new TH3F("DCAyTanSPtTPCITS","DCAyTanSPt",40,-2,2, 10,0.3,3, 100,-1,1);
159 fD0TanSPtTPCITS->SetXTitle("tan(#theta)");
160 fD0TanSPtTPCITS->SetYTitle("#sqrt{p_{t}(GeV)}");
161 fD0TanSPtTPCITS->SetZTitle("DCA_{xy}");
162
163 fD1TanSPtTPCITS = new TH3F("DCAzTanSPtTPCITS","DCAzTanSPt",40,-2,2, 10,0.3,3, 100,-1,1);
164 fD1TanSPtTPCITS->SetXTitle("tan(#theta)");
165 fD1TanSPtTPCITS->SetYTitle("#sqrt(p_{t}(GeV))");
166 fD1TanSPtTPCITS->SetZTitle("DCA_{z}");
167
168 fD0TanSPt = new TH3F("DCAyTanSPt","DCAyTanSPt",40,-2,2, 10,0.3,3, 100,-1,1);
169 fD0TanSPt->SetXTitle("tan(#theta)");
170 fD0TanSPt->SetYTitle("#sqrt{p_{t}(GeV)}");
171 fD0TanSPt->SetZTitle("DCA_{xy}");
172
173 fD1TanSPt = new TH3F("DCAzTanSPt","DCAzTanSPt",40,-2,2, 10,0.3,3, 100, -1,1);
174 fD1TanSPt->SetXTitle("tan(#theta)");
175 fD1TanSPt->SetYTitle("#sqrt{p_{t}(GeV)}");
176 fD1TanSPt->SetZTitle("DCA_{z}");
177
178 fD0TanSPtTPC = new TH3F("DCAyTanSPtTPC","DCAyTanSPt",40,-2,2, 10,0.3,3, 100,-1,1);
179 fD0TanSPtTPC->SetXTitle("tan(#theta)");
180 fD0TanSPtTPC->SetYTitle("#sqrt{p_{t}(GeV)}");
181 fD0TanSPtTPC->SetZTitle("DCA_{xy}");
182
183 fD1TanSPtTPC = new TH3F("DCAzTanSPtTPC","DCAzTanSPt",40,-2,2, 10,0.3,3, 100, -1,1);
184 fD1TanSPtTPC->SetXTitle("tan(#theta)");
185 fD1TanSPtTPC->SetYTitle("#sqrt{p_{t}(GeV)}");
186 fD1TanSPtTPC->SetZTitle("DCA_{z}");
71a14197 187 */
3baa4bfd 188
189 // init cuts
190 if(!fCutsMC)
191 AliDebug(AliLog::kError, "ERROR: Cannot find AliMCInfoCuts object");
192 if(!fCutsRC)
193 AliDebug(AliLog::kError, "ERROR: Cannot find AliRecInfoCuts object");
194
195 // init folder
196 fAnalysisFolder = CreateFolder("folderDCA","Analysis DCA Folder");
197}
198
199//_____________________________________________________________________________
71a14197 200void AliComparisonDCA::ProcessTPC(AliMCInfo* const infoMC, AliESDRecInfo * const infoRC)
3baa4bfd 201{
202 // Fill DCA comparison information
203 AliExternalTrackParam *track = 0;
ff0f1307 204 //Double_t field = AliTracker::GetBz(); // nominal Bz field [kG]
3baa4bfd 205 Double_t kMaxD = 123456.0; // max distance
206
3baa4bfd 207 Double_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z
208
209 Float_t mcpt = infoMC->GetParticle().Pt();
71a14197 210 Float_t mceta = infoMC->GetParticle().Eta();
211 //Float_t spt = TMath::Sqrt(mcpt);
3baa4bfd 212
213 // distance to Prim. vertex
214 const Double_t* dv = infoMC->GetVDist();
215
216 Bool_t isPrim = TMath::Sqrt(dv[0]*dv[0] + dv[1]*dv[1])<fCutsMC->GetMaxR() && TMath::Abs(dv[2])<fCutsMC->GetMaxVz();
217
218 // Check selection cuts
219 if (fCutsMC->IsPdgParticle(TMath::Abs(infoMC->GetParticle().GetPdgCode())) == kFALSE) return;
220 if (!isPrim) return;
221 if (infoRC->GetStatus(1)!=3) return;
222 if (!infoRC->GetESDtrack()) return;
223 if (infoRC->GetESDtrack()->GetTPCNcls()<fCutsRC->GetMinNClustersTPC()) return;
71a14197 224 //if (!infoRC->GetESDtrack()->GetConstrainedParam()) return;
3baa4bfd 225
226 // calculate and set prim. vertex
35771050 227 AliESDVertex vertexMC;
228 vertexMC.SetXv( infoMC->GetParticle().Vx() - dv[0] );
229 vertexMC.SetYv( infoMC->GetParticle().Vy() - dv[1] );
230 vertexMC.SetZv( infoMC->GetParticle().Vz() - dv[2] );
3baa4bfd 231
232 // calculate track parameters at vertex
233 if (infoRC->GetESDtrack()->GetTPCInnerParam())
234 {
235 if ((track = new AliExternalTrackParam(*infoRC->GetESDtrack()->GetTPCInnerParam())) != 0 )
236 {
ff0f1307 237
238 //Bool_t bDCAStatus = track->PropagateToDCA(&vertexMC,field,kMaxD,dca,cov);
239 Double_t field[3]; track->GetBxByBz(field);
240 Bool_t bDCAStatus = track->PropagateToDCABxByBz(&vertexMC,field,kMaxD,dca,cov);
3baa4bfd 241
242 if(bDCAStatus) {
71a14197 243 Double_t vDCAHisto[4]={dca[0],dca[1],mceta,mcpt};
244 fDCAHisto->Fill(vDCAHisto);
245 }
246 delete track;
3baa4bfd 247 }
248 }
71a14197 249}
250
251//_____________________________________________________________________________
252void AliComparisonDCA::ProcessTPCITS(AliMCInfo* const infoMC, AliESDRecInfo * const infoRC)
253{
254 // Fill DCA comparison information
255 Int_t clusterITS[200];
256 Float_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z
257
258 Float_t mcpt = infoMC->GetParticle().Pt();
259 Float_t mceta = infoMC->GetParticle().Eta();
260 //Float_t spt = TMath::Sqrt(mcpt);
261
262 // distance to Prim. vertex
263 const Double_t* dv = infoMC->GetVDist();
264 Bool_t isPrim = TMath::Sqrt(dv[0]*dv[0] + dv[1]*dv[1])<fCutsMC->GetMaxR() && TMath::Abs(dv[2])<fCutsMC->GetMaxVz();
265
266 // Check selection cuts
267 if (fCutsMC->IsPdgParticle(TMath::Abs(infoMC->GetParticle().GetPdgCode())) == kFALSE) return;
268 if (!isPrim) return;
269 if (infoRC->GetStatus(1)!=3) return;
270 if (!infoRC->GetESDtrack()) return;
271 if (infoRC->GetESDtrack()->GetTPCNcls()<fCutsRC->GetMinNClustersTPC()) return;
272 //if (!infoRC->GetESDtrack()->GetConstrainedParam()) return;
3baa4bfd 273
71a14197 274 infoRC->GetESDtrack()->GetImpactParameters(dca,cov);
275
276 // ITS + TPC
277 if(infoRC->GetESDtrack()->GetITSclusters(clusterITS)>fCutsRC->GetMinNClustersITS())
278 {
279 Double_t vDCAHisto[4]={dca[0],dca[1],mceta,mcpt};
280 fDCAHisto->Fill(vDCAHisto);
3baa4bfd 281 }
71a14197 282}
283
37c57fc9 284void AliComparisonDCA::ProcessConstrained(AliMCInfo* const /*infoMC*/, AliESDRecInfo * const /*infoRC*/)
71a14197 285{
286 // Fill DCA comparison information
287
288 AliDebug(AliLog::kWarning, "Warning: Not implemented");
3baa4bfd 289}
290
291//_____________________________________________________________________________
71a14197 292Long64_t AliComparisonDCA::Merge(TCollection* const list)
3baa4bfd 293{
294 // Merge list of objects (needed by PROOF)
295
296 if (!list)
297 return 0;
298
299 if (list->IsEmpty())
300 return 1;
301
302 TIterator* iter = list->MakeIterator();
303 TObject* obj = 0;
304
305 // collection of generated histograms
306 Int_t count=0;
307 while((obj = iter->Next()) != 0)
308 {
309 AliComparisonDCA* entry = dynamic_cast<AliComparisonDCA*>(obj);
310 if (entry == 0) continue;
3baa4bfd 311
71a14197 312 fDCAHisto->Add(entry->fDCAHisto);
313 /*
35771050 314 fD0TanSPtTPCITS->Add(entry->fD0TanSPtTPCITS);
315 fD1TanSPtTPCITS->Add(entry->fD1TanSPtTPCITS);
316 fD0TanSPt->Add(entry->fD0TanSPt);
317 fD1TanSPt->Add(entry->fD1TanSPt);
318 fD0TanSPtTPC->Add(entry->fD0TanSPtTPC);
319 fD1TanSPtTPC->Add(entry->fD1TanSPtTPC);
71a14197 320 */
3baa4bfd 321
322 count++;
323 }
324
325return count;
326}
327
328//_____________________________________________________________________________
71a14197 329void AliComparisonDCA::Exec(AliMCInfo* const infoMC, AliESDRecInfo * const infoRC)
330{
3baa4bfd 331 // Process comparison information
71a14197 332 if(GetAnalysisMode() == 0) ProcessTPC(infoMC,infoRC);
333 else if(GetAnalysisMode() == 1) ProcessTPCITS(infoMC,infoRC);
334 else if(GetAnalysisMode() == 2) ProcessConstrained(infoMC,infoRC);
335 else {
336 printf("ERROR: AnalysisMode %d \n",fAnalysisMode);
337 return;
338 }
3baa4bfd 339}
340
341//_____________________________________________________________________________
342void AliComparisonDCA::Analyse()
343{
344 //
345 // Analyse comparison information and store output histograms
346 // in the analysis folder "folderDCA"
347 //
348
349 TH1::AddDirectory(kFALSE);
71a14197 350 TObjArray *aFolderObj = new TObjArray;
3baa4bfd 351
71a14197 352 /*
35771050 353 TGraph * gr[8]= { 0,0,0,0,0,0,0,0 };
354 TGraph2D *gr2[8]= { 0,0,0,0,0,0,0,0};
3baa4bfd 355 AliComparisonDCA * comp=this;
3baa4bfd 356
357 // write results in the folder
358 // Canvas to draw analysed histograms
359 TCanvas * c = new TCanvas("canDCA","DCA resolution");
decf0997 360 c->Divide(2,4);
3baa4bfd 361 //
362 // DCA resolution
363 //
decf0997 364 c->cd(1);
35771050 365 gr[0] = AliMathBase::MakeStat1D(comp->fD0TanSPtTPC,2,5);
decf0997 366 gr[0]->GetXaxis()->SetTitle("Tan(#theta)");
367 gr[0]->GetYaxis()->SetTitle("#sigmaDCA_xy (cm)");
35771050 368 gr[0]->SetName("DCAXYResolTanTPC");
369 gr[0]->SetTitle("resol. DCA_xy (TPC only)");
decf0997 370 gr[0]->Draw("Al*");
371
372 aFolderObj->Add(gr[0]);
373
3baa4bfd 374 c->cd(2);
35771050 375 gr[1] = AliMathBase::MakeStat1D(comp->fD1TanSPtTPC,2,5);
decf0997 376 gr[1]->GetXaxis()->SetTitle("Tan(#theta)");
377 gr[1]->GetYaxis()->SetTitle("#sigmaDCA_z (cm)");
35771050 378 gr[1]->SetName("DCAZResolTanTPC");
379 gr[1]->SetTitle("resol. DCA_z (TPC only)");
decf0997 380 gr[1]->Draw("Al*");
381
382 aFolderObj->Add(gr[1]);
383
decf0997 384 c->cd(3);
35771050 385 gr[2] = AliMathBase::MakeStat1D(comp->fD0TanSPtTPCITS,2,5);
decf0997 386 gr[2]->GetXaxis()->SetTitle("Tan(#theta)");
35771050 387 gr[2]->GetYaxis()->SetTitle("#sigmaDCA_xy (cm)");
388 gr[2]->SetName("DCAXYResolTanTPCITS");
389 gr[2]->SetTitle("resol. DCA_xy (TPC+ITS)");
decf0997 390 gr[2]->Draw("Al*");
391
392 aFolderObj->Add(gr[2]);
393
394 c->cd(4);
35771050 395 gr[3] = AliMathBase::MakeStat1D(comp->fD1TanSPtTPCITS,2,5);
decf0997 396 gr[3]->GetXaxis()->SetTitle("Tan(#theta)");
35771050 397 gr[3]->GetYaxis()->SetTitle("#sigmaDCA_z (cm)");
398 gr[3]->SetName("DCAZResolTanTPCITS");
399 gr[3]->SetTitle("resol. DCA_z (TPC+ITS)");
decf0997 400 gr[3]->Draw("Al*");
401
402 aFolderObj->Add(gr[3]);
403
35771050 404 //
405 // DCA mean value
406 //
decf0997 407 c->cd(5);
35771050 408 gr[4] = AliMathBase::MakeStat1D(comp->fD0TanSPtTPC,2,4);
409 gr[4]->GetXaxis()->SetTitle("Tan(#theta)");
410 gr[4]->GetYaxis()->SetTitle("mean DCA_xy (cm)");
411 gr[4]->SetName("DCAXYMeanTanTPC");
412 gr[4]->SetTitle("mean DCA_xy (TPC only)");
413 gr[4]->Draw("Al*");
414
415 aFolderObj->Add(gr[4]);
416
417 c->cd(6);
418 gr[5] = AliMathBase::MakeStat1D(comp->fD1TanSPtTPC,2,4);
419 gr[5]->GetXaxis()->SetTitle("Tan(#theta)");
420 gr[5]->GetYaxis()->SetTitle("mean DCA_z (cm)");
421 gr[5]->SetName("DCAZMeanTanTPC");
422 gr[5]->SetTitle("mean DCA_z (TPC only)");
423 gr[5]->Draw("Al*");
424
425 aFolderObj->Add(gr[5]);
426
427 c->cd(7);
428 gr[6] = AliMathBase::MakeStat1D(comp->fD0TanSPtTPCITS,2,4);
429 gr[6]->GetXaxis()->SetTitle("Tan(#theta)");
430 gr[6]->GetYaxis()->SetTitle("mean DCA_xy (cm)");
431 gr[6]->SetName("DCAXYMeanTanTPCITS");
432 gr[6]->SetTitle("mean DCA_xy (TPC+ITS)");
433 gr[6]->Draw("Al*");
434
435 aFolderObj->Add(gr[6]);
436
437 c->cd(8);
438 gr[7] = AliMathBase::MakeStat1D(comp->fD1TanSPtTPCITS,2,4);
439 gr[7]->GetXaxis()->SetTitle("Tan(#theta)");
440 gr[7]->GetYaxis()->SetTitle("mean DCA_z (cm)");
441 gr[7]->SetName("DCAZMeanTanTPCITS");
442 gr[7]->SetTitle("mean DCA_z (TPC+ITS)");
443 gr[7]->Draw("Al*");
444
445 aFolderObj->Add(gr[7]);
446
447 // 2D DCA resolution
448 TCanvas * c1 = new TCanvas("canDCA1","2D DCA resolution");
449 c1->Divide(2,4);
450
451 // TPC only
452 c1->cd(1);
453 gr2[0] = AliMathBase::MakeStat2D(comp->fD0TanSPtTPC,4,2,5);
decf0997 454 gr2[0]->GetXaxis()->SetTitle("Tan(#theta)");
35771050 455 gr2[0]->GetYaxis()->SetTitle("#sqrt{p_{t}(GeV)}");
decf0997 456 gr2[0]->GetZaxis()->SetTitle("#sigmaDCA_xy (cm)");
35771050 457 gr2[0]->SetName("DCAXYResolSPTTanTPC");
458 gr2[0]->SetTitle("#sigma DCA_xy (TPC only)");
decf0997 459 gr2[0]->GetHistogram()->Draw("colz");
460
35771050 461 gr2[0]->GetHistogram()->SetName("DCAXYResolSPTTanTPC");
decf0997 462 aFolderObj->Add(gr2[0]->GetHistogram());
463
35771050 464 c1->cd(2);
465 gr2[1] = AliMathBase::MakeStat2D(comp->fD1TanSPtTPC,4,2,5);
decf0997 466 gr2[1]->GetXaxis()->SetTitle("Tan(#theta)");
35771050 467 gr2[1]->GetYaxis()->SetTitle("#sqrt{p_{t}(GeV)}");
decf0997 468 gr2[1]->GetZaxis()->SetTitle("#sigmaDCA_z (cm)");
35771050 469 gr2[1]->SetName("DCAZResolSPTTanTPC");
470 gr2[1]->SetTitle("#sigma DCA_z (TPC only)");
decf0997 471 gr2[1]->GetHistogram()->Draw("colz");
472
35771050 473 gr2[1]->GetHistogram()->SetName("DCAZResolSPTTanTPC");
decf0997 474 aFolderObj->Add(gr2[1]->GetHistogram());
475
35771050 476 // TPC+ITS
477 c1->cd(3);
478 gr2[2] = AliMathBase::MakeStat2D(comp->fD0TanSPtTPCITS,4,2,5);
decf0997 479 gr2[2]->GetXaxis()->SetTitle("Tan(#theta)");
35771050 480 gr2[2]->GetYaxis()->SetTitle("#sqrt{p_{t}(GeV)}");
481 gr2[2]->GetZaxis()->SetTitle("#sigmaDCA_xy (cm)");
482 gr2[2]->SetName("DCAXYResolSPTTanTPCITS");
483 gr2[2]->SetTitle("#sigma DCA_xy (TPC+ITS)");
decf0997 484 gr2[2]->GetHistogram()->Draw("colz");
485
35771050 486 gr2[2]->GetHistogram()->SetName("DCAXYResolSPTTanTPCITS");
decf0997 487 aFolderObj->Add(gr2[2]->GetHistogram());
488
35771050 489 c1->cd(4);
490 gr2[3] = AliMathBase::MakeStat2D(comp->fD1TanSPtTPCITS,4,2,5);
decf0997 491 gr2[3]->GetXaxis()->SetTitle("Tan(#theta)");
35771050 492 gr2[3]->GetYaxis()->SetTitle("#sqrt{p_{t}(GeV)}");
493 gr2[3]->GetZaxis()->SetTitle("#sigmaDCA_z (cm)");
494 gr2[3]->SetName("DCAZResolSPTTanTPCITS");
495 gr2[3]->SetTitle("#sigma DCA_z (TPC+ITS)");
decf0997 496 gr2[3]->GetHistogram()->Draw("colz");
497
35771050 498 gr2[3]->GetHistogram()->SetName("DCAZResolSPTTanTPCITS");
decf0997 499 aFolderObj->Add(gr2[3]->GetHistogram());
b4126c69 500
35771050 501 // 2D DCA mean value
502 c1->cd(5);
503 gr2[4] = AliMathBase::MakeStat2D(comp->fD0TanSPtTPC,4,2,4);
504 gr2[4]->GetXaxis()->SetTitle("Tan(#theta)");
505 gr2[4]->GetYaxis()->SetTitle("#sqrt{p_{t}(GeV)}");
506 gr2[4]->GetZaxis()->SetTitle("mean DCA_xy (cm)");
507 gr2[4]->SetName("DCAXYMeanSPTTanTPC");
508 gr2[4]->SetTitle("mean DCA_xy (TPC only)");
509 gr2[4]->GetHistogram()->Draw("colz");
510
511 gr2[4]->GetHistogram()->SetName("DCAXYMeanSPTTanTPC");
512 aFolderObj->Add(gr2[4]->GetHistogram());
513
514 c1->cd(6);
515 gr2[5] = AliMathBase::MakeStat2D(comp->fD1TanSPtTPC,4,2,4);
516 gr2[5]->GetXaxis()->SetTitle("Tan(#theta)");
517 gr2[5]->GetYaxis()->SetTitle("#sqrt{p_{t}(GeV)}");
518 gr2[5]->GetZaxis()->SetTitle("mean DCA_z (cm)");
519 gr2[5]->SetName("DCAZMeanSPTTanTPC");
520 gr2[5]->SetTitle("mean DCA_z (TPC only)");
521 gr2[5]->GetHistogram()->Draw("colz");
522
523 gr2[5]->GetHistogram()->SetName("DCAZMeanSPTTanTPC");
524 aFolderObj->Add(gr2[5]->GetHistogram());
525
526 c1->cd(7);
527 gr2[6] = AliMathBase::MakeStat2D(comp->fD0TanSPtTPCITS,4,2,4);
528 gr2[6]->GetXaxis()->SetTitle("Tan(#theta)");
529 gr2[6]->GetYaxis()->SetTitle("#sqrt{p_{t}(GeV)}");
530 gr2[6]->GetZaxis()->SetTitle("mean DCA_xy (cm)");
531 gr2[6]->SetName("DCAXYMeanSPTTanTPCITS");
532 gr2[6]->SetTitle("mean DCA_xy (TPC+ITS)");
533 gr2[6]->GetHistogram()->Draw("colz");
534
535 gr2[6]->GetHistogram()->SetName("DCAXYMeanSPTTanTPCITS");
536 aFolderObj->Add(gr2[6]->GetHistogram());
537
538 c1->cd(8);
539 gr2[7] = AliMathBase::MakeStat2D(comp->fD1TanSPtTPCITS,4,2,4);
540 gr2[7]->GetXaxis()->SetTitle("Tan(#theta)");
541 gr2[7]->GetYaxis()->SetTitle("#sqrt{p_{t}(GeV)}");
542 gr2[7]->GetZaxis()->SetTitle("mean DCA_z (cm)");
543 gr2[7]->SetName("DCAZMeanSPTTanTPCITS");
544 gr2[7]->SetTitle("mean DCA_z (TPC+ITS)");
545 gr2[7]->GetHistogram()->Draw("colz");
546
547 gr2[7]->GetHistogram()->SetName("DCAZMeanSPTTanTPCITS");
548 aFolderObj->Add(gr2[7]->GetHistogram());
549
71a14197 550 */
b4126c69 551 // export objects to analysis folder
552 fAnalysisFolder = ExportToFolder(aFolderObj);
3baa4bfd 553
b4126c69 554 // delete only TObjArray
555 if(aFolderObj) delete aFolderObj;
3baa4bfd 556}
557
b4126c69 558//_____________________________________________________________________________
559TFolder* AliComparisonDCA::ExportToFolder(TObjArray * array)
560{
561 // recreate folder avery time and export objects to new one
562 //
563 AliComparisonDCA * comp=this;
564 TFolder *folder = comp->GetAnalysisFolder();
565
566 TString name, title;
567 TFolder *newFolder = 0;
568 Int_t i = 0;
569 Int_t size = array->GetSize();
570
571 if(folder) {
572 // get name and title from old folder
573 name = folder->GetName();
574 title = folder->GetTitle();
575
576 // delete old one
577 delete folder;
578
579 // create new one
580 newFolder = CreateFolder(name.Data(),title.Data());
581 newFolder->SetOwner();
582
583 // add objects to folder
584 while(i < size) {
585 newFolder->Add(array->At(i));
586 i++;
587 }
588 }
589
590return newFolder;
591}
592
593
3baa4bfd 594//_____________________________________________________________________________
595TFolder* AliComparisonDCA::CreateFolder(TString name,TString title) {
596// create folder for analysed histograms
597TFolder *folder = 0;
598 folder = new TFolder(name.Data(),title.Data());
599
600 return folder;
601}