3 #include "TDatabasePDG.h"
9 #include "TTreeStream.h"
13 #include "AliTPCcalibDB.h"
14 #include "AliToyMCEvent.h"
15 #include "AliToyMCTrack.h"
16 #include "AliTPCclusterMI.h"
17 #include "AliTPCParam.h"
18 #include "AliTPCROC.h"
19 #include "AliTPCSpaceCharge3D.h"
20 #include "AliTrackerBase.h"
21 #include "AliTrackPointArray.h"
25 Float_t GetTimeAtVertex(Float_t &tVtx, Float_t &x, const AliToyMCTrack *tr, Int_t clsType=0, Int_t seedRow=140, Int_t seedDist=10, Int_t correctionType=0);
26 void SetTrackPointFromCluster(const AliTPCclusterMI *cl, AliTrackPoint &p);
27 void ClusterToSpacePoint(const AliTPCclusterMI *cl, Float_t xyz[3]);
28 void InitSpaceCharge(TTree *t=0x0);
31 root.exe -l $ALICE_ROOT/TPC/Upgrade/macros/{loadlibs.C,ConfigOCDB.C}
32 .x $ALICE_ROOT/TPC/Upgrade/macros/testRec.C
36 AliTPCParam *fTPCParam=0x0;
37 AliTPCSpaceCharge3D *fSpaceCharge=0x0;
38 TTreeSRedirector *fStreamer=0x0;
45 void testRec(const char* filename="toyMC.root", Int_t nmaxEv=-1)
51 fTPCParam=AliTPCcalibDB::Instance()->GetParameters();
53 if (!f.IsOpen() || f.IsZombie()) {
54 printf("ERROR: couldn't open the file '%s'\n", filename);
58 TTree *t=(TTree*)f.Get("toyMCtree");
60 printf("ERROR: couldn't read the 'toyMCtree' from file '%s'\n", filename);
64 AliToyMCEvent *ev=0x0;
65 t->SetBranchAddress("event",&ev);
67 // read spacecharge from the Userinfo ot the tree
70 TString debugName=filename;
71 debugName.ReplaceAll(".root","");
72 debugName.Append(".debug.root");
74 gSystem->Exec(Form("test -f %s && rm %s", debugName.Data(), debugName.Data()));
75 if (!fStreamer) fStreamer=new TTreeSRedirector(debugName.Data());
79 // const Double_t kDriftVel = fTPCParam->GetDriftV()/1000000;
80 // const Double_t kDriftVel = fTPCParam->GetDriftV();
81 // const Double_t kMaxZ0=fTPCParam->GetZLength();
83 TH1F *h0=new TH1F("h0","h0",1000,0,0);
84 TH1F *hX=new TH1F("hX","hX",1000,0,0);
85 TH1F *h1=new TH1F("h1","h1",1000,0,0);
86 TH1I *hcount0=new TH1I("count0","Failed extrapolation1",5,0,5);
87 TH1I *hcount1=new TH1I("count1","Failed extrapolation2",5,0,5);
89 Int_t maxev=t->GetEntries();
90 if (nmaxEv>0&&nmaxEv<maxev) maxev=nmaxEv;
92 for (Int_t iev=0; iev<maxev; ++iev){
95 for (Int_t itr=0; itr<ev->GetNumberOfTracks(); ++itr){
96 printf("============== Processing Track %6d\n",itr);
98 fT0event = ev->GetT0();
101 //Float_t &tVtx, Float_t &x, AliToyMCTrack *tr,
102 // Int_t clsType=0, Int_t seedRow=140, Int_t seedDist=10, Int_t correctionType=0
103 // correctionType: 0 none, 1 center, 2 mean tan,
104 // 3 full from seed (iterative), 4 ideal (real z-Position)
105 const AliToyMCTrack *tr=ev->GetTrack(itr);
108 Int_t ret0=GetTimeAtVertex(tVtx0,xmin,tr);
112 Int_t ret1=GetTimeAtVertex(tVtx1,xmin,tr,1);// seeding at the outside
113 GetTimeAtVertex(tVtx1,xmin,tr,1,70); // seeding in the center
114 GetTimeAtVertex(tVtx1,xmin,tr,1,0); // seeding at the inside
115 //correction at tpc center
116 GetTimeAtVertex(tVtx1,xmin,tr,1,140, 10, 1);
117 //correction with mean tan theta
118 GetTimeAtVertex(tVtx1,xmin,tr,1,140, 10, 2);
119 //correction with ideal z
120 GetTimeAtVertex(tVtx1,xmin,tr,1,140, 10, 4);
131 // printf("TVtx: %f, %f\n",tVtx0,0);
135 TCanvas *c=(TCanvas*)gROOT->GetListOfCanvases()->FindObject("cOutput");
136 if (!c) c=new TCanvas("cOutput","Results");
141 h1->SetLineColor(kRed);
145 hcount1->SetLineColor(kRed);
146 hcount1->Draw("same");
154 //____________________________________________________________________________
155 Float_t GetTimeAtVertex(Float_t &tVtx, Float_t &x, const AliToyMCTrack *tr, Int_t clsType, Int_t seedRow, Int_t seedDist, Int_t correctionType)
158 // clsType: 0 undistorted; 1 distorted
159 // seedRow: seeding row
160 // seedDist: distance of seeding points
161 // correctionType: 0 none, 1 center, 2 mean tan,
162 // 3 full from seed (iterative), 4 ideal (real z-Position)
165 // seed point informaion
166 AliTrackPoint seedPoint[3];
167 const AliTPCclusterMI *seedCluster[3]={0x0,0x0,0x0};
169 // number of clusters to loop over
170 const Int_t ncls=(clsType==0)?tr->GetNumberOfSpacePoints():tr->GetNumberOfDistSpacePoints();
172 UChar_t nextSeedRow=seedRow;
175 //assumes sorted clusters
176 for (Int_t icl=0;icl<ncls;++icl) {
177 const AliTPCclusterMI *cl=tr->GetSpacePoint(icl);
178 if (clsType==1) cl=tr->GetDistortedSpacePoint(icl);
181 const UChar_t row=cl->GetRow() + 63*(cl->GetDetector()>35);
182 // skip clusters without proper pad row
183 if (row>200) continue;
186 // if we are in the last row and still miss a seed we use the last row
187 // even if the row spacing will not be equal
188 if (row>=nextSeedRow || icl==ncls-1){
189 seedCluster[seed]=cl;
190 SetTrackPointFromCluster(cl, seedPoint[seed]);
191 // printf("\nSeed point %d: %d, %d, %.2f, %.2f, %.2f, %.2f, %.2f\n",seed, cl->GetDetector(), row, seedPoint[seed].GetX(),seedPoint[seed].GetY(),seedPoint[seed].GetZ(), seedPoint[seed].GetAngle(), ((cl->GetDetector()%18)*20.+10.)/180.*TMath::Pi());
193 nextSeedRow+=seedDist;
199 // check we really have 3 seeds
200 if (seed!=3 && x>-900.) {
202 AliToyMCTrack *nctr = const_cast<AliToyMCTrack*>(tr);
203 // debug output for failed seeding
204 (*fStreamer) << "TracksFailSeed" <<
208 "itrack=" << fTrack <<
209 "clsType=" << clsType <<
210 "seedRow=" << seedRow <<
211 "seedDist=" << seedDist <<
212 "corrType=" << correctionType <<
216 printf("Seeding failed for parameters %d, %d\n",seedRow,seedDist);
221 if (correctionType==3) {
222 Float_t xDummy=-999.;
223 GetTimeAtVertex(tVtx_opt3,xDummy, tr, clsType, seedRow, seedDist, 2);
225 // do cluster correction and
226 // assign the cluster abs time as z component to all seeds
227 for (Int_t iseed=0; iseed<3; ++iseed) {
228 Float_t xyz[3]={0,0,0};
229 seedPoint[iseed].GetXYZ(xyz);
230 Float_t r=TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
232 Int_t sector=seedCluster[iseed]->GetDetector();
233 Int_t sign=1-2*((sector/18)%2);
235 if (clsType && correctionType) {
236 if (correctionType==1) xyz[2]=125.;
237 //!!! TODO: is this the correct association?
238 if (correctionType==2) xyz[2]=TMath::Tan(45./2.*TMath::DegToRad())*r*sign;
239 // if (correctionType==3) {
240 // xyz[2]=(seedCluster[iseed]->GetTimeBin()-tVtx_opt3)*kDriftVel;
243 if (correctionType==4) xyz[2]=seedCluster[iseed]->GetZ();
245 fSpaceCharge->CorrectPoint(xyz, seedCluster[iseed]->GetDetector());
248 // set different sign for c-Side (only for testing: makes half of the times negative)
249 // xyz[2]=seedCluster[iseed]->GetTimeBin() * sign;
251 // correct with track z (only for testing: not possible in exp?)
252 // xyz[2]=seedCluster[iseed]->GetTimeBin() + sign * tr->GetZ()/(fTPCParam->GetDriftV());
254 // no correction (default)
255 xyz[2]=seedCluster[iseed]->GetTimeBin();
257 seedPoint[iseed].SetXYZ(xyz);
260 // create seed and Propagate to r=0;
262 const Double_t kMaxSnp = 0.85;
263 const Double_t kMass = TDatabasePDG::Instance()->GetParticle("pi+")->Mass();
265 AliExternalTrackParam *track = 0x0;
266 track = AliTrackerBase::MakeSeed(seedPoint[0], seedPoint[1], seedPoint[2]);
267 track->ResetCovariance(10);
269 // printf("orig: %.2f, %.2f, %.2f, %.2f, %.2f, %.2f\n",
270 // tr->GetParameter()[0],tr->GetParameter()[1],tr->GetParameter()[2],
271 // tr->GetParameter()[3],tr->GetParameter()[4],tr->GetAlpha());
273 // printf("seed: %.2f, %.2f, %.2f, %.2f, %.2f, %.2f\n",
274 // track->GetParameter()[0],track->GetParameter()[1],track->GetParameter()[2],
275 // track->GetParameter()[3],track->GetParameter()[4],track->GetAlpha());
277 // printf("Track: %.2f, %.2f, %.2f, %.2f, %.2f\n",track->GetX(),track->GetY(),track->GetZ(), track->GetAlpha(),track->Phi());
278 AliExternalTrackParam pInit(*track);
281 // when propagating with the time binwe need to switch off the material correction
282 // otherwise we will be quite off ...
284 AliTrackerBase::PropagateTrackTo(track,0,kMass,5,kTRUE,kMaxSnp,0,kFALSE,kFALSE);
285 if (TMath::Abs(track->GetX())>3) {
286 printf("Could not propagate track to 0, %.2f, %.2f, %.2f\n",track->GetX(),track->GetAlpha(),track->Pt());
289 // printf("Track2: %.2f, %.2f, %.2f, %.2f\n",track->GetX(),track->GetY(),track->GetZ(), track->GetAlpha());
293 for (Int_t i=0; i<3; ++i)
294 gr.SetPoint(gr.GetN(),seedPoint[i].GetX(),seedPoint[i].GetZ());
296 TF1 fpol1("fpol1","pol1");
298 Float_t fitT0=fpol1.Eval(0);
300 AliExternalTrackParam pOrig(*tr);
301 AliToyMCTrack *nctr = const_cast<AliToyMCTrack*>(tr);
304 (*fStreamer) << "Tracks" <<
308 "itrack=" << fTrack <<
309 "clsType=" << clsType <<
310 "seedRow=" << seedRow <<
311 "seedDist=" << seedDist <<
312 "corrType=" << correctionType <<
315 "seedI.=" << &pInit <<
316 // "seedcl0.=" << seedCluster[0] <<
317 // "seedcl1.=" << seedCluster[1] <<
318 // "seedcl2.=" << seedCluster[2] <<
319 // "seedp0.=" << &seedPoint[0] <<
320 // "seedp1.=" << &seedPoint[1] <<
321 // "seedp2.=" << &seedPoint[2] <<
332 //____________________________________________________________________________
333 void SetTrackPointFromCluster(const AliTPCclusterMI *cl, AliTrackPoint &p ) {
335 // make AliTrackPoint out of AliTPCclusterMI
339 // Float_t xyz[3]={0.,0.,0.};
340 // ClusterToSpacePoint(cl,xyz);
341 // cl->GetGlobalCov(cov);
342 //TODO: what to do with the covariance matrix???
343 //TODO: the problem is that it is used in GetAngle in AliTrackPoint
344 //TODO: which is used by AliTrackerBase::MakeSeed to get alpha correct ...
345 //TODO: for the moment simply assign 1 permill squared
346 // in AliTrackPoint the cov is xx, xy, xz, yy, yz, zz
347 // Float_t cov[6]={xyz[0]*xyz[0]*1e-6,xyz[0]*xyz[1]*1e-6,xyz[0]*xyz[2]*1e-6,
348 // xyz[1]*xyz[1]*1e-6,xyz[1]*xyz[2]*1e-6,xyz[2]*xyz[2]*1e-6};
349 // cl->GetGlobalXYZ(xyz);
350 // cl->GetGlobalCov(cov);
351 // voluem ID to add later ....
354 AliTrackPoint *tp=const_cast<AliTPCclusterMI*>(cl)->MakePoint();
359 p.SetVolumeID(cl->GetDetector());
360 // p.Rotate(p.GetAngle()).Print();
363 //____________________________________________________________________________
364 void ClusterToSpacePoint(const AliTPCclusterMI *cl, Float_t xyz[3])
367 // convert the cluster to a space point in global coordinates
372 xyz[2]=cl->GetTimeBin(); // this will not be correct at all
373 Int_t i[3]={0,cl->GetDetector(),cl->GetRow()};
374 // printf("%.2f, %.2f, %.2f - %d, %d, %d\n",xyz[0],xyz[1],xyz[2],i[0],i[1],i[2]);
375 fTPCParam->Transform8to4(xyz,i);
376 // printf("%.2f, %.2f, %.2f - %d, %d, %d\n",xyz[0],xyz[1],xyz[2],i[0],i[1],i[2]);
377 fTPCParam->Transform4to3(xyz,i);
378 // printf("%.2f, %.2f, %.2f - %d, %d, %d\n",xyz[0],xyz[1],xyz[2],i[0],i[1],i[2]);
379 fTPCParam->Transform2to1(xyz,i);
380 // printf("%.2f, %.2f, %.2f - %d, %d, %d\n",xyz[0],xyz[1],xyz[2],i[0],i[1],i[2]);
383 //____________________________________________________________________________
384 void InitSpaceCharge(TTree *t)
387 // Init the space charge map
390 TString filename="$ALICE_ROOT/TPC/Calib/maps/SC_NeCO2_eps5_50kHz_precal.root";
392 TList *l=t->GetUserInfo();
393 for (Int_t i=0; i<l->GetEntries(); ++i) {
394 TString s(l->At(i)->GetName());
395 if (s.Contains("SC_")) {
402 printf("Initialising the space charge map using the file: '%s'\n",filename.Data());
403 TFile f(filename.Data());
404 fSpaceCharge=(AliTPCSpaceCharge3D*)f.Get("map");
406 // fSpaceCharge = new AliTPCSpaceCharge3D();
407 // fSpaceCharge->SetSCDataFileName("$ALICE_ROOT/TPC/Calib/maps/SC_NeCO2_eps10_50kHz.root");
408 // fSpaceCharge->SetOmegaTauT1T2(0.325,1,1); // Ne CO2
409 // // fSpaceCharge->SetOmegaTauT1T2(0.41,1,1.05); // Ar CO2
410 // fSpaceCharge->InitSpaceCharge3DDistortion();
414 //____________________________________________________________________________
415 AliExternalTrackParam* GetFullTrack(const AliToyMCTrack *tr, Int_t clsType=0, Int_t corrType=0, Bool_t useMaterial=kFALSE)
418 // clsType: 0=undistorted clusters; 1: distorted clusters
419 // corrType: 0=none; 1: ideal
422 // no correction for undistorted clusters
423 if (clsType==0) corrType=0;
425 AliTPCROC * roc = AliTPCROC::Instance();
426 // const Int_t npoints0=roc->GetNRows(0)+roc->GetNRows(36);
427 const Double_t kRTPC0 =roc->GetPadRowRadii(0,0);
428 const Double_t kRTPC1 =roc->GetPadRowRadii(36,roc->GetNRows(36)-1);
429 const Double_t kMaxSnp = 0.85;
430 // const Double_t kSigmaY=0.1;
431 // const Double_t kSigmaZ=0.1;
432 const Double_t kMaxR=500;
433 const Double_t kMaxZ=500;
435 // const Double_t kMaxZ0=220;
436 const Double_t kZcut=3;
437 const Double_t kMass = TDatabasePDG::Instance()->GetParticle("pi+")->Mass();
439 Int_t ncls=(clsType==0)?tr->GetNumberOfSpacePoints():tr->GetNumberOfDistSpacePoints();
442 Double_t refX = tr->GetX();
444 // get points for the seed
446 AliTrackPoint seedPoint[3];
447 for (Int_t ipoint=ncls-1; ipoint>=ncls-3; --ipoint){
448 const AliTPCclusterMI *cl=tr->GetSpacePoint(ipoint);
449 if (clsType==1) cl=tr->GetDistortedSpacePoint(ipoint);
451 SetTrackPointFromCluster(cl, seedPoint[seed]);
454 Float_t xyz[3]={0,0,0};
455 seedPoint[seed].GetXYZ(xyz);
456 fSpaceCharge->CorrectPoint(xyz, cl->GetDetector());
457 seedPoint[seed].SetXYZ(xyz);
459 // seedPoint[seed].Print();
463 AliExternalTrackParam *track = AliTrackerBase::MakeSeed(seedPoint[2], seedPoint[1], seedPoint[0]);
464 track->ResetCovariance(10);
466 // printf("============================================\n");
467 // printf("orig: %.2f, %.2f, %.2f, %.2f, %.2f, %.2f\n",
468 // tr->GetParameter()[0],tr->GetParameter()[1],tr->GetParameter()[2],
469 // tr->GetParameter()[3],tr->GetParameter()[4],tr->GetAlpha());
471 // printf("seed: %.2f, %.2f, %.2f, %.2f, %.2f, %.2f\n",
472 // track->GetParameter()[0],track->GetParameter()[1],track->GetParameter()[2],
473 // track->GetParameter()[3],track->GetParameter()[4],track->GetAlpha());
475 // loop over all other points and add to the track
476 for (Int_t ipoint=ncls-4; ipoint>=0; --ipoint){
478 const AliTPCclusterMI *cl=tr->GetSpacePoint(ipoint);
479 if (clsType==1) cl=tr->GetDistortedSpacePoint(ipoint);
480 SetTrackPointFromCluster(cl, pIn);
482 Float_t xyz[3]={0,0,0};
484 fSpaceCharge->CorrectPoint(xyz, cl->GetDetector());
487 // rotate the cluster to the local detector frame
488 track->Rotate(((cl->GetDetector()%18)*20+10)*TMath::DegToRad());
489 AliTrackPoint prot = pIn.Rotate(track->GetAlpha()); // rotate to the local frame - non distoted point
490 if (TMath::Abs(prot.GetX())<kRTPC0) continue;
491 if (TMath::Abs(prot.GetX())>kRTPC1) continue;
494 // printf("before: %.2f, %.2f, %.2f, %.2f, %.2f, %.2f\n",
495 // track->GetParameter()[0],track->GetParameter()[1],track->GetParameter()[2],
496 // track->GetParameter()[3],track->GetParameter()[4],track->GetAlpha());
497 if (useMaterial) ret=AliTrackerBase::PropagateTrackTo2(track,prot.GetX(),kMass,5,kFALSE,kMaxSnp);
498 else ret=AliTrackerBase::PropagateTrackTo2(track,prot.GetX(),kMass,5,kFALSE,kMaxSnp,0,kFALSE,kFALSE);
499 // printf("after: %.2f, %.2f, %.2f, %.2f, %.2f, %.2f\n",
500 // track->GetParameter()[0],track->GetParameter()[1],track->GetParameter()[2],
501 // track->GetParameter()[3],track->GetParameter()[4],track->GetAlpha());
502 AliToyMCTrack *nctr = const_cast<AliToyMCTrack*>(tr);
504 (*fStreamer) << "np" <<
509 "clsType=" << clsType <<
510 "corrType=" << corrType <<
513 printf("Could not propagate track: %d\n",ret);
516 // printf("\n=========\n%d:\n",ipoint);
517 // printf("%.2f, %.2f, %.2f - %d, %d, %.2f, %.2g\n",cl->GetX(),cl->GetY(),cl->GetZ(),cl->GetDetector(),cl->GetRow(),cl->GetPad(),cl->GetTimeBin());
518 // printf("%.2f, %.2f, %.2f - %.2f\n", prot.GetX(),prot.GetY(),prot.GetZ(), prot.GetAngle());
519 // printf("%.2f, %.2f, %.2f - %.2f\n", track->GetX(),track->GetY(),track->GetZ(), track->GetAlpha());
521 if (TMath::Abs(track->GetZ())>kMaxZ) break;
522 if (TMath::Abs(track->GetX())>kMaxR) break;
523 if (dir>0 && track->GetX()>refX) continue;
524 if (dir<0 && track->GetX()<refX) continue;
525 if (TMath::Abs(track->GetZ())<kZcut)continue;
527 Double_t pointPos[2]={0,0};
528 Double_t pointCov[3]={0,0,0};
529 pointPos[0]=prot.GetY();//local y
530 pointPos[1]=prot.GetZ();//local z
531 pointCov[0]=prot.GetCov()[3];//simay^2
532 pointCov[1]=prot.GetCov()[4];//sigmayz
533 pointCov[2]=prot.GetCov()[5];//sigmaz^2
534 if (!track->Update(pointPos,pointCov)) {printf("no update\n"); break;}
536 // printf(">>> before2: %.2f, %.2f, %.2f, %.2f, %.2f, %.2f\n",
537 // track->GetParameter()[0],track->GetParameter()[1],track->GetParameter()[2],
538 // track->GetParameter()[3],track->GetParameter()[4],track->GetAlpha());
539 if (useMaterial) AliTrackerBase::PropagateTrackTo2(track,refX,kMass,5.,kTRUE,kMaxSnp);
540 else AliTrackerBase::PropagateTrackTo2(track,refX,kMass,5.,kTRUE,kMaxSnp,0,kFALSE,kFALSE);
541 // printf(">>> after2: %.2f, %.2f, %.2f, %.2f, %.2f, %.2f\n",
542 // track->GetParameter()[0],track->GetParameter()[1],track->GetParameter()[2],
543 // track->GetParameter()[3],track->GetParameter()[4],track->GetAlpha());
544 track->Rotate(tr->GetAlpha());
546 if (useMaterial) ret=AliTrackerBase::PropagateTrackTo2(track,refX,kMass,1.,kFALSE,kMaxSnp);
547 else ret=AliTrackerBase::PropagateTrackTo2(track,refX,kMass,1.,kFALSE,kMaxSnp,0,kFALSE,kFALSE);
548 // printf(">>> after2.2: %.2f, %.2f, %.2f, %.2f, %.2f, %.2f\n",
549 // track->GetParameter()[0],track->GetParameter()[1],track->GetParameter()[2],
550 // track->GetParameter()[3],track->GetParameter()[4],track->GetAlpha());
551 printf("Propagation to 0 stopped at %.2f with %d\n",track->GetX(),ret);
552 // once more propagate to refX
553 // try without material budget correction
557 //____________________________________________________________________________
558 void testResolution(const char* filename, Int_t nmaxEv=-1, Bool_t useMaterial=kFALSE)
560 fTPCParam=AliTPCcalibDB::Instance()->GetParameters();
562 if (!f.IsOpen() || f.IsZombie()) {
563 printf("ERROR: couldn't open the file '%s'\n", filename);
567 TTree *t=(TTree*)f.Get("toyMCtree");
569 printf("ERROR: couldn't read the 'toyMCtree' from file '%s'\n", filename);
573 AliToyMCEvent *ev=0x0;
574 t->SetBranchAddress("event",&ev);
576 TString debugName=filename;
577 debugName.ReplaceAll(".root","");
578 if (useMaterial) debugName.Append(".Mat");
579 else debugName.Append(".noMat");
580 debugName.Append(".testRes.root");
582 gSystem->Exec(Form("test -f %s && rm %s", debugName.Data(), debugName.Data()));
583 if (!fStreamer) fStreamer=new TTreeSRedirector(debugName.Data());
587 // read spacecharge from the Userinfo ot the tree
590 Int_t maxev=t->GetEntries();
591 if (nmaxEv>0&&nmaxEv<maxev) maxev=nmaxEv;
593 for (Int_t iev=0; iev<maxev; ++iev){
596 printf("========== Processing event %3d =============\n",iev);
597 for (Int_t itr=0; itr<ev->GetNumberOfTracks(); ++itr){
599 printf(" ======= Processing track %3d ==========\n",itr);
600 const AliToyMCTrack *tr=ev->GetTrack(itr);
601 AliExternalTrackParam tOrig(*tr);
602 AliExternalTrackParam *tIdeal = GetFullTrack(tr,0,0,useMaterial);
603 AliExternalTrackParam *tDist = GetFullTrack(tr,1,0,useMaterial);
604 AliExternalTrackParam *tDistCorr = GetFullTrack(tr,1,1,useMaterial);
606 (*fStreamer) << "res" <<
609 "tOrig.=" << &tOrig <<
610 "tIdeal.=" << tIdeal <<
611 "tDist.=" << tDist <<
612 "tDistCorr.=" << tDistCorr <<
625 //____________________________________________________________________________
626 void ConnectTrees (const char* files, TObjArray &arrTrees) {
627 TString s=gSystem->GetFromPipe(Form("ls %s",files));
629 TObjArray *arrFiles=s.Tokenize("\n");
630 for (Int_t ifile=0; ifile<arrFiles->GetEntriesFast(); ++ifile){
631 TFile f(arrFiles->At(ifile)->GetName());
632 if (!f.IsOpen() || f.IsZombie()) continue;
633 TTree *t=f.Get("Tracks");