Added function AliL3HoughTransformer::GetEtaIndex. Modified AliL3Hough::WriteTracks.
authorvestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Apr 2002 09:08:16 +0000 (09:08 +0000)
committervestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Apr 2002 09:08:16 +0000 (09:08 +0000)
HLT/hough/AliL3Hough.cxx
HLT/hough/AliL3HoughMaxFinder.cxx
HLT/hough/AliL3HoughTransformer.cxx
HLT/hough/AliL3HoughTransformer.h
HLT/hough/Makefile

index 621ba03..0f419bd 100644 (file)
@@ -86,12 +86,11 @@ void AliL3Hough::CleanUp()
       if(fMemHandler[i]) delete fMemHandler[i];
     }
   
-  /*Shitty compiler doesn't allow this:
-    
-  if(fTracks) delete [] fTracks;
-  if(fEval) delete [] fEval;
-  if(fHoughTransformer) delete [] fHoughTransformer;
-  if(fMemHandler) delete [] fMemHandler;
+  /*    
+       if(fTracks) delete [] fTracks;
+       if(fEval) delete [] fEval;
+       if(fHoughTransformer) delete [] fHoughTransformer;
+       if(fMemHandler) delete [] fMemHandler;
   */
 }
 
@@ -233,6 +232,7 @@ void AliL3Hough::ProcessPatchIter(Int_t patch)
   ev->InitTransformer(tr);
   ev->RemoveFoundTracks();
   ev->SetNumOfRowsToMiss(2);
+  ev->SetNumOfPadsToLook(2);
   AliL3Histogram *hist;
   for(Int_t t=0; t<num_of_tries; t++)
     {
@@ -244,10 +244,11 @@ void AliL3Hough::ProcessPatchIter(Int_t patch)
          if(hist->GetNEntries()==0) continue;
          fPeakFinder->SetHistogram(hist);
          Int_t n=1;
-         Int_t x[n],y[n];
-         fPeakFinder->FindAbsMaxima(*x,*y);
+         Float_t x,y;
+         //fPeakFinder->FindAbsMaxima(*x,*y);
+         fPeakFinder->FindPeak(3,0.95,5,x,y);
          AliL3HoughTrack *track = (AliL3HoughTrack*)tracks->NextTrack();
-         track->SetTrackParameters(hist->GetBinCenterX(*x),hist->GetBinCenterY(*y),1);
+         track->SetTrackParameters(x,y,1);
          if(!ev->LookInsideRoad(track,i))
            {   
              tracks->Remove(tracks->GetNTracks()-1);
@@ -383,10 +384,23 @@ void AliL3Hough::WriteTracks(Char_t *path)
 {
   AliL3MemHandler *mem = new AliL3MemHandler();
   Char_t fname[100];
-  sprintf(fname,"%s/tracks.raw",path);
-  mem->SetBinaryOutput(fname);
-  mem->TrackArray2Binary(fTracks[0]);
-  mem->CloseBinaryOutput();
+  if(fAddHistograms)
+    {
+      sprintf(fname,"%s/tracks.raw",path);
+      mem->SetBinaryOutput(fname);
+      mem->TrackArray2Binary(fTracks[0]);
+      mem->CloseBinaryOutput();
+    }
+  else 
+    {
+      for(Int_t i=0; i<fNPatches; i++)
+       {
+         sprintf(fname,"%s/tracks_%d.raw",path,i);
+         mem->SetBinaryOutput(fname);
+         mem->TrackArray2Binary(fTracks[i]);
+         mem->CloseBinaryOutput();
+       }
+    }
   delete mem;
   
 }
index 776ec7e..1b3d217 100644 (file)
@@ -1,3 +1,5 @@
+//$Id$
+
 // Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
 //*-- Copyright &copy ASV 
 
@@ -634,6 +636,7 @@ void AliL3HoughMaxFinder::FindPeak1(Float_t *xpeaks,Float_t *ypeaks,Int_t *weigh
       ypeaks[i] = ytop/ybutt;
       weight[i] = w;
       
+      
       //Check if this peak is overlapping with a previous:
       for(Int_t p=0; p<i-1; p++)
        {
index 7723a69..5369b46 100644 (file)
@@ -1,3 +1,5 @@
+//$Id$
+
 // Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
 //*-- Copyright &copy ASV 
 
@@ -59,11 +61,10 @@ void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Double_t pt_min,
 {
   //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);
+  CreateHistograms(nxbin,-1.*x,x,nybin,phimin*ToRad,phimax*ToRad);
 }
 
 void AliL3HoughTransformer::CreateHistograms(Int_t nxbin,Double_t xmin,Double_t xmax,
@@ -101,6 +102,14 @@ void AliL3HoughTransformer::SetInputData(UInt_t ndigits,AliL3DigitRowData *ptr)
   fDigitRowData = ptr;
 }
 
+Int_t AliL3HoughTransformer::GetEtaIndex(Double_t eta)
+{
+  
+  Double_t etaslice = (fEtaMax - fEtaMin)/fNEtaSegments;
+  Double_t index = (eta-fEtaMin)/etaslice;
+  return (Int_t)index;
+}
+
 void AliL3HoughTransformer::TransformCircle()
 {
   //Transform the input data with a circle HT.
@@ -114,7 +123,7 @@ void AliL3HoughTransformer::TransformCircle()
       return;
     }
   
-  Double_t etaslice = (fEtaMax - fEtaMin)/fNEtaSegments;
+  //Double_t etaslice = (fEtaMax - fEtaMin)/fNEtaSegments;
   for(Int_t i=NRows[fPatch][0]; i<=NRows[fPatch][1]; i++)
     {
       AliL3DigitData *digPt = tempPt->fDigitData;
@@ -135,7 +144,7 @@ void AliL3HoughTransformer::TransformCircle()
          fTransform->Slice2Sector(fSlice,i,sector,row);
          fTransform->Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
          Double_t eta = fTransform->GetEta(xyz);
-         Int_t eta_index = (Int_t)((eta-fEtaMin)/etaslice);
+         Int_t eta_index = GetEtaIndex(eta);//(Int_t)((eta-fEtaMin)/etaslice);
          if(eta_index < 0 || eta_index >= fNEtaSegments)
            continue;
          
@@ -183,7 +192,7 @@ void AliL3HoughTransformer::TransformCircleC()
       rowPt[prow] = tempPt;
       AliL3MemHandler::UpdateRowPointer(tempPt);
     }
-  Double_t etaslice = (fEtaMax - fEtaMin)/fNEtaSegments;
+  //Double_t etaslice = (fEtaMax - fEtaMin)/fNEtaSegments;
 
   AliL3DigitData *digPt;
   Double_t r1,r2,phi1,phi2,eta,kappa,phi_0;
@@ -205,7 +214,7 @@ void AliL3HoughTransformer::TransformCircleC()
          fTransform->Slice2Sector(fSlice,i,sector,row);
          fTransform->Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
          eta = fTransform->GetEta(xyz);
-         eta_index1 = (Int_t)((eta-fEtaMin)/etaslice);
+         eta_index1 = GetEtaIndex(eta);//(Int_t)((eta-fEtaMin)/etaslice);
          if(eta_index1 < 0 || eta_index1 >= fNEtaSegments)
            continue;
          r1 = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]);
@@ -233,7 +242,7 @@ void AliL3HoughTransformer::TransformCircleC()
                  fTransform->Slice2Sector(fSlice,j,sector,row);
                  fTransform->Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
                  eta = fTransform->GetEta(xyz);
-                 eta_index2 = (Int_t)((eta-fEtaMin)/etaslice);
+                 eta_index2 = GetEtaIndex(eta);//(Int_t)((eta-fEtaMin)/etaslice);
                  if(eta_index2 != eta_index1)
                    continue;
                  r2 = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]);
@@ -264,7 +273,7 @@ void AliL3HoughTransformer::TransformLine()
       return;
     }
   
-  Double_t etaslice = (fEtaMax - fEtaMin)/fNEtaSegments;
+  //Double_t etaslice = (fEtaMax - fEtaMin)/fNEtaSegments;
   for(Int_t i=NRows[fPatch][0]; i<=NRows[fPatch][1]; i++)
     {
       AliL3DigitData *digPt = tempPt->fDigitData;
@@ -285,7 +294,7 @@ void AliL3HoughTransformer::TransformLine()
          fTransform->Slice2Sector(fSlice,i,sector,row);
          fTransform->Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
          Float_t eta = fTransform->GetEta(xyz);
-         Int_t eta_index = (Int_t)(eta/etaslice);
+         Int_t eta_index = GetEtaIndex(eta);//(Int_t)(eta/etaslice);
          if(eta_index < 0 || eta_index >= fNEtaSegments)
            continue;
          
index 5850565..8866d94 100644 (file)
@@ -26,6 +26,7 @@ class AliL3HoughTransformer {
   UInt_t fNDigitRowData;
   AliL3DigitRowData *fDigitRowData; //!
   
+  Int_t GetEtaIndex(Double_t eta);
   void DeleteHistograms();
 
  public:
index bca3fd8..65d0dc1 100644 (file)
@@ -5,6 +5,9 @@
 # Author: Anders Vestbo   #                    
 ###########################
 
+#USEPACKAGE = ROOT
+USEPACKAGE = ALIROOT
+
 CXX         = g++
 LD          = g++
 CXXFLAGS    = -O2 -Wall -fPIC
@@ -15,6 +18,14 @@ TOPDIR = $(HOME)/level3code
 OBJDIR = lib
 LIBDIR = $(LEVEL3)/lib_$(USERNAME)
 
+ifeq ($(USEPACKAGE),ROOT) 
+INCLUDES = -I$(ROOTSYS)/include -I$(TOPDIR)/hough -I$(TOPDIR)/src -I$(TOPDIR)/comp
+endif
+
+ifeq ($(USEPACKAGE),ALIROOT)
+INCLUDES = -I$(ROOTSYS)/include -I$(TOPDIR)/hough -I$(TOPDIR)/src -I$(TOPDIR)/comp -I$(ALICE_ROOT)/include/ -I$(ALICE_ROOT)/TPC -I$(ALICE_ROOT)/CONTAINERS -I$(ALICE_ROOT)/STEER
+endif
+
 SRCS   = AliL3HoughTransformer.cxx AliL3Hough.cxx AliL3HoughTrack.cxx\
          AliL3HoughMaxFinder.cxx AliL3HoughEval.cxx AliL3HoughMerger.cxx \
          AliL3Histogram.cxx AliL3Histogram1D.cxx \
@@ -37,11 +48,11 @@ $(LEVELSO) : $(OBJS)
 
 $(DICT) : $(HDRS)
        @echo "Generating dictionary..."
-       @rootcint -f $(DICT) -c -I$(ROOTSYS) -I$(TOPDIR)/src $(HDRS)
+       @rootcint -f $(DICT) -c $(INCLUDES) $(HDRS)
 
 
 $(OBJDIR)/%.o : %.cxx 
-       $(CXX) $(CXXFLAGS) -c -I$(ROOTSYS)/include -I$(TOPDIR)/src -I$(TOPDIR)/hough -o $@ $<
+       $(CXX) $(CXXFLAGS) -c $(INCLUDES) -o $@ $<
 
 $(OBJDIR) : 
        test ! -e $(OBJDIR) && mkdir -p $(OBJDIR)