Minor changes at new Top Makefile.
[u/mrichter/AliRoot.git] / HLT / programs / runvhdlcf.cxx
CommitLineData
8ec6d140 1/* $Id$
2 Author: Constantin Loizides <loizides@ikf.physik.uni-frankfurt.de>
3*/
4
5#include <stream.h>
6#include <libgen.h>
7#include <stdlib.h>
8#include "AliL3RootTypes.h"
9#include "AliL3Transform.h"
10#include "AliL3VHDLClusterFinder.h"
11#include "AliL3AltroMemHandler.h"
12#include "AliL3Logger.h"
13
14/**
15 Example program how to run the vhdl clusterfinder.
16*/
17
18int main(int argc,char **argv)
19{
20 Int_t slice=0;
21 Int_t patch=0;
22 Int_t fm=4;
23 Int_t th=10;
24
25 //AliL3Logger l;
26 //l.Set(AliL3Logger::kAll);
27 //l.UseStdout();
28 //l.UseStream();
29
30 if(argc<2){
31 cout<<"Usage: runvhdlcf altrodatafile [slice] [patch] [matchwidth] [threshold]"<<endl;
32 return -1;
33 }
34 if (argc>2) {
35 slice=atoi(argv[2]);
36 }
37 if (argc>3) {
38 patch=atoi(argv[3]);
39 }
40 if (argc>4) {
41 fm=atoi(argv[4]);
42 }
43 if (argc>5) {
44 th=atoi(argv[5]);
45 }
46
47 //Storing all specific quantities, needed by the Cluster Finder.
48 //Char_t fname[1024];
49 //strcpy(fname,argv[1]);
50 //AliL3Transform::Init(dirname(fname));
51 //strcpy(fname,argv[1]);
52
53 FILE *afile=fopen(argv[1],"r");
54 if(!afile) {
55 cerr << "Can't open file " << argv[1] << endl;
56 exit(1);
57 }
58
59 AliL3VHDLClusterFinder cf;
60 cf.SetASCIIInput(afile);
61
62 //set cluster finder parameters
63 cf.SetMatchWidth(fm);
64 cf.SetThreshold(th);
65 //cf.SetXYError(0.2);
66 //cf.SetZError(0.3);
67 cf.SetSTDOutput(kTRUE);
68 cf.SetCalcErr(kTRUE);
69 //cf.SetDeconv(kFALSE);
70
71 //start processing data
72 cf.ProcessDigits();
73
74 if(afile) fclose(afile);
75 exit(1);
76}
77
78
79
80
81