3 // Author: Constantin Loizides <loizides@ikf.uni-frankfurt.de>
4 //*-- Copyright © ALICE HLT Group
8 Example program how to run the "standalone" clusterfinder.
10 Important: give patch=-1 for one-patch slices.
14 #include "AliL3StandardIncludes.h"
16 #include "AliL3Logging.h"
17 #include "AliL3Logger.h"
18 #include "AliL3RootTypes.h"
19 #include "AliL3Transform.h"
20 #include "AliL3ClustFinderNew.h"
21 #include "AliL3MemHandler.h"
22 #include "AliL3SpacePointData.h"
32 #define MAXCLUSTER 25000
34 int main(Int_t argc,Char_t **argv)
43 l.Set(AliL3Logger::kAll);
49 cout<<"Usage: runit datafile [slice] [patch] [match] [threshold] [deconv]"<<endl;
68 AliL3DigitRowData *digits = 0;
71 //reading transformer init file
73 strcpy(fname,argv[1]);
74 AliL3Transform::Init(dirname(fname));
75 strcpy(fname,argv[1]);
77 //Does all the file/data handling
80 //Give slice and patch information (see filename convention)
81 if((patch>=0)&&(patch<6)) file.Init(slice,patch);
83 Int_t srows[2]={0,AliL3Transform::GetLastRow(5)};
85 file.Init(slice,patch,srows);
89 if(!file.SetBinaryInput(fname))
91 cerr<<"Error opening file "<<fname<<endl;
95 //Store the data in memory, and get the pointer to it:
96 digits = file.CompBinary2Memory(nrows);
97 file.CloseBinaryInput();
99 //The cluster finder itself.
100 AliL3ClustFinderNew cf;
102 //Init cluster finder
103 cf.InitSlice(slice,patch,0,nrows-1,MAXCLUSTER);
104 cf.SetMatchWidth(fm);
106 //cf.SetXYError(0.2);
108 cf.SetSTDOutput(kTRUE);
109 cf.SetCalcErr(kTRUE);
110 cf.SetDeconv(de); //standard is false
112 //Allocate memory to store found spacepoints
113 AliL3MemHandler fpoints;
114 AliL3SpacePointData *points=(AliL3SpacePointData*)fpoints.Allocate(MAXCLUSTER*sizeof(AliL3SpacePointData));
115 cf.SetOutputArray(points);
117 //Give the data pointer to the cluster finder
118 cf.Read(nrows,digits);