]>
Commit | Line | Data |
---|---|---|
3e87ef69 | 1 | // $Id$ |
2 | ||
3 | /* Example macro showing the usage of the | |
4 | cluster finder storing the space points | |
5 | in an array. | |
6 | */ | |
7 | ||
8 | void runcf(Char_t *path) | |
9 | { | |
10 | AliL3Transform::Init(path,kTRUE); | |
11 | ||
12 | Char_t fname[1024]; | |
13 | Char_t digitfile[1024]; | |
14 | sprintf(digitfile,"%s/digitfile.root",path); | |
15 | ||
16 | ||
17 | AliL3MemHandler *memory = new AliL3MemHandler(); | |
18 | AliL3MemHandler *out = new AliL3MemHandler(); | |
19 | ||
20 | for(Int_t event=0; event<1; event++) | |
21 | { | |
22 | AliL3FileHandler *file = new AliL3FileHandler(); | |
23 | file->SetAliInput(digitfile); | |
24 | for(Int_t slice=0; slice<=35; slice++) | |
25 | { | |
26 | for(Int_t patch=0; patch<6; patch++) | |
27 | { | |
28 | cout<<"Processing event "<<event<<" slice "<<slice<<" patch "<<patch<<endl; | |
29 | file->Init(slice,patch); | |
30 | UInt_t ndigits=0; | |
31 | UInt_t maxclusters=100000; | |
32 | UInt_t pointsize = maxclusters*sizeof(AliL3SpacePointData); | |
33 | ||
34 | AliL3SpacePointData *points = (AliL3SpacePointData*)memory->Allocate(pointsize); | |
35 | AliL3DigitRowData *digits = (AliL3DigitRowData*)file->AliAltroDigits2Memory(ndigits,event); | |
36 | AliL3ClustFinderNew *cf = new AliL3ClustFinderNew(); | |
37 | //cf->SetMatchWidth(2); | |
38 | cf->InitSlice(slice,patch,AliL3Transform::GetFirstRow(patch),AliL3Transform::GetLastRow(patch),maxclusters); | |
39 | cf->SetSTDOutput(kTRUE); | |
40 | cf->SetThreshold(5); | |
41 | cf->SetDeconv(kTRUE); | |
42 | cf->SetCalcErr(kTRUE); | |
43 | cf->SetOutputArray(points); | |
44 | cf->Read(ndigits,digits); | |
45 | cf->ProcessDigits(); | |
46 | Int_t npoints = cf->GetNumberOfClusters(); | |
47 | ||
48 | sprintf(fname,"%s/points_%d_%d_%d.raw",path,event,slice,patch); | |
49 | ||
50 | //Transform points into global system | |
51 | //out->Transform(npoints,points,slice); | |
52 | ||
53 | out->SetBinaryOutput(fname); | |
54 | out->Memory2Binary(npoints,points); | |
55 | out->CloseBinaryOutput(); | |
56 | out->Free(); | |
57 | ||
58 | memory->Free(); | |
59 | file->Free(); | |
60 | delete cf; | |
61 | } | |
62 | ||
63 | } | |
64 | delete file; | |
65 | } | |
66 | ||
67 | delete memory; | |
68 | delete out; | |
69 | } |