]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/programs/runvhdlcf.cxx
Splitting raw data libs
[u/mrichter/AliRoot.git] / HLT / programs / runvhdlcf.cxx
1 // $Id$
2    
3 // Author: Constantin Loizides <loizides@ikf.uni-frankfurt.de>
4 //*-- Copyright &copy ALICE HLT Group
5
6
7 #include "AliL3StandardIncludes.h"
8
9 #include "AliL3RootTypes.h"
10 #include "AliL3Logging.h"
11 #include "AliL3Logger.h"
12 #include "AliL3MemHandler.h"
13 #include "AliL3Transform.h"
14 #include "AliL3VHDLClusterFinder.h"
15 #include "AliL3AltroMemHandler.h"
16
17
18 #if __GNUC__ == 3
19 using namespace std;
20 #else
21 #include <stream.h>
22 #include <libgen.h>
23 #include <stdlib.h>
24 #endif
25
26
27 /**
28 Example program how to run the vhdl clusterfinder.
29 */
30
31 int main(Int_t argc,Char_t **argv)
32 {
33   Int_t slice=0;
34   Int_t patch=0;
35   Int_t fm=4;
36   Int_t th=10;
37   Bool_t de=kFALSE;
38
39   AliL3Logger l;
40   l.Set(AliL3Logger::kAll);
41   l.UseStderr();
42   //l.UseStdout();
43   //l.UseStream();
44
45   if(argc<2){
46     cout<<"Usage: runvhdlcf altrodatafile [slice] [patch] [matchwidth] [threshold] [deconv]"<<endl;
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   }
61   if (argc>6) {
62     de=kTRUE;
63   }
64
65   /*
66   //reading transformer config file
67   Char_t fname[1024];
68   strcpy(fname,argv[1]);
69   AliL3Transform::Init(dirname(fname)); 
70   strcpy(fname,argv[1]);
71   */
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
79   AliL3VHDLClusterFinder cf;
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);
89   cf.SetDeconv(de);
90   
91   //start processing data
92   cf.ProcessDigits();
93
94   if(afile) fclose(afile);
95   exit(1);
96 }
97
98
99
100
101