3 #include "AliHLTStandardIncludes.h"
4 #include "AliHLTRootTypes.h"
6 #include "AliHLTTransform.h"
7 #include "AliHLTRawDataFileHandler.h"
8 #include "AliHLTSpacePointData.h"
9 #include "AliHLTClustFinderNew.h"
10 #include "AliHLTConfMapper.h"
11 #include "AliHLTVertex.h"
23 struct stat stat_results;
26 //This program does the clusterfinding and the tracking.
27 int main(Int_t argc,Char_t **argv)
36 cout<<"Usage: tpcbeamtesttracker filename path_to_cosmics"<<endl;
40 sprintf(cfile,"%s",argv[1]);
41 sprintf(path,"%s",argv[2]);
44 AliHLTTransform::Init("./l3-cosmics-transform.config");
45 AliHLTTransform::SetZeroSup(5);
46 AliHLTRawDataFileHandler *f=new AliHLTRawDataFileHandler();
50 f->SetMappingFile("remap.txt");
56 f->SetRawPedestalsInput("./pedout.out");
57 f->ReadRawPedestalsInput();
60 sprintf(pname,"%s/%s",path,cfile);
62 f->SetRawInput(pname);
65 if (stat(pname, &stat_results) != 0){
68 Char_t *t=new Char_t[stat_results.st_size];
69 ifstream *fin=new ifstream(pname,fstream::binary);
70 fin->read(t,stat_results.st_size);
72 f->ReadRawInputPointer(t);
76 AliHLTDigitRowData *data=(AliHLTDigitRowData*)f->RawData2Memory(nrows);
78 AliHLTMemHandler *out = new AliHLTMemHandler();
79 sprintf(fname,"./%s-digits_%d_%d.raw",cfile,slice,patch);
80 out->SetBinaryOutput(fname);
81 out->Memory2Binary(nrows,data);
82 out->CloseBinaryOutput();
85 AliHLTMemHandler *mem=new AliHLTMemHandler();
87 UInt_t maxclusters=100000;
88 UInt_t pointsize = maxclusters*sizeof(AliHLTSpacePointData);
89 AliHLTSpacePointData *points = (AliHLTSpacePointData*)mem->Allocate(pointsize);
92 AliHLTClustFinderNew *cf = new AliHLTClustFinderNew();
93 cf->InitSlice(slice,patch,maxclusters);
94 cf->SetMatchWidth(10);
95 cf->SetSTDOutput(kTRUE);
98 cf->SetDeconv(kFALSE);
99 cf->SetCalcErr(kTRUE);
100 cf->SetOutputArray(points);
101 cf->Read(nrows,data);
103 Int_t npoints = cf->GetNumberOfClusters();
105 sprintf(fname,"./%s-points_%d_%d.raw",cfile,slice,patch);
106 out->Transform(npoints,points,slice);
107 out->SetBinaryOutput(fname);
108 out->Memory2Binary(npoints,points);
109 out->CloseBinaryOutput();