3 void ITSreadClustTest (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");
25 // 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");
38 for (int nev=0; nev<= evNumber2; nev++) {
39 Int_t nparticles = gAlice->GetEvent(nev);
40 cout << "nev " << nev <<endl;
41 cout << "nparticles " << nparticles <<endl;
42 if (nev < evNumber1) continue;
43 if (nparticles <= 0) return;
45 TTree *TH = gAlice->TreeH();
46 Int_t ntracks = TH->GetEntries();
47 cout<<"ntracks "<<ntracks<<endl;
51 //AliITSRawClusterSDD *ITSclust;
52 AliITSRawClusterSPD *ITSclust;
54 // Get pointers to Alice detectors and Digits containers
55 AliITS *ITS = (AliITS*)gAlice->GetModule("ITS");
57 TClonesArray *Particles = gAlice->Particles();
60 TTree *TC=ITS->TreeC();
61 Int_t nent=TC->GetEntries();
62 printf("Found %d entries in the tree (must be one per module per event!)\n",nent);
64 for (Int_t idet=0;idet<3;idet++) {
66 TClonesArray *ITSclu = ITS->ClustersAddress(idet);
68 if (idet != 0) continue;
69 for (Int_t mod=0; mod<nent; mod++) {
72 Int_t ncl = ITSclu->GetEntries();
73 if (ncl) printf("Found %d clusters for module %d in det type %d \n",nrecp,mod,idet);
77 for (Int_t icl=0;icl<ncl;icl++) {
78 ITSclust = (AliITSRawClusterSPD*)ITSclu->UncheckedAt(icl);
79 printf("%d %d %f %f %f\n",ITSclust->NclZ(),ITSclust->NclX(),ITSclust->Q(),ITSclust->X(),ITSclust->Z());
81 for (Int_t icl=0;icl<ncl;icl++) {
82 ITSclust = (AliITSRawClusterSDD*)ITSclu->UncheckedAt(icl);
83 printf("%d %d %f %f %f\n",ITSclust->Anodes(),ITSclust->Samples(),ITSclust->Q(),ITSclust->X(),ITSclust->Z());
92 cout<<"END test for clusters "<<endl;