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");
13 delete gAlice->GetRunLoader();
18 // Connect the Root Galice file containing Geometry, Kine and Hits
19 AliRunLoader *rl = 0x0;
20 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(filename);
22 cout<<"galice.root is already open \n";
26 rl = AliRunLoader::Open(filename,"DISPLAYED EVENT");
30 cerr<<"Error <display.C()>: can not get Run Loader. Exiting"<<endl;
33 // Get AliRun object from file or create it if not on file
37 gAlice = rl->GetAliRun();
39 cerr<<"AliTPCHits2Digits.C : AliRun object not found on file\n";
49 // Create Event Display object
50 AliDisplay *edisplay = new AliDisplay(750);
51 if (ntracks>0) edisplay->SetTracksToDisplay(tracks, ntracks);
53 // Display the requested event
54 edisplay->ShowNextEvent(0);
56 // Define the buttons to switch on/off the existing modules
58 TObjArray *moduli = gAlice->Modules();
59 Int_t nomod=moduli->GetEntriesFast();
61 for (Int_t j=0; j<nomod; j++){
62 modu=(AliModule*)moduli->At(j);
63 char *avoid=strstr("BODY MAG ABSO DIPO HALL FRAME SHIL PIPE",modu->GetName());
67 TDialogCanvas *dialog = new TDialogCanvas("Modules"," ",150,30*nodet);
68 Float_t yval1=1./nodet*0.9*0.05;
69 Float_t yval2=1./nodet*0.9*0.95;
74 for (Int_t j=0; j<nomod; j++){
75 modu=(AliModule*)moduli->At(j);
76 char *avoid=strstr(" BODY MAG ABSO DIPO HALL FRAME SHIL PIPE",modu->GetName());
78 sprintf(action,"swioff(\"%s\")",modu->GetName());
79 sprintf(title,"%s is on",modu->GetName());
80 sprintf(bname,"but%s",modu->GetName());
81 butto1 = new TButton(title,action,.05,yval1,.95,yval2);
82 butto1->SetName(bname);
83 butto1->SetFillColor(3);
90 void swioff(const char *dete){
91 gAlice->Display()->DisableDetector(dete);
92 gAlice->Display()->Pad()->Modified();
93 gAlice->Display()->Pad()->Update();
97 sprintf(bname,"but%s",dete);
98 TDialogCanvas *dia = (TDialogCanvas *)gROOT->FindObject("Modules");
99 TButton *bt = (TButton *)dia->FindObject(bname);
101 sprintf(action,"swion(\"%s\")",dete);
102 bt->SetMethod(action);
103 sprintf(title,"%s is off",dete);
108 void swion(const char *dete){
109 gAlice->Display()->EnableDetector(dete);
110 gAlice->Display()->Pad()->Modified();
111 gAlice->Display()->Pad()->Update();
112 TDialogCanvas *dia = (TDialogCanvas *)gROOT->FindObject("Modules");
116 sprintf(bname,"but%s",dete);
117 TButton *bt = (TButton *)dia->FindObject(bname);
119 sprintf(action,"swioff(\"%s\")",dete);
120 bt->SetMethod(action);
121 sprintf(title,"%s is on",dete);