Added new function AliL3Hough::MergeEtaSlices which merges tracks which
authorvestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 1 Oct 2002 12:19:40 +0000 (12:19 +0000)
committervestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 1 Oct 2002 12:19:40 +0000 (12:19 +0000)
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
HLT/hough/AliL3Hough.h
HLT/hough/AliL3HoughTransformer.cxx
HLT/hough/AliL3HoughTransformer.h

index 233e160..0ecebaa 100644 (file)
@@ -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 "<<endl;
       return;
     }
-  printf("Number of tracks before evaluation %d\n",fTracks[0]->GetNTracks());
-  for(Int_t i=0; i<fNPatches; i++)
+  for(Int_t j=0; j<tracks->GetNTracks(); 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; k<tracks->GetNTracks(); 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 "<<track1->GetEtaIndex()<<" "<<track2->GetEtaIndex()<<endl;
+               if(track1->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)
index a23bf7b..71ffba2 100644 (file)
@@ -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();
index dc2c829..709e233 100644 (file)
@@ -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; i<GetNEtaSegments(); i++)
     {
       sprintf(histname,"paramspace_%d",i);
-      //fParamSpace[i] = new AliL3HistogramAdaptive(histname,0.1,1,0.05,64,ymin,ymax);
+      //fParamSpace[i] = new AliL3HistogramAdaptive(histname,0.1,2,0.02,nybin,ymin,ymax);
       fParamSpace[i] = new AliL3Histogram(histname,"",nxbin,xmin,xmax,nybin,ymin,ymax);
     }
   
@@ -164,7 +170,6 @@ Double_t AliL3HoughTransformer::GetEta(Int_t eta_index,Int_t slice)
 {
   Double_t eta_slice = (GetEtaMax()-GetEtaMin())/GetNEtaSegments();
   Double_t eta=(Double_t)((eta_index+0.5)*eta_slice);
-  if(slice>17) eta*=-1;
   return eta;
 }
 
@@ -200,7 +205,7 @@ void AliL3HoughTransformer::TransformCircle()
          cerr<<"AliL3HoughTransform::TransformCircle : Mismatching padrow numbering "<<i<<" "<<(Int_t)tempPt->fRow<<endl;
          continue;
        }
-
+      
       //Loop over the data on this padrow:
       for(UInt_t j=0; j<tempPt->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)
            {
index 1f342a8..0fad4b4 100644 (file)
@@ -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);