]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/hough/AliL3HoughTransformer.cxx
- check for AliRoot features/libs/files and corresponding conditional
[u/mrichter/AliRoot.git] / HLT / hough / AliL3HoughTransformer.cxx
index 5aad5fc6fbabf9d06fcada8cc7a7956568de3522..da5a65016e4430d87a2fa0ff49158ba3ec1f9f20 100644 (file)
@@ -3,6 +3,16 @@
 // Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
 //*-- Copyright &copy ALICE HLT Group
 
+/** \class AliL3HoughTransformer
+<pre>
+//_____________________________________________________________
+// AliL3HoughTransformer
+//
+// Hough transformation class
+//
+</pre>
+*/
+
 #include "AliL3StandardIncludes.h"
 
 #include "AliL3Logging.h"
 #include "AliL3DigitData.h"
 #include "AliL3HistogramAdaptive.h"
 
-#if __GNUC__ == 3
+#if __GNUC__ >= 3
 using namespace std;
 #endif
 
-/** \class AliL3HoughTransformer
-<pre>
-//_____________________________________________________________
-// AliL3HoughTransformer
-//
-// Hough transformation class
-//
-</pre>
-*/
-
 ClassImp(AliL3HoughTransformer)
 
 AliL3HoughTransformer::AliL3HoughTransformer()
@@ -79,6 +79,7 @@ void AliL3HoughTransformer::DeleteHistograms()
       delete fParamSpace[i];
     }
   delete [] fParamSpace;
+  fParamSpace = 0;
 }
 
 void AliL3HoughTransformer::CreateHistograms(Float_t ptmin,Float_t ptmax,Float_t ptres,
@@ -150,10 +151,10 @@ void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t xm
     {
       AliL3Histogram *hist = fParamSpace[0];
       Int_t ncells = (hist->GetNbinsX()+2)*(hist->GetNbinsY()+2);
-      cout<<"Transformer: Allocating "<<GetNEtaSegments()*ncells*sizeof(TrackIndex)<<" bytes to fTrackID"<<endl;
-      fTrackID = new TrackIndex*[GetNEtaSegments()];
+      cout<<"Transformer: Allocating "<<GetNEtaSegments()*ncells*sizeof(AliL3TrackIndex)<<" bytes to fTrackID"<<endl;
+      fTrackID = new AliL3TrackIndex*[GetNEtaSegments()];
       for(Int_t i=0; i<GetNEtaSegments(); i++)
-       fTrackID[i] = new TrackIndex[ncells];
+       fTrackID[i] = new AliL3TrackIndex[ncells];
     }
 #endif
 }
@@ -178,12 +179,12 @@ void AliL3HoughTransformer::Reset()
       AliL3Histogram *hist = fParamSpace[0];
       Int_t ncells = (hist->GetNbinsX()+2)*(hist->GetNbinsY()+2);
       for(Int_t i=0; i<GetNEtaSegments(); i++)
-       memset(fTrackID[i],0,ncells*sizeof(TrackIndex));
+       memset(fTrackID[i],0,ncells*sizeof(AliL3TrackIndex));
     }
 #endif
 }
 
-Int_t AliL3HoughTransformer::GetEtaIndex(Double_t eta)
+Int_t AliL3HoughTransformer::GetEtaIndex(Double_t eta) const
 {
   //Return the histogram index of the corresponding eta. 
 
@@ -192,7 +193,7 @@ Int_t AliL3HoughTransformer::GetEtaIndex(Double_t eta)
   return (Int_t)index;
 }
 
-void AliL3HoughTransformer::GetEtaIndexes(Double_t eta,Int_t *indexes)
+void AliL3HoughTransformer::GetEtaIndexes(Double_t eta,Int_t *indexes) const
 {
   //Return histogram indexes in case of overlapping etaslices.
   
@@ -210,7 +211,7 @@ void AliL3HoughTransformer::GetEtaIndexes(Double_t eta,Int_t *indexes)
     }
 }
 
-inline AliL3Histogram *AliL3HoughTransformer::GetHistogram(Int_t etaindex)
+AliL3Histogram *AliL3HoughTransformer::GetHistogram(Int_t etaindex)
 {
   // Return a pointer to the histogram which contains etaindex eta slice
   if(!fParamSpace || etaindex >= GetNEtaSegments() || etaindex < 0)
@@ -745,7 +746,8 @@ void AliL3HoughTransformer::TransformLineC(Int_t *rowrange,Float_t *phirange)
   delete [] digits;
 }
 
-Int_t AliL3HoughTransformer::GetTrackID(Int_t etaindex,Double_t kappa,Double_t psi)
+#ifdef do_mc
+Int_t AliL3HoughTransformer::GetTrackID(Int_t etaindex,Double_t kappa,Double_t psi) const
 {
   // Returns the MC label for a given peak found in the Hough space
   if(!fDoMC)
@@ -754,7 +756,6 @@ Int_t AliL3HoughTransformer::GetTrackID(Int_t etaindex,Double_t kappa,Double_t p
       return -1;
     }
   
-#ifdef do_mc
   if(etaindex < 0 || etaindex > GetNEtaSegments())
     {
       cerr<<"AliL3HoughTransformer::GetTrackID : Wrong etaindex "<<etaindex<<endl;
@@ -776,8 +777,18 @@ Int_t AliL3HoughTransformer::GetTrackID(Int_t etaindex,Double_t kappa,Double_t p
     }
   //nhits = max;
   return label;
-#endif
+#else
+  Int_t AliL3HoughTransformer::GetTrackID(Int_t /*etaindex*/,Double_t /*kappa*/,Double_t /*psi*/) const
+{
+  // Returns the MC label for a given peak found in the Hough space
+  if(!fDoMC)
+    {
+      cerr<<"AliL3HoughTransformer::GetTrackID : Flag switched off"<<endl;
+      return -1;
+    }
+  
   cout<<"AliL3HoughTransformer::GetTrackID : Compile with do_mc flag!"<<endl;
   return -1;
+#endif
 }