The Init method of AliITSreconstruction has to be called by the user. This was done...
[u/mrichter/AliRoot.git] / RICH / RICHrawclusters.C
CommitLineData
79aa5519 1#include "iostream.h"
2
3void RICHrawclusters (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
ec4199d1 14 if (gClassTable->GetID("AliRun") < 0) {
15 gROOT->LoadMacro("loadlibs.C");
16 loadlibs();
17 }else {
18 delete gAlice;
79aa5519 19 gAlice = 0;
ec4199d1 20 }
21
22 gAlice=0;
79aa5519 23
24// Connect the Root Galice file containing Geometry, Kine and Hits
25
26 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
27 if (!file) file = new TFile("galice.root","UPDATE");
28
29// Get AliRun object from file or create it if not on file
30
31 if (!gAlice) {
32 gAlice = (AliRun*)file->Get("gAlice");
33 if (gAlice) printf("AliRun object found on file\n");
34 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
35 } else {
36 delete gAlice;
37 gAlice = (AliRun*)file->Get("gAlice");
38 if (gAlice) printf("AliRun object found on file\n");
39 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
40 }
a93a6c55 41
79aa5519 42//
43// Set reconstruction models
44//
45// Get pointers to Alice detectors and Digits containers
46 AliRICH *RICH = (AliRICH*) gAlice->GetModule("RICH");
47
48 RecModel1 = new AliRICHClusterFinder();
49 RecModel1->SetNperMax(90);
50 //RecModel1->SetClusterSize(12);
51 RecModel1->SetClusterSize(100);
52 RecModel1->SetDeclusterFlag(1);
53 RICH->SetReconstructionModel(0,RecModel1);
54
55 RecModel2 = new AliRICHClusterFinder();
56 RecModel2->SetNperMax(90);
57 //RecModel2->SetClusterSize(12);
58 RecModel2->SetClusterSize(100);
59 RecModel2->SetDeclusterFlag(1);
60 RICH->SetReconstructionModel(1,RecModel2);
61
62 RecModel3 = new AliRICHClusterFinder();
63 RecModel3->SetNperMax(90);
64 //RecModel3->SetClusterSize(12);
65 RecModel3->SetClusterSize(100);
66 RecModel3->SetDeclusterFlag(1);
67 RICH->SetReconstructionModel(2,RecModel3);
68
69 RecModel4 = new AliRICHClusterFinder();
70 RecModel4->SetNperMax(90);
71 //RecModel4->SetClusterSize(12);
72 RecModel4->SetClusterSize(100);
73 RecModel4->SetDeclusterFlag(1);
74 RICH->SetReconstructionModel(3,RecModel4);
75
76 //RecModel5 = new AliRICHClusterFinderv0();
77 RecModel5 = new AliRICHClusterFinder();
78 RecModel5->SetNperMax(90);
79 //RecModel5->SetClusterSize(15);
80 RecModel5->SetClusterSize(100);
81 RecModel5->SetDeclusterFlag(1);
82 RICH->SetReconstructionModel(4,RecModel5);
83
84 //RecModel6 = new AliRICHClusterFinderv0();
85 RecModel6 = new AliRICHClusterFinder();
86 RecModel6->SetNperMax(90);
87 //RecModel6->SetClusterSize(15);
88 RecModel6->SetClusterSize(100);
89 RecModel6->SetDeclusterFlag(1);
90 RICH->SetReconstructionModel(5,RecModel6);
91
92 RecModel7 = new AliRICHClusterFinder();
93 RecModel7->SetNperMax(90);
94 //RecModel7->SetClusterSize(9);
95 RecModel7->SetClusterSize(100);
96 RecModel7->SetDeclusterFlag(1);
97 RICH->SetReconstructionModel(6,RecModel7);
a93a6c55 98
79aa5519 99//
100// Loop over events
101//
102 Int_t Nh=0;
103 Int_t Nh1=0;
104 for (int nev=0; nev<= evNumber2; nev++) {
105 Int_t nparticles = gAlice->GetEvent(nev);
106 cout <<endl<< "Processing event:" << nev <<endl;
107 cout << "Particles :" << nparticles <<endl;
108 if (nev < evNumber1) continue;
109 if (nparticles <= 0) return;
110
111 TTree *TH = gAlice->TreeH();
112 Int_t ntracks = TH->GetEntries();
113 //cout<<"ntracks "<<ntracks<<endl;
114
115 Int_t nbytes = 0;
116
117
118 TClonesArray *Particles = gAlice->Particles();
119 TTree *TD = gAlice->TreeD();
ec4199d1 120 Int_t nent=gAlice->TreeD()->GetEntries();
79aa5519 121 //printf("Found %d entries in the tree (must be one per cathode per event!)\n",nent);
122 if (RICH) {
123 //printf("Finding clusters for event:%d",nev);
a93a6c55 124 gAlice->MakeTree("R");
125 RICH->MakeBranch("R");
126 RICH->FindClusters(nev,nent-2);
79aa5519 127 } // end if RICH
a93a6c55 128 } // event loop
129 file->Close();
130
ec4199d1 131
132
79aa5519 133 printf("\nEnd of Macro *************************************\n");
134}
135