]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/macros/tpc_tracks.C
Example macro creating the PWG2 specific AOD from
[u/mrichter/AliRoot.git] / TPC / macros / tpc_tracks.C
CommitLineData
ff981c19 1
61e70d92 2class TEveProjectionManager;
3class TEveGeoShape;
4class TEveElement;
5class TEveElementList;
6
7TEveProjectionManager * proj = 0;
8TEveGeoShape * geom = 0;
ff981c19 9
4ad0d7ba 10void tpc_tracks(const char *input=0)
ff981c19 11{
4ad0d7ba 12 //
13 //
14 //
15 if (input){
16 TString ipath(input);
17 if (ipath.Contains(".zip")){
05912a3a 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 gSystem->Exec("unzip in.zip");
25 }
26 if (ipath.Contains("alien:/")){
27 char command[1000];
28 sprintf(command,"alien_cp %s in.zip",input);
29 gSystem->Exec(command);
30 gSystem->Exec("unzip in.zip");
31 }
4ad0d7ba 32 }
33 }
34
61e70d92 35 TEveUtil::LoadMacro("alieve_init.C");
ff981c19 36 alieve_init(".", -1);
37
61e70d92 38 TEveUtil::LoadMacro("geom_gentle.C");
ff981c19 39
61e70d92 40 TEveUtil::LoadMacro("primary_vertex.C");
41 TEveUtil::LoadMacro("esd_tracks.C");
42 TEveUtil::LoadMacro("its_clusters.C+");
43 TEveUtil::LoadMacro("tpc_clusters.C+");
ff981c19 44
61e70d92 45 TEveViewer* nv = gEve->SpawnNewViewer("NLT Projected");
46 TEveScene* ns = gEve->SpawnNewScene("NLT");
ff981c19 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
61e70d92 53 TEveTrackCounter* g_trkcnt = new TEveTrackCounter("Primary Counter");
54 gEve->AddToListTree(g_trkcnt, kFALSE);
ff981c19 55
61e70d92 56 TEveProjectionManager* p = new TEveProjectionManager; proj = p;
57 gEve->AddToListTree(p, kTRUE);
58 gEve->AddElement(proj, ns);
ff981c19 59
60 // geometry
61e70d92 61 TEveGeoShape* gg = geom_gentle();
ff981c19 62 geom = gg;
63
64 // event
61e70d92 65 gEvent->AddNewEventCommand("on_new_event();");
66 gEvent->GotoEvent(0);
ff981c19 67
61e70d92 68 gEve->Redraw3D(kTRUE);
ff981c19 69}
70
71/**************************************************************************/
72
73void on_new_event()
74{
75 try {
61e70d92 76 //TEvePointSet* itsc = its_clusters();
ff981c19 77 //itsc->SetMarkerColor(5);
78
61e70d92 79 TEvePointSet* tpcc = tpc_clusters();
ff981c19 80 tpcc->SetMarkerColor(4);
81 }
61e70d92 82 catch(TEveException& exc) {
ff981c19 83 printf("Exception loading ITS/TPC clusters: %s\n", exc.Data());
84 }
85
61e70d92 86 TEveTrackList* cont = esd_tracks();
ff981c19 87 cont->SetLineWidth((Width_t)2);
88
61e70d92 89 TEveElement* top = gEve->GetCurrentEvent();
ff981c19 90 proj->DestroyElements();
61e70d92 91 //AliESDEvent* esd = AliEveEventManager::AssertESD();
ff981c19 92
93 // geom
94 proj->ImportElements(geom);
95 // event
96 proj->ImportElements(top);
97 // top->SetRnrState(kFALSE);
98}