1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // high level filter algorithm for TPC using a hough transformation //
22 ///////////////////////////////////////////////////////////////////////////////
25 #include <TStopwatch.h>
27 #include "AliL3StandardIncludes.h"
28 #include "AliL3Logging.h"
29 #include "AliL3Transform.h"
30 #include "AliL3Hough.h"
33 #include "AliHoughFilter.h"
36 ClassImp(AliHoughFilter)
38 //_____________________________________________________________________________
39 AliHoughFilter::AliHoughFilter()
41 // default constructor
43 AliL3Log::fgLevel = AliL3Log::kError;
44 if (AliDebugLevel() > 0) AliL3Log::fgLevel = AliL3Log::kWarning;
45 if (AliDebugLevel() > 1) AliL3Log::fgLevel = AliL3Log::kInformational;
46 if (AliDebugLevel() > 2) AliL3Log::fgLevel = AliL3Log::kDebug;
47 if (!AliL3Transform::Init("./", kFALSE)) {
48 AliError("HLT initialization failed!");
52 //_____________________________________________________________________________
53 Bool_t AliHoughFilter::Filter(AliRawEvent* event, AliESD* esd)
55 // TPC hough transformation
60 Float_t ptmin = 0.1*AliL3Transform::GetSolenoidField();
62 AliL3Hough *hough1 = new AliL3Hough();
64 hough1->SetThreshold(4);
65 hough1->CalcTransformerParams(ptmin);
66 hough1->SetPeakThreshold(70,-1);
67 // Attention Z of the vertex to be taken from the event head!
68 // So far for debug purposes it is fixed by hand...
69 hough1->Init(100,4,event,3.82147);
70 hough1->SetAddHistograms();
72 AliL3Hough *hough2 = new AliL3Hough();
74 hough2->SetThreshold(4);
75 hough2->CalcTransformerParams(ptmin);
76 hough2->SetPeakThreshold(70,-1);
77 hough2->Init(100,4,event,3.82147);
78 hough2->SetAddHistograms();
80 Int_t nglobaltracks = 0;
81 /* In case we run HLT code in 2 threads */
82 hough1->StartProcessInThread(0,17);
83 hough2->StartProcessInThread(18,35);
85 if(hough1->WaitForThreadFinish())
86 AliFatal(" Can not join the required thread! ");
87 if(hough2->WaitForThreadFinish())
88 AliFatal(" Can not join the required thread! ");
90 /* In case we run HLT code in the main thread
91 for(Int_t slice=0; slice<=17; slice++)
93 hough1->ReadData(slice,0);
95 hough1->AddAllHistogramsRows();
96 hough1->FindTrackCandidatesRow();
99 for(Int_t slice=18; slice<=35; slice++)
101 hough2->ReadData(slice,0);
103 hough2->AddAllHistogramsRows();
104 hough2->FindTrackCandidatesRow();
109 nglobaltracks += hough1->FillESD(esd);
110 nglobaltracks += hough2->FillESD(esd);
112 /* In case we want to debug the ESD
113 gSystem->MakeDirectory("hough1");
114 hough1->WriteTracks("./hough1");
115 gSystem->MakeDirectory("hough2");
116 hough2->WriteTracks("./hough2");
122 printf("Filter has found %d TPC tracks in %f seconds\n", nglobaltracks,timer.RealTime());