1 void RICH (Int_t evNumber=0)
3 /////////////////////////////////////////////////////////////////////////
4 // This macro is a small example of a ROOT macro
5 // illustrating how to read the output of GALICE
8 // Root > .L RICH.C //this loads the macro in memory
9 // Root > RICH(); //by default process first event
10 // Root > RICH(2); //process third event
11 /////////////////////////////////////////////////////////////////////////
14 // Dynamically link some shared libs
15 if (gClassTable->GetID("AliRun") < 0) {
16 gSystem->Load("libGeant3Dummy.so"); // a dummy version of Geant3
17 gSystem->Load("PHOS/libPHOSdummy.so"); // the standard Alice classes
18 gSystem->Load("libgalice.so"); // the standard Alice classes
21 // Connect the Root Galice file containing Geometry, Kine and Hits
22 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
23 if (!file) file = new TFile("galice.root");
25 // Get AliRun object from file or create it if not on file
27 gAlice = (AliRun*)file->Get("gAlice");
28 if (gAlice) printf("AliRun object found on file\n");
29 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
32 // Import the Kine and Hits Trees for the event evNumber in the file
33 Int_t nparticles = gAlice->GetEvent(evNumber);
34 if (nparticles <= 0) return;
44 // Get pointers to Alice detectors and Hits containers
45 AliRICH *RICH = gAlice->GetDetector("RICH");
46 TClonesArray *Particles = gAlice->Particles();
48 TClonesArray *RICHhits = RICH->Hits();
49 TClonesArray *Mips = RICH->Mips();
50 TClonesArray *Ckovs = RICH->Ckovs();
51 TClonesArray *Padhits = RICH->Padhits();
53 printf("RICHhits, Mips, Ckovs, Pad %d, %d, %d, %d\n",RICHhits,Mips,Ckovs,Padhits);
55 TTree *TH = gAlice->TreeH();
56 Int_t ntracks = TH->GetEntries();
58 // Start loop on tracks in the hits containers
59 for (Int_t track=0; track<ntracks;track++) {
61 nbytes += TH->GetEvent(track);
62 Int_t nrich=RICHhits->GetEntriesFast();
64 printf("Number of hit entries %d\n",nrich);
65 printf("Number of Mips entries %d\n",Mips->GetEntriesFast());
66 printf("Number of Ckovs entries %d\n",Ckovs->GetEntriesFast());
67 printf("Number of Padhits entries %d\n",Padhits->GetEntriesFast());