]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/programs/runit.cxx
Minor changes to use new AliL3ClusterFinder class.
[u/mrichter/AliRoot.git] / HLT / programs / runit.cxx
CommitLineData
9579103e 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"
3539d83a 8#include "AliL3ClustFinderNew.h"
9#include "AliL3MemHandler.h"
10#include "AliL3SpacePointData.h"
11
9579103e 12/**
13 Example program how to run the "standalone" clusterfinder.
14*/
15
3539d83a 16int main(int argc,char **argv)
17{
18 if(argc!=2)
19 {
20 cout<<"Usage: runit datafile"<<endl;
21 return -1;
22 }
9579103e 23
3539d83a 24 AliL3DigitRowData *digits = 0;
25 unsigned int ndigits=0;
26
9579103e 27 //Does all the file/data handling
28 AliL3MemHandler file;
3539d83a 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
9579103e 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);
47c84a2b 51 cf.SetSTDOutput(kTRUE);
9579103e 52
47c84a2b 53 //Switch off deconvolution:
54 cf.SetDeconv(false);
55
3539d83a 56 //Allocate memory to store found spacepoints
57 AliL3MemHandler fpoints;
58 AliL3SpacePointData *points=(AliL3SpacePointData*)fpoints.Allocate(10000*sizeof(AliL3SpacePointData));
59 cf.SetOutputArray(points);
60
3539d83a 61 //Give the data pointer to the cluster finder
62 cf.Read(ndigits,digits);
9579103e 63
3539d83a 64 //Start processing:
65 cf.ProcessDigits();
66
67 return 0;
68}
69