]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Sample program to run VHDL cluster finder.
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 14 Jun 2002 21:47:55 +0000 (21:47 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 14 Jun 2002 21:47:55 +0000 (21:47 +0000)
HLT/programs/Makefile
HLT/programs/runvhdlcf.cxx [new file with mode: 0644]

index f07aae7dfd8164faffc2d7825e1923197f9a0a2a..a0ea4a71e0e4528514fc6827f0228d71ae19b464 100644 (file)
@@ -66,7 +66,7 @@ CXXFLAGS = -O2 -Wall -ggdb $(INCLUDES)
 LDFLAGS  = -O2 $(LIBS)
 
 
-PRGS   = runit read speedtest convbin gettransform
+PRGS   = runit read speedtest convbin gettransform runvhdlcf
 
 
 all : $(PRGS)
diff --git a/HLT/programs/runvhdlcf.cxx b/HLT/programs/runvhdlcf.cxx
new file mode 100644 (file)
index 0000000..44ec81b
--- /dev/null
@@ -0,0 +1,81 @@
+/* $Id$
+   Author: Constantin Loizides <loizides@ikf.physik.uni-frankfurt.de>
+*/
+
+#include <stream.h>
+#include <libgen.h>
+#include <stdlib.h>
+#include "AliL3RootTypes.h"
+#include "AliL3Transform.h"
+#include "AliL3VHDLClusterFinder.h"
+#include "AliL3AltroMemHandler.h"
+#include "AliL3Logger.h"
+
+/**
+ Example program how to run the vhdl clusterfinder.
+*/
+
+int main(int argc,char **argv)
+{
+  Int_t slice=0;
+  Int_t patch=0;
+  Int_t fm=4;
+  Int_t th=10;
+
+  //AliL3Logger l;
+  //l.Set(AliL3Logger::kAll);
+  //l.UseStdout();
+  //l.UseStream();
+
+  if(argc<2){
+    cout<<"Usage: runvhdlcf altrodatafile [slice] [patch] [matchwidth] [threshold]"<<endl;
+    return -1;
+  }
+  if (argc>2) {
+    slice=atoi(argv[2]);
+  }
+  if (argc>3) {
+    patch=atoi(argv[3]);
+  }
+  if (argc>4) {
+    fm=atoi(argv[4]);
+  }
+  if (argc>5) {
+    th=atoi(argv[5]);
+  }
+
+  //Storing all specific quantities, needed by the Cluster Finder.
+  //Char_t fname[1024];
+  //strcpy(fname,argv[1]);
+  //AliL3Transform::Init(dirname(fname)); 
+  //strcpy(fname,argv[1]);
+
+  FILE *afile=fopen(argv[1],"r");
+  if(!afile) {
+    cerr << "Can't open file " << argv[1] << endl;
+    exit(1);
+  }
+
+  AliL3VHDLClusterFinder cf;
+  cf.SetASCIIInput(afile);
+
+  //set cluster finder parameters
+  cf.SetMatchWidth(fm);
+  cf.SetThreshold(th);
+  //cf.SetXYError(0.2);
+  //cf.SetZError(0.3);
+  cf.SetSTDOutput(kTRUE);
+  cf.SetCalcErr(kTRUE);
+  //cf.SetDeconv(kFALSE);
+  
+  //start processing data
+  cf.ProcessDigits();
+
+  if(afile) fclose(afile);
+  exit(1);
+}
+
+
+
+
+