]>
Commit | Line | Data |
---|---|---|
e8189707 | 1 | #include "iostream.h" |
2 | ||
3 | void ITSmixedpoints (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 | printf("file %p\n",file); | |
24 | if (file) file->Close(); | |
25 | file = new TFile("galice.root","UPDATE"); | |
26 | file->ls(); | |
27 | ||
28 | printf ("I'm after Map \n"); | |
29 | ||
30 | // Get AliRun object from file or create it if not on file | |
31 | ||
32 | if (!gAlice) { | |
33 | gAlice = (AliRun*)file->Get("gAlice"); | |
34 | if (gAlice) printf("AliRun object found on file\n"); | |
35 | if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); | |
36 | } | |
37 | printf ("I'm after gAlice \n"); | |
38 | ||
39 | AliITS *ITS = (AliITS*) gAlice->GetModule("ITS"); | |
40 | if (!ITS) return; | |
41 | ||
42 | // set the simulation models | |
43 | AliITSgeom *geom = ITS->GetITSgeom(); | |
44 | ||
45 | // SPD - simulation slow points | |
46 | ||
47 | AliITSDetType *iDetType=ITS->DetType(0); | |
48 | AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel(); | |
49 | AliITSresponseSPD *res0 = (AliITSresponseSPD*)iDetType->GetResponseModel(); | |
50 | AliITSsimulationSPD *sim0=new AliITSsimulationSPD(seg0,res0); | |
51 | ITS->SetSimulationModel(0,sim0); | |
52 | ||
53 | // SPD - cluster finder | |
54 | AliITSDetType *iDetType=ITS->DetType(0); | |
55 | AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel(); | |
56 | TClonesArray *dig0 = ITS->DigitsAddress(0); | |
57 | TClonesArray *recp0 = ITS->ClustersAddress(0); | |
58 | AliITSClusterFinderSPD *rec0=new AliITSClusterFinderSPD(seg0,dig0,recp0); | |
59 | ITS->SetReconstructionModel(0,rec0); | |
60 | ||
61 | // SDD+SSD - fast poinst | |
62 | ||
63 | AliITSsimulationFastPoints *sim = new AliITSsimulationFastPoints(); | |
64 | ||
65 | for (Int_t i=1;i<3;i++) { | |
66 | ITS->SetSimulationModel(i,sim); | |
67 | } | |
68 | ||
69 | // | |
70 | // Event Loop | |
71 | // | |
72 | Int_t nbgr_ev=0; | |
73 | ||
74 | for (int ev=evNumber1; ev<= evNumber2; ev++) { | |
75 | Int_t nparticles = gAlice->GetEvent(ev); | |
76 | cout << "event " <<ev<<endl; | |
77 | cout << "nparticles " <<nparticles<<endl; | |
78 | if (ev < evNumber1) continue; | |
79 | if (nparticles <= 0) return; | |
80 | Int_t bgr_ev=Int_t(ev/nsignal); | |
81 | Int_t last_entry=1; | |
82 | ITS->DigitsToRecPoints(ev,last_entry,"SPD"); | |
83 | ITS->HitsToFastRecPoints(ev,bgr_ev,size," ","SDD"," "); | |
84 | ITS->HitsToFastRecPoints(ev,bgr_ev,size," ","SSD"," "); | |
85 | } // event loop | |
86 | ||
87 | file->Close(); | |
88 | } | |
89 | ||
90 | ||
91 | ||
92 | ||
93 | ||
94 | ||
95 | ||
96 | ||
97 | ||
98 | ||
99 | ||
100 | ||
101 | ||
102 |