]>
Commit | Line | Data |
---|---|---|
37f14bbf | 1 | // This macro displays the hits belonging to a track for selected detectors |
2 | // Input: in the tracks contains the interesting tracks | |
3 | // ntracks is the number of interesing tracks | |
4 | // The default values correspond to "Show everything" | |
5 | // Note: For the moment it works only with HIJING events, the PYTHIA is | |
6 | // still not supported | |
7 | //#include <ClassTable.h> | |
8 | ||
9 | void display2 (const char *filename="galice.root",Int_t nevent=0, Int_t * tracks=0, Int_t ntracks=0) { | |
10 | // Dynamically link some shared libs | |
11 | if (gClassTable->GetID("AliRun") < 0) { | |
12 | gROOT->LoadMacro("loadlibs.C"); | |
13 | loadlibs(); | |
14 | } else { | |
15 | delete gAlice->GetRunLoader(); | |
16 | delete gAlice; | |
17 | gAlice = 0; | |
18 | } | |
19 | //gROOT->LoadMacro("AliDisplay2.C"); | |
20 | gSystem->Load("libAliL3Src"); | |
21 | gSystem->Load("libDISPLAY"); | |
22 | // Connect the Root Galice file containing Geometry, Kine and Hits | |
23 | ||
24 | AliRunLoader *rl = 0x0; | |
25 | TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename); | |
26 | if(file){ | |
27 | cout<<"galice.root is already open \n"; | |
28 | } | |
29 | rl = AliRunLoader::Open(filename,"DISPLAYED EVENT"); | |
30 | ||
31 | if (rl == 0x0) | |
32 | { | |
33 | cerr<<"Error <display.C()>: can not get Run Loader. Exiting"<<endl; | |
34 | return; | |
35 | } | |
36 | ||
37 | // Get AliRun object from file or create it if not on file | |
38 | rl->LoadgAlice(); | |
39 | ||
40 | gAlice = rl->GetAliRun(); | |
41 | if (!gAlice) { | |
42 | cerr<<"AliTPCHits2Digits.C : AliRun object not found on file\n"; | |
43 | return; | |
44 | } | |
45 | ||
46 | // Create Event Display object | |
47 | AliDisplay2 *edisplay = new AliDisplay2(gClient->GetRoot(), 900, 700); | |
48 | // if (ntracks>0) edisplay->SetTracksToDisplay(tracks, ntracks); | |
49 | ||
50 | // Display the requested event | |
51 | // gAlice->GetEvent(nevent); | |
52 | rl->GetEvent(nevent); | |
53 | rl->LoadKinematics(); | |
54 | rl->LoadHeader(); | |
55 | rl->LoadHits(); | |
56 | // edisplay->FindModules(); | |
57 | edisplay->ShowNextEvent(0); | |
58 | } | |
59 | ||
60 | ||
61 |