]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking/AliHLTTPCHoughTracker.cxx
a789abc9c9060e7c279c7ac3f1c4159c3a7131ab
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking / AliHLTTPCHoughTracker.cxx
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
19 /** @file   AliHLTTPCHoughTracker.cxx
20     @author Cvetan Cheshkov
21     @date   
22     @brief  Implementation of the HLT TPC hough transform tracker. */
23
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
35 #include "AliESD.h"
36 #include "AliRunLoader.h"
37 #include "AliHLTTPCHoughTracker.h"
38 #include "AliHLTTPCHough.h"
39 #include "AliLog.h"
40 #include "AliHLTTPCTransform.h"
41 #include "AliHLTTPCLog.h"
42
43 /** ROOT macro for the implementation of ROOT specific class methods */
44 ClassImp(AliHLTTPCHoughTracker);
45
46 /** 
47  * creator
48  * used for instantiation when the library is loaded dynamically
49  */
50 extern "C" AliTracker* CreateHLTTPCHoughTrackerInstance(AliRunLoader* runLoader)
51 {
52   return new AliHLTTPCHoughTracker(runLoader);
53 }
54
55 AliHLTTPCHoughTracker::AliHLTTPCHoughTracker(AliRunLoader *runLoader):AliTracker()
56 {
57   //--------------------------------------------------------------
58   // Constructor
59   //--------------------------------------------------------------
60
61   if(AliHLTTPCTransform::GetVersion() == AliHLTTPCTransform::kVdefault) {
62     Bool_t isinit=AliHLTTPCTransform::Init(runLoader);
63     if(!isinit) AliWarning("Could not init AliHLTTPCTransform settings, using defaults!");
64   }
65
66   fRunLoader = runLoader;
67 }
68
69 Int_t AliHLTTPCHoughTracker::Clusters2Tracks(AliESD *event)
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   
81   Float_t ptmin = 0.1*AliHLTTPCTransform::GetSolenoidField();
82
83   Float_t zvertex = GetZ();
84
85   AliInfo(Form("Hough Transform will run with ptmin=%f and zvertex=%f",ptmin,zvertex));
86
87   // increase logging level temporarily to avoid bunches of info messages
88   AliHLTTPCLog::TLogLevel loglevelbk=AliHLTTPCLog::fgLevel;
89   AliHLTTPCLog::fgLevel=AliHLTTPCLog::kWarning;
90
91   AliHLTTPCHough *hough = new AliHLTTPCHough();
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;
114   AliHLTTPCLog::fgLevel=loglevelbk;
115
116   return 0;
117 }