1 void MUONdigitsTestnew (Int_t evNumber1=0,Int_t evNumber2=0)
3 /////////////////////////////////////////////////////////////////////////
4 // This macro is a small example of a ROOT macro
5 // illustrating how to read the output of GALICE
6 // and do some analysis.
8 /////////////////////////////////////////////////////////////////////////
10 // Dynamically link some shared libs
12 if (gClassTable->GetID("AliRun") < 0) {
13 gSystem->Load("libGeant3Dummy.sl"); // a dummy version of Geant3
14 gSystem->Load("PHOS/libPHOSdummy.sl"); // the standard Alice classes
15 gSystem->Load("libgalice.sl"); // the standard Alice classes
18 // Connect the Root Galice file containing Geometry, Kine and Hits
20 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
21 if (!file) file = new TFile("galice.root");
23 // Get AliRun object from file or create it if not on file
26 gAlice = (AliRun*)file->Get("gAlice");
27 if (gAlice) printf("AliRun object found on file\n");
28 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
36 for (int nev=0; nev<= evNumber2; nev++) {
37 Int_t nparticles = gAlice->GetEvent(nev);
38 cout << "nev " << nev <<endl;
39 cout << "nparticles " << nparticles <<endl;
40 if (nev < evNumber1) continue;
41 if (nparticles <= 0) return;
43 TTree *TH = gAlice->TreeH();
44 Int_t ntracks = TH->GetEntries();
45 cout<<"ntracks "<<ntracks<<endl;
49 AliMUONdigit *MUONdigit;
51 // Get pointers to Alice detectors and Digits containers
52 AliMUON *MUON = gAlice->GetDetector("MUON");
53 TClonesArray *Particles = gAlice->Particles();
54 TTree *TD = gAlice->TreeD();
55 Int_t nent=TD->GetEntries();
56 printf("Found %d entries in the tree (must be one per cathode per event!)\n",nent);
58 for (Int_t ich=0;ich<10;ich++) {
59 TClonesArray *MUONdigits = MUON->DigitsAddress(ich);
60 // printf ("MUONdigits %f \n",MUONdigits);
62 for (Int_t dig=1; dig<nent; dig++) {
63 gAlice->ResetDigits();
64 nbytes += TD->GetEvent(dig);
65 Int_t ndigits = MUONdigits->GetEntries();
66 printf("Found %d digits for cathode %d in chamber %d \n",ndigits,dig,ich+1);
67 for (Int_t digit=0;digit<ndigits;digit++) {
68 MUONdigit = (AliMUONdigit*)MUONdigits->UncheckedAt(digit);
69 // printf("%d %d %d %d %d\n",MUONdigit->fPadX,MUONdigit->fPadY,MUONdigit->fSignal,MUONdigit->fTracks[0],MUONdigit->fTcharges[0]);
77 cout<<"END test for digits "<<endl;