]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/macros/tpc_tracks.C
doxy: TPC/macros root converted
[u/mrichter/AliRoot.git] / TPC / macros / tpc_tracks.C
1 /// \file tpc_tracks.C
2
3
4 class TEveProjectionManager;
5 class TEveGeoShape;
6 class TEveElement;
7 class TEveElementList;
8
9 TEveProjectionManager  * proj = 0;
10 TEveGeoShape * geom = 0;
11
12 void tpc_tracks(const char *input=0)
13 {
14   ///
15
16   if (input){
17     TString ipath(input);
18     if (ipath.Contains(".zip")){
19       gSystem->Exec("rm TPC*");
20       gSystem->Exec("rm AliESD*");
21       if (ipath.Contains("root:/")){
22         char command[1000];
23         sprintf(command,"xrdcp %s in.zip",input);
24         gSystem->Exec(command);
25       }
26       if (ipath.Contains("alien:/")){
27         char command[1000];
28         sprintf(command,"alien_cp %s in.zip",input);
29         gSystem->Exec(command);
30       }
31       gSystem->Exec("unzip in.zip");      
32     }
33   }
34
35   TEveUtil::LoadMacro("alieve_init.C");
36   alieve_init(".", -1);
37
38   TEveUtil::LoadMacro("geom_gentle.C");
39
40   TEveUtil::LoadMacro("primary_vertex.C");
41   TEveUtil::LoadMacro("esd_tracks.C");
42   TEveUtil::LoadMacro("its_clusters.C+");
43   TEveUtil::LoadMacro("tpc_clusters.C+");
44
45   TEveViewer* nv = gEve->SpawnNewViewer("NLT Projected");
46   TEveScene*  ns = gEve->SpawnNewScene("NLT"); 
47   nv->AddScene(ns);
48   TGLViewer* v = nv->GetGLViewer();
49   v->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
50   TGLCameraMarkupStyle* mup = v->GetCameraMarkup();
51   if(mup) mup->SetShow(kFALSE);
52
53   TEveTrackCounter* g_trkcnt = new TEveTrackCounter("Primary Counter");
54   gEve->AddToListTree(g_trkcnt, kFALSE);
55
56   TEveProjectionManager* p = new TEveProjectionManager; proj = p;
57   gEve->AddToListTree(p, kTRUE);
58   gEve->AddElement(proj, ns);
59
60   // geometry
61   TEveGeoShape* gg = geom_gentle();
62   geom = gg;
63
64   // event
65   gAliEveEvent->AddNewEventCommand("on_new_event();");
66   gAliEveEvent->GotoEvent(0);
67
68   gEve->Redraw3D(kTRUE);
69 }
70
71 /**************************************************************************/
72
73 void on_new_event()
74 {
75   try {
76     //TEvePointSet* itsc = its_clusters();
77     //itsc->SetMarkerColor(5);
78
79     TEvePointSet* tpcc = tpc_clusters();
80     tpcc->SetMarkerColor(4);
81   }
82   catch(TEveException& exc) {
83     printf("Exception loading ITS/TPC clusters: %s\n", exc.Data());
84   }
85
86   TEveTrackList* cont = esd_tracks();
87   cont->SetLineWidth((Width_t)2);
88
89   TEveElement* top = gEve->GetCurrentEvent();
90   proj->DestroyElements();
91   //AliESDEvent* esd = AliEveEventManager::AssertESD();
92
93   // geom
94   proj->ImportElements(geom);
95   // event
96   proj->ImportElements(top);
97   // top->SetRnrState(kFALSE);
98 }