Coding violations...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Jun 2004 13:18:42 +0000 (13:18 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Jun 2004 13:18:42 +0000 (13:18 +0000)
20 files changed:
HLT/hough/AliL3Histogram.h
HLT/hough/AliL3Histogram1D.cxx
HLT/hough/AliL3Histogram1D.h
HLT/hough/AliL3HistogramAdaptive.cxx
HLT/hough/AliL3HistogramAdaptive.h
HLT/hough/AliL3HoughBaseTransformer.h
HLT/hough/AliL3HoughDisplay.cxx
HLT/hough/AliL3HoughDisplay.h
HLT/hough/AliL3HoughIntMerger.cxx
HLT/hough/AliL3HoughIntMerger.h
HLT/hough/AliL3HoughMerger.cxx
HLT/hough/AliL3HoughMerger.h
HLT/hough/AliL3HoughTrack.cxx
HLT/hough/AliL3HoughTrack.h
HLT/hough/AliL3HoughTransformer.cxx
HLT/hough/AliL3HoughTransformer.h
HLT/hough/AliL3HoughTransformerLUT.cxx
HLT/hough/AliL3HoughTransformerLUT.h
HLT/hough/AliL3HoughTransformerRow.cxx
HLT/hough/AliL3HoughTransformerRow.h

index 9145e08..b6b5f52 100644 (file)
@@ -38,7 +38,7 @@ class AliL3Histogram {
   void SetThreshold(Int_t i) {fThreshold = i;}
   void CreateRootHisto();
   virtual void Draw(Char_t *option="hist");
-  virtual void Print() {};
+  virtual void Print() const {};
 
   friend ofstream& operator<< (ofstream &o, const AliL3Histogram &h);
 
index 2838e68..09fb433 100644 (file)
@@ -9,6 +9,10 @@
 #include "AliL3Logging.h"
 #include "AliL3Histogram1D.h"
 
+#ifdef use_root
+#include <TH1.h>
+#endif
+
 #if __GNUC__ == 3
 using namespace std;
 #endif
@@ -22,6 +26,7 @@ ClassImp(AliL3Histogram1D)
 
 AliL3Histogram1D::AliL3Histogram1D()
 {
+  //default ctor
   fNbins = 0;
   fNcells = 0;
   fEntries = 0;
@@ -38,7 +43,7 @@ AliL3Histogram1D::AliL3Histogram1D()
 AliL3Histogram1D::AliL3Histogram1D(Char_t *name,Char_t */*id*/,Int_t nxbin,Double_t xmin,Double_t xmax)
 
 {
-  
+  //normal ctor
   strcpy(fName,name);
   fNbins = nxbin;
   fNcells = fNbins + 2;
@@ -68,6 +73,7 @@ AliL3Histogram1D::~AliL3Histogram1D()
 
 void AliL3Histogram1D::Reset()
 {
+  //Reset histogram contents
 #if defined(__DECCXX)
   bzero((char *)fContent,fNcells*sizeof(Double_t));
 #else
@@ -78,13 +84,15 @@ void AliL3Histogram1D::Reset()
 
 void AliL3Histogram1D::Fill(Double_t x,Int_t weight)
 {
+  //Fill a given bin with weight
   Int_t bin = FindBin(x);
   AddBinContent(bin,weight);
 }
 
 
-Int_t AliL3Histogram1D::FindBin(Double_t x)
+Int_t AliL3Histogram1D::FindBin(Double_t x) const
 {
+  //Find a given bin
   if(x < fXmin || x > fXmax)
     return 0;
   
@@ -92,23 +100,25 @@ Int_t AliL3Histogram1D::FindBin(Double_t x)
 
 }
 
-Int_t AliL3Histogram1D::GetMaximumBin()
+Int_t AliL3Histogram1D::GetMaximumBin() const
 {
-  Double_t max_value=0;
-  Int_t max_bin=0;
+  //Find the bin with the largest content
+  Double_t maxvalue=0;
+  Int_t maxbin=0;
   for(Int_t i=0; i<fNcells; i++)
     {
-      if(fContent[i] > max_value)
+      if(fContent[i] > maxvalue)
        {
-         max_value=fContent[i];
-         max_bin = i;
+         maxvalue=fContent[i];
+         maxbin = i;
        }
     }
-  return max_bin;
+  return maxbin;
 }
 
-Double_t AliL3Histogram1D::GetBinContent(Int_t bin)
+Double_t AliL3Histogram1D::GetBinContent(Int_t bin) const
 {
+  //Get bin content
   if(bin >= fNcells)
     {
       LOG(AliL3Log::kError,"AliL3Histogram::GetBinContent","array")<<AliL3Log::kDec<<
@@ -124,7 +134,7 @@ Double_t AliL3Histogram1D::GetBinContent(Int_t bin)
 
 void AliL3Histogram1D::SetBinContent(Int_t bin,Int_t value)
 {
-
+  //Set bin content
   if(bin >= fNcells)
     {
       LOG(AliL3Log::kError,"AliL3Histogram::SetBinContent","array")<<AliL3Log::kDec<<
@@ -139,6 +149,7 @@ void AliL3Histogram1D::SetBinContent(Int_t bin,Int_t value)
 
 void AliL3Histogram1D::AddBinContent(Int_t bin,Int_t weight)
 {
+  //Add weight to bin content
   if(bin < 0 || bin > fNcells)
     {
       LOG(AliL3Log::kError,"AliL3Histogram::AddBinContent","array")<<AliL3Log::kDec<<
@@ -151,9 +162,9 @@ void AliL3Histogram1D::AddBinContent(Int_t bin,Int_t weight)
   fContent[bin] += weight;
 }
 
-Double_t AliL3Histogram1D::GetBinCenter(Int_t bin)
+Double_t AliL3Histogram1D::GetBinCenter(Int_t bin) const
 {
-  
+  //Get bin center  
   Double_t binwidth = (fXmax - fXmin) / fNbins;
   return fXmin + (bin-1) * binwidth + 0.5*binwidth;
   
@@ -162,6 +173,7 @@ Double_t AliL3Histogram1D::GetBinCenter(Int_t bin)
 #ifdef use_root
 void AliL3Histogram1D::Draw(Char_t *option)
 {
+  //Draw the histogram
   fRootHisto = new TH1F(fName,"",fNbins,fXmin,fXmax);
   for(Int_t bin=0; bin<fNcells; bin++)
     fRootHisto->AddBinContent(bin,GetBinContent(bin));
index e56727a..03c97de 100644 (file)
@@ -1,33 +1,16 @@
 // @(#) $Id$
 
-#ifndef ALIL3_HISTOGRAM1D
-#define ALIL3_HISTOGRAM1D
+#ifndef ALIL3HISTOGRAM1D_H
+#define ALIL3HISTOGRAM1D_H
 
 #include "AliL3RootTypes.h"
 
 #ifdef use_root
-#include <TH1.h>
+class TH1F;
 #endif
 
 class AliL3Histogram1D {
   
- private:
-  
-  Double_t *fContent; //!
-  Char_t fName[100];
-  Int_t fNbins;
-  Int_t fNcells;
-  Int_t fEntries;
-
-  Int_t fThreshold;
-  Double_t fXmin;
-  Double_t fXmax;
-
-  
-#ifdef use_root
-  TH1F *fRootHisto;
-#endif  
-
  public:
   AliL3Histogram1D();
   AliL3Histogram1D(Char_t *name,Char_t *id,Int_t nxbin,Double_t xmin,Double_t xmax);
@@ -36,11 +19,11 @@ class AliL3Histogram1D {
   void Reset();
   void Fill(Double_t x,Int_t weight=1);
   void AddBinContent(Int_t bin,Int_t weight);
-  Int_t GetMaximumBin();
-  Int_t FindBin(Double_t x);
-  Double_t GetBinContent(Int_t bin);
-  Double_t GetBinCenter(Int_t bin);
-  Int_t GetNEntries() {return fEntries;}
+  Int_t GetMaximumBin() const;
+  Int_t FindBin(Double_t x) const;
+  Double_t GetBinContent(Int_t bin) const;
+  Double_t GetBinCenter(Int_t bin) const;
+  Int_t GetNEntries() const {return fEntries;}
   
   void SetBinContent(Int_t bin,Int_t value);
   void SetThreshold(Int_t i) {fThreshold = i;}
@@ -51,6 +34,23 @@ class AliL3Histogram1D {
   TH1F *GetRootHisto() {return fRootHisto;}
 #endif
   
+ private:
+  
+  Double_t *fContent; //!
+  Char_t fName[100];//Histogram title
+  Int_t fNbins;//Number of bins
+  Int_t fNcells;//Number of cells
+  Int_t fEntries;//Number of entries
+
+  Int_t fThreshold;//Bin content threshold
+  Double_t fXmin;//Lower limit in X
+  Double_t fXmax;//Upper limit in X
+
+  
+#ifdef use_root
+  TH1F *fRootHisto;//The corresponding ROOT histogram
+#endif  
+
   ClassDef(AliL3Histogram1D,1) //1D histogram class
     
 };
index e9bf95d..5826efe 100644 (file)
@@ -25,6 +25,7 @@ ClassImp(AliL3HistogramAdaptive)
 
 AliL3HistogramAdaptive::AliL3HistogramAdaptive() : AliL3Histogram()
 {
+  //default ctor
   fKappaBins=0;
 }
 
@@ -32,6 +33,7 @@ AliL3HistogramAdaptive::AliL3HistogramAdaptive() : AliL3Histogram()
 AliL3HistogramAdaptive::AliL3HistogramAdaptive(Char_t *name,Double_t minpt,Double_t maxpt,Double_t ptres,
                                               Int_t nybins,Double_t ymin,Double_t ymax)
 {
+  //normal ctor
   strcpy(fName,name);
   
   fPtres = ptres;
@@ -58,6 +60,7 @@ AliL3HistogramAdaptive::AliL3HistogramAdaptive(Char_t *name,Double_t minpt,Doubl
 
 AliL3HistogramAdaptive::~AliL3HistogramAdaptive()
 {
+  //dtor
   if(fKappaBins)
     delete [] fKappaBins;
 }
@@ -70,14 +73,14 @@ Int_t AliL3HistogramAdaptive::InitKappaBins()
   //Since the kappa values are symmetric about origo, the size of the
   //LUT is half of the total number of bins in kappa direction.
   
-  Double_t pt = fMinPt,delta_pt,local_pt;
+  Double_t pt = fMinPt,deltapt,localpt;
   Int_t bin=0;
   
   while(pt < fMaxPt)
     {
-      local_pt = pt;
-      delta_pt = fPtres*local_pt*local_pt;
-      pt += 2*delta_pt;
+      localpt = pt;
+      deltapt = fPtres*localpt*localpt;
+      pt += 2*deltapt;
       bin++;
     }
   fKappaBins = new Double_t[bin+1];
@@ -86,9 +89,9 @@ Int_t AliL3HistogramAdaptive::InitKappaBins()
   fKappaBins[bin] = AliL3Transform::GetBFact()*AliL3Transform::GetBField()/fMinPt; 
   while(pt < fMaxPt)
     {
-      local_pt = pt;
-      delta_pt = fPtres*local_pt*local_pt;
-      pt += 2*delta_pt;                      //*2 because pt +- 1/2*deltapt is one bin
+      localpt = pt;
+      deltapt = fPtres*localpt*localpt;
+      pt += 2*deltapt;                      //*2 because pt +- 1/2*deltapt is one bin
       bin++;
       fKappaBins[bin] = AliL3Transform::GetBFact()*AliL3Transform::GetBField()/pt;
     }
@@ -98,6 +101,7 @@ Int_t AliL3HistogramAdaptive::InitKappaBins()
 
 void AliL3HistogramAdaptive::Fill(Double_t x,Double_t y,Int_t weight)
 {
+  //Fill a given bin in the histogram
   Int_t bin = FindBin(x,y);
   if(bin < 0)
     return;
@@ -107,7 +111,7 @@ void AliL3HistogramAdaptive::Fill(Double_t x,Double_t y,Int_t weight)
 
 Int_t AliL3HistogramAdaptive::FindBin(Double_t x,Double_t y) const
 {
-  
+  //Find a bin in the histogram  
   Int_t xbin = FindXbin(x);
   Int_t ybin = FindYbin(y);
   
@@ -118,7 +122,7 @@ Int_t AliL3HistogramAdaptive::FindBin(Double_t x,Double_t y) const
 
 Int_t AliL3HistogramAdaptive::FindXbin(Double_t x) const
 {
-
+  //Find X bin in the histogram
   if(x < fXmin || x > fXmax || fabs(x) < fKappaBins[(fNxbins/2-1)])
     return 0;
   
@@ -142,6 +146,7 @@ Int_t AliL3HistogramAdaptive::FindXbin(Double_t x) const
 
 Int_t AliL3HistogramAdaptive::FindYbin(Double_t y) const
 {
+  //Find Y bin in the histogram
   if(y < fYmin || y > fYmax)
     return 0;
   
@@ -150,6 +155,7 @@ Int_t AliL3HistogramAdaptive::FindYbin(Double_t y) const
 
 Double_t AliL3HistogramAdaptive::GetBinCenterX(Int_t xbin) const
 {
+  //Returns bin center in X
   if(xbin < fFirstXbin || xbin > fLastXbin)
     {
       LOG(AliL3Log::kWarning,"AliL3HistogramAdaptive::GetBinCenterX","Bin-value")
@@ -179,6 +185,7 @@ Double_t AliL3HistogramAdaptive::GetBinCenterX(Int_t xbin) const
 
 Double_t AliL3HistogramAdaptive::GetBinCenterY(Int_t ybin) const
 {
+  //Returns bin center in Y
   if(ybin < fFirstYbin || ybin > fLastYbin)
     {
       LOG(AliL3Log::kError,"AliL3HistogramAdaptive::GetBinCenterY","ybin")
@@ -193,6 +200,7 @@ Double_t AliL3HistogramAdaptive::GetBinCenterY(Int_t ybin) const
 
 void AliL3HistogramAdaptive::Draw(Char_t *option)
 {
+  //Draw the histogram
 #ifdef use_root
   if(!fRootHisto)
     CreateRootHisto();
@@ -216,8 +224,9 @@ void AliL3HistogramAdaptive::Draw(Char_t *option)
   cerr<<"AliL3HistogramAdaptive::Draw : You need to compile with ROOT in order to draw histogram"<<endl;
 }
 
-void AliL3HistogramAdaptive::Print()
+void AliL3HistogramAdaptive::Print() const
 {
+  //Print the contents of the histogram
   cout<<"Printing content of histogram "<<fName<<endl;
   for(Int_t i=0; i<fNcells; i++)
     {
index 56eb46d..92d1db3 100644 (file)
@@ -1,21 +1,13 @@
 // @(#) $Id$
 
-#ifndef ALIL3_HISTOGRAMADAPTIVE
-#define ALIL3_HISTOGRAMADAPTIVE
+#ifndef ALIL3HISTOGRAMADAPTIVE_H
+#define ALIL3HISTOGRAMADAPTIVE_H
 
 #include "AliL3RootTypes.h"
 #include "AliL3Histogram.h"
 
 class AliL3HistogramAdaptive : public AliL3Histogram {
   
- private:
-  Double_t fPtres;
-  Double_t fMinPt;
-  Double_t fMaxPt;
-  Double_t *fKappaBins; //!
-  
-  Int_t InitKappaBins();
-  
  public:
   AliL3HistogramAdaptive();
   AliL3HistogramAdaptive(Char_t *name,Double_t minpt,Double_t maxpt,Double_t ptres,
@@ -27,11 +19,19 @@ class AliL3HistogramAdaptive : public AliL3Histogram {
   Int_t FindXbin(Double_t x) const;
   Int_t FindYbin(Double_t x) const;
   void Draw(Char_t *option = "hist");
-  void Print();
+  void Print() const;
 
   Double_t GetBinCenterX(Int_t xbin) const;
   Double_t GetBinCenterY(Int_t ybin) const;
 
+ private:
+  Double_t fPtres;//The desired Pt resolution
+  Double_t fMinPt;//Minimum Pt
+  Double_t fMaxPt;//Maximum Pt
+  Double_t *fKappaBins; //!
+  
+  Int_t InitKappaBins();
+  
   ClassDef(AliL3HistogramAdaptive,1) //2D histogram class
     
 };
index 66c0c84..caf550e 100644 (file)
@@ -59,7 +59,7 @@ class AliL3HoughBaseTransformer {
 
   AliL3DigitRowData *GetDataPointer() {return fDigitRowData;}
  
-  virtual Int_t GetEtaIndex(Double_t eta) = 0;
+  virtual Int_t GetEtaIndex(Double_t eta) const = 0;
   virtual void GetEtaIndexes(Double_t /*eta*/,Int_t */*indexes*/) const
     {STDCERR<<"GetEtaIndexes not implemented for this Transformer class"<<STDENDL;}
   virtual AliL3Histogram *GetHistogram(Int_t etaindex) = 0;
index 6f3fe9f..926db32 100644 (file)
@@ -33,7 +33,7 @@ ClassImp(AliL3HoughDisplay)
 
 AliL3HoughDisplay::AliL3HoughDisplay()
 {
-
+  //default ctor
   fTracks = 0;
   fDigitRowData = 0;
   fNDigitRowData = 0;
@@ -43,12 +43,14 @@ AliL3HoughDisplay::AliL3HoughDisplay()
 
 AliL3HoughDisplay::~AliL3HoughDisplay()
 {
+  //dtor
   if(fTracks)
     delete fTracks;
 }
 
 void AliL3HoughDisplay::Init(Char_t *trackfile, Char_t *gfile)
 {
+  //Init hough display
   TFile *file = TFile::Open(gfile);
   if(!file->IsOpen())
     cerr<<"AliL3HoughDisplay::AliL3HoughDisplay : Geometry file " << gfile << " does not exist"<<endl;
@@ -65,6 +67,7 @@ void AliL3HoughDisplay::Init(Char_t *trackfile, Char_t *gfile)
 
 void AliL3HoughDisplay::GenerateHits(AliL3Track *track,Float_t *x,Float_t *y,Float_t *z,Int_t &n)
 {
+  //Generate hits according to the track parameters
   n=0;
   Float_t xyz[3];
   for(Int_t i=AliL3Transform::GetFirstRow(0); i<AliL3Transform::GetLastRow(5); i++)
@@ -84,7 +87,7 @@ void AliL3HoughDisplay::GenerateHits(AliL3Track *track,Float_t *x,Float_t *y,Flo
 
 TPolyMarker3D *AliL3HoughDisplay::LoadDigits()
 {
-  
+  //Load digits  
   AliL3DigitRowData *tempPt = fDigitRowData;
   if(!tempPt)
     {
@@ -161,10 +164,10 @@ void AliL3HoughDisplay::DisplayEvent()
       
       pm->SetMarkerColor(2);
       pm->Draw();
-      TPolyLine3D *current_line = &(line[j]);
-      current_line = new TPolyLine3D(n,x,y,z,"");
-      current_line->SetLineColor(4);
-      current_line->Draw("same");
+      TPolyLine3D *currentline = &(line[j]);
+      currentline = new TPolyLine3D(n,x,y,z,"");
+      currentline->SetLineColor(4);
+      currentline->Draw("same");
       
     }
   
index 59cafba..084e516 100644 (file)
@@ -1,7 +1,7 @@
 // @(#) $Id$
 
-#ifndef ALIL3HoughDisplay
-#define ALIL3HoughDisplay
+#ifndef ALIL3HOUGHDISPLAY_H
+#define ALIL3HOUGHDISPLAY_H
 
 #include "AliL3RootTypes.h"
 
@@ -13,27 +13,27 @@ class AliL3Track;
 
 class AliL3HoughDisplay {
 
+ public:
+  AliL3HoughDisplay();
+  virtual ~AliL3HoughDisplay();
+  
+  void Init(Char_t *trackfile, Char_t *gfile="$(LEVEL3)/GEO/alice.geom");
+  void DisplayEvent();
+  void ShowData(AliL3DigitRowData *data,UInt_t size,Int_t slice,Int_t patch);
+
  private:
   
   TGeometry *fGeom; //!
   AliL3TrackArray *fTracks; //!
   AliL3DigitRowData *fDigitRowData;  //!
   UInt_t fNDigitRowData; //!
-  Int_t fShowSlice; 
-  Int_t fPatch;
+  Int_t fShowSlice; //Which slice to show
+  Int_t fPatch;//Which patch to show
   
   void GenerateHits(AliL3Track *track,Float_t *x,Float_t *y,Float_t *z,Int_t &n);
   
   TPolyMarker3D *LoadDigits();
 
- public:
-  AliL3HoughDisplay();
-  virtual ~AliL3HoughDisplay();
-  
-  void Init(Char_t *trackfile, Char_t *gfile="$(LEVEL3)/GEO/alice.geom");
-  void DisplayEvent();
-  void ShowData(AliL3DigitRowData *data,UInt_t size,Int_t slice,Int_t patch);
-
   ClassDef(AliL3HoughDisplay,1) 
 };
 
index abe8585..11b8f76 100644 (file)
@@ -40,6 +40,7 @@ AliL3HoughIntMerger::~AliL3HoughIntMerger()
 
 void AliL3HoughIntMerger::SetParameters(Double_t maxkappa, Double_t maxphi0, Double_t maxtgl)
 {
+  //Set merger params
   fMaxKappa = maxkappa;
   fMaxPhi0 = maxphi0;
   fMaxTgl = maxtgl;
@@ -47,6 +48,7 @@ void AliL3HoughIntMerger::SetParameters(Double_t maxkappa, Double_t maxphi0, Dou
 
 void AliL3HoughIntMerger::FillTracks(AliL3TrackArray *tracks)
 {
+  //Fills tracks into merger
   if(tracks->GetNTracks()==0)
     LOG(AliL3Log::kWarning,"AliL3HoughIntMerger::FillTracks","Track Array")
       <<"Adding empty track array"<<ENDLOG;
@@ -87,6 +89,7 @@ AliL3Track *AliL3HoughIntMerger::MultiMerge(AliL3TrackArray *mergedtrack,AliL3Tr
 
 void AliL3HoughIntMerger::MMerge()
 {
+  //Track merging??
   GetInTracks(0)->QSort();
   while(Merge());
   GetOutTracks()->AddTracks(GetInTracks(0));
@@ -94,7 +97,7 @@ void AliL3HoughIntMerger::MMerge()
 
 Int_t AliL3HoughIntMerger::Merge()
 {
-  
+  //Track merging??  
   AliL3TrackArray * tracks = GetInTracks(0);
   const Int_t  kNIn =tracks->GetNTracks();
   AliL3Track *tr[2];
@@ -133,6 +136,7 @@ Int_t AliL3HoughIntMerger::Merge()
 
 void AliL3HoughIntMerger::Print(AliL3Track **tracks)
 {
+  //Prints merger results
   AliL3HoughTrack *tr1 = (AliL3HoughTrack*)tracks[0];
   AliL3HoughTrack *tr2 = (AliL3HoughTrack*)tracks[1];
   Double_t kappadiff = fabs(tr1->GetKappa()-tr2->GetKappa());
index f7c0458..7e89caa 100644 (file)
@@ -10,14 +10,6 @@ class AliL3Track;
 class AliL3TrackArray;
 
 class AliL3HoughIntMerger : public AliL3Merger {
-
- private:
-  Int_t fPatch;
-  Int_t fRowMin;
-  Int_t fRowMax;
-  Double_t fMaxKappa;
-  Double_t fMaxPhi0;
-  Double_t fMaxTgl;
  
  public:
   AliL3HoughIntMerger();
@@ -34,6 +26,14 @@ class AliL3HoughIntMerger : public AliL3Merger {
   void SortTracks(AliL3Track **tracks, Int_t ntrack);
   void Print(AliL3Track **tracks);
 
+ private:
+  Int_t fPatch;//Index of the current patch
+  Int_t fRowMin;//First padrow inside the patch
+  Int_t fRowMax;//Last padrow inside the patch
+  Double_t fMaxKappa;//Maximum track curvature
+  Double_t fMaxPhi0;//Maximum phi0??
+  Double_t fMaxTgl;//??
+
   ClassDef(AliL3HoughIntMerger,1) 
 };
 
index 2e9b785..010c45d 100644 (file)
@@ -41,11 +41,12 @@ AliL3HoughMerger::AliL3HoughMerger(Int_t nsubsectors)
 
 AliL3HoughMerger::~AliL3HoughMerger()
 {
+  //dtor 
 }
 
 void AliL3HoughMerger::FillTracks(AliL3TrackArray *tracks,Int_t patch)
 {
+  //Fills tracks into merger
   if(tracks->GetNTracks()==0)
     LOG(AliL3Log::kWarning,"AliL3HoughMerger::FillTracks","Track Array")
       <<"Adding empty track array"<<ENDLOG;
@@ -56,6 +57,7 @@ void AliL3HoughMerger::FillTracks(AliL3TrackArray *tracks,Int_t patch)
 
 void AliL3HoughMerger::SetParameters(Double_t maxkappa,Double_t maxpsi,Double_t maxphi0)
 {
+  //Set merger params
   fMaxKappa = maxkappa;
   fMaxPsi = maxpsi;
   fMaxPhi0 = maxphi0;
@@ -88,6 +90,7 @@ Bool_t AliL3HoughMerger::IsTrack(AliL3Track *innertrack,AliL3Track *outertrack)
 
 void AliL3HoughMerger::AddTrack(AliL3TrackArray *mergedtrack,AliL3Track *track)
 {
+  //Adds track to an already merged one
   AliL3Track *t[1];
   t[0] = track;
   MultiMerge(mergedtrack,t,1);
@@ -145,6 +148,7 @@ void AliL3HoughMerger::MergePatches(Bool_t slow)
 
 void AliL3HoughMerger::Merge()
 {
+  //Merging of tracks
   Double_t edge0 = AliL3Transform::Pi()/18;
   //Double_t edge1 = 2*PI - edge0;
   AliL3TrackArray *ttt = GetOutTracks();
@@ -205,7 +209,7 @@ void AliL3HoughMerger::Merge()
 
 Int_t AliL3HoughMerger::Merge(AliL3TrackArray* mergedtrack,AliL3TrackArray *tracksin,AliL3TrackArray *tracksout)
 {
-  
+  //Merging of tracks  
   AliL3Track *tracks[2];
   const Int_t  kNOut=tracksout->GetNTracks();
   const Int_t  kNIn =tracksin->GetNTracks();
@@ -252,6 +256,7 @@ Int_t AliL3HoughMerger::Merge(AliL3TrackArray* mergedtrack,AliL3TrackArray *trac
 
 void AliL3HoughMerger::SlowMerge(AliL3TrackArray *mergedtrack,AliL3TrackArray *tracksin,AliL3TrackArray *tracksout,Double_t xval)
 {
+  //Slow merging of tracks??
   void *ntuple=GetNtuple();
   const Int_t  kNOut=tracksout->GetNTracks();
   const Int_t  kNIn =tracksin->GetNTracks();
@@ -305,6 +310,7 @@ void AliL3HoughMerger::SlowMerge(AliL3TrackArray *mergedtrack,AliL3TrackArray *t
 
 void AliL3HoughMerger::Print(AliL3Track **tracks)
 {
+  //Print merging results
   AliL3HoughTrack *tr1 = (AliL3HoughTrack*)tracks[0];
   AliL3HoughTrack *tr2 = (AliL3HoughTrack*)tracks[1];
   Double_t kappadiff = fabs(tr1->GetKappa()-tr2->GetKappa());
index 56eda18..9562aef 100644 (file)
@@ -1,7 +1,7 @@
 // @(#) $Id$
 
-#ifndef ALIL3_HOUGH_Merger
-#define ALIL3_HOUGH_Merger
+#ifndef ALIL3HOUGHMERGER_H
+#define ALIL3HOUGHMERGER_H
 
 #include "AliL3RootTypes.h"
 #include "AliL3Merger.h"
@@ -10,19 +10,6 @@ class AliL3TrackArray;
 class AliL3Track;
 
 class AliL3HoughMerger : public AliL3Merger {
-  
- private:
-  Double_t fMaxY;
-  Double_t fMaxZ;
-  Double_t fMaxKappa;
-  Double_t fMaxPsi;
-  Double_t fMaxTgl;
-  Double_t fMaxPhi0;
-  Bool_t fSlow;
-
-  void Merge();
-  Int_t Merge(AliL3TrackArray* mergedtrack,AliL3TrackArray *tracksin,AliL3TrackArray *tracksout);
-  void SlowMerge(AliL3TrackArray *mergedtrack,AliL3TrackArray *tracksin,AliL3TrackArray *tracksout,Double_t xval);
 
  public:
   AliL3HoughMerger(); 
@@ -40,6 +27,19 @@ class AliL3HoughMerger : public AliL3Merger {
   void Print(AliL3Track **tracks);
   void SetParameters(Double_t maxkappa=0.001, Double_t maxpsi=0.05,Double_t maxphi0=0.1);
   
+ private:
+  Double_t fMaxY;//maximum Y
+  Double_t fMaxZ;//maximum Z
+  Double_t fMaxKappa;//maximum track curvature
+  Double_t fMaxPsi;//maximum track emission angle
+  Double_t fMaxTgl;//??
+  Double_t fMaxPhi0;//??
+  Bool_t fSlow;//??
+
+  void Merge();
+  Int_t Merge(AliL3TrackArray* mergedtrack,AliL3TrackArray *tracksin,AliL3TrackArray *tracksout);
+  void SlowMerge(AliL3TrackArray *mergedtrack,AliL3TrackArray *tracksin,AliL3TrackArray *tracksout,Double_t xval);
+  
   ClassDef(AliL3HoughMerger,1) //Patch merger for Hough tracklets
 
 };
index 117b7f8..0b19bd6 100644 (file)
@@ -43,10 +43,12 @@ ClassImp(AliL3HoughTrack)
 
 AliL3HoughTrack::~AliL3HoughTrack()
 {
+  //dtor
 }
 
 void AliL3HoughTrack::Set(AliL3Track *track)
 {
+  //Basically copy constructor
   AliL3HoughTrack *tpt = (AliL3HoughTrack*)track;
   SetTrackParameters(tpt->GetKappa(),tpt->GetPsi(),tpt->GetWeight());
   SetEtaIndex(tpt->GetEtaIndex());
@@ -76,6 +78,7 @@ void AliL3HoughTrack::Set(AliL3Track *track)
 
 Int_t AliL3HoughTrack::Compare(const AliL3Track *tpt) const
 {
+  //Compare 2 hough tracks according to their weight
   AliL3HoughTrack *track = (AliL3HoughTrack*)tpt;
   if(track->GetWeight() < GetWeight()) return 1;
   if(track->GetWeight() > GetWeight()) return -1;
@@ -171,6 +174,7 @@ void AliL3HoughTrack::UpdateToFirstRow()
 
 void AliL3HoughTrack::SetTrackParameters(Double_t kappa,Double_t eangle,Int_t weight)
 {
+  //Set track parameters - sort of ctor
   fWeight = weight;
   fMinDist = 100000;
   SetKappa(kappa);
@@ -210,17 +214,19 @@ void AliL3HoughTrack::SetLineParameters(Double_t psi,Double_t D,Int_t weight,Int
   fIsHelix = false;
 }
 
-void AliL3HoughTrack::SetBestMCid(Int_t mcid,Double_t min_dist)
+void AliL3HoughTrack::SetBestMCid(Int_t mcid,Double_t mindist)
 {
-  if(min_dist < fMinDist)
+  //Finds and set the closest mc label
+  if(mindist < fMinDist)
     {
-      fMinDist = min_dist;
+      fMinDist = mindist;
       SetMCid(mcid);
     }
 }
 
 void AliL3HoughTrack::GetLineCrossingPoint(Int_t padrow,Float_t *xy)
 {
+  //Returns the crossing point of the track with a given padrow
   if(fIsHelix)
     {
       printf("AliL3HoughTrack::GetLineCrossingPoint : Track is not a line\n");
index 96483ce..aced427 100644 (file)
@@ -1,27 +1,12 @@
 // @(#) $Id$
 
-#ifndef ALIL3_HOUGH_Track
-#define ALIL3_HOUGH_Track
+#ifndef ALIL3HOUGHTRACK_H
+#define ALIL3HOUGHTRACK_H
 
 #include "AliL3Track.h"
 
 class AliL3HoughTrack : public AliL3Track {
   
- private:
-  
-  Double_t fMinDist;
-  Int_t fWeight;
-  Int_t fEtaIndex;
-  Double_t fEta;
-  Int_t fSlice; //The slice where this track was found
-
-  Double_t fDLine;
-  Double_t fPsiLine;
-  Bool_t fIsHelix;
-
-  Float_t fBinX,fBinY,fSizeX,fSizeY;
-
  public:
   AliL3HoughTrack(); 
   virtual ~AliL3HoughTrack();
@@ -29,10 +14,10 @@ class AliL3HoughTrack : public AliL3Track {
   virtual void Set(AliL3Track *track);
   virtual Int_t Compare(const AliL3Track *track) const;
   
-  Bool_t IsHelix() {return fIsHelix;}
+  Bool_t IsHelix() const {return fIsHelix;}
   void UpdateToFirstRow();
   void SetTrackParameters(Double_t kappa,Double_t eangle,Int_t weight);  
-  void SetLineParameters(Double_t psi,Double_t D,Int_t weight,Int_t *rowrange,Int_t ref_row);
+  void SetLineParameters(Double_t psi,Double_t D,Int_t weight,Int_t *rowrange,Int_t refrow);
 
   Int_t GetWeight()  const {return fWeight;}
   Double_t GetPsiLine() const {return fPsiLine;}
@@ -53,12 +38,27 @@ class AliL3HoughTrack : public AliL3Track {
   void SetEta(Double_t f);
   void SetWeight(Int_t i,Bool_t update=kFALSE) {if(update) fWeight+= i; else fWeight = i;}
   void SetEtaIndex(Int_t f) {fEtaIndex = f;}
-  void SetBestMCid(Int_t f,Double_t min_dist);
+  void SetBestMCid(Int_t f,Double_t mindist);
   void SetDLine(Double_t f) {fDLine=f;}
   void SetPsiLine(Double_t f) {fPsiLine=f;}
 
   void SetBinXY(Float_t binx,Float_t biny,Float_t sizex,Float_t sizey) {fBinX = binx; fBinY = biny; fSizeX = sizex; fSizeY = sizey;}
 
+ private:
+  
+  Double_t fMinDist;//Minimum distance to a generated track while associating mc label 
+  Int_t fWeight;//Track weight
+  Int_t fEtaIndex;//Eta slice index
+  Double_t fEta;//Track Eta
+  Int_t fSlice; //The slice where this track was found
+
+  Double_t fDLine;//??
+  Double_t fPsiLine;//??
+  Bool_t fIsHelix;//Is the track helix or not?
+
+  Float_t fBinX,fBinY,fSizeX,fSizeY;//Size and position of the hough space peak 
+
   ClassDef(AliL3HoughTrack,1) //Track class for Hough tracklets
 
 };
index 5aad5fc..7350cdf 100644 (file)
@@ -150,10 +150,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 +178,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 +192,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.
   
index a171cdf..918da5b 100644 (file)
@@ -25,8 +25,8 @@ class AliL3HoughTransformer : public AliL3HoughBaseTransformer {
   void TransformLine(Int_t *rowrange=0,Float_t *phirange=0);
   void TransformLineC(Int_t *rowrange,Float_t *phirange);
 
-  Int_t GetEtaIndex(Double_t eta);
-  void GetEtaIndexes(Double_t eta,Int_t *indexes);
+  Int_t GetEtaIndex(Double_t eta) const;
+  void GetEtaIndexes(Double_t eta,Int_t *indexes) const;
   AliL3Histogram *GetHistogram(Int_t etaindex);
   Double_t GetEta(Int_t etaindex,Int_t slice) const;
   Int_t GetTrackID(Int_t etaindex,Double_t kappa,Double_t psi);
index a770a52..9323841 100644 (file)
@@ -313,7 +313,7 @@ void AliL3HoughTransformerLUT::Reset()
     fParamSpace[i]->Reset();
 }
 
-Int_t AliL3HoughTransformerLUT::GetEtaIndex(Double_t eta)
+Int_t AliL3HoughTransformerLUT::GetEtaIndex(Double_t eta) const
 {
   //Return the histogram index of the corresponding eta. 
   
index 19548e1..88b8f0c 100644 (file)
@@ -26,7 +26,7 @@ class AliL3HoughTransformerLUT : public AliL3HoughBaseTransformer {
 
   void TransformCircle();
 
-  Int_t GetEtaIndex(Double_t eta);
+  Int_t GetEtaIndex(Double_t eta) const;
   AliL3Histogram *GetHistogram(Int_t etaIndex);
   Double_t GetEta(Int_t etaIndex,Int_t slice) const;
   
index 9f51475..0694a46 100644 (file)
@@ -30,7 +30,7 @@ UChar_t **AliL3HoughTransformerRow::fgRowCount = 0;
 UChar_t **AliL3HoughTransformerRow::fgGapCount = 0;
 UChar_t **AliL3HoughTransformerRow::fgCurrentRowCount = 0;
 #ifdef do_mc
-TrackIndex **AliL3HoughTransformerRow::fgTrackID = 0;
+AliL3TrackIndex **AliL3HoughTransformerRow::fgTrackID = 0;
 #endif
 UChar_t *AliL3HoughTransformerRow::fgTrackNRows = 0;
 UChar_t *AliL3HoughTransformerRow::fgTrackFirstRow = 0;
@@ -198,10 +198,10 @@ void AliL3HoughTransformerRow::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t
       if(!fgTrackID)
        {
          LOG(AliL3Log::kInformational,"AliL3HoughTransformerRow::CreateHistograms()","")
-           <<"Transformer: Allocating "<<GetNEtaSegments()*ncells*sizeof(TrackIndex)<<" bytes to fgTrackID"<<ENDLOG;
-         fgTrackID = new TrackIndex*[GetNEtaSegments()];
+           <<"Transformer: Allocating "<<GetNEtaSegments()*ncells*sizeof(AliL3TrackIndex)<<" bytes to fgTrackID"<<ENDLOG;
+         fgTrackID = new AliL3TrackIndex*[GetNEtaSegments()];
          for(Int_t i=0; i<GetNEtaSegments(); i++)
-           fgTrackID[i] = new TrackIndex[ncells];
+           fgTrackID[i] = new AliL3TrackIndex[ncells];
        }
     }
 #endif
@@ -350,7 +350,7 @@ void AliL3HoughTransformerRow::Reset()
       Int_t ncellsy = (hist->GetNbinsY()+3)/2;
       Int_t ncells = ncellsx*ncellsy;
       for(Int_t i=0; i<GetNEtaSegments(); i++)
-       memset(fgTrackID[i],0,ncells*sizeof(TrackIndex));
+       memset(fgTrackID[i],0,ncells*sizeof(AliL3TrackIndex));
     }
 #endif
   AliL3Histogram *hist = fParamSpace[0];
@@ -364,7 +364,7 @@ void AliL3HoughTransformerRow::Reset()
     }
 }
 
-Int_t AliL3HoughTransformerRow::GetEtaIndex(Double_t eta)
+Int_t AliL3HoughTransformerRow::GetEtaIndex(Double_t eta) const
 {
   //Return the histogram index of the corresponding eta. 
 
index d032897..e210b44 100644 (file)
@@ -27,7 +27,7 @@ class AliL3HoughTransformerRow : public AliL3HoughBaseTransformer {
   void Reset();
   void TransformCircle();
 
-  Int_t GetEtaIndex(Double_t eta);
+  Int_t GetEtaIndex(Double_t eta) const;
   AliL3Histogram *GetHistogram(Int_t etaindex);
   Double_t GetEta(Int_t etaindex,Int_t slice) const;
   Int_t GetTrackID(Int_t etaindex,Double_t kappa,Double_t psi);