]>
Commit | Line | Data |
---|---|---|
9579103e | 1 | /* $Id$ |
2 | Author: Constantin Loizides <loizides@ikf.physik.uni-frankfurt.de> | |
3 | */ | |
4 | ||
5 | #include <stream.h> | |
6 | #include <libgen.h> | |
7 | #include "AliL3Transform.h" | |
3539d83a | 8 | #include "AliL3ClustFinderNew.h" |
9 | #include "AliL3MemHandler.h" | |
10 | #include "AliL3SpacePointData.h" | |
11 | ||
9579103e | 12 | /** |
13 | Example program how to run the "standalone" clusterfinder. | |
14 | */ | |
15 | ||
3539d83a | 16 | int main(int argc,char **argv) |
17 | { | |
18 | if(argc!=2) | |
19 | { | |
20 | cout<<"Usage: runit datafile"<<endl; | |
21 | return -1; | |
22 | } | |
9579103e | 23 | |
3539d83a | 24 | AliL3DigitRowData *digits = 0; |
25 | unsigned int ndigits=0; | |
26 | ||
9579103e | 27 | //Does all the file/data handling |
28 | AliL3MemHandler file; | |
3539d83a | 29 | |
30 | //Open the data file: | |
31 | if(!file.SetBinaryInput(argv[1])) | |
32 | { | |
33 | cerr<<"Error opening file "<<argv[1]<<endl; | |
34 | return -1; | |
35 | } | |
36 | ||
9579103e | 37 | //Store the data in memory, and get the pointer to it: |
38 | digits = file.CompBinary2Memory(ndigits); | |
39 | file.CloseBinaryInput(); | |
40 | ||
41 | //Storing all detector-spesific quantities, needed by the clusterfinder. | |
42 | AliL3Transform::Init(dirname(argv[1])); | |
43 | ||
44 | //The cluster finder itself. | |
45 | AliL3ClustFinderNew cf; | |
46 | ||
47 | //Init cluster finder | |
48 | cf.InitSlice(0,0,0,ndigits-1,10000); | |
de4bbf7d | 49 | //cf.SetXYError(0.2); |
50 | //cf.SetZError(0.3); | |
47c84a2b | 51 | cf.SetSTDOutput(kTRUE); |
de4bbf7d | 52 | cf.SetCalcErr(kTRUE); |
9579103e | 53 | |
47c84a2b | 54 | //Switch off deconvolution: |
55 | cf.SetDeconv(false); | |
56 | ||
3539d83a | 57 | //Allocate memory to store found spacepoints |
58 | AliL3MemHandler fpoints; | |
59 | AliL3SpacePointData *points=(AliL3SpacePointData*)fpoints.Allocate(10000*sizeof(AliL3SpacePointData)); | |
60 | cf.SetOutputArray(points); | |
61 | ||
3539d83a | 62 | //Give the data pointer to the cluster finder |
63 | cf.Read(ndigits,digits); | |
9579103e | 64 | |
3539d83a | 65 | //Start processing: |
66 | cf.ProcessDigits(); | |
67 | ||
68 | return 0; | |
69 | } | |
70 |