3 void MUONdigitsTestnew (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");
19 // Connect the Root Galice file containing Geometry, Kine and Hits
21 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
22 if (!file) file = new TFile("galice.root");
24 // 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");
37 for (int nev=0; nev<= evNumber2; nev++) {
38 Int_t nparticles = gAlice->GetEvent(nev);
39 cout << "nev " << nev <<endl;
40 cout << "nparticles " << nparticles <<endl;
41 if (nev < evNumber1) continue;
42 if (nparticles <= 0) return;
44 TTree *TH = gAlice->TreeH();
45 Int_t ntracks = TH->GetEntries();
46 cout<<"ntracks "<<ntracks<<endl;
50 AliMUONdigit *MUONdigit;
52 // Get pointers to Alice detectors and Digits containers
53 AliMUON *MUON = gAlice->GetDetector("MUON");
54 TClonesArray *Particles = gAlice->Particles();
55 TTree *TD = gAlice->TreeD();
56 Int_t nent=TD->GetEntries();
57 printf("Found %d entries in the tree (must be one per cathode per event!)\n",nent);
59 for (Int_t ich=0;ich<10;ich++) {
60 TClonesArray *MUONdigits = MUON->DigitsAddress(ich);
61 // printf ("MUONdigits %f \n",MUONdigits);
63 for (Int_t dig=1; dig<nent; dig++) {
64 gAlice->ResetDigits();
65 nbytes += TD->GetEvent(dig);
66 Int_t ndigits = MUONdigits->GetEntries();
67 printf("Found %d digits for cathode %d in chamber %d \n",ndigits,dig,ich+1);
68 for (Int_t digit=0;digit<ndigits;digit++) {
69 MUONdigit = (AliMUONdigit*)MUONdigits->UncheckedAt(digit);
70 // printf("%d %d %d %d %d\n",MUONdigit->fPadX,MUONdigit->fPadY,MUONdigit->fSignal,MUONdigit->fTracks[0],MUONdigit->fTcharges[0]);
78 cout<<"END test for digits "<<endl;