Added Reset function
authorvestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Oct 2001 16:41:59 +0000 (16:41 +0000)
committervestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Oct 2001 16:41:59 +0000 (16:41 +0000)
HLT/hough/AliL3HoughTransformer.cxx
HLT/hough/AliL3HoughTransformer.h

index eb6cb9a197b2fea36b4f86ff075c79a0f2f51765..d8c3030ee5e6e797dec8abbae5e30266294101fd 100644 (file)
@@ -1,6 +1,7 @@
 //Author:        Anders Strand Vestbo
 //Last Modified: 14.09.01
 
+#include "AliL3Logging.h"
 #include "AliL3HoughTransformer.h"
 #include "AliL3Defs.h"
 #include "AliL3Transform.h"
@@ -46,6 +47,18 @@ void AliL3HoughTransformer::DeleteHistograms()
   delete [] fParamSpace;
 }
 
+void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Double_t pt_min,
+                                            Int_t nybin,Double_t phimin,Double_t phimax)
+{
+  //Set the minimum absolute pt value, and phi0 angles given in degrees.
+
+  Double_t torad = 3.1415/180;
+  Double_t bfact = 0.0029980;
+  Double_t bfield = 0.2;
+  Double_t x = bfact*bfield/pt_min;
+  CreateHistograms(nxbin,-1.*x,x,nybin,phimin*torad,phimax*torad);
+}
+
 void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Double_t xmin,Double_t xmax,
                                             Int_t nybin,Double_t ymin,Double_t ymax)
 {
@@ -60,6 +73,23 @@ void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Double_t xmin,Double_t
     }
 }
 
+void AliL3HoughTransformer::Reset()
+{
+  //Reset all the histograms, and memory
+
+  if(!fParamSpace)
+    {
+      LOG(AliL3Log::kWarning,"AliL3HoughTransformer::Reset","Histograms")
+       <<"No histograms to reset"<<ENDLOG;
+      return;
+    }
+  
+  for(Int_t i=0; i<fNEtaSegments; i++)
+    fParamSpace[i]->Reset();
+  fNDigitRowData = 0;
+  fDigitRowData = 0;
+}
+
 void AliL3HoughTransformer::SetInputData(UInt_t ndigits,AliL3DigitRowData *ptr)
 {
   fNDigitRowData = ndigits;
@@ -114,7 +144,7 @@ void AliL3HoughTransformer::TransformCircle()
          if(eta_index < 0 || eta_index >= fNEtaSegments)
            continue;
          
-         //Get the correct histogram:
+         //Get the correct histogrampointer:
          AliL3Histogram *hist = fParamSpace[eta_index];
          if(!hist)
            {
@@ -123,7 +153,7 @@ void AliL3HoughTransformer::TransformCircle()
            }
 
          //Start transformation
-         Float_t R = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1] + xyz[2]*xyz[2]);
+         Float_t R = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]); // + xyz[2]*xyz[2]);
          Float_t phi = fTransform->GetPhi(xyz);
          
          //Fill the histogram along the phirange
index aad4f7cd9c432bcaa548c270a0d583a11f91bf52..d8424e49a591e52ae911ef9bfa6f82ea51dd0c1d 100644 (file)
@@ -35,8 +35,10 @@ class AliL3HoughTransformer : public TObject {
   
   void SetInputData(UInt_t ndigits,AliL3DigitRowData *ptr);
   void UpdateDataPointer(AliL3DigitRowData *&tempPt);
+  void CreateHistograms(Int_t nxbin,Double_t ptmin,Int_t nybin,Double_t phimin,Double_t phimax);
   void CreateHistograms(Int_t nxbin=64,Double_t xmin=-0.006,Double_t xmax=0.006,
                        Int_t nybin=64,Double_t ymin=-0.26,Double_t ymax=0.26);
+  void Reset();
   void TransformCircle();
   void TransformLine();