Coding violation fixes...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 26 Oct 2004 08:17:26 +0000 (08:17 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 26 Oct 2004 08:17:26 +0000 (08:17 +0000)
HLT/hough/AliL3Hough.cxx
HLT/hough/AliL3HoughTransformerRow.cxx
HLT/hough/AliL3HoughTransformerRow.h

index 23eb283b60f1e12350e1f575feb1bd6d4f7bb903..bc4ead0eac2ecf694557b2b1596b18b153d423f5 100644 (file)
@@ -973,7 +973,7 @@ void AliL3Hough::FindTrackCandidatesRow()
          if(hist->GetNEntries()==0) continue;
          fPeakFinder->SetHistogram(hist);
          fPeakFinder->SetEtaSlice(j);
-         fPeakFinder->SetTrackLUTs(((AliL3HoughTransformerRow *)tr)->fTrackNRows,((AliL3HoughTransformerRow *)tr)->fTrackFirstRow,((AliL3HoughTransformerRow *)tr)->fTrackLastRow);
+         fPeakFinder->SetTrackLUTs(((AliL3HoughTransformerRow *)tr)->GetTrackNRows(),((AliL3HoughTransformerRow *)tr)->GetTrackFirstRow(),((AliL3HoughTransformerRow *)tr)->GetTrackLastRow());
 #ifdef do_mc
          LOG(AliL3Log::kInformational,"AliL3Hough::FindTrackCandidates()","")
            <<"Starting "<<j<<" etaslice"<<ENDLOG;
index a914544a1bc209c426d28831407b514dc46208d1..c4204d3aac55fe92e912fc43a61145a6709da52f 100644 (file)
@@ -1,8 +1,7 @@
 // @(#) $Id$
 
 
-// Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
-//*-- Copyright &copy ALICE HLT Group
+// Author: Cvetan Cheshkov <mailto:cvetan.cheshkov@cern.ch>
 
 #include "AliL3StandardIncludes.h"
 
@@ -21,8 +20,10 @@ using namespace std;
 //_____________________________________________________________
 // AliL3HoughTransformerRow
 //
-// TPC rows Hough transformation class
+// Impelementation of the so called "TPC rows Hough transformation" class
 //
+// Transforms the TPC data into the hough space and counts the missed TPC
+// rows corresponding to each track cnadidate - hough space bin
 
 ClassImp(AliL3HoughTransformerRow)
 
@@ -242,10 +243,13 @@ void AliL3HoughTransformerRow::DeleteHistograms()
 }
 
 struct AliL3TrackLength {
-  Bool_t fIsFilled;
-  UInt_t fFirstRow;
-  UInt_t fLastRow;
-  Float_t fTrackPt;
+  // Structure is used for temporarely storage of the LUT
+  // which contains the track lengths associated to each hough
+  // space bin
+  Bool_t fIsFilled; // Is bin already filled?
+  UInt_t fFirstRow; // First TPC row crossed by the track
+  UInt_t fLastRow; // Last TPC row crossed by the track
+  Float_t fTrackPt; // Pt of the track
 };
 
 void AliL3HoughTransformerRow::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t xmax,
@@ -265,29 +269,7 @@ void AliL3HoughTransformerRow::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t
     }
 
   if(fLastTransformer) {
-
-    fGapCount = ((AliL3HoughTransformerRow *)fLastTransformer)->fGapCount;
-    fCurrentRowCount = ((AliL3HoughTransformerRow *)fLastTransformer)->fCurrentRowCount;
-#ifdef do_mc
-    fTrackID = ((AliL3HoughTransformerRow *)fLastTransformer)->fTrackID;
-#endif
-    fTrackNRows = ((AliL3HoughTransformerRow *)fLastTransformer)->fTrackNRows;
-    fTrackFirstRow = ((AliL3HoughTransformerRow *)fLastTransformer)->fTrackFirstRow;
-    fTrackLastRow = ((AliL3HoughTransformerRow *)fLastTransformer)->fTrackLastRow;
-    fInitialGapCount = ((AliL3HoughTransformerRow *)fLastTransformer)->fInitialGapCount;
-
-    fPrevBin = ((AliL3HoughTransformerRow *)fLastTransformer)->fPrevBin;
-    fNextBin = ((AliL3HoughTransformerRow *)fLastTransformer)->fNextBin;
-    fNextRow = ((AliL3HoughTransformerRow *)fLastTransformer)->fNextRow;
-
-    fStartPadParams = ((AliL3HoughTransformerRow *)fLastTransformer)->fStartPadParams;
-    fEndPadParams = ((AliL3HoughTransformerRow *)fLastTransformer)->fEndPadParams;
-    fLUTr2 = ((AliL3HoughTransformerRow *)fLastTransformer)->fLUTr2;
-    fLUTforwardZ = ((AliL3HoughTransformerRow *)fLastTransformer)->fLUTforwardZ;
-    fLUTforwardZ2 = ((AliL3HoughTransformerRow *)fLastTransformer)->fLUTforwardZ2;
-    fLUTbackwardZ = ((AliL3HoughTransformerRow *)fLastTransformer)->fLUTbackwardZ;
-    fLUTbackwardZ2 = ((AliL3HoughTransformerRow *)fLastTransformer)->fLUTbackwardZ2;
-
+    SetTransformerArrays((AliL3HoughTransformerRow *)fLastTransformer);
     return;
   }
 #ifdef do_mc
@@ -694,6 +676,10 @@ Double_t AliL3HoughTransformerRow::GetEta(Int_t etaindex,Int_t /*slice*/) const
 
 void AliL3HoughTransformerRow::TransformCircle()
 {
+  // This method contains the hough transformation
+  // Depending on the option selected, it reads as an input
+  // either the preloaded array with digits or directly raw
+  // data stream (option fast_raw)
   if(GetDataPointer())
     TransformCircleFromDigitArray();
   else if(fTPCRawStream)
@@ -1083,53 +1069,17 @@ Int_t AliL3HoughTransformerRow::GetTrackID(Int_t etaindex,Double_t alpha1,Double
   return -1;
 }
 
-UChar_t *AliL3HoughTransformerRow::GetGapCount(Int_t etaindex)
-{
-  return fGapCount[etaindex];
-}
-
-UChar_t *AliL3HoughTransformerRow::GetCurrentRowCount(Int_t etaindex)
-{
-  return fCurrentRowCount[etaindex];
-}
-
-UChar_t *AliL3HoughTransformerRow::GetTrackNRows()
-{
-  return fTrackNRows;
-}
-
-
-UChar_t *AliL3HoughTransformerRow::GetTrackFirstRow()
-{
-  return fTrackFirstRow;
-}
-
-UChar_t *AliL3HoughTransformerRow::GetTrackLastRow()
-{
-  return fTrackLastRow;
-}
-
-UChar_t *AliL3HoughTransformerRow::GetPrevBin(Int_t etaindex)
-{
-  return fPrevBin[etaindex];
-}
-
-UChar_t *AliL3HoughTransformerRow::GetNextBin(Int_t etaindex)
-{
-  return fNextBin[etaindex];
-}
-
-UChar_t *AliL3HoughTransformerRow::GetNextRow(Int_t etaindex)
-{
-  return fNextRow[etaindex];
-}
-
 inline void AliL3HoughTransformerRow::FillClusterRow(UChar_t i,Int_t binx1,Int_t binx2,UChar_t *ngaps2,UChar_t *currentrow2,UChar_t *lastrow2
 #ifdef do_mc
                           ,AliL3EtaRow etaclust,AliL3TrackIndex *trackid
 #endif
                           )
 {
+  // The method is a part of the fast hough transform.
+  // It fills one row of the hough space.
+  // It is called by FillCluster() method inside the
+  // loop over alpha2 bins
+
   for(Int_t bin=binx1;bin<=binx2;bin++)
     {
       if(ngaps2[bin] < MAX_N_GAPS) {
@@ -1163,6 +1113,9 @@ inline void AliL3HoughTransformerRow::FillClusterRow(UChar_t i,Int_t binx1,Int_t
 
 inline void AliL3HoughTransformerRow::FillCluster(UChar_t i,Int_t etaindex,AliL3EtaRow *etaclust,Int_t ilastpatch,Int_t firstbinx,Int_t lastbinx,Int_t nbinx,Int_t firstbiny)
 {
+  // The method is a part of the fast hough transform.
+  // It fills a TPC cluster into the hough space.
+
   UChar_t *ngaps = fGapCount[etaindex];
   UChar_t *currentrow = fCurrentRowCount[etaindex];
   UChar_t *lastrow = fTrackLastRow;
@@ -1271,6 +1224,9 @@ inline void AliL3HoughTransformerRow::FillCluster(UChar_t i,Int_t etaindex,AliL3
 #ifdef do_mc
 inline void AliL3HoughTransformerRow::FillClusterMCLabels(AliL3DigitData digpt,AliL3EtaRow *etaclust)
 {
+  // The method is a part of the fast hough transform.
+  // It fills the MC labels of a TPC cluster into a
+  // special hough space array.
   for(Int_t t=0; t<3; t++)
     {
       Int_t label = digpt.fTrackID[t];
@@ -1284,3 +1240,34 @@ inline void AliL3HoughTransformerRow::FillClusterMCLabels(AliL3DigitData digpt,A
     }
 }
 #endif
+
+void AliL3HoughTransformerRow::SetTransformerArrays(AliL3HoughTransformerRow *tr)
+{
+  // In case of sequential filling of the hough space, the method is used to
+  // transmit the pointers to the hough arrays from one transformer to the
+  // following one.
+
+    fGapCount = tr->fGapCount;
+    fCurrentRowCount = tr->fCurrentRowCount;
+#ifdef do_mc
+    fTrackID = tr->fTrackID;
+#endif
+    fTrackNRows = tr->fTrackNRows;
+    fTrackFirstRow = tr->fTrackFirstRow;
+    fTrackLastRow = tr->fTrackLastRow;
+    fInitialGapCount = tr->fInitialGapCount;
+
+    fPrevBin = tr->fPrevBin;
+    fNextBin = tr->fNextBin;
+    fNextRow = tr->fNextRow;
+
+    fStartPadParams = tr->fStartPadParams;
+    fEndPadParams = tr->fEndPadParams;
+    fLUTr2 = tr->fLUTr2;
+    fLUTforwardZ = tr->fLUTforwardZ;
+    fLUTforwardZ2 = tr->fLUTforwardZ2;
+    fLUTbackwardZ = tr->fLUTbackwardZ;
+    fLUTbackwardZ2 = tr->fLUTbackwardZ2;
+
+    return;
+}
index 74b055784caa8a8a066711242918e13002185b3f..63db0550be6d8d6043a328595e4c4bb09cc2ad49 100644 (file)
@@ -22,10 +22,13 @@ struct AliL3EtaRow {
 };
 
 struct AliL3PadHoughParams {
-  Float_t fAlpha;
-  Float_t fDeltaAlpha;
-  Int_t fFirstBin;
-  Int_t fLastBin;
+  // Parameters which represent given pad in the hough space
+  // Used in order to avoid as much as possible floating
+  // point operations during the hough transform
+  Float_t fAlpha; // Starting value for the hough parameter alpha1
+  Float_t fDeltaAlpha; // Slope of alpha1
+  Int_t fFirstBin; // First alpha2 bin to be filled 
+  Int_t fLastBin; // Last alpha2 bin to be filled
 };
 
 class AliL3DigitData;
@@ -50,19 +53,21 @@ class AliL3HoughTransformerRow : public AliL3HoughBaseTransformer {
   AliL3Histogram *GetHistogram(Int_t etaindex);
   Double_t GetEta(Int_t etaindex,Int_t slice) const;
   Int_t GetTrackID(Int_t etaindex,Double_t alpha1,Double_t alpha2) const;
-  UChar_t *GetGapCount(Int_t etaindex);
-  UChar_t *GetCurrentRowCount(Int_t etaindex);
-  UChar_t *GetPrevBin(Int_t etaindex);
-  UChar_t *GetNextBin(Int_t etaindex);
-  UChar_t *GetNextRow(Int_t etaindex);
-  UChar_t *GetTrackNRows();
-  UChar_t *GetTrackFirstRow();
-  UChar_t *GetTrackLastRow();
+  UChar_t *GetGapCount(Int_t etaindex) const { return fGapCount[etaindex]; }
+  UChar_t *GetCurrentRowCount(Int_t etaindex) const { return fCurrentRowCount[etaindex]; }
+  UChar_t *GetPrevBin(Int_t etaindex) const { return fPrevBin[etaindex]; }
+  UChar_t *GetNextBin(Int_t etaindex) const { return fNextBin[etaindex]; }
+  UChar_t *GetNextRow(Int_t etaindex) const { return fNextRow[etaindex]; }
+  UChar_t *GetTrackNRows() const { return fTrackNRows; }
+  UChar_t *GetTrackFirstRow() const { return fTrackFirstRow; }
+  UChar_t *GetTrackLastRow() const { return fTrackLastRow; }
   static Float_t GetBeta1() {return fgBeta1;}
   static Float_t GetBeta2() {return fgBeta2;}
 
   void SetTPCRawStream(AliTPCRawStream *rawstream) {fTPCRawStream=rawstream;}
 
+ private:
+
   UChar_t **fGapCount; //!
   UChar_t **fCurrentRowCount; //!
 #ifdef do_mc
@@ -87,8 +92,6 @@ class AliL3HoughTransformerRow : public AliL3HoughBaseTransformer {
   Float_t *fLUTbackwardZ; //!
   Float_t *fLUTbackwardZ2; //!
 
- private:
-  
   AliL3Histogram **fParamSpace; //!
 
   void TransformCircleFromDigitArray();
@@ -106,9 +109,11 @@ class AliL3HoughTransformerRow : public AliL3HoughBaseTransformer {
   inline void FillClusterMCLabels(AliL3DigitData digpt,AliL3EtaRow *etaclust);
 #endif
 
+  void SetTransformerArrays(AliL3HoughTransformerRow *tr);
+
   static Float_t fgBeta1,fgBeta2; // Two curves which define the Hough space
 
-  AliTPCRawStream *fTPCRawStream;
+  AliTPCRawStream *fTPCRawStream; // Pointer to the raw stream in case of fast reading of the raw data (fast_raw flag)
 
   ClassDef(AliL3HoughTransformerRow,1) //TPC Rows Hough transformation class