1 void TrackDisplay(Int_t track) {
3 c1 = new TCanvas( "RecPoints", "RecPoints Display", 10, 10, 710, 740);
7 v->SetRange(-350.,-350.,-400.,350.,350.,400.); // full
8 // v->SetRange(0.,0.,0.,350.,350.,400.); // top right
9 // v->SetRange(-350.,0.,0.,0.,350.,400.); // top left
10 // v->SetRange(0.,-350.,0.,350.,0.,400.); // bottom right
11 // v->SetRange(-350.,-350.,0.,0.,0.,400.); // bottom left
14 cerr<<"psi = "<<v->GetPsi()<<endl;
16 // Dynamically link some shared libs
17 if (gClassTable->GetID("AliRun") < 0) {
18 gROOT->LoadMacro("loadlibs.C");
20 cout << "Loaded shared libraries" << endl;
26 TFile *tf=TFile::Open("AliTRDtracks.root");
27 if (!tf->IsOpen()) {cerr<<"Can't open AliTRDtracks.root !\n"; return 3;}
28 TObjArray tarray(2000);
29 TTree *tracktree=(TTree*)tf->Get("TreeT");
30 TBranch *tbranch=tracktree->GetBranch("tracks");
31 Int_t nentr=tracktree->GetEntries();
32 cerr<<"Found "<<nentr<<" entries in the track tree"<<endl;
33 for (Int_t i=0; i<nentr; i++) {
34 AliTRDtrack *iotrack=new AliTRDtrack;
35 tbranch->SetAddress(&iotrack);
36 tracktree->GetEvent(i);
37 tarray.AddLast(iotrack);
38 cerr<<"got track "<<i<<": index ="<<iotrack->GetLabel()<<endl;
44 Char_t *alifile = "AliTRDclusters.root";
46 TObjArray rparray(2000);
47 TObjArray *RecPointsArray = &rparray;
48 AliTRDtracker *Tracker = new AliTRDtracker("dummy","dummy");
49 Tracker->ReadClusters(RecPointsArray,alifile,nEvent,-1);
50 Int_t nRecPoints = RecPointsArray->GetEntriesFast();
51 cerr<<"Found "<<nRecPoints<<" rec. points"<<endl;
54 // Connect the AliRoot file containing Geometry, Kine, Hits, and Digits
55 TFile *gafl = (TFile*) gROOT->GetListOfFiles()->FindObject(alifile);
57 cout << "Open the ALIROOT-file " << alifile << endl;
58 gafl = new TFile(alifile);
61 cout << alifile << " is already open" << endl;
64 // Get AliRun object from file or create it if not on file
65 gAlice = (AliRun*) gafl->Get("gAlice");
67 cout << "AliRun object found on file" << endl;
69 gAlice = new AliRun("gAlice","Alice test program");
72 AliTRDv1 *TRD = (AliTRDv1*) gAlice->GetDetector("TRD");
73 AliTRDgeometry *fGeom = TRD->GetGeometry();
75 Int_t i,j,index,det,sector, ti[3];
76 Double_t x,y,z, cs,sn,tmp;
77 Float_t global[3], local[3];
79 // Display all TRD RecPoints
80 TPolyMarker3D *pm = new TPolyMarker3D(nRecPoints);
82 for (Int_t i = 0; i < nRecPoints; i++) {
83 printf("\r point %d out of %d",i,nRecPoints);
84 AliTRDrecPoint *rp = (AliTRDrecPoint *) RecPointsArray->UncheckedAt(i);
86 local[0]=rp->GetLocalRow();
87 local[1]=rp->GetLocalCol();
88 local[2]=rp->GetLocalTime();
89 det=rp->GetDetector();
91 for (j = 0; j < 3; j++) { ti[j] = rp->GetTrackIndex(j); }
94 ((ti[0]==track)||(ti[1]==track)||(ti[2]==track))) {
96 if(fGeom->Local2Global(det,local,global)) {
97 x=global[0]; y=global[1]; z=global[2];
98 pm->SetPoint(i,x,y,z);
103 pm->SetMarkerSize(1); pm->SetMarkerColor(10); pm->SetMarkerStyle(1);
107 Int_t ntracks = tarray.GetEntriesFast();
109 for (i = 0; i < ntracks; i++) {
110 AliTRDtrack *pt = (AliTRDtrack *) tarray.UncheckedAt(i), &t=*pt;
111 Int_t nclusters = t.GetNclusters();
112 cerr<<"in track "<<i<<" found "<<nclusters<<" clusters"<<endl;
114 TPolyMarker3D *pm = new TPolyMarker3D(nclusters);
115 for(j = 0; j < nclusters; j++) {
116 index = t.GetClusterIndex(j);
117 AliTRDrecPoint *rp = (AliTRDrecPoint *) RecPointsArray->UncheckedAt(index);
118 local[0]=rp->GetLocalRow();
119 local[1]=rp->GetLocalCol();
120 local[2]=rp->GetLocalTime();
121 det=rp->GetDetector();
123 if(fGeom->Local2Global(det,local,global)) {
124 x=global[0]; y=global[1]; z=global[2];
125 pm->SetPoint(j,x,y,z);
128 pm->SetMarkerSize(1); pm->SetMarkerColor(i%6+3); pm->SetMarkerStyle(1);
132 TGeometry *geom=(TGeometry*)gafl->Get("AliceGeom");