From Jochen Klein.
[u/mrichter/AliRoot.git] / EVE / alice-macros / trd_tracklets.C
CommitLineData
13b77589 1#include "TEveLine.h"
2
3TEveElementList *trd_tracklets()
4{
5 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
6 AliLoader *loader = rl ? rl->GetLoader("TRDLoader") : 0x0;
7 AliDataLoader *dl = loader ? loader->GetDataLoader("tracklets") : 0x0;
8 if (!dl)
9 return;
10
11 dl->Load();
12 TTree *trklTree = dl->Tree();
13
14 TBranch *trklBranch = 0x0;
15
16 gEve->DisableRedraw();
17
18 if (trklBranch = trklTree->GetBranch("trkbranch")) {
19 TEveElementList* listOfTracklets = new TEveElementList("Online tracklets");
20 gEve->AddElement(listOfTracklets);
21
22 UInt_t *leaves = new UInt_t[258];
23 trklBranch->SetAddress(leaves);
24
25 for (Int_t iEntry = 0; iEntry < trklBranch->GetEntries(); iEntry++) {
26 trklBranch->GetEntry(iEntry);
27 for (Int_t iTracklet = 0; iTracklet < 256; iTracklet++) {
28 if (leaves[2 + iTracklet] == 0)
29 break;
a428533a 30 AliEveTRDTrackletOnline *evetrkl = new AliEveTRDTrackletOnline(new AliTRDtrackletWord(leaves[2 + iTracklet], 2*leaves[0] + leaves[1]));
13b77589 31 gEve->AddElement(evetrkl, listOfTracklets);
32 }
33 }
34 delete [] leaves;
35 }
36
37 if (trklBranch = trklTree->GetBranch("mcmtrklbranch")) {
38 AliTRDtrackletMCM *trkl = 0x0; //new AliTRDtrackletMCM;
39 trklBranch->SetAddress(&trkl);
40
41 TEveElementList* listOfTracklets = new TEveElementList("MCM tracklets");
42 gEve->AddElement(listOfTracklets);
43
44 for (Int_t i = 0; i < trklBranch->GetEntries(); i++) {
45 trklBranch->GetEntry(i);
46 if (!trkl)
47 continue;
48 gEve->AddElement(new AliEveTRDTrackletOnline(trkl), listOfTracklets);
49 }
50 }
51
52 gEve->EnableRedraw();
53 gEve->Redraw3D();
54
55 return 0x0;
56}
57