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