2 Author: Constantin Loizides <loizides@ikf.physik.uni-frankfurt.de>
7 #include "AliL3RootTypes.h"
8 #include "AliL3Transform.h"
9 #include "AliL3ClustFinderNew.h"
10 #include "AliL3MemHandler.h"
11 #include "AliL3SpacePointData.h"
12 #include "AliL3Logger.h"
14 #define MAXCLUSTER 15000
16 Example program how to run the "standalone" clusterfinder.
18 Import: give patch=-1 for one-patch slices.
21 int main(int argc,char **argv)
29 //l.Set(AliL3Logger::kAll);
34 cout<<"Usage: runit datafile [slice] [patch] [match] [threshold]"<<endl;
50 AliL3DigitRowData *digits = 0;
53 //Storing all specific quantities, needed by the Cluster Finder.
55 strcpy(fname,argv[1]);
56 AliL3Transform::Init(dirname(fname));
57 strcpy(fname,argv[1]);
59 //Does all the file/data handling
62 //Give slice and patch information (see filename convention)
63 if((patch>=0)&&(patch<6)) file.Init(slice,patch);
65 Int_t srows[2]={0,175};
67 file.Init(slice,patch,srows);
71 if(!file.SetBinaryInput(fname))
73 cerr<<"Error opening file "<<fname<<endl;
77 //Store the data in memory, and get the pointer to it:
78 digits = file.CompBinary2Memory(nrows);
79 file.CloseBinaryInput();
81 //The cluster finder itself.
82 AliL3ClustFinderNew cf;
85 cf.InitSlice(slice,patch,0,nrows-1,MAXCLUSTER);
90 cf.SetSTDOutput(kTRUE);
93 //Switch off deconvolution:
96 //Allocate memory to store found spacepoints
97 AliL3MemHandler fpoints;
98 AliL3SpacePointData *points=(AliL3SpacePointData*)fpoints.Allocate(MAXCLUSTER*sizeof(AliL3SpacePointData));
99 cf.SetOutputArray(points);
101 //Give the data pointer to the cluster finder
102 cf.Read(nrows,digits);