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
7 void display (const char *filename="galice.root",Int_t nevent=0, Int_t * tracks=0, Int_t ntracks=0) {
8 // Dynamically link some shared libs
9 if (gClassTable->GetID("AliRun") < 0) {
10 gROOT->LoadMacro("loadlibs.C");
17 // Connect the Root Galice file containing Geometry, Kine and Hits
19 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
21 cout<<"galice.root is already open \n";
24 if(!file)file=TFile::Open(filename);
27 // Get AliRun object from file or create it if not on file
29 gAlice = (AliRun*)file->Get("gAlice");
30 if (gAlice) printf("AliRun object found on file\n");
31 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
34 // Create Event Display object
35 AliDisplay *edisplay = new AliDisplay(750);
36 if (ntracks>0) edisplay->SetTracksToDisplay(tracks, ntracks);
38 // Display the requested event
39 gAlice->GetEvent(nevent);
40 edisplay->ShowNextEvent(0);
42 // Define the buttons to switch on/off the existing modules
44 TObjArray *moduli = gAlice->Modules();
45 Int_t nomod=moduli->GetEntriesFast();
47 for (Int_t j=0; j<nomod; j++){
48 modu=(AliModule*)moduli->At(j);
49 char *avoid=strstr("BODY MAG ABSO DIPO HALL FRAME SHIL PIPE",modu->GetName());
53 TDialogCanvas *dialog = new TDialogCanvas("Modules"," ",150,30*nodet);
54 Float_t yval1=1./nodet*0.9*0.05;
55 Float_t yval2=1./nodet*0.9*0.95;
60 for (Int_t j=0; j<nomod; j++){
61 modu=(AliModule*)moduli->At(j);
62 char *avoid=strstr(" BODY MAG ABSO DIPO HALL FRAME SHIL PIPE",modu->GetName());
64 sprintf(action,"swioff(\"%s\")",modu->GetName());
65 sprintf(title,"%s is on",modu->GetName());
66 sprintf(bname,"but%s",modu->GetName());
67 butto1 = new TButton(title,action,.05,yval1,.95,yval2);
68 butto1->SetName(bname);
69 butto1->SetFillColor(3);
76 void swioff(const char *dete){
77 gAlice->Display()->DisableDetector(dete);
78 gAlice->Display()->Pad()->Modified();
79 gAlice->Display()->Pad()->Update();
83 sprintf(bname,"but%s",dete);
84 TDialogCanvas *dia = (TDialogCanvas *)gROOT->FindObject("Modules");
85 TButton *bt = (TButton *)dia->FindObject(bname);
87 sprintf(action,"swion(\"%s\")",dete);
88 bt->SetMethod(action);
89 sprintf(title,"%s is off",dete);
94 void swion(const char *dete){
95 gAlice->Display()->EnableDetector(dete);
96 gAlice->Display()->Pad()->Modified();
97 gAlice->Display()->Pad()->Update();
98 TDialogCanvas *dia = (TDialogCanvas *)gROOT->FindObject("Modules");
102 sprintf(bname,"but%s",dete);
103 TButton *bt = (TButton *)dia->FindObject(bname);
105 sprintf(action,"swioff(\"%s\")",dete);
106 bt->SetMethod(action);
107 sprintf(title,"%s is on",dete);