3 /* Example of how to use the AliL3ClusterFitter to fit clusters
4 to the track candidates given as a AliL3TrackArray.
6 The path "path" should contain the link to the digitsfile,
7 and the directories called fitter (for the results) and hough
8 (for the track files). For NEWIO, make sure that the file
9 TPC.Digits.root is in the path!
11 Also provide the neccessary parameters in SetFitParameters.C.
13 RUN with ALIROOT (not ROOT), no other method is
17 void deconvclusters(char *path,int minslice=0,int maxslice=35,int nevent=1)
20 AliL3Transform::Init(path,kTRUE);
23 AliL3FileHandler *file = new AliL3FileHandler();
26 sprintf(filename,"%s/digitfile.root",path);
28 file->SetAliInput(filename);
31 AliL3ClusterFitter *fitter = new AliL3ClusterFitter(path);
34 gROOT->LoadMacro("SetFitParameters.C");
35 SetFitParameters(fitter);
38 int rowrange[2] = {0,AliL3Transform::GetNRows()-1};
40 for(int ev=0; ev<nevent; ev++)
42 fitter->LoadSeeds(rowrange,kFALSE,ev);//Takes input from global hough tracks
44 for(int slice=minslice; slice<=maxslice; slice++)
47 cout<<"Processing event "<<ev<<" slice "<<slice<<" patch "<<patch<<endl;
48 AliL3DigitRowData *digits = (AliL3DigitRowData*)file->AliAltroDigits2Memory(ndigits,ev);
50 fitter->Init(slice,patch);
51 fitter->SetInputData(digits);
53 fitter->FindClusters();
55 fitter->WriteClusters();
61 //If you want a refit of the clusters;-------------------------
63 AliL3TrackArray *tracks = fitter->GetSeeds(); //The seeds are the input tracks from circle HT
64 AliL3Fitter *ft = new AliL3Fitter(&vertex,1);
65 sprintf(filename,"%s/fitter/",path);
66 ft->LoadClusters(filename,0,kTRUE);
67 for(Int_t i=0; i<tracks->GetNTracks(); i++)
69 track = tracks->GetCheckedTrack(i);
71 if(track->GetNHits() < 40) continue;
72 ft->SortTrackClusters(track);
74 ft->UpdateTrack(track);
77 //-------------------------------------------------------------
79 fitter->WriteTracks(5); //Write the final tracks
80 file->FreeDigitsTree();
86 void deconvlocally(char *path,int minslice=0,int maxslice=17)
89 AliL3Transform::Init(path,kTRUE);
92 AliL3FileHandler *file = new AliL3FileHandler();
95 sprintf(filename,"%s/digitfile.root",path);
97 file->SetAliInput(filename);
100 AliL3ClusterFitter *fitter = new AliL3ClusterFitter(path);
102 char macroname[1024];
103 sprintf(macroname,"%s/SetFitParameters.C",path);
104 gROOT->LoadMacro(macroname);
105 SetFitParameters(fitter);
109 for(int slice=minslice; slice<=maxslice; slice++)
111 file->Init(slice,patch);
112 cout<<"Processing slice "<<slice<<" patch "<<patch<<endl;
113 AliL3DigitRowData *digits = (AliL3DigitRowData*)file->AliAltroDigits2Memory(ndigits);
115 fitter->Init(slice,patch);
116 fitter->LoadLocalSegments();
118 fitter->SetInputData(digits);
120 fitter->FindClusters();
121 fitter->WriteClusters();
127 fitter->WriteTracks(5);