New class AliESDEvent, backward compatibility with the old AliESD (Christian)
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking / AliHLTTPCHoughTracker.cxx
CommitLineData
a0cef3e1 1// $Id$
2// origin: src/AliL3TPCtracker.cxx 1.2 Fri Jun 10 04:25:00 2005 UTC by cvetan
3
4/**************************************************************************
5 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * *
7 * Author: The ALICE Off-line Project. *
8 * Contributors are mentioned in the code where appropriate. *
9 * *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
18
0f2fc60b 19/** @file AliHLTTPCHoughTracker.cxx
20 @author Cvetan Cheshkov
21 @date
22 @brief Implementation of the HLT TPC hough transform tracker. */
23
a0cef3e1 24//-------------------------------------------------------------------------
25// Implementation of the HLT TPC hough transform tracker class
26//
27// It reads directly TPC digits using runloader and runs the HT
28// algorithm over them.
29// It stores the reconstructed hough tracks in the HLT ESD using the
30// the off-line AliESDtrack format.
31//
32// Origin: Cvetan Cheshkov, CERN, Cvetan.Cheshkov@cern.ch
33//-------------------------------------------------------------------------
34
af885e0f 35#include "AliESDEvent.h"
a0cef3e1 36#include "AliRunLoader.h"
37#include "AliHLTTPCHoughTracker.h"
d2ef7687 38#include "AliHLTTPCHough.h"
0f2fc60b 39#include "AliLog.h"
40#include "AliHLTTPCTransform.h"
41#include "AliHLTTPCLog.h"
a0cef3e1 42
0f2fc60b 43/** ROOT macro for the implementation of ROOT specific class methods */
44ClassImp(AliHLTTPCHoughTracker);
45
46/**
47 * creator
48 * used for instantiation when the library is loaded dynamically
49 */
50extern "C" AliTracker* CreateHLTTPCHoughTrackerInstance(AliRunLoader* runLoader)
51{
52 return new AliHLTTPCHoughTracker(runLoader);
53}
a0cef3e1 54
55AliHLTTPCHoughTracker::AliHLTTPCHoughTracker(AliRunLoader *runLoader):AliTracker()
56{
57 //--------------------------------------------------------------
58 // Constructor
59 //--------------------------------------------------------------
60
d2ef7687 61 if(AliHLTTPCTransform::GetVersion() == AliHLTTPCTransform::kVdefault) {
62 Bool_t isinit=AliHLTTPCTransform::Init(runLoader);
63 if(!isinit) AliWarning("Could not init AliHLTTPCTransform settings, using defaults!");
a0cef3e1 64 }
65
66 fRunLoader = runLoader;
67}
68
af885e0f 69Int_t AliHLTTPCHoughTracker::Clusters2Tracks(AliESDEvent *event)
a0cef3e1 70{
71 //--------------------------------------------------------------------
72 // This method reconstructs HLT TPC Hough tracks
73 //--------------------------------------------------------------------
74
75 if (!fRunLoader) {
76 AliError("Missing runloader!");
77 return kTRUE;
78 }
79 Int_t iEvent = fRunLoader->GetEventNumber();
80
d2ef7687 81 Float_t ptmin = 0.1*AliHLTTPCTransform::GetSolenoidField();
a0cef3e1 82
83 Float_t zvertex = GetZ();
84
85 AliInfo(Form("Hough Transform will run with ptmin=%f and zvertex=%f",ptmin,zvertex));
86
0f2fc60b 87 // increase logging level temporarily to avoid bunches of info messages
88 AliHLTTPCLog::TLogLevel loglevelbk=AliHLTTPCLog::fgLevel;
89 AliHLTTPCLog::fgLevel=AliHLTTPCLog::kWarning;
90
d2ef7687 91 AliHLTTPCHough *hough = new AliHLTTPCHough();
a0cef3e1 92
93 hough->SetThreshold(4);
94 hough->CalcTransformerParams(ptmin);
95 hough->SetPeakThreshold(70,-1);
96 hough->SetRunLoader(fRunLoader);
97 hough->Init("./", kFALSE, 100, kFALSE,4,0,0,zvertex);
98 hough->SetAddHistograms();
99
100 for(Int_t slice=0; slice<=35; slice++)
101 {
102 hough->ReadData(slice,iEvent);
103 hough->Transform();
104 hough->AddAllHistogramsRows();
105 hough->FindTrackCandidatesRow();
106 hough->AddTracks();
107 }
108
109 Int_t ntrk = hough->FillESD(event);
110
111 Info("Clusters2Tracks","Number of found tracks: %d\n",ntrk);
112
113 delete hough;
0f2fc60b 114 AliHLTTPCLog::fgLevel=loglevelbk;
a0cef3e1 115
116 return 0;
117}