3 // Author: Constantin Loizides <loizides@ikf.physik.uni-frankfurt.de>
6 Example program how to run the "standalone" clusterfinder.
8 Important: give patch=-1 for one-patch slices.
15 #include "AliL3RootTypes.h"
16 #include "AliL3Transform.h"
17 #include "AliL3ClustFinderNew.h"
18 #include "AliL3MemHandler.h"
19 #include "AliL3SpacePointData.h"
20 #include "AliL3Logging.h"
21 #include "AliL3Logger.h"
23 #define MAXCLUSTER 25000
25 int main(int argc,char **argv)
34 l.Set(AliL3Logger::kAll);
40 cout<<"Usage: runit datafile [slice] [patch] [match] [threshold] [deconv]"<<endl;
59 AliL3DigitRowData *digits = 0;
62 //reading transformer init file
64 strcpy(fname,argv[1]);
65 AliL3Transform::Init(dirname(fname));
66 strcpy(fname,argv[1]);
68 //Does all the file/data handling
71 //Give slice and patch information (see filename convention)
72 if((patch>=0)&&(patch<6)) file.Init(slice,patch);
74 Int_t srows[2]={0,AliL3Transform::GetLastRow(5)};
76 file.Init(slice,patch,srows);
80 if(!file.SetBinaryInput(fname))
82 cerr<<"Error opening file "<<fname<<endl;
86 //Store the data in memory, and get the pointer to it:
87 digits = file.CompBinary2Memory(nrows);
88 file.CloseBinaryInput();
90 //The cluster finder itself.
91 AliL3ClustFinderNew cf;
94 cf.InitSlice(slice,patch,0,nrows-1,MAXCLUSTER);
99 cf.SetSTDOutput(kTRUE);
100 cf.SetCalcErr(kTRUE);
101 cf.SetDeconv(de); //standard is false
103 //Allocate memory to store found spacepoints
104 AliL3MemHandler fpoints;
105 AliL3SpacePointData *points=(AliL3SpacePointData*)fpoints.Allocate(MAXCLUSTER*sizeof(AliL3SpacePointData));
106 cf.SetOutputArray(points);
108 //Give the data pointer to the cluster finder
109 cf.Read(nrows,digits);