]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSHits2FastRecPoints.C
Avoid compiler warnings.
[u/mrichter/AliRoot.git] / ITS / AliITSHits2FastRecPoints.C
CommitLineData
88cb7938 1void AliITSHits2FastRecPoints (Int_t evNumber1=0,Int_t evNumber2=0, TString inFile = "galice.root", Int_t nsignal=25, Int_t size=-1)
af8e1c2d 2{
cc2535cd 3 /////////////////////////////////////////////////////////////////////////
4 //
5 // This macro creates fast recpoints, optionally on a separate file
6 //
7 /////////////////////////////////////////////////////////////////////////
8
88cb7938 9
cc2535cd 10 // Dynamically link some shared libs
11
12 if (gClassTable->GetID("AliRun") < 0) {
13 gROOT->LoadMacro("loadlibs.C");
14 loadlibs();
88cb7938 15 } else if (gAlice){
16 delete gAlice->GetRunLoader();
17 delete gAlice;
18 gAlice=0;
cc2535cd 19 }
20
21 // Connect the Root Galice file containing Geometry, Kine and Hits
88cb7938 22 AliRunLoader* rl = AliRunLoader::Open("galice.root");
23 if (rl == 0x0)
24 {
25 ::Error("AliITSHits2FastRecPoints.C","Can not open session RL=NULL");
26 return;
27 }
28
29 Int_t retval = rl->LoadgAlice();
30 if (retval)
31 {
32 ::Error("AliITSHits2FastRecPoints.C","LoadgAlice returned error");
33 delete rl;
34 return;
35 }
36 gAlice=rl->GetAliRun();
37 rl->LoadHeader();
38 retval = rl->LoadKinematics();
39 if (retval)
40 {
41 ::Error("AliITSHits2FastRecPoints.C","LoadKinematics returned error");
42 delete rl;
43 return;
44 }
45
46 AliITSLoader* gime = (AliITSLoader*)rl->GetLoader("ITSLoader");
47 if (gime == 0x0)
48 {
49 ::Error("AliITSHits2FastRecPoints.C","can not get ITS loader");
50 delete rl;
51 return;
52 }
53 retval = gime->LoadHits("read");
54 if (retval)
55 {
56 ::Error("AliITSHits2FastRecPoints.C","LoadHits returned error");
57 delete rl;
58 return;
59 }
60 gime->SetRecPointsFileName("ITS.FastRecPoints.root");
61 retval = gime->LoadRecPoints("update");
62 if (retval)
63 {
64 ::Error("AliITSHits2FastRecPoints.C","LoadRecPoints returned error");
65 delete rl;
66 return;
67 }
68
69 AliITS *ITS = (AliITS*) gAlice->GetModule("ITS");
70 if (!ITS) return;
af8e1c2d 71
72 // Set the simulation model
73
cc2535cd 74 for (Int_t i=0;i<3;i++) {
75 ITS->SetSimulationModel(i,new AliITSsimulationFastPoints());
76 }
af8e1c2d 77
78
cc2535cd 79 //
80 // Event Loop
81 //
82
83 Int_t nbgr_ev=0;
84 TStopwatch timer;
85
86 cout << "Creating fast reconstructed points from hits for the ITS..." << endl;
87
88 for (int ev=evNumber1; ev<= evNumber2; ev++) {
89 cout << "...working on event "<< ev << " ..." << endl;
90 Int_t nparticles = gAlice->GetEvent(ev);
91 cout << "event " <<ev<<endl;
92 cout << "nparticles " <<nparticles<<endl;
88cb7938 93 rl->GetEvent(ev);
94 if(gime->TreeR() == 0x0) gime->MakeTree("R");
95
cc2535cd 96 ITS->MakeBranch("RF");
97 if (ev < evNumber1) continue;
98 if (nparticles <= 0) return;
99
100 Int_t bgr_ev=Int_t(ev/nsignal);
cc2535cd 101 timer.Start();
102 ITS->HitsToFastRecPoints(ev,bgr_ev,size," ","All"," ");
103 timer.Stop(); timer.Print();
104 } // event loop
105
88cb7938 106 delete rl;
af8e1c2d 107}
108