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