]>
Commit | Line | Data |
---|---|---|
2f3824aa | 1 | // $Id$ |
2 | ||
3e87ef69 | 3 | // Author: Constantin Loizides <loizides@ikf.uni-frankfurt.de> |
02f030e3 | 4 | //*-- Copyright © ALICE HLT Group |
2f3824aa | 5 | |
8ec6d140 | 6 | |
4aa41877 | 7 | #include "AliHLTStandardIncludes.h" |
3e87ef69 | 8 | |
4aa41877 | 9 | #include "AliHLTRootTypes.h" |
10 | #include "AliHLTLogging.h" | |
11 | #include "AliHLTLogger.h" | |
12 | #include "AliHLTMemHandler.h" | |
13 | #include "AliHLTTransform.h" | |
14 | #include "AliHLTVHDLClusterFinder.h" | |
15 | #include "AliHLTAltroMemHandler.h" | |
3e87ef69 | 16 | |
17 | ||
0bd0c1ef | 18 | #if __GNUC__ == 3 |
3e87ef69 | 19 | using namespace std; |
20 | #else | |
21 | #include <stream.h> | |
22 | #include <libgen.h> | |
23 | #include <stdlib.h> | |
24 | #endif | |
25 | ||
8ec6d140 | 26 | |
27 | /** | |
2f3824aa | 28 | Example program how to run the vhdl clusterfinder. |
8ec6d140 | 29 | */ |
30 | ||
3e87ef69 | 31 | int main(Int_t argc,Char_t **argv) |
8ec6d140 | 32 | { |
33 | Int_t slice=0; | |
34 | Int_t patch=0; | |
35 | Int_t fm=4; | |
36 | Int_t th=10; | |
d5e6cede | 37 | Bool_t de=kFALSE; |
8ec6d140 | 38 | |
4aa41877 | 39 | AliHLTLogger l; |
40 | l.Set(AliHLTLogger::kAll); | |
2f3824aa | 41 | l.UseStderr(); |
8ec6d140 | 42 | //l.UseStdout(); |
43 | //l.UseStream(); | |
44 | ||
45 | if(argc<2){ | |
d5e6cede | 46 | cout<<"Usage: runvhdlcf altrodatafile [slice] [patch] [matchwidth] [threshold] [deconv]"<<endl; |
8ec6d140 | 47 | return -1; |
48 | } | |
49 | if (argc>2) { | |
50 | slice=atoi(argv[2]); | |
51 | } | |
52 | if (argc>3) { | |
53 | patch=atoi(argv[3]); | |
54 | } | |
55 | if (argc>4) { | |
56 | fm=atoi(argv[4]); | |
57 | } | |
58 | if (argc>5) { | |
59 | th=atoi(argv[5]); | |
60 | } | |
d5e6cede | 61 | if (argc>6) { |
62 | de=kTRUE; | |
63 | } | |
8ec6d140 | 64 | |
d5e6cede | 65 | /* |
66 | //reading transformer config file | |
67 | Char_t fname[1024]; | |
68 | strcpy(fname,argv[1]); | |
4aa41877 | 69 | AliHLTTransform::Init(dirname(fname)); |
d5e6cede | 70 | strcpy(fname,argv[1]); |
71 | */ | |
8ec6d140 | 72 | |
73 | FILE *afile=fopen(argv[1],"r"); | |
74 | if(!afile) { | |
75 | cerr << "Can't open file " << argv[1] << endl; | |
76 | exit(1); | |
77 | } | |
78 | ||
4aa41877 | 79 | AliHLTVHDLClusterFinder cf; |
8ec6d140 | 80 | cf.SetASCIIInput(afile); |
81 | ||
82 | //set cluster finder parameters | |
83 | cf.SetMatchWidth(fm); | |
84 | cf.SetThreshold(th); | |
85 | //cf.SetXYError(0.2); | |
86 | //cf.SetZError(0.3); | |
87 | cf.SetSTDOutput(kTRUE); | |
88 | cf.SetCalcErr(kTRUE); | |
d5e6cede | 89 | cf.SetDeconv(de); |
8ec6d140 | 90 | |
91 | //start processing data | |
92 | cf.ProcessDigits(); | |
93 | ||
94 | if(afile) fclose(afile); | |
95 | exit(1); | |
96 | } | |
97 | ||
98 | ||
99 | ||
100 | ||
101 |