+#ifdef ENABLE_ALIMONITORPROCESS_HLT
+//_____________________________________________________________________________
+void AliMonitorProcess::CreateHLT(const char* fileName)
+{
+
+// create the HLT (Level3) object
+
+ if (fHLT) delete fHLT;
+
+ char name[256];
+ strcpy(name, fileName);
+ fHLT = new AliLevel3(name);
+ fHLT->Init("./", AliLevel3::kRaw, 1);
+
+ fHLT->SetClusterFinderParam(-1, -1, kTRUE);
+
+ Int_t phiSegments = 50;
+ Int_t etaSegments = 100;
+ Int_t trackletlength = 3;
+ Int_t tracklength = 20;//40 or 5
+ Int_t rowscopetracklet = 2;
+ Int_t rowscopetrack = 10;
+ Double_t minPtFit = 0;
+ Double_t maxangle = 0.1745;
+ Double_t goodDist = 5;
+ Double_t maxphi = 0.1;
+ Double_t maxeta = 0.1;
+ Double_t hitChi2Cut = 15;//100 or 15
+ Double_t goodHitChi2 = 5;//20 or 5
+ Double_t trackChi2Cut = 10;//50 or 10
+ fHLT->SetTrackerParam(phiSegments, etaSegments,
+ trackletlength, tracklength,
+ rowscopetracklet, rowscopetrack,
+ minPtFit, maxangle, goodDist, hitChi2Cut,
+ goodHitChi2, trackChi2Cut, 50, maxphi, maxeta, kTRUE);
+
+ fHLT->WriteFiles("./hlt/");
+}
+#endif // ENABLE_ALIMONITORPROCESS_HLT
+
+#ifdef ENABLE_ALIMONITORPROCESS_HLT
+//_____________________________________________________________________________
+void AliMonitorProcess::CreateHLTHough(const char* fileName)
+{
+
+// create the HLT Hough transform (L3Hough) object
+
+ if (fHLTHough) delete fHLTHough;
+
+ char name[256];
+ strcpy(name, fileName);
+
+ fHLTHough = new AliHLTHough();
+ fHLTHough->SetThreshold(4);
+ fHLTHough->SetTransformerParams(140,150,0.5,-1);
+ fHLTHough->SetPeakThreshold(9000,-1);// or 6000
+ fHLTHough->Init("./", kFALSE, 50, kFALSE,0,name);
+ fHLTHough->SetAddHistograms();
+ // fHLTHough->GetMaxFinder()->SetThreshold(14000);
+
+}
+#endif // ENABLE_ALIMONITORPROCESS_HLT
+
+#ifdef ENABLE_ALIMONITORPROCESS_HLT
+//_____________________________________________________________________________
+Bool_t AliMonitorProcess::ReconstructHLT(Int_t iEvent)
+{
+// run the HLT cluster and track finder
+
+ SetStatus(kRecHLT);
+
+ gSystem->Exec("rm -rf hlt");
+ gSystem->MakeDirectory("hlt");
+ if (!fHLT) return kFALSE;
+
+ fHLT->ProcessEvent(0, 35, iEvent);
+
+ // remove the event number from the file names
+ char command[256];
+ sprintf(command, "rename points_%d points hlt/*.raw", iEvent);
+ gSystem->Exec(command);
+ sprintf(command, "rename tracks_tr_%d tracks_tr hlt/*.raw", iEvent);
+ gSystem->Exec(command);
+ sprintf(command, "rename tracks_gl_%d tracks_gl hlt/*.raw", iEvent);
+ gSystem->Exec(command);
+ sprintf(command, "rename tracks_%d tracks hlt/*.raw", iEvent);
+ gSystem->Exec(command);
+ return kTRUE;
+}
+#endif // ENABLE_ALIMONITORPROCESS_HLT
+
+#ifdef ENABLE_ALIMONITORPROCESS_HLT
+//_____________________________________________________________________________
+Bool_t AliMonitorProcess::ReconstructHLTHough(Int_t iEvent)
+{
+// run the HLT Hough transformer
+
+ SetStatus(kRecHLT);
+
+ 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
+ AliHLTClusterFitter *fitter = new AliHLTClusterFitter("./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,AliHLTTransform::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 < AliHLTTransform::GetNPatches(); ipatch++)
+ {
+ // Read digits
+ fHLTHough->GetMemHandler(ipatch)->Free();
+ fHLTHough->GetMemHandler(ipatch)->Init(islice,ipatch);
+ AliHLTDigitRowData *digits = (AliHLTDigitRowData *)fHLTHough->GetMemHandler(ipatch)->AliAltroDigits2Memory(ndigits,iEvent);
+
+ fitter->Init(islice,ipatch);
+ fitter->SetInputData(digits);
+ fitter->FindClusters();
+ fitter->WriteClusters();
+ }
+ }
+
+ // Refit of the clusters
+ AliHLTVertex vertex;
+ //The seeds are the input tracks from circle HT
+ AliHLTTrackArray *tracks = fitter->GetSeeds();
+ AliHLTFitter *ft = new AliHLTFitter(&vertex,1);
+
+ ft->LoadClusters("./hlt/fitter/",iEvent,kFALSE);
+ for(Int_t i=0; i<tracks->GetNTracks(); i++)
+ {
+ AliHLTTrack *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 // ENABLE_ALIMONITORPROCESS_HLT