From 44c7f8de7bcdce86f9c280c164755f6f3c609058 Mon Sep 17 00:00:00 2001 From: vestbo Date: Tue, 1 Oct 2002 12:19:40 +0000 Subject: [PATCH] Added new function AliL3Hough::MergeEtaSlices which merges tracks which appear in 2 neighbouring eta slices. The tracks are matching if they have identical kappa and psi; they appear in the same bin. The one with the lower threshold are removed from the track array. There is also a bugfix in AliL3HoughTransformer::GetEta, the sign should not be swicthed on the other half of TPC, because the sign is already included in the (GetEtaMax() - GetEtaMin()). Also the DoMC flag in the AliL3HoughTransformer ctor. --- HLT/hough/AliL3Hough.cxx | 36 +++++++++++++++++++++-------- HLT/hough/AliL3Hough.h | 4 ++-- HLT/hough/AliL3HoughTransformer.cxx | 22 +++++++++++------- HLT/hough/AliL3HoughTransformer.h | 2 +- 4 files changed, 43 insertions(+), 21 deletions(-) diff --git a/HLT/hough/AliL3Hough.cxx b/HLT/hough/AliL3Hough.cxx index 233e16038d7..0ecebaa7899 100644 --- a/HLT/hough/AliL3Hough.cxx +++ b/HLT/hough/AliL3Hough.cxx @@ -188,7 +188,7 @@ void AliL3Hough::Init(Bool_t doit, Bool_t addhists) fMemHandler[i] = new AliL3FileHandler(); if(!fBinary) { - Char_t filename[100]; + Char_t filename[1024]; sprintf(filename,"%s/digitfile.root",fPath); fMemHandler[i]->SetAliInput(filename); } @@ -579,21 +579,37 @@ void AliL3Hough::EvaluatePatch(Int_t i,Int_t road_width,Int_t nrowstomiss) } -void AliL3Hough::EvaluateWithEta() +void AliL3Hough::MergeEtaSlices() { - if(!fTracks[0]) + //Merge tracks found in neighbouring eta slices. + //Removes the track with the lower weight. + + AliL3TrackArray *tracks = fTracks[0]; + if(!tracks) { - printf("AliL3Hough::EvaluateWithEta: NO TRACKS\n"); + cerr<<"AliL3Hough::MergeEtaSlices : No tracks "<GetNTracks()); - - for(Int_t i=0; iGetNTracks(); j++) { - fEval[i]->InitTransformer(fHoughTransformer[i]); - fEval[i]->FindEta(fTracks[0]); + AliL3HoughTrack *track1 = (AliL3HoughTrack*)tracks->GetCheckedTrack(j); + if(!track1) continue; + for(Int_t k=j+1; kGetNTracks(); k++) + { + AliL3HoughTrack *track2 = (AliL3HoughTrack*)tracks->GetCheckedTrack(k); + if(!track2) continue; + if(abs(track1->GetEtaIndex() - track2->GetEtaIndex()) != 1) continue; + if(track1->GetKappa() == track2->GetKappa() && track1->GetPsi() == track2->GetPsi()) + { + cout<<"Merging track in slices "<GetEtaIndex()<<" "<GetEtaIndex()<GetWeight() > track2->GetWeight()) + tracks->Remove(k); + else + tracks->Remove(j); + } + } } - fMerger->FillTracks(fTracks[0],0); + tracks->Compress(); } void AliL3Hough::WriteTracks(Int_t slice,Char_t *path) diff --git a/HLT/hough/AliL3Hough.h b/HLT/hough/AliL3Hough.h index a23bf7b0c36..71ffba227ea 100644 --- a/HLT/hough/AliL3Hough.h +++ b/HLT/hough/AliL3Hough.h @@ -63,12 +63,12 @@ class AliL3Hough { void ProcessPatchIter(Int_t patch); void MergePatches(); void MergeInternally(); - + void MergeEtaSlices(); + void FindTrackCandidates(); void AddAllHistograms(); Int_t Evaluate(Int_t road_width=1,Int_t nrowstomiss=1); void EvaluatePatch(Int_t i,Int_t road_width,Int_t nrowstomiss); - void EvaluateWithEta(); void WriteTracks(Int_t slice,Char_t *path="./"); void WriteDigits(Char_t *outfile="output_digits.root"); void InitEvaluate(); diff --git a/HLT/hough/AliL3HoughTransformer.cxx b/HLT/hough/AliL3HoughTransformer.cxx index dc2c82939b3..709e2331f83 100644 --- a/HLT/hough/AliL3HoughTransformer.cxx +++ b/HLT/hough/AliL3HoughTransformer.cxx @@ -28,17 +28,23 @@ AliL3HoughTransformer::AliL3HoughTransformer() { //Default constructor fParamSpace = 0; - fDoMC = kFALSE; + fDoMC = kFALSE;; #ifdef do_mc fTrackID = 0; #endif } -AliL3HoughTransformer::AliL3HoughTransformer(Int_t slice,Int_t patch,Int_t n_eta_segments) : AliL3HoughBaseTransformer(slice,patch,n_eta_segments) +AliL3HoughTransformer::AliL3HoughTransformer(Int_t slice,Int_t patch,Int_t n_eta_segments,Bool_t DoMC) : AliL3HoughBaseTransformer(slice,patch,n_eta_segments) { //Normal constructor fParamSpace = 0; - fDoMC = kFALSE; + if(DoMC) + { + if(patch==0) + fDoMC = kTRUE; + else + fDoMC = kFALSE; + } #ifdef do_mc fTrackID = 0; #endif @@ -101,7 +107,7 @@ void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Double_t xmin,Double_t for(Int_t i=0; i17) eta*=-1; return eta; } @@ -200,7 +205,7 @@ void AliL3HoughTransformer::TransformCircle() cerr<<"AliL3HoughTransform::TransformCircle : Mismatching padrow numbering "<fRow<fNDigit; j++) { @@ -209,6 +214,7 @@ void AliL3HoughTransformer::TransformCircle() UShort_t time = digPt[j].fTime; if((Int_t)charge <= GetLowerThreshold() || (Int_t)charge > GetUpperThreshold()) continue; + Int_t sector,row; Float_t xyz[3]; @@ -241,7 +247,7 @@ void AliL3HoughTransformer::TransformCircle() { Float_t phi0 = hist->GetBinCenterY(b); Float_t kappa = 2*sin(phi - phi0)/R; - hist->Fill(kappa,phi0,charge); + hist->Fill(kappa,phi0,1);//charge); #ifdef do_mc if(fDoMC) { @@ -360,7 +366,7 @@ void AliL3HoughTransformer::TransformCircleC(Int_t row_range) phi_0 = atan( (r2*sin(phi1)-r1*sin(phi2))/(r2*cos(phi1)-r1*cos(phi2)) ); kappa = 2*sin(phi2-phi_0)/r2; tot_charge = digits[i].charge + digits[j].charge; - hist->Fill(kappa,phi_0,tot_charge); + hist->Fill(kappa,phi_0,1);//tot_charge); #ifdef do_mc if(fDoMC) { diff --git a/HLT/hough/AliL3HoughTransformer.h b/HLT/hough/AliL3HoughTransformer.h index 1f342a8257e..0fad4b43564 100644 --- a/HLT/hough/AliL3HoughTransformer.h +++ b/HLT/hough/AliL3HoughTransformer.h @@ -20,7 +20,7 @@ class AliL3HoughTransformer : public AliL3HoughBaseTransformer { public: AliL3HoughTransformer(); - AliL3HoughTransformer(Int_t slice,Int_t patch,Int_t n_eta_segments); + AliL3HoughTransformer(Int_t slice,Int_t patch,Int_t n_eta_segments,Bool_t DoMC=kFALSE); virtual ~AliL3HoughTransformer(); void CreateHistograms(Int_t nxbin,Double_t ptmin,Int_t nybin,Double_t phimin,Double_t phimax); -- 2.31.1