]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/MUONrawclusters.C
Changes in Lego for G4 compatibility
[u/mrichter/AliRoot.git] / MUON / MUONrawclusters.C
1 #include "iostream.h"
2
3 void MUONrawclusters (Int_t evNumber1=0,Int_t evNumber2=0) 
4 {
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.
9 //   
10 /////////////////////////////////////////////////////////////////////////
11
12 // Dynamically link some shared libs
13
14     if (gClassTable->GetID("AliRun") < 0) {
15         gROOT->LoadMacro("loadlibs.C");
16         loadlibs();
17     }
18
19 // Connect the Root Galice file containing Geometry, Kine and Hits
20
21     TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
22     if (!file) file = new TFile("galice.root","UPDATE");
23
24 // Get AliRun object from file or create it if not on file
25
26     if (!gAlice) {
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");
30     }
31 //
32 // Set reconstruction models
33 //
34 // Get pointers to Alice detectors and Digits containers
35     AliMUON *MUON  = (AliMUON*) gAlice->GetModule("MUON");
36
37     RecModel1 = new AliMUONClusterFinder();
38     RecModel1->SetNperMax(90);
39     //RecModel1->SetClusterSize(12);
40     RecModel1->SetClusterSize(100);
41     RecModel1->SetDeclusterFlag(0);
42     MUON->SetReconstructionModel(0,RecModel1);
43     
44     RecModel2 = new AliMUONClusterFinder();
45     RecModel2->SetNperMax(90);
46     //RecModel2->SetClusterSize(12);
47     RecModel2->SetClusterSize(100);
48     RecModel2->SetDeclusterFlag(0);
49     MUON->SetReconstructionModel(1,RecModel2);
50  
51     RecModel3 = new AliMUONClusterFinder();
52     RecModel3->SetNperMax(90);
53     //RecModel3->SetClusterSize(12);
54     RecModel3->SetClusterSize(100);
55     RecModel3->SetDeclusterFlag(0);
56     MUON->SetReconstructionModel(2,RecModel3);
57     
58     RecModel4 = new AliMUONClusterFinder();
59     RecModel4->SetNperMax(90);
60     //RecModel4->SetClusterSize(12);
61     RecModel4->SetClusterSize(100);
62     RecModel4->SetDeclusterFlag(0);
63     MUON->SetReconstructionModel(3,RecModel4);
64     
65     //RecModel5 = new AliMUONClusterFinderv0();
66     RecModel5 = new AliMUONClusterFinder();
67     RecModel5->SetNperMax(90);
68     //RecModel5->SetClusterSize(15);
69     RecModel5->SetClusterSize(100);
70     RecModel5->SetDeclusterFlag(0);
71     MUON->SetReconstructionModel(4,RecModel5);
72     
73     //RecModel6 = new AliMUONClusterFinderv0();
74     RecModel6 = new AliMUONClusterFinder();
75     RecModel6->SetNperMax(90);
76     //RecModel6->SetClusterSize(15);
77     RecModel6->SetClusterSize(100);
78     RecModel6->SetDeclusterFlag(0);
79     MUON->SetReconstructionModel(5,RecModel6);
80     
81     RecModel7 = new AliMUONClusterFinder();
82     RecModel7->SetNperMax(90);
83     //RecModel7->SetClusterSize(9);
84     RecModel7->SetClusterSize(100);
85     RecModel7->SetDeclusterFlag(0);
86     MUON->SetReconstructionModel(6,RecModel7);
87     
88     RecModel8 = new AliMUONClusterFinder();
89     RecModel8->SetNperMax(90);
90     //RecModel8->SetClusterSize(9);
91     RecModel8->SetClusterSize(100);
92     RecModel8->SetDeclusterFlag(0);
93     MUON->SetReconstructionModel(7,RecModel8);
94
95     RecModel9 = new AliMUONClusterFinder();
96     RecModel9->SetNperMax(90);
97     //RecModel9->SetClusterSize(9);
98     RecModel9->SetClusterSize(100);
99     RecModel9->SetDeclusterFlag(0);
100     MUON->SetReconstructionModel(8,RecModel9);
101
102     RecModel10 = new AliMUONClusterFinder();
103     RecModel10->SetNperMax(90);
104     //    RecModel1->SetClusterSize(9);
105     RecModel1->SetClusterSize(100);
106     RecModel10->SetDeclusterFlag(0);
107     MUON->SetReconstructionModel(9,RecModel10);
108
109  
110 //
111 //   Loop over events              
112 //
113     Int_t Nh=0;
114     Int_t Nh1=0;
115     for (int nev=0; nev<= evNumber2; nev++) {
116         Int_t nparticles = gAlice->GetEvent(nev);
117         cout << "nev         " << nev <<endl;
118         cout << "nparticles  " << nparticles <<endl;
119         if (nev < evNumber1) continue;
120         if (nparticles <= 0) return;
121         
122         TTree *TH = gAlice->TreeH();
123         Int_t ntracks = TH->GetEntries();
124         cout<<"ntracks "<<ntracks<<endl;
125         
126         Int_t nbytes = 0;
127
128
129         TClonesArray *Particles = gAlice->Particles();
130         TTree *TD = gAlice->TreeD();
131         Int_t nent=TD->GetEntries();
132         //printf("Found %d entries in the tree (must be one per cathode per event!)\n",nent);
133         if (MUON) {
134             MUON->FindClusters(nev,nent-2);
135         }   // end if MUON
136     }   // event loop 
137     //file->ls();
138     file->Close();
139 }
140