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