Merge MC labels for 4 neighbour bins in the Hough space in order to reduce the size...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 May 2004 14:28:55 +0000 (14:28 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 May 2004 14:28:55 +0000 (14:28 +0000)
HLT/hough/AliL3Histogram.cxx
HLT/hough/AliL3Histogram.h
HLT/hough/AliL3HoughBaseTransformer.h
HLT/hough/AliL3HoughTransformerRow.cxx

index 73dec7953d6b6b2ff86b4eed1573bd80c5c69b34..327769824bb0476260379d09b1f65888b7b476d1 100644 (file)
@@ -157,6 +157,18 @@ Int_t AliL3Histogram::FindBin(Double_t x,Double_t y) const
   return GetBin(xbin,ybin);
 }
 
+Int_t AliL3Histogram::FindLabelBin(Double_t x,Double_t y) const
+{
+  Int_t xbin = FindXbin(x);
+  Int_t ybin = FindYbin(y);
+#ifdef _IFON_
+  if(!xbin || !ybin)
+    return -1;
+#endif
+  
+  return GetLabelBin(xbin,ybin);
+}
+
 Int_t AliL3Histogram::FindXbin(Double_t x) const
 {
   if(x < fXmin || x > fXmax)
@@ -183,6 +195,16 @@ Int_t AliL3Histogram::GetBin(Int_t xbin,Int_t ybin) const
   return xbin + ybin*(fNxbins+2);
 }
 
+Int_t AliL3Histogram::GetLabelBin(Int_t xbin,Int_t ybin) const
+{
+  if(xbin < fFirstXbin || xbin > fLastXbin)
+    return -1;
+  if(ybin < fFirstYbin || ybin > fLastYbin)
+    return -1;
+    
+  return (Int_t)(xbin/2) + ((Int_t)(ybin/2))*((Int_t)((fNxbins+3)/2));
+}
+
 Int_t AliL3Histogram::GetBinContent(Int_t bin) const
 {
   if(bin >= fNcells)
index 44d24b8fcc91ea66267ae19a104a05d653ba3aab..003ba80a3751e8feb0a9d62e1aecceeb9ec323e2 100644 (file)
@@ -51,9 +51,11 @@ class AliL3Histogram {
   virtual void Fill(Int_t xbin,Double_t y,Int_t weight=1);
   virtual void Fill(Int_t xbin,Int_t ybin,Int_t weight=1);
   virtual Int_t FindBin(Double_t x,Double_t y) const;
+  virtual Int_t FindLabelBin(Double_t x,Double_t y) const;
   virtual Int_t FindXbin(Double_t x) const;
   virtual Int_t FindYbin(Double_t y) const;
   Int_t GetBin(Int_t xbin,Int_t ybin) const;
+  Int_t GetLabelBin(Int_t xbin,Int_t ybin) const;
   Int_t GetBinContent(Int_t bin) const;
   void SetBinContent(Int_t xbin,Int_t ybin,Int_t value);
   void SetBinContent(Int_t bin,Int_t value);
index 7a006787007b8eab4655d882b799ac2822fd5c17..8646c8aeb7219182b4794b13940c2aebac9fe34d 100644 (file)
@@ -6,7 +6,7 @@
 #include "AliL3RootTypes.h"
 
 #ifdef do_mc
-const UInt_t MaxTrack=100;
+const UInt_t MaxTrack=120;
 struct TrackIndex {
   Int_t fLabel[MaxTrack];
   UChar_t fNHits[MaxTrack];
index 327db71cb2bd68636578cc5ef30b9d808dabe0f8..80b3ff759c02d2c8403456f8a995101694fd15ac 100644 (file)
@@ -187,7 +187,9 @@ void AliL3HoughTransformerRow::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t
   if(fDoMC)
     {
       AliL3Histogram *hist = fParamSpace[0];
-      Int_t ncells = (hist->GetNbinsX()+2)*(hist->GetNbinsY()+2);
+      Int_t ncellsx = (hist->GetNbinsX()+3)/2;
+      Int_t ncellsy = (hist->GetNbinsY()+3)/2;
+      Int_t ncells = ncellsx*ncellsy;
       if(!fTrackID)
        {
          LOG(AliL3Log::kInformational,"AliL3HoughTransformerRow::CreateHistograms()","")
@@ -339,7 +341,9 @@ void AliL3HoughTransformerRow::Reset()
   if(fDoMC)
     {
       AliL3Histogram *hist = fParamSpace[0];
-      Int_t ncells = (hist->GetNbinsX()+2)*(hist->GetNbinsY()+2);
+      Int_t ncellsx = (hist->GetNbinsX()+3)/2;
+      Int_t ncellsy = (hist->GetNbinsY()+3)/2;
+      Int_t ncells = ncellsx*ncellsy;
       for(Int_t i=0; i<GetNEtaSegments(); i++)
        memset(fTrackID[i],0,ncells*sizeof(TrackIndex));
     }
@@ -624,7 +628,7 @@ void AliL3HoughTransformerRow::TransformCircle()
                                    Int_t label = eta_clust[eta_index].mc_labels[t];
                                    if(label == 0) break;
                                    UInt_t c;
-                                   Int_t temp_bin2 = b*nbinx + bin;
+                                   Int_t temp_bin2 = ((Int_t)(b/2))*((Int_t)((nbinx+1)/2)) + (Int_t)(bin/2);
                                    for(c=0; c<(MaxTrack-1); c++)
                                      if(fTrackID[eta_index][temp_bin2].fLabel[c] == label || fTrackID[eta_index][temp_bin2].fNHits[c] == 0)
                                        break;
@@ -750,7 +754,7 @@ void AliL3HoughTransformerRow::TransformCircle()
                            Int_t label = eta_clust[eta_index].mc_labels[t];
                            if(label == 0) break;
                            UInt_t c;
-                           Int_t temp_bin2 = b*nbinx + bin;
+                           Int_t temp_bin2 = ((Int_t)(b/2))*((Int_t)((nbinx+1)/2)) + (Int_t)(bin/2);
                            for(c=0; c<(MaxTrack-1); c++)
                              if(fTrackID[eta_index][temp_bin2].fLabel[c] == label || fTrackID[eta_index][temp_bin2].fNHits[c] == 0)
                                break;
@@ -794,7 +798,12 @@ Int_t AliL3HoughTransformerRow::GetTrackID(Int_t eta_index,Double_t kappa,Double
       return -1;
     }
   AliL3Histogram *hist = fParamSpace[eta_index];
-  Int_t bin = hist->FindBin(kappa,psi);
+  Int_t bin = hist->FindLabelBin(kappa,psi);
+  if(bin==-1) {
+    LOG(AliL3Log::kWarning,"AliL3HoughTransformerRow::GetTrackID()","")
+      <<"Track candidate outside Hough space boundaries: "<<kappa<<" "<<psi<<ENDLOG;
+    return -1;
+  }
   Int_t label=-1;
   Int_t max=0;
   for(UInt_t i=0; i<(MaxTrack-1); i++)
@@ -821,7 +830,8 @@ Int_t AliL3HoughTransformerRow::GetTrackID(Int_t eta_index,Double_t kappa,Double
          }
        }
     }
-  //  cout<<" TrackID label "<<label<<" max "<<max<<" label2 "<<label2<<" max2 "<<max2<<" "<<(Float_t)max2/(Float_t)max<<" "<<fTrackID[eta_index][bin].fLabel[MaxTrack-1]<<" "<<(Int_t)fTrackID[eta_index][bin].fNHits[MaxTrack-1]<<endl;
+  LOG(AliL3Log::kDebug,"AliL3HoughTransformerRow::GetTrackID()","")
+    <<" TrackID"<<" label "<<label<<" max "<<max<<" label2 "<<label2<<" max2 "<<max2<<" "<<(Float_t)max2/(Float_t)max<<" "<<fTrackID[eta_index][bin].fLabel[MaxTrack-1]<<" "<<(Int_t)fTrackID[eta_index][bin].fNHits[MaxTrack-1]<<ENDLOG;
   return label;
 #endif
   LOG(AliL3Log::kWarning,"AliL3HoughTransformerRow::GetTrackID()","")