]>
Commit | Line | Data |
---|---|---|
e8189707 | 1 | #include "iostream.h" |
2 | ||
3 | void ITSHitsToFastPoints (Int_t evNumber1=0,Int_t evNumber2=0,Int_t nsignal=25, Int_t size=-1) | |
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 | ||
20 | // Connect the Root Galice file containing Geometry, Kine and Hits | |
21 | ||
22 | TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root"); | |
23 | if (file) file->Close(); | |
24 | file = new TFile("galice.root","UPDATE"); | |
25 | file->ls(); | |
26 | ||
27 | printf ("I'm after Map \n"); | |
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 | } | |
36 | printf ("I'm after gAlice \n"); | |
37 | ||
38 | AliITS *ITS = (AliITS*) gAlice->GetModule("ITS"); | |
39 | if (!ITS) return; | |
40 | ||
41 | // Set the simulation model | |
42 | AliITSsimulationFastPoints *sim = new AliITSsimulationFastPoints(); | |
43 | ||
44 | for (Int_t i=0;i<3;i++) { | |
45 | ITS->SetSimulationModel(i,sim); | |
46 | } | |
47 | ||
48 | // | |
49 | // Event Loop | |
50 | // | |
51 | ||
52 | Int_t nbgr_ev=0; | |
53 | ||
54 | for (int ev=evNumber1; ev<= evNumber2; ev++) { | |
55 | Int_t nparticles = gAlice->GetEvent(ev); | |
56 | cout << "event " <<ev<<endl; | |
57 | cout << "nparticles " <<nparticles<<endl; | |
58 | if (ev < evNumber1) continue; | |
59 | if (nparticles <= 0) return; | |
60 | ||
61 | Int_t bgr_ev=Int_t(ev/nsignal); | |
62 | //printf("bgr_ev %d\n",bgr_ev); | |
63 | ITS->HitsToFastRecPoints(ev,bgr_ev,size," ","All"," "); | |
64 | } // event loop | |
65 | ||
66 | file->Close(); | |
67 | } | |
68 | ||
69 | ||
70 | ||
71 | ||
72 | ||
73 | ||
74 | ||
75 | ||
76 | ||
77 | ||
78 | ||
79 | ||
80 | ||
81 |