2 //Add the Trigger output in the tree TR of the ROOT file galice.root
4 void MUONtrigger (Int_t evNumber1=0, Int_t evNumber2=0)
6 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 // Dynamically link some shared libs
8 if (gClassTable->GetID("AliRun") < 0) {
9 gROOT->LoadMacro("loadlibs.C");
13 // Connect the Root Galice file containing Geometry, Kine and Hits
14 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
15 if (file) file->Close();
16 file = new TFile("galice.root","UPDATE");
18 // Get AliRun object from file or create it if not on file
20 gAlice = (AliRun*)file->Get("gAlice");
21 if (gAlice) printf("AliRun object found on file\n");
22 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
24 printf ("I'm after gAlice \n");
26 AliMUON *MUON = (AliMUON*) gAlice->GetModule("MUON");
27 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29 for (int nev=evNumber1; nev<= evNumber2; nev++) { // event loop
30 Int_t nparticles = gAlice->GetEvent(nev);
31 cout << "nev " <<nev<<endl;
32 cout << "nparticles " <<nparticles<<endl;
33 if (nparticles <= 0) return;
35 if (MUON) MUON->Trigger(nev);