Sample program for using the simple fast cluster finder.
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 16 Apr 2002 13:04:21 +0000 (13:04 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 16 Apr 2002 13:04:21 +0000 (13:04 +0000)
HLT/programs/runit.cxx [new file with mode: 0644]

diff --git a/HLT/programs/runit.cxx b/HLT/programs/runit.cxx
new file mode 100644 (file)
index 0000000..681b7d3
--- /dev/null
@@ -0,0 +1,58 @@
+#include "stream.h"
+#include "AliL3ClustFinderNew.h"
+#include "AliL3MemHandler.h"
+#include "AliL3SpacePointData.h"
+
+//Example program how to run the "standalone" clusterfinder.
+int main(int argc,char **argv)
+{
+  if(argc!=2)
+    {
+      cout<<"Usage: runit datafile"<<endl;
+      return -1;
+    }
+  
+  AliL3DigitRowData *digits = 0;
+  unsigned int ndigits=0;
+  
+  AliL3MemHandler file; //Does all the file/data handling
+  AliL3Transform transform; //Storing all detector-spesific quantities, needed by the clusterfinder.
+  AliL3ClustFinderNew cf(&transform); //The cluster finder itself.
+
+  //Open the data file:
+  if(!file.SetBinaryInput(argv[1]))
+    {
+      cerr<<"Error opening file "<<argv[1]<<endl;
+      return -1;
+    }
+
+  //Allocate memory to store found spacepoints 
+  AliL3MemHandler fpoints;
+  AliL3SpacePointData *points=(AliL3SpacePointData*)fpoints.Allocate(10000*sizeof(AliL3SpacePointData));
+  cf.SetOutputArray(points);
+
+  //Store the data in memory, and get the pointer to it:
+  digits = file.CompBinary2Memory(ndigits);
+  file.CloseBinaryInput();
+  
+  //Switch off deconvolution:
+  cf.SetDeconv(false);
+  
+  //Init cluster finder
+  cf.InitSlice(0,0,0,20,10000);
+  cf.SetXYError(0.2);
+  cf.SetZError(0.3);
+
+  //Give the data pointer to the cluster finder
+  cf.Read(ndigits,digits);
+  
+  //Start processing:
+  cf.ProcessDigits();
+  
+  return 0;
+}
+
+
+
+
+