1 void ITSdigit (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 ITSdigit.C //this loads the macro in memory
9 // Root > ITSdigit(); //by default process first event
10 // Root > ITSdigit(2); //process third event
12 /////////////////////////////////////////////////////////////////////////
15 // Dynamically link some shared libs
16 if (gClassTable->GetID("AliRun") < 0) {
17 gSystem->Load("libGeant3Dummy.so"); // a dummy version of Geant3
18 gSystem->Load("PHOS/libPHOSdummy.so"); // the standard Alice classes
19 gSystem->Load("libgalice.so"); // the standard Alice classes
22 // Connect the Root Galice file containing Geometry, Kine and Hits
23 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
24 if (!file) file = new TFile("galice.root");
26 // Get AliRun object from file or create it if not on file
28 gAlice = (AliRun*)file->Get("gAlice");
29 if (gAlice) printf("AliRun object found on file\n");
30 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
33 // Import the Kine and Hits Trees for the event evNumber in the file
34 Int_t nparticles = gAlice->GetEvent(evNumber);
35 if (nparticles <= 0) return;
42 AliITSdigit *ITSdigit;
44 // Get pointers to Alice detectors and Hits containers
45 AliDetector *ITS = gAlice->GetDetector("ITS");
46 TClonesArray *Particles = gAlice->Particles();
47 if (ITS) TClonesArray *ITSdigits = ITS->Digits();
49 TTree *TD = gAlice->TreeD();
50 Int_t nent = TD->GetEntries();
52 printf("Found %d entries in the tree (must be one per event!)\n",nent);
54 for (Int_t dig=0; dig<nent; dig++) {
55 gAlice->ResetDigits();
56 nbytes += TD->GetEvent(dig);
58 Int_t ndigits = ITSdigits->GetEntriesFast();
59 printf("Found %d digits\n",ndigits);
60 for (Int_t digit=0;digit<ndigits;digit++) {
61 ITSdigit = (AliITSdigit*)ITSdigits->UncheckedAt(digit);
62 printf("%d %d %d %d \n",ITSdigit->fEvent,ITSdigit->fLayer,ITSdigit->fDet,ITSdigit->fNoverl);