3 // Author: Constantin Loizides <loizides@ikf.physik.uni-frankfurt.de>
9 #include "AliL3RootTypes.h"
10 #include "AliL3Transform.h"
11 #include "AliL3ClustFinderNew.h"
12 #include "AliL3MemHandler.h"
13 #include "AliL3SpacePointData.h"
14 #include "AliL3Logging.h"
15 #include "AliL3Logger.h"
17 #define MAXCLUSTER 15000
20 Example program how to run the "standalone" clusterfinder.
22 Import: give patch=-1 for one-patch slices.
25 int main(int argc,char **argv)
33 l.Set(AliL3Logger::kAll);
39 cout<<"Usage: runit datafile [slice] [patch] [match] [threshold]"<<endl;
55 AliL3DigitRowData *digits = 0;
58 //Storing all specific quantities, needed by the Cluster Finder.
60 strcpy(fname,argv[1]);
61 AliL3Transform::Init(dirname(fname));
62 strcpy(fname,argv[1]);
64 //Does all the file/data handling
67 //Give slice and patch information (see filename convention)
68 if((patch>=0)&&(patch<6)) file.Init(slice,patch);
70 Int_t srows[2]={0,175};
72 file.Init(slice,patch,srows);
76 if(!file.SetBinaryInput(fname))
78 cerr<<"Error opening file "<<fname<<endl;
82 //Store the data in memory, and get the pointer to it:
83 digits = file.CompBinary2Memory(nrows);
84 file.CloseBinaryInput();
86 //The cluster finder itself.
87 AliL3ClustFinderNew cf;
90 cf.InitSlice(slice,patch,0,nrows-1,MAXCLUSTER);
95 cf.SetSTDOutput(kTRUE);
98 //Switch off deconvolution:
101 //Allocate memory to store found spacepoints
102 AliL3MemHandler fpoints;
103 AliL3SpacePointData *points=(AliL3SpacePointData*)fpoints.Allocate(MAXCLUSTER*sizeof(AliL3SpacePointData));
104 cf.SetOutputArray(points);
106 //Give the data pointer to the cluster finder
107 cf.Read(nrows,digits);