3 void ITSreadRecPointsTest (Int_t evNumber1=0,Int_t evNumber2=0)
5 /////////////////////////////////////////////////////////////////////////
6 // This macro is a small example of a ROOT macro
7 // illustrating how to read the output of GALICE
8 // and do some analysis.
10 /////////////////////////////////////////////////////////////////////////
12 // Dynamically link some shared libs
14 if (gClassTable->GetID("AliRun") < 0) {
15 gROOT->LoadMacro("loadlibs.C");
18 // Anyway, this macro needs to read a gAlice file, so it
19 // clears the gAlice object if there is already one in memory...
27 // Connect the Root Galice file containing Geometry, Kine and Hits
29 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
30 if (!file) file = new TFile("galice.root");
33 // Get AliRun object from file or create it if not on file
36 gAlice = (AliRun*)file->Get("gAlice");
37 if (gAlice) printf("AliRun object found on file\n");
38 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
46 for (int nev=0; nev<= evNumber2; nev++) {
47 Int_t nparticles = gAlice->GetEvent(nev);
48 cout << "nev " << nev <<endl;
49 cout << "nparticles " << nparticles <<endl;
50 if (nev < evNumber1) continue;
51 if (nparticles <= 0) return;
53 TTree *TH = gAlice->TreeH();
54 Int_t ntracks = TH->GetEntries();
55 cout<<"ntracks "<<ntracks<<endl;
61 // Get pointers to Alice detectors and Digits containers
62 AliITS *ITS = (AliITS*)gAlice->GetModule("ITS");
64 TClonesArray *Particles = gAlice->Particles();
65 TTree *TR = gAlice->TreeR();
66 Int_t nent=TR->GetEntries();
67 printf("Found %d entries in the tree (must be one per module per event!)\n",nent);
69 TClonesArray *ITSrec = ITS->RecPoints();
70 for (Int_t mod=0; mod<nent; mod++) {
71 ITS->ResetRecPoints();
73 Int_t nrecp = ITSrec->GetEntries();
74 if (nrecp) printf("Found %d rec points for module %d \n",nrecp,mod);
77 for (Int_t irec=0;irec<nrecp;irec++) {
78 recp = (AliITSRecPoint*)ITSrec->UncheckedAt(irec);
79 printf("%d %f %f %d %d %d\n",irec,recp->GetX(),recp->GetZ(),recp->GetLabel(0),recp->GetLabel(1),recp->GetLabel(2));
85 cout<<"END test for rec points "<<endl;