+//_____________________________________________________________________________
+Bool_t AliMonitorProcess::ReconstructHLTHough(
+#ifdef ALI_HLT
+ Int_t iEvent
+#else
+ Int_t /* iEvent */
+#endif
+)
+{
+// run the HLT Hough transformer
+
+ SetStatus(kRecHLT);
+
+#ifndef ALI_HLT
+ Warning("ReconstructHLTHough", "the code was compiled without HLT support");
+ return kTRUE;
+
+#else
+ gSystem->Exec("rm -rf hlt/hough");
+ gSystem->MakeDirectory("hlt/hough");
+ gSystem->Exec("rm -rf hlt/fitter");
+ gSystem->MakeDirectory("hlt/fitter");
+ if (!fHLTHough) return kFALSE;
+
+ // fHLTHough->Process(0, 35);
+ // Loop over TPC sectors and process the data
+ for(Int_t i=0; i<=35; i++)
+ {
+ fHLTHough->ReadData(i,iEvent);
+ fHLTHough->Transform();
+ // if(fHLTHough->fAddHistograms)
+ fHLTHough->AddAllHistograms();
+ fHLTHough->FindTrackCandidates();
+ fHLTHough->AddTracks();
+ }
+ fHLTHough->WriteTracks("./hlt/hough");
+
+ // Run cluster fitter
+ AliL3ClusterFitter *fitter = new AliL3ClusterFitter("./hlt");
+
+ // Set debug flag for the cluster fitter
+ // fitter->Debug();
+
+ // Setting fitter parameters
+ fitter->SetInnerWidthFactor(1,1.5);
+ fitter->SetOuterWidthFactor(1,1.5);
+ fitter->SetNmaxOverlaps(5);
+
+ //fitter->SetChiSqMax(5,kFALSE); //isolated clusters
+ fitter->SetChiSqMax(5,kTRUE); //overlapping clusters
+
+ Int_t rowrange[2] = {0,AliL3Transform::GetNRows()-1};
+
+ // Takes input from global hough tracks produced by HT
+ fitter->LoadSeeds(rowrange,kFALSE,iEvent);
+
+ UInt_t ndigits;
+
+ for(Int_t islice = 0; islice <= 35; islice++)
+ {
+ for(Int_t ipatch = 0; ipatch < AliL3Transform::GetNPatches(); ipatch++)
+ {
+ // Read digits
+ fHLTHough->GetMemHandler(ipatch)->Free();
+ fHLTHough->GetMemHandler(ipatch)->Init(islice,ipatch);
+ AliL3DigitRowData *digits = (AliL3DigitRowData *)fHLTHough->GetMemHandler(ipatch)->AliAltroDigits2Memory(ndigits,iEvent);
+
+ fitter->Init(islice,ipatch);
+ fitter->SetInputData(digits);
+ fitter->FindClusters();
+ fitter->WriteClusters();
+ }
+ }
+
+ // Refit of the clusters
+ AliL3Vertex vertex;
+ //The seeds are the input tracks from circle HT
+ AliL3TrackArray *tracks = fitter->GetSeeds();
+ AliL3Fitter *ft = new AliL3Fitter(&vertex,1);
+
+ ft->LoadClusters("./hlt/fitter/",iEvent,kFALSE);
+ for(Int_t i=0; i<tracks->GetNTracks(); i++)
+ {
+ AliL3Track *track = tracks->GetCheckedTrack(i);
+ if(!track) continue;
+ if(track->GetNHits() < 20) continue;
+ ft->SortTrackClusters(track);
+ ft->FitHelix(track);
+ track->UpdateToFirstPoint();
+ }
+ delete ft;
+
+ //Write the final tracks
+ fitter->WriteTracks(20);
+
+ delete fitter;
+
+ // remove the event number from the file names
+ char command[256];
+ sprintf(command, "rename tracks_%d tracks hlt/hough/*.raw", iEvent);
+ gSystem->Exec(command);
+ sprintf(command, "rename tracks_%d tracks hlt/fitter/*.raw", iEvent);
+ gSystem->Exec(command);
+ sprintf(command, "rename points_%d points hlt/fitter/*.raw", iEvent);
+ gSystem->Exec(command);
+ return kTRUE;
+#endif
+}