1 #if !defined(__CINT__) || defined(__MAKECINT__)
4 #include<TClassTable.h>
6 #include <TInterpreter.h>
7 #include <TStopwatch.h>
10 #include "AliRunLoader.h"
12 #include "AliITSInitGeometry.h"
13 #include "AliITSgeom.h"
14 #include "AliITSLoader.h"
15 #include "AliITSsimulationFastPoints.h"
16 #include "AliGeomManager.h"
24 void AliITSHits2FastRecPoints (Int_t evNumber1=0,Int_t evNumber2=0, TString inFile = "galice.root", Int_t nsignal=25, Int_t size=-1)
26 /////////////////////////////////////////////////////////////////////////
28 // This macro creates fast recpoints
30 /////////////////////////////////////////////////////////////////////////
33 // Dynamically link some shared libs
35 if (gClassTable->GetID("AliRun") < 0) {
36 gInterpreter->ExecuteMacro("loadlibs.C");
40 delete gAlice->GetRunLoader();
48 AliGeomManager::LoadGeometry("geometry.root");
50 // Connect the Root Galice file containing Geometry, Kine and Hits
51 AliRunLoader* rl = AliRunLoader::Open(inFile.Data());
54 Error("AliITSHits2FastRecPoints.C","Can not open session RL=NULL");
58 Int_t retval = rl->LoadgAlice();
61 Error("AliITSHits2FastRecPoints.C","LoadgAlice returned error");
65 gAlice=rl->GetAliRun();
67 retval = rl->LoadKinematics();
70 Error("AliITSHits2FastRecPoints.C","LoadKinematics returned error");
75 AliITSInitGeometry initgeom;
76 AliITSgeom *geom = initgeom.CreateAliITSgeom();
77 printf("Geometry name: %s \n",(initgeom.GetGeometryName()).Data());
79 AliITSLoader* gime = (AliITSLoader*)rl->GetLoader("ITSLoader");
82 ::Error("AliITSHits2FastRecPoints.C","can not get ITS loader");
86 gime->SetITSgeom(geom);
87 retval = gime->LoadHits("read");
90 ::Error("AliITSHits2FastRecPoints.C","LoadHits returned error");
94 gime->SetRecPointsFileName("ITS.FastRecPoints.root");
95 retval = gime->LoadRecPoints("update");
98 ::Error("AliITSHits2FastRecPoints.C","LoadRecPoints returned error");
106 AliITS *ITS = (AliITS*) gAlice->GetModule("ITS");
109 // Set the simulation model
119 cout << "Creating fast reconstructed points from hits for the ITS..." << endl;
120 AliITSDetTypeSim* dettyp = new AliITSDetTypeSim();
121 dettyp->SetITSgeom(geom);
122 dettyp->SetLoader(gime);
123 ITS->SetDetTypeSim(dettyp);
124 for (Int_t i=0;i<3;i++) {
125 ITS->SetSimulationModel(i,new AliITSsimulationFastPoints());
129 for (int ev=evNumber1; ev<= evNumber2; ev++) {
130 cout << "...working on event "<< ev << " ..." << endl;
131 Int_t nparticles = gAlice->GetEvent(ev);
132 cout << "event " <<ev<<endl;
133 cout << "nparticles " <<nparticles<<endl;
135 //if(gime->TreeR() == 0x0) gime->MakeTree("R");
137 if (ev < evNumber1) continue;
138 if (nparticles <= 0) return;
140 Int_t bgr_ev=Int_t(ev/nsignal);
142 ITS->HitsToFastRecPoints(ev,bgr_ev,size," ","All"," ");
143 timer.Stop(); timer.Print();