]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added threshold
authorvestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Sep 2001 13:59:45 +0000 (13:59 +0000)
committervestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Sep 2001 13:59:45 +0000 (13:59 +0000)
HLT/hough/AliL3Histogram.cxx
HLT/hough/AliL3Histogram.h

index 2791e6f8421ac88e4131496e927228c5de230442..8494a5b12a49926a6088d1abf2cbe43d720d0f70 100644 (file)
@@ -23,10 +23,13 @@ AliL3Histogram::AliL3Histogram()
   fLastYbin = 0;
   fEntries = 0;
   fContent = 0;
+  fThreshold = 0;
 }
 
   
-AliL3Histogram::AliL3Histogram(Char_t *name,Char_t *id,Int_t nxbin,Double_t xmin,Double_t xmax,Int_t nybin,Double_t ymin,Double_t ymax) 
+AliL3Histogram::AliL3Histogram(Char_t *name,Char_t *id,
+                              Int_t nxbin,Double_t xmin,Double_t xmax,
+                              Int_t nybin,Double_t ymin,Double_t ymax) 
 {
   
   strcpy(fName,name);
@@ -44,6 +47,7 @@ AliL3Histogram::AliL3Histogram(Char_t *name,Char_t *id,Int_t nxbin,Double_t xmin
   fLastXbin = nxbin;
   fLastYbin = nybin;
   fRootHisto = 0;
+  fThreshold = 0;
 
   fContent = new Double_t[fNcells];
   Reset();
@@ -128,6 +132,8 @@ Double_t AliL3Histogram::GetBinContent(Int_t bin)
       return 0;
     }
   
+  if(fContent[bin] < fThreshold)
+    return 0;
   return fContent[bin];
 }
 
@@ -229,7 +235,7 @@ void AliL3Histogram::Draw(Char_t *option)
   fRootHisto = new TH2F(fName,"",fNxbins,fXmin,fXmax,fNybins,fYmin,fYmax);
   for(Int_t bin=0; bin<fNcells; bin++)
     {
-      fRootHisto->AddBinContent(bin,fContent[bin]);
+      fRootHisto->AddBinContent(bin,GetBinContent(bin));
     }
   
   fRootHisto->Draw(option);
index 6a7d1db85d0a1febbf9b5f9fc14ef8554a9229c2..613eb6b5da47fc4b479ed6f1ab7f53ea0f149d1e 100644 (file)
@@ -5,7 +5,7 @@
 #include <TH2.h>
 
 
-class AliL3Histogram : public TObject {
+class AliL3Histogram {
   
  private:
   
@@ -19,6 +19,7 @@ class AliL3Histogram : public TObject {
   Int_t fFirstYbin;
   Int_t fLastXbin;
   Int_t fLastYbin;
+  Int_t fThreshold;
 
   Double_t fXmin;
   Double_t fYmin;
@@ -33,7 +34,7 @@ class AliL3Histogram : public TObject {
   virtual ~AliL3Histogram();
   
   void Reset();
-  void Fill(Double_t x,Double_t y,Int_t weight);
+  void Fill(Double_t x,Double_t y,Int_t weight=1);
   Int_t FindBin(Double_t x,Double_t y);
   Int_t FindXbin(Double_t x);
   Int_t FindYbin(Double_t y);
@@ -45,7 +46,7 @@ class AliL3Histogram : public TObject {
   void AddBinContent(Int_t bin,Int_t weight);
   void Add(AliL3Histogram *h1,Double_t weight=1);
   void Draw(Char_t *option="hist");
-  
+  void SetThreshold(Int_t i) {fThreshold = i;}
 
   TH2F *GetRootHisto() {return fRootHisto;}
   Double_t GetXmin() {return fXmin;}
@@ -61,7 +62,8 @@ class AliL3Histogram : public TObject {
   Int_t GetNbinsX() {return fNxbins;}
   Int_t GetNbinsY() {return fNybins;}
   Int_t GetNEntries() {return fEntries;}
-
+  
+  
   ClassDef(AliL3Histogram,1)
     
 };