]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/ITSrecpointsBari.C
Decay_t moved to AliDecayer.h
[u/mrichter/AliRoot.git] / ITS / ITSrecpointsBari.C
CommitLineData
88c93889 1#include "iostream.h"
2
3void ITSrecpointsBari (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// version to execute the Bari model
11//
12/////////////////////////////////////////////////////////////////////////
13
14// Dynamically link some shared libs
15
16 if (gClassTable->GetID("AliRun") < 0) {
17 gROOT->LoadMacro("loadlibs.C");
18 loadlibs();
19 }
20
21
22// Connect the Root Galice file containing Geometry, Kine and Hits
23
24 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
25 printf("file %p\n",file);
26 if (file) file->Close();
27 file = new TFile("galice.root","UPDATE");
28 file->ls();
29
30 printf ("I'm after Map \n");
31
32// Get AliRun object from file or create it if not on file
33
34 if (!gAlice) {
35 gAlice = (AliRun*)file->Get("gAlice");
36 if (gAlice) printf("AliRun object found on file\n");
37 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
38 }
39 printf ("I'm after gAlice \n");
40
41 AliITS *ITS = (AliITS*) gAlice->GetModule("ITS");
42 if (!ITS) return;
43
44//
45// Event Loop
46//
47
48
49 AliITSgeom *geom = ITS->GetITSgeom();
50
51 // SPD
52
53 AliITSDetType *iDetType=ITS->DetType(0);
54 AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel();
55 TClonesArray *dig0 = ITS->DigitsAddress(0);
56 TClonesArray *recp0 = ITS->ClustersAddress(0);
57 AliITSClusterFinderSPDbari *rec0=new AliITSClusterFinderSPDbari(seg0,dig0,recp0);
58 ITS->SetReconstructionModel(0,rec0);
59
60 // test
61 printf("SPD dimensions %f %f \n",seg0->Dx(),seg0->Dz());
62 printf("SPD npixels %d %d \n",seg0->Npz(),seg0->Npx());
63
64
65
66 for (int nev=evNumber1; nev<= evNumber2; nev++) {
67 Int_t nparticles = gAlice->GetEvent(nev);
68 cout << "nev " <<nev<<endl;
69 cout << "nparticles " <<nparticles<<endl;
70 if (nev < evNumber1) continue;
71 if (nparticles <= 0) return;
72
73 TTree *TD = gAlice->TreeD();
74 Int_t nent=TD->GetEntries();
75 printf("Found %d entries in the tree (must be one per module per event!)\n",nent);
76 Int_t nmodules=geom->GetLastSSD();
77 Int_t last_entry=1;
78// ITS->DigitsToRecPoints(nev,last_entry,"All");
79 ITS->DigitsToRecPoints(nev,last_entry,"SPD");
80 } // event loop
81
82 file->Close();
83}
84