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