10 Int_t particle_type=0;
14 void RICHdigit (Int_t evNumber1=0,Int_t evNumber2=0)
16 /////////////////////////////////////////////////////////////////////////
17 // This macro is a small example of a ROOT macro
18 // illustrating how to read the output of GALICE
19 // and do some analysis.
21 /////////////////////////////////////////////////////////////////////////
23 // Dynamically link some shared libs
26 if (gClassTable->GetID("AliRun") < 0) {
27 gROOT->LoadMacro("loadlibs.C");
32 // Connect the Root Galice file containing Geometry, Kine and Hits
34 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
35 if (file) file->Close();
36 file = new TFile("galice.root","UPDATE");
38 // Get AliRun object from file or create it if not on file
42 if (gClassTable->GetID("AliRun") < 0) {
43 gROOT->LoadMacro("loadlibs.C");
54 gAlice = (AliRun*)file->Get("gAlice");
55 if (gAlice) printf("AliRun object found on file\n");
56 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
59 gAlice = (AliRun*)file->Get("gAlice");
60 if (gAlice) printf("AliRun object found on file\n");
61 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
64 AliRICH *RICH = (AliRICH*) gAlice->GetDetector("RICH");
68 for (int nev=0; nev<= evNumber2; nev++) {
69 Int_t nparticles = gAlice->GetEvent(nev);
70 cout <<endl<< "Processing event:" <<nev<<endl;
71 cout << "Particles :" <<nparticles<<endl;
72 if (nev < evNumber1) continue;
73 if (nparticles <= 0) return;
74 if (RICH) RICH->Digitise(nev, particle_type);
76 sprintf(hname,"TreeD%d",nev);
77 gAlice->TreeD()->Write(hname);
78 gAlice->TreeD()->Reset();
83 printf("\nEnd of Macro *************************************\n");