]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/programs/runit.cxx
Minor changes to use new AliL3ClusterFinder class.
[u/mrichter/AliRoot.git] / HLT / programs / runit.cxx
1 /* $Id$
2    Author: Constantin Loizides <loizides@ikf.physik.uni-frankfurt.de>
3 */
4
5 #include <stream.h>
6 #include <libgen.h>
7 #include "AliL3Transform.h"
8 #include "AliL3ClustFinderNew.h"
9 #include "AliL3MemHandler.h"
10 #include "AliL3SpacePointData.h"
11
12 /**
13  Example program how to run the "standalone" clusterfinder.
14 */
15
16 int main(int argc,char **argv)
17 {
18   if(argc!=2)
19     {
20       cout<<"Usage: runit datafile"<<endl;
21       return -1;
22     }
23
24   AliL3DigitRowData *digits = 0;
25   unsigned int ndigits=0;
26   
27   //Does all the file/data handling  
28   AliL3MemHandler file; 
29
30   //Open the data file:
31   if(!file.SetBinaryInput(argv[1]))
32     {
33       cerr<<"Error opening file "<<argv[1]<<endl;
34       return -1;
35     }
36
37   //Store the data in memory, and get the pointer to it:
38   digits = file.CompBinary2Memory(ndigits);
39   file.CloseBinaryInput();
40
41   //Storing all detector-spesific quantities, needed by the clusterfinder.
42   AliL3Transform::Init(dirname(argv[1])); 
43
44   //The cluster finder itself.
45   AliL3ClustFinderNew cf; 
46
47   //Init cluster finder
48   cf.InitSlice(0,0,0,ndigits-1,10000);
49   cf.SetXYError(0.2);
50   cf.SetZError(0.3);
51   cf.SetSTDOutput(kTRUE);
52
53   //Switch off deconvolution:
54   cf.SetDeconv(false);
55   
56   //Allocate memory to store found spacepoints 
57   AliL3MemHandler fpoints;
58   AliL3SpacePointData *points=(AliL3SpacePointData*)fpoints.Allocate(10000*sizeof(AliL3SpacePointData));
59   cf.SetOutputArray(points);
60
61   //Give the data pointer to the cluster finder
62   cf.Read(ndigits,digits);
63
64   //Start processing:
65   cf.ProcessDigits();
66   
67   return 0;
68 }
69