From 3bb06991c159dbff4fb9518c5295658c25009238 Mon Sep 17 00:00:00 2001 From: vestbo Date: Thu, 30 May 2002 14:39:40 +0000 Subject: [PATCH] Bugfix in AliL3Hough::FindTrackCandidates; when track->SetEta, one has to check the current slice, in order to get minus sign on other half of TPC. Included an upper threshold in AliL3HoughBaseTransformer; all digits with high values than this are not transformed. --- HLT/hough/AliL3Hough.cxx | 23 +++++++++++++++-------- HLT/hough/AliL3Hough.h | 3 ++- HLT/hough/AliL3HoughBaseTransformer.cxx | 3 ++- HLT/hough/AliL3HoughBaseTransformer.h | 9 ++++++--- HLT/hough/AliL3HoughEval.cxx | 2 +- HLT/hough/AliL3HoughTransformer.cxx | 4 ++-- HLT/hough/AliL3HoughTransformerVhdl.cxx | 4 ++-- HLT/hough/Makefile | 2 +- 8 files changed, 31 insertions(+), 19 deletions(-) diff --git a/HLT/hough/AliL3Hough.cxx b/HLT/hough/AliL3Hough.cxx index acd660224a8..8af03dfc42c 100644 --- a/HLT/hough/AliL3Hough.cxx +++ b/HLT/hough/AliL3Hough.cxx @@ -136,12 +136,12 @@ void AliL3Hough::Init(Char_t *path,Bool_t binary,Int_t n_eta_segments,Bool_t bit case 1: fHoughTransformer[i] = new AliL3HoughTransformerVhdl(1,i,fNEtaSegments); fHoughTransformer[i]->CreateHistograms(180,0.1,180,-90,90); - fHoughTransformer[i]->SetThreshold(3); + fHoughTransformer[i]->SetLowerThreshold(3); break; default: fHoughTransformer[i] = new AliL3HoughTransformer(1,i,fNEtaSegments); fHoughTransformer[i]->CreateHistograms(64,0.1,64,-30,30); - fHoughTransformer[i]->SetThreshold(3); + fHoughTransformer[i]->SetLowerThreshold(3); } fEval[i] = new AliL3HoughEval(); @@ -153,7 +153,11 @@ void AliL3Hough::Init(Char_t *path,Bool_t binary,Int_t n_eta_segments,Bool_t bit { fMemHandler[i] = new AliL3FileHandler(); if(!fBinary) - fMemHandler[i]->SetAliInput(fPath); + { + Char_t filename[100]; + sprintf(filename,"%s/digitfile",fPath); + fMemHandler[i]->SetAliInput(filename); + } } #else fMemHandler[i] = new AliL3MemHandler(); @@ -185,7 +189,8 @@ void AliL3Hough::Process(Int_t minslice,Int_t maxslice) void AliL3Hough::ReadData(Int_t slice,Int_t eventnr=0) { //Read data from files, binary or root. - + + fCurrentSlice = slice; for(Int_t i=0; iFree(); @@ -206,7 +211,7 @@ void AliL3Hough::ReadData(Int_t slice,Int_t eventnr=0) else //read data from root file { #ifdef use_aliroot - digits=(AliL3DigitRowData *)fMemHandler[i]->AliDigits2Memory(ndigits,eventnr); + digits=(AliL3DigitRowData *)fMemHandler[i]->AliDigits2Memory(ndigits,eventnr); fMemHandler[i]->FreeDigitsTree(); #else cerr<<"You cannot read from rootfile now"<Reset(); fPeakFinder->SetHistogram(hist); fPeakFinder->FindMaxima(0,0); //Simple maxima finder - cout<<"Found "<GetEntries()<FindAbsMaxima(); for(Int_t k=0; kGetEntries(); k++) { if(fPeakFinder->GetWeight(k) == 0) continue; AliL3HoughTrack *track = (AliL3HoughTrack*)fTracks[i]->NextTrack(); track->SetTrackParameters(fPeakFinder->GetXPeak(k),fPeakFinder->GetYPeak(k),fPeakFinder->GetWeight(k)); track->SetEtaIndex(j); - track->SetEta((Double_t)((j+0.5)*eta_slice)); + Double_t eta = (Double_t)((j+0.5)*eta_slice); + if(fCurrentSlice > 17) eta*=-1; + track->SetEta(eta); track->SetRowRange(AliL3Transform::GetFirstRow(0),AliL3Transform::GetLastRow(5)); } } diff --git a/HLT/hough/AliL3Hough.h b/HLT/hough/AliL3Hough.h index e6c7354b68e..02960bcba3e 100644 --- a/HLT/hough/AliL3Hough.h +++ b/HLT/hough/AliL3Hough.h @@ -26,7 +26,8 @@ class AliL3Hough { Int_t fNEtaSegments; Int_t fNPatches; Int_t fversion; - + Int_t fCurrentSlice; + AliL3MemHandler **fMemHandler; //! AliL3HoughBaseTransformer **fHoughTransformer; //! AliL3HoughEval **fEval; //! diff --git a/HLT/hough/AliL3HoughBaseTransformer.cxx b/HLT/hough/AliL3HoughBaseTransformer.cxx index 28cd6e1b64b..d67deec3510 100644 --- a/HLT/hough/AliL3HoughBaseTransformer.cxx +++ b/HLT/hough/AliL3HoughBaseTransformer.cxx @@ -32,7 +32,8 @@ AliL3HoughBaseTransformer::AliL3HoughBaseTransformer(Int_t slice,Int_t patch,Int fNEtaSegments = n_eta_segments; fEtaMin = 0; fEtaMax = fSlice < 18 ? 0.9 : -0.9; - fThreshold = 0; + fLowerThreshold = 3; + fUpperThreshold = 1023; fDigitRowData = 0; } diff --git a/HLT/hough/AliL3HoughBaseTransformer.h b/HLT/hough/AliL3HoughBaseTransformer.h index 8d7d8ce2077..7645574bdcc 100644 --- a/HLT/hough/AliL3HoughBaseTransformer.h +++ b/HLT/hough/AliL3HoughBaseTransformer.h @@ -15,7 +15,8 @@ class AliL3HoughBaseTransformer { Int_t fNEtaSegments; Double_t fEtaMin; Double_t fEtaMax; - Int_t fThreshold; + Int_t fLowerThreshold; + Int_t fUpperThreshold; AliL3DigitRowData *fDigitRowData; //! @@ -37,7 +38,8 @@ class AliL3HoughBaseTransformer { Int_t GetSlice() {return fSlice;} Int_t GetPatch() {return fPatch;} Int_t GetNEtaSegments() {return fNEtaSegments;} - Int_t GetThreshold() {return fThreshold;} + Int_t GetLowerThreshold() {return fLowerThreshold;} + Int_t GetUpperThreshold() {return fUpperThreshold;} Double_t GetEtaMin() {return fEtaMin;} Double_t GetEtaMax() {return fEtaMax;} @@ -47,7 +49,8 @@ class AliL3HoughBaseTransformer { virtual AliL3Histogram *GetHistogram(Int_t eta_index) = 0; //setters - void SetThreshold(Int_t i) {fThreshold = i;} + void SetLowerThreshold(Int_t i) {fLowerThreshold = i;} + void SetUpperThreshold(Int_t i) {fUpperThreshold = i;} ClassDef(AliL3HoughBaseTransformer,1) //Hough transformation base class diff --git a/HLT/hough/AliL3HoughEval.cxx b/HLT/hough/AliL3HoughEval.cxx index 0053e0456ca..51a7bcfd7e8 100644 --- a/HLT/hough/AliL3HoughEval.cxx +++ b/HLT/hough/AliL3HoughEval.cxx @@ -289,7 +289,7 @@ void AliL3HoughEval::DisplayEtaSlice(Int_t eta_index,AliL3Histogram *hist) UChar_t pad = digPt[j].fPad; UChar_t charge = digPt[j].fCharge; UShort_t time = digPt[j].fTime; - if(charge < fHoughTransformer->GetThreshold()) continue; + if((Int_t)charge < fHoughTransformer->GetLowerThreshold() || (Int_t)charge > fHoughTransformer->GetUpperThreshold()) continue; Float_t xyz[3]; Int_t sector,row; AliL3Transform::Slice2Sector(fSlice,padrow,sector,row); diff --git a/HLT/hough/AliL3HoughTransformer.cxx b/HLT/hough/AliL3HoughTransformer.cxx index a9e6dd0e44a..43c48ae5470 100644 --- a/HLT/hough/AliL3HoughTransformer.cxx +++ b/HLT/hough/AliL3HoughTransformer.cxx @@ -144,7 +144,7 @@ void AliL3HoughTransformer::TransformCircle() UShort_t charge = digPt[j].fCharge; UChar_t pad = digPt[j].fPad; UShort_t time = digPt[j].fTime; - if(charge <= GetThreshold()) + if((Int_t)charge <= GetLowerThreshold() || (Int_t)charge > GetUpperThreshold()) continue; Int_t sector,row; Float_t xyz[3]; @@ -302,7 +302,7 @@ void AliL3HoughTransformer::TransformLine() UShort_t charge = digPt[j].fCharge; UChar_t pad = digPt[j].fPad; UShort_t time = digPt[j].fTime; - if(charge < GetThreshold()) + if(charge < GetLowerThreshold()) continue; Int_t sector,row; Float_t xyz[3]; diff --git a/HLT/hough/AliL3HoughTransformerVhdl.cxx b/HLT/hough/AliL3HoughTransformerVhdl.cxx index 801e3ac1ea9..9efc2505423 100644 --- a/HLT/hough/AliL3HoughTransformerVhdl.cxx +++ b/HLT/hough/AliL3HoughTransformerVhdl.cxx @@ -144,7 +144,7 @@ void AliL3HoughTransformerVhdl::TransformCircle() UShort_t charge = digPt[j].fCharge; UChar_t pad = digPt[j].fPad; UShort_t time = digPt[j].fTime; - if(charge <= GetThreshold()) + if((Int_t)charge <= GetLowerThreshold()) continue; Int_t sector,row; Float_t xyz[3]; @@ -302,7 +302,7 @@ void AliL3HoughTransformerVhdl::TransformLine() UShort_t charge = digPt[j].fCharge; UChar_t pad = digPt[j].fPad; UShort_t time = digPt[j].fTime; - if(charge < GetThreshold()) + if((Int_t)charge < GetLowerThreshold()) continue; Int_t sector,row; Float_t xyz[3]; diff --git a/HLT/hough/Makefile b/HLT/hough/Makefile index 29a50e2c2d2..e5882bbaf16 100644 --- a/HLT/hough/Makefile +++ b/HLT/hough/Makefile @@ -15,7 +15,7 @@ DEFSTR = -Dno_root CXX = g++ LD = g++ -CXXFLAGS = -O2 -Wall -fPIC +CXXFLAGS = -O2 -Wall -fPIC -Woverloaded-virtual LDFLAGS = -O2 SOFLAGS = -shared -- 2.39.3