]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/ITSHitsToFastPoints.C
new class to take into account ITS material distribution in tracking v1
[u/mrichter/AliRoot.git] / ITS / ITSHitsToFastPoints.C
CommitLineData
e8189707 1#include "iostream.h"
2
3void 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();
9c712bc6 17 } else {
18 delete gAlice;
19 gAlice=0;
e8189707 20 }
21
e8189707 22// Connect the Root Galice file containing Geometry, Kine and Hits
23
24 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
25 if (file) file->Close();
26 file = new TFile("galice.root","UPDATE");
27 file->ls();
28
29 printf ("I'm after Map \n");
30
31// Get AliRun object from file or create it if not on file
32
33 if (!gAlice) {
34 gAlice = (AliRun*)file->Get("gAlice");
35 if (gAlice) printf("AliRun object found on file\n");
36 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
37 }
38 printf ("I'm after gAlice \n");
39
40 AliITS *ITS = (AliITS*) gAlice->GetModule("ITS");
41 if (!ITS) return;
42
43 // Set the simulation model
44 AliITSsimulationFastPoints *sim = new AliITSsimulationFastPoints();
45
46 for (Int_t i=0;i<3;i++) {
47 ITS->SetSimulationModel(i,sim);
48 }
49
50//
51// Event Loop
52//
53
54 Int_t nbgr_ev=0;
55
e53d0fac 56
57 cout<<"Creating fast points...\n";
58
59 TStopwatch timer;
60
e8189707 61 for (int ev=evNumber1; ev<= evNumber2; ev++) {
62 Int_t nparticles = gAlice->GetEvent(ev);
63 cout << "event " <<ev<<endl;
64 cout << "nparticles " <<nparticles<<endl;
65 if (ev < evNumber1) continue;
66 if (nparticles <= 0) return;
67
68 Int_t bgr_ev=Int_t(ev/nsignal);
69 //printf("bgr_ev %d\n",bgr_ev);
e53d0fac 70 timer.Start();
e8189707 71 ITS->HitsToFastRecPoints(ev,bgr_ev,size," ","All"," ");
e53d0fac 72 timer.Stop(); timer.Print();
e8189707 73 } // event loop
74
cfeb18d5 75 delete gAlice;
76 gAlice=0;
e8189707 77 file->Close();
78}
79
80
81
82
83
84
85
86
87
88
89
90
91
92