Changes as a result of making AliL3Transform static.
authorvestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Apr 2002 15:18:39 +0000 (15:18 +0000)
committervestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Apr 2002 15:18:39 +0000 (15:18 +0000)
20 files changed:
HLT/exa/Binary.C
HLT/exa/Make_Init.C
HLT/hough/AliL3Hough.cxx
HLT/hough/AliL3Hough.h
HLT/hough/AliL3HoughBaseTransformer.cxx
HLT/hough/AliL3HoughBaseTransformer.h
HLT/hough/AliL3HoughDisplay.cxx
HLT/hough/AliL3HoughDisplay.h
HLT/hough/AliL3HoughEval.cxx
HLT/hough/AliL3HoughEval.h
HLT/hough/AliL3HoughGlobalMerger.cxx
HLT/hough/AliL3HoughMaxFinder.cxx
HLT/hough/AliL3HoughMaxFinder.h
HLT/hough/AliL3HoughMerger.cxx
HLT/hough/AliL3HoughTrack.cxx
HLT/hough/AliL3HoughTransformer.cxx
HLT/hough/GetGoodParticles.cxx
HLT/programs/runit.cxx
HLT/trigger/AliL3Trigger.cxx
HLT/trigger/AliL3Trigger.h

index 496630729e0989b3bc1f5e9ae4a3031716aa37c4..c5fd6710d48b3d9819fac46813c2429645167e7d 100644 (file)
@@ -17,8 +17,7 @@ Binary(char* in,int first, int last,char *path=""){
 
   AliL3FileHandler *fFileHandler = new AliL3FileHandler(); 
   fFileHandler->SetAliInput(in);
-  AliL3Transform *fTransformer = new AliL3Transform(path);
-  fFileHandler->SetTransformer(fTransformer);
+  AliL3Transform::Init(path);
 
   for(int slice=first; slice<=last; slice++){
     for(int patch=0;patch<npatch;patch++){
index 73c8ae8d5c6f65a9ec9b50a1ffb2e745a209a6c8..67137e2f55d3d19ddc1ccdcd84635d8ec5ed0bed 100644 (file)
@@ -75,3 +75,70 @@ void Make_Init(char *file, char *tofile="Init.cxx"){
   fclose(f);
 }
 
+void Make_Default(char *file,char *tofile)
+{
+  /*
+    Macro to write out default values, which should be used to initialize
+    the static data members of the AliL3Transform class. Macro does more
+    or less the same as the above, only the output syntax is changed in order
+    to use it for static data member initialization.
+  */
+  
+  TFile * rootf = new TFile(file,"READ");
+  
+  if(!rootf->IsOpen()){
+    cerr<<"no file: "<<file<<endl;
+    return;
+  }
+
+  AliTPCParam* par = (AliTPCParam*)rootf->Get("75x40_100x60");
+
+  if(!par){
+    cerr<<"no AliTPCParam 75x40_100x60 in file: "<<file<<endl;
+    return;
+  }
+
+  int fNTimeBins = par->GetMaxTBin()+1;
+  int fNRowLow = par->GetNRowLow();
+  int fNRowUp  = par->GetNRowUp();
+  int fNRow= fNRowLow + fNRowUp;
+  int fNSectorLow = par->GetNInnerSector();
+  int fNSectorUp = par->GetNOuterSector();
+  int fNSector = fNSectorLow + fNSectorUp;
+  int fNSlice = fNSectorLow;
+
+  FILE *f = fopen(tofile,"w");
+  fprintf(f,"Int_t AliL3Transform::fNTimeBins = %d ;\n",fNTimeBins);
+  fprintf(f,"Int_t AliL3Transform::fNRowLow = %d ;\n",fNRowLow);
+  fprintf(f,"Int_t AliL3Transform::fNRowUp = %d ;\n",fNRowUp);
+  fprintf(f,"Int_t AliL3Transform::fNSectorLow = %d ;\n",fNSectorLow);
+  fprintf(f,"Int_t AliL3Transform::fNSectorUp = %d ;\n",fNSectorUp);
+  fprintf(f,"Int_t AliL3Transform::fNSector = %d ;\n",fNSector);
+  fprintf(f,"Double_t AliL3Transform::fPadPitchWidthLow = %f ;\n",par->GetPadPitchWidth(0));
+  fprintf(f,"Double_t AliL3Transform::fPadPitchWidthUp = %f ;\n",par->GetPadPitchWidth(fNSectorLow));
+  fprintf(f,"Double_t AliL3Transform::fZWidth = %.20f ;\n",par->GetZWidth());
+  fprintf(f,"Double_t AliL3Transform::fZSigma = %.20f ;\n",par->GetZSigma());
+  fprintf(f,"Int_t AliL3Transform::fNSlice = %d ;\n",fNSectorLow);
+  fprintf(f,"Int_t AliL3Transform::fNRow = %d ;\n",fNRow);
+  fprintf(f,"Double_t AliL3Transform::fNRotShift = 0.5 ;\n");
+  fprintf(f,"Double_t AliL3Transform::fPi = %.15f ;\n",TMath::Pi());
+  fprintf(f,"Double_t AliL3Transform::fX[176] = {\n");
+  for(Int_t i=0;i<fNRow;i++){
+    int sec,row;
+    if( i < fNRowLow){sec =0;row =i;}
+    else{sec = fNSectorLow;row =i-fNRowLow;}
+    
+  fprintf(f,"                                    %3.15f,\n",par->GetPadRowRadii(sec,row));
+  }
+  fprintf(f,"};\n\n");
+  
+  fprintf(f,"Int_t AliL3Transform::fNPads[176] = {\n");
+  for(Int_t i=0;i<fNRow;i++){
+    int sec,row;
+    if( i < fNRowLow){sec =0;row =i;}
+    else{sec = fNSectorLow;row =i-fNRowLow;}
+  fprintf(f,"                                     %d,\n",par->GetNPads(sec,row));
+  }
+  fprintf(f,"};\n");
+  fclose(f);
+}
index 0e8b6510df2afad188026eb7da4d964fb827b1cc..223e737e47d62b5777936674e95834009b7b9337 100644 (file)
@@ -61,7 +61,6 @@ AliL3Hough::AliL3Hough()
   fMerger = 0;
   fInterMerger = 0;
   fGlobalMerger = 0;
-  fTransform = 0;
 }
 
 
@@ -92,8 +91,6 @@ AliL3Hough::~AliL3Hough()
     delete fPeakFinder;
   if(fGlobalMerger)
     delete fGlobalMerger;
-  if(fTransform)
-    delete fTransform;
 }
 
 void AliL3Hough::CleanUp()
@@ -120,7 +117,7 @@ void AliL3Hough::Init()
 {
   fPeakThreshold = 0;
   fNPatches = NPatches;
-  fTransform = new AliL3Transform(fPath);
+  AliL3Transform::Init(fPath);
   fHoughTransformer = new AliL3HoughBaseTransformer*[fNPatches];
 #ifdef use_aliroot
   fMemHandler = new AliL3FileHandler*[fNPatches];
@@ -132,7 +129,6 @@ void AliL3Hough::Init()
   for(Int_t i=0; i<fNPatches; i++)
     {
       fHoughTransformer[i] = new AliL3HoughTransformer(1,i,fNEtaSegments);
-      fHoughTransformer[i]->SetTransformer(fTransform);
       //fHoughTransformer[i]->CreateHistograms(64,-0.003,0.003,64,-0.26,0.26);
       fHoughTransformer[i]->CreateHistograms(64,0.1,64,-30,30);
       fHoughTransformer[i]->SetThreshold(3);
@@ -221,7 +217,6 @@ void AliL3Hough::MergePatches()
 {
   if(fAddHistograms) //Nothing to merge here
     return;
-  fMerger->SetTransformer(fTransform);
   fMerger->MergePatches(kTRUE);
 }
 
index 44f9b4ef95b7262fd397601c16b3a9cfc1dd811e..16d7616c3c98f3cd416bb090cf481272c041bdff 100644 (file)
@@ -9,12 +9,10 @@ class AliL3Histogram;
 class AliL3MemHandler;
 class AliL3FileHandler;
 class AliL3HoughEval;
-class AliL3Transform;
 class AliL3TrackArray;
 class AliL3HoughMerger;
 class AliL3HoughIntMerger;
 class AliL3HoughGlobalMerger;
-class AliL3Transform;
 
 class AliL3Hough {
   
@@ -39,7 +37,6 @@ class AliL3Hough {
   AliL3HoughMerger *fMerger; //!
   AliL3HoughIntMerger *fInterMerger; //!
   AliL3HoughGlobalMerger *fGlobalMerger; //!
-  AliL3Transform *fTransform; //!
 
   void CleanUp();
   void Init();
index c04802143d2e7a8bcb585a8469525d1953b3f0fe..dc7fd05e11ad4859f61c7fa0d7c7581b870f84a0 100644 (file)
@@ -7,7 +7,6 @@
 #include "AliL3Logging.h"
 #include "AliL3HoughBaseTransformer.h"
 #include "AliL3Defs.h"
-#include "AliL3Transform.h"
 #include "AliL3DigitData.h"
 #include "AliL3Histogram.h"
 
@@ -24,7 +23,6 @@ ClassImp(AliL3HoughBaseTransformer)
 AliL3HoughBaseTransformer::AliL3HoughBaseTransformer()
 {
   //Default constructor
-  fTransform = 0;
   fDigitRowData = 0;
 }
 
@@ -37,7 +35,6 @@ AliL3HoughBaseTransformer::AliL3HoughBaseTransformer(Int_t slice,Int_t patch,Int
   fEtaMax = fSlice < 18 ? 0.9 : -0.9;
   fThreshold = 0;
   fDigitRowData = 0;
-  fTransform = 0;
 }
 
 AliL3HoughBaseTransformer::~AliL3HoughBaseTransformer()
index a1a298691b49ac6779064ccdb86813a337aa09f4..8d7d8ce207725cdd82195178a52ea8fe128801c7 100644 (file)
@@ -3,7 +3,6 @@
 
 #include "AliL3RootTypes.h"
 
-class AliL3Transform;
 class AliL3DigitRowData;
 class AliL3Histogram;
 
@@ -20,15 +19,11 @@ class AliL3HoughBaseTransformer {
   
   AliL3DigitRowData *fDigitRowData; //!
   
- protected:
-  AliL3Transform *fTransform; //!
-
  public:
   AliL3HoughBaseTransformer(); 
   AliL3HoughBaseTransformer(Int_t slice,Int_t patch,Int_t n_eta_segments);
   virtual ~AliL3HoughBaseTransformer();
   
-  void SetTransformer(AliL3Transform *tr) {fTransform = tr;}
   void SetInputData(UInt_t ndigits,AliL3DigitRowData *ptr) {fDigitRowData = ptr;}
   
   virtual void CreateHistograms(Int_t nxbin,Double_t ptmin,Int_t nybin,Double_t phimin,Double_t phimax) = 0;
index a239115553d90d8cf0dc09a9290282c0674925b2..c570fc8f07fcf3f8c92fbfa6cb4fa7faacfd6b4d 100644 (file)
@@ -37,8 +37,6 @@ AliL3HoughDisplay::AliL3HoughDisplay()
 
 AliL3HoughDisplay::~AliL3HoughDisplay()
 {
-  if(fTransform)
-    delete fTransform;
 }
 
 void AliL3HoughDisplay::Init()
@@ -48,7 +46,6 @@ void AliL3HoughDisplay::Init()
     cerr<<"AliL3HoughDisplay::AliL3HoughDisplay : Geometry file alice.geom does not exist"<<endl;
   fGeom = (TGeometry*)file->Get("AliceGeom");
   file->Close();
-  fTransform = new AliL3Transform();
 }
 
 
@@ -61,7 +58,7 @@ void AliL3HoughDisplay::GenerateHits(AliL3HoughTrack *track,Float_t *x,Float_t *
     {
       if(track->GetCrossingPoint(i,xyz))
        {
-         fTransform->Local2Global(xyz,slice);
+         AliL3Transform::Local2Global(xyz,slice);
          x[n] = xyz[0];
          y[n] = xyz[1];
          z[n] = xyz[2];
@@ -100,8 +97,8 @@ TPolyMarker3D *AliL3HoughDisplay::LoadDigits()
       Int_t padrow = (Int_t)tempPt->fRow;
       for(UInt_t j=0; j<tempPt->fNDigit; j++)
        {
-         fTransform->Slice2Sector(fShowSlice,padrow,sector,row);
-         fTransform->Raw2Global(xyz,sector,row,(Int_t)digPt->fPad,(Int_t)digPt->fTime);
+         AliL3Transform::Slice2Sector(fShowSlice,padrow,sector,row);
+         AliL3Transform::Raw2Global(xyz,sector,row,(Int_t)digPt->fPad,(Int_t)digPt->fTime);
          pm->SetPoint(count,xyz[0],xyz[1],xyz[2]);
          count++;
        }
index 21f6ed1c9e9f0888c47017f586de517627b508fc..1ff8be09f3149664d9a911346f01225fe85dd863 100644 (file)
@@ -5,7 +5,6 @@
 
 class TGeometry;
 class AliL3TrackArray;
-class AliL3Transform;
 class AliL3DigitRowData;
 class TPolyMarker3D;
 class AliL3HoughTrack;
@@ -16,7 +15,6 @@ class AliL3HoughDisplay {
   
   TGeometry *fGeom; //!
   AliL3TrackArray *fTracks; //!
-  AliL3Transform *fTransform; //!
   AliL3DigitRowData *fDigitRowData;  //!
   UInt_t fNDigitRowData; //!
   Int_t fShowSlice; 
index 05e3a4ca3e756b2c501108ed9b31d1caf5ed6be2..fbb5bb8aa160a006d9a9a8de8766d178d20e1d76 100644 (file)
@@ -32,7 +32,6 @@ ClassImp(AliL3HoughEval)
 AliL3HoughEval::AliL3HoughEval()
 {
   
-  fTransform = new AliL3Transform();
   fRemoveFoundTracks = kFALSE;
   fNumOfPadsToLook = 1;
   fNumOfRowsToMiss = 1;
@@ -44,8 +43,6 @@ AliL3HoughEval::AliL3HoughEval()
 AliL3HoughEval::~AliL3HoughEval()
 {
   fHoughTransformer = 0;
-  if(fTransform)
-    delete fTransform;
   if(fRowPointers)
     {
       for(Int_t i=0; i<fNrows; i++)
@@ -115,7 +112,7 @@ Bool_t AliL3HoughEval::LookInsideRoad(AliL3HoughTrack *track,Int_t eta_index,Boo
 
   for(Int_t padrow = NRows[fPatch][0]; padrow <= NRows[fPatch][1]; padrow++)
     {
-      if(fTransform->Row2X(padrow) > maxrow) break;//The track has left this slice
+      if(AliL3Transform::Row2X(padrow) > maxrow) break;//The track has left this slice
       rows_crossed++;
       Int_t prow = padrow - NRows[fPatch][0];
       if(!track->GetCrossingPoint(padrow,xyz))  
@@ -124,8 +121,8 @@ Bool_t AliL3HoughEval::LookInsideRoad(AliL3HoughTrack *track,Int_t eta_index,Boo
          continue;
        }
       
-      fTransform->Slice2Sector(fSlice,padrow,sector,row);
-      fTransform->Local2Raw(xyz,sector,row);
+      AliL3Transform::Slice2Sector(fSlice,padrow,sector,row);
+      AliL3Transform::Local2Raw(xyz,sector,row);
       npixs=0;
       
       
@@ -148,7 +145,7 @@ Bool_t AliL3HoughEval::LookInsideRoad(AliL3HoughTrack *track,Int_t eta_index,Boo
              if(pad < p) continue;
              if(pad > p) break;
              UShort_t time = digPt[j].fTime;
-             Double_t eta = fTransform->GetEta(padrow,pad,time);
+             Double_t eta = AliL3Transform::GetEta(padrow,pad,time);
              Int_t pixel_index = (Int_t)(eta/etaslice);
              if(pixel_index > eta_index) continue;
              if(pixel_index != eta_index) break;
@@ -214,8 +211,8 @@ void AliL3HoughEval::FindEta(AliL3TrackArray *tracks)
              continue;
            }
          
-         fTransform->Slice2Sector(fSlice,padrow,sector,row);
-         fTransform->Local2Raw(xyz,sector,row);
+         AliL3Transform::Slice2Sector(fSlice,padrow,sector,row);
+         AliL3Transform::Local2Raw(xyz,sector,row);
          
          //Get the timebins for this pad
          AliL3DigitRowData *tempPt = fRowPointers[prow];
@@ -236,7 +233,7 @@ void AliL3HoughEval::FindEta(AliL3TrackArray *tracks)
                  if(pad < p) continue;
                  if(pad > p) break;
                  UShort_t time = digPt[j].fTime;
-                 Double_t eta = fTransform->GetEta(padrow,pad,time);
+                 Double_t eta = AliL3Transform::GetEta(padrow,pad,time);
                  Int_t pixel_index = (Int_t)(eta/etaslice);
                  if(pixel_index > track->GetEtaIndex()+1) continue;
                  if(pixel_index < track->GetEtaIndex()-1) break;
@@ -308,9 +305,9 @@ void AliL3HoughEval::DisplayEtaSlice(Int_t eta_index,AliL3Histogram *hist)
          if(charge < fHoughTransformer->GetThreshold()) continue;
          Float_t xyz[3];
          Int_t sector,row;
-         fTransform->Slice2Sector(fSlice,padrow,sector,row);
-         fTransform->Raw2Local(xyz,sector,row,pad,time);
-         Double_t eta = fTransform->GetEta(xyz);
+         AliL3Transform::Slice2Sector(fSlice,padrow,sector,row);
+         AliL3Transform::Raw2Local(xyz,sector,row,pad,time);
+         Double_t eta = AliL3Transform::GetEta(xyz);
          Int_t pixel_index = (Int_t)(eta/etaslice);
          if(pixel_index != eta_index) continue;
          hist->Fill(xyz[0],xyz[1],charge);
index f88d7f0fd1ba3a018d2231fa0de56b7a772c307a..7d6579477161b9d64d11d6be806156af93016bee 100644 (file)
@@ -5,7 +5,6 @@
 
 
 class AliL3HoughBaseTransformer;
-class AliL3Transform;
 class AliL3HoughTrack;
 class AliL3DigitRowData;
 class AliL3Histogram;
@@ -28,7 +27,6 @@ class AliL3HoughEval {
   //Flags
   Bool_t fRemoveFoundTracks;
   
-  AliL3Transform *fTransform; //!
   AliL3HoughBaseTransformer *fHoughTransformer; //!
   AliL3DigitRowData **fRowPointers; //!
   
index 1d9426d04a7319a2613d6c0aa76f63ee9538521a..c5334955c149519d6d72f3d39a9d84d85cf18bdc 100644 (file)
@@ -8,8 +8,8 @@
 #include "AliL3HoughTrack.h"
 #include "AliL3HoughGlobalMerger.h"
 #include "AliL3Track.h"
-#include "AliL3Transform.h"
 #include "AliL3TrackArray.h"
+#include "AliL3Transform.h"
 
 //_____________________________________________________________
 // Merging Hough tracks across slices
@@ -111,7 +111,7 @@ void AliL3HoughGlobalMerger::SlowMerge(){
     if(slice2==fNSlices) slice2 =0; 
     AliL3TrackArray *ttt1=GetInTracks(slice2);
     Float_t angle = PI/18.; //10 degrees -> the border of the slices
-    fTransformer->Local2GlobalAngle(&angle,slice);
+    AliL3Transform::Local2GlobalAngle(&angle,slice);
     if(i==0)
       ttt0->QSort();
     ttt1->QSort();
@@ -194,7 +194,7 @@ void AliL3HoughGlobalMerger::Merge()
       if(slice2==fNSlices) slice2 =0;
       AliL3TrackArray *ttt1=GetInTracks(slice2);
       Float_t angle = PI/18.; //10 degrees -> the border of the slices
-      fTransformer->Local2GlobalAngle(&angle,slice);
+      AliL3Transform::Local2GlobalAngle(&angle,slice);
       if(i==0)
        ttt0->QSort();
       ttt1->QSort();
index 1b3d217818d5ab7a58c8b8f1945d83498e23ccd4..3b36ab77e2aaec869f5ebb9d5ca3820d1e01f5ca 100644 (file)
@@ -6,6 +6,7 @@
 #include <string.h>
 #include <math.h>
 #include <stdlib.h>
+#include <stream.h>
 
 #include "AliL3Histogram.h"
 #include "AliL3TrackArray.h"
@@ -133,80 +134,96 @@ AliL3TrackArray *AliL3HoughMaxFinder::FindBigMaxima(AliL3Histogram *hist)
 }
 
 
-AliL3TrackArray *AliL3HoughMaxFinder::FindMaxima(AliL3Histogram *hist,Int_t *rowrange,Int_t ref_row)
+void AliL3HoughMaxFinder::FindMaxima(Float_t *xpeaks,Float_t *ypeaks,Int_t *weight,Int_t &entries)
 {
   //Locate all the maxima in input histogram.
   //Maxima is defined as bins with more entries than the
   //immediately neighbouring bins. 
   
-  Int_t xmin = hist->GetFirstXbin();
-  Int_t xmax = hist->GetLastXbin();
-  Int_t ymin = hist->GetFirstYbin();
-  Int_t ymax = hist->GetLastYbin();
-  Int_t bin[9],track_counter=0;
+  Int_t max_entries = entries;
+  entries = 0;
+  Int_t xmin = fCurrentHisto->GetFirstXbin();
+  Int_t xmax = fCurrentHisto->GetLastXbin();
+  Int_t ymin = fCurrentHisto->GetFirstYbin();
+  Int_t ymax = fCurrentHisto->GetLastYbin();
+  Int_t bin[9];
   Double_t value[9];
   
-  AliL3TrackArray *tracks = new AliL3TrackArray("AliL3HoughTrack");
-  AliL3HoughTrack *track;
-
+  Double_t kappa_overlap = 0.001;
+  Double_t phi_overlap = 0.05;
+  
   for(Int_t xbin=xmin+1; xbin<xmax-1; xbin++)
     {
       for(Int_t ybin=ymin+1; ybin<ymax-1; ybin++)
        {
-         bin[0] = hist->GetBin(xbin-1,ybin-1);
-         bin[1] = hist->GetBin(xbin,ybin-1);
-         bin[2] = hist->GetBin(xbin+1,ybin-1);
-         bin[3] = hist->GetBin(xbin-1,ybin);
-         bin[4] = hist->GetBin(xbin,ybin);
-         bin[5] = hist->GetBin(xbin+1,ybin);
-         bin[6] = hist->GetBin(xbin-1,ybin+1);
-         bin[7] = hist->GetBin(xbin,ybin+1);
-         bin[8] = hist->GetBin(xbin+1,ybin+1);
-         value[0] = hist->GetBinContent(bin[0]);
-         value[1] = hist->GetBinContent(bin[1]);
-         value[2] = hist->GetBinContent(bin[2]);
-         value[3] = hist->GetBinContent(bin[3]);
-         value[4] = hist->GetBinContent(bin[4]);
-         value[5] = hist->GetBinContent(bin[5]);
-         value[6] = hist->GetBinContent(bin[6]);
-         value[7] = hist->GetBinContent(bin[7]);
-         value[8] = hist->GetBinContent(bin[8]);
+         bin[0] = fCurrentHisto->GetBin(xbin-1,ybin-1);
+         bin[1] = fCurrentHisto->GetBin(xbin,ybin-1);
+         bin[2] = fCurrentHisto->GetBin(xbin+1,ybin-1);
+         bin[3] = fCurrentHisto->GetBin(xbin-1,ybin);
+         bin[4] = fCurrentHisto->GetBin(xbin,ybin);
+         bin[5] = fCurrentHisto->GetBin(xbin+1,ybin);
+         bin[6] = fCurrentHisto->GetBin(xbin-1,ybin+1);
+         bin[7] = fCurrentHisto->GetBin(xbin,ybin+1);
+         bin[8] = fCurrentHisto->GetBin(xbin+1,ybin+1);
+         value[0] = fCurrentHisto->GetBinContent(bin[0]);
+         value[1] = fCurrentHisto->GetBinContent(bin[1]);
+         value[2] = fCurrentHisto->GetBinContent(bin[2]);
+         value[3] = fCurrentHisto->GetBinContent(bin[3]);
+         value[4] = fCurrentHisto->GetBinContent(bin[4]);
+         value[5] = fCurrentHisto->GetBinContent(bin[5]);
+         value[6] = fCurrentHisto->GetBinContent(bin[6]);
+         value[7] = fCurrentHisto->GetBinContent(bin[7]);
+         value[8] = fCurrentHisto->GetBinContent(bin[8]);
+         
          
-         if(value[4] <= fThreshold) continue;//central bin below threshold
          
          if(value[4]>value[0] && value[4]>value[1] && value[4]>value[2]
             && value[4]>value[3] && value[4]>value[5] && value[4]>value[6]
             && value[4]>value[7] && value[4]>value[8])
            {
              //Found a local maxima
-             Float_t max_x = hist->GetBinCenterX(xbin);
-             Float_t max_y = hist->GetBinCenterY(ybin);
+             Float_t max_x = fCurrentHisto->GetBinCenterX(xbin);
+             Float_t max_y = fCurrentHisto->GetBinCenterY(ybin);
              
-             track = (AliL3HoughTrack*)tracks->NextTrack();
              
+             if((Int_t)value[4] <= fThreshold) continue;//central bin below threshold
              
-             switch(fHistoType)
+             if(entries >= max_entries)
                {
-               case 'c':
-                 track->SetTrackParameters(max_x,max_y,(Int_t)value[4]);
-                 break;
-               case 'l':
-                 track->SetLineParameters(max_x,max_y,(Int_t)value[4],rowrange,ref_row);
-                 break;
-               default:
-                 printf("AliL3HoughMaxFinder: Error in tracktype\n");
+                 cerr<<"AliL3HoughMaxFinder::FindMaxima : Array out of range : "<<entries<<" "<<max_entries<<endl;
+                 return;
                }
              
-             track_counter++;
-             
-
+             //Check if the peak is overlapping with a previous:
+             Bool_t bigger = kFALSE;
+             for(Int_t p=0; p<entries; p++)
+               {
+                 if(fabs(max_x - xpeaks[p]) < kappa_overlap && fabs(max_y - ypeaks[p]) < phi_overlap)
+                   {
+                     bigger = kTRUE;
+                     if(value[4] > weight[p]) //this peak is bigger.
+                       {
+                         xpeaks[p] = max_x;
+                         ypeaks[p] = max_y;
+                         weight[p] = (Int_t)value[4];
+                       }
+                     else
+                       continue; //previous peak is bigger.
+                   }
+               }
+             if(!bigger) //there were no overlapping peaks.
+               {
+                 xpeaks[entries] = max_x;
+                 ypeaks[entries] = max_y;
+                 weight[entries] = (Int_t)value[4];
+                 entries++;
+               }
            }
          else
            continue; //not a maxima
        }
     }
-  tracks->QSort();
-  return tracks;
+  
 }
 
 
@@ -571,9 +588,6 @@ void AliL3HoughMaxFinder::FindPeak1(Float_t *xpeaks,Float_t *ypeaks,Int_t *weigh
   //Sort the windows according to the weight
   SortPeaks(windowPt,0,nbinsx);
   
-  //for(Int_t i=0; i<nbinsx; i++)
-  //printf("xbin %f weight %d\n",fCurrentHisto->GetBinCenterX(windowPt[i]->xbin),windowPt[i]->weight);
-  
   Float_t top,butt;
   for(Int_t i=0; i<nbinsx; i++)
     {
@@ -596,6 +610,8 @@ void AliL3HoughMaxFinder::FindPeak1(Float_t *xpeaks,Float_t *ypeaks,Int_t *weigh
        }
       xpeaks[n] = fCurrentHisto->GetBinCenterX(windowPt[i]->xbin);
       ypeaks[n] = top/butt;
+      weight[n] = (Int_t)butt;
+      //cout<<"mean in y "<<ypeaks[n]<<" on x "<<windowPt[i]->xbin<<" content "<<butt<<endl;
       n++;
       if(n==max_entries) break;
     }
@@ -615,11 +631,13 @@ void AliL3HoughMaxFinder::FindPeak1(Float_t *xpeaks,Float_t *ypeaks,Int_t *weigh
       prev = xbin - x_bin_sides+1;
       for(Int_t j=xbin-x_bin_sides; j<=xbin+x_bin_sides; j++)
        {
+         /*
          //Check if the windows are overlapping:
          if(anotherPt[j]->ymin > anotherPt[prev]->ymax) {prev=j; continue;}
          if(anotherPt[j]->ymax < anotherPt[prev]->ymin) {prev=j; continue;}
          prev = j;
-
+         */
+         
          top += fCurrentHisto->GetBinCenterX(j)*anotherPt[j]->weight;
          butt += anotherPt[j]->weight;
          
@@ -635,7 +653,7 @@ void AliL3HoughMaxFinder::FindPeak1(Float_t *xpeaks,Float_t *ypeaks,Int_t *weigh
       xpeaks[i] = top/butt;
       ypeaks[i] = ytop/ybutt;
       weight[i] = w;
-      
+      //cout<<"Setting weight "<<w<<" kappa "<<xpeaks[i]<<" phi0 "<<ypeaks[i]<<endl;
       
       //Check if this peak is overlapping with a previous:
       for(Int_t p=0; p<i-1; p++)
index 520c19b5dd4b3095e1f852a902a9077245a7a8a0..0d5b241f6f007346cbdccc0db587b28fb0dce48f 100644 (file)
@@ -31,7 +31,7 @@ class AliL3HoughMaxFinder {
 
   void FindAbsMaxima(Int_t &max_xbin,Int_t &max_ybin);
   AliL3TrackArray *FindBigMaxima(AliL3Histogram *hist);
-  AliL3TrackArray *FindMaxima(AliL3Histogram *hist,Int_t *rowrange=0,Int_t ref_row=0);
+  void FindMaxima(Float_t *xpeaks,Float_t *ypeaks,Int_t *weight,Int_t &entries);
   AliL3TrackArray *LookForPeaks(AliL3Histogram *hist,Int_t nbins);
   
   void FindPeak(Int_t t1,Double_t t2,Int_t t3,Float_t &kappa,Float_t &phi0);
index 4478cf5dbb016d64e1bf6ce309c3d089ef6221e7..cfc6c094502c3f5b9a0d51ba1f0c565d427491c4 100644 (file)
@@ -148,8 +148,8 @@ void AliL3HoughMerger::Merge()
     AliL3TrackArray *tout = GetOutTracks();
     if(i==subsec) tout = GetInTracks(subsec+1);
     AliL3TrackArray *tin = GetInTracks(i);
-    Double_t xval = fTransformer->Row2X(NRows[i][1]);
-    Double_t xmax = fTransformer->Row2X(NRows[i+1][1]);
+    Double_t xval = AliL3Transform::Row2X(NRows[i][1]);
+    Double_t xmax = AliL3Transform::Row2X(NRows[i+1][1]);
     Double_t ymax = xval*tan(edge0);
     for(Int_t out=0;out<tout->GetNTracks();out++){
       AliL3Track *outtrack=tout->GetCheckedTrack(out);
index 9baff670de76970785e76e7f1f06ef90eb2a8ebb..7ef8d8214b54f8a856c768f73c77e8a8c1b2c6ae 100644 (file)
@@ -6,7 +6,6 @@
 #include <math.h>
 
 #include "AliL3Logging.h"
-#include "AliL3Transform.h"
 #include "AliL3Defs.h"
 #include "AliL3HoughTrack.h"
 
index 753f6e122bfa2f49cca416c49fab75346817c11d..f56e315ac5ca2471fae3752d0071e89a38a63d62 100644 (file)
@@ -126,12 +126,6 @@ void AliL3HoughTransformer::TransformCircle()
        <<"No input data "<<ENDLOG;
       return;
     }
-  if(!fTransform)
-    {
-      LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformCircle","Transformer")
-       <<"No AliL3Transform object"<<ENDLOG;
-      return;
-    }
   
   //Loop over the padrows:
   for(Int_t i=NRows[GetPatch()][0]; i<=NRows[GetPatch()][1]; i++)
@@ -156,11 +150,11 @@ void AliL3HoughTransformer::TransformCircle()
          Float_t xyz[3];
          
          //Transform data to local cartesian coordinates:
-         fTransform->Slice2Sector(GetSlice(),i,sector,row);
-         fTransform->Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
+         AliL3Transform::Slice2Sector(GetSlice(),i,sector,row);
+         AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
          
          //Calculate the eta:
-         Double_t eta = fTransform->GetEta(xyz);
+         Double_t eta = AliL3Transform::GetEta(xyz);
          
          //Get the corresponding index, which determines which histogram to fill:
          Int_t eta_index = GetEtaIndex(eta);
@@ -177,7 +171,7 @@ void AliL3HoughTransformer::TransformCircle()
 
          //Do the transformation:
          Float_t R = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]); 
-         Float_t phi = fTransform->GetPhi(xyz);
+         Float_t phi = AliL3Transform::GetPhi(xyz);
          
          //Fill the histogram along the phirange
          for(Int_t b=hist->GetFirstYbin(); b<=hist->GetLastYbin(); b++)
@@ -203,13 +197,6 @@ void AliL3HoughTransformer::TransformCircleC(Int_t row_range)
     LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformCircleC","Data")
       <<"No input data "<<ENDLOG;
  
-  if(!fTransform)
-    {
-      LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformCircleC","Transformer")
-       <<"No AliL3Transform object"<<ENDLOG;
-      return;
-    }
-  
   Int_t counter=0;
   for(Int_t i=NRows[GetPatch()][0]; i<=NRows[GetPatch()][1]; i++)
     {
@@ -244,9 +231,9 @@ void AliL3HoughTransformer::TransformCircleC(Int_t row_range)
          charge = digPt[di].fCharge;
          pad = digPt[di].fPad;
          time = digPt[di].fTime;
-         fTransform->Slice2Sector(GetSlice(),i,sector,row);
-         fTransform->Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
-         eta = fTransform->GetEta(xyz);
+         AliL3Transform::Slice2Sector(GetSlice(),i,sector,row);
+         AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
+         eta = AliL3Transform::GetEta(xyz);
          digits[counter].row = i;
          digits[counter].r = sqrt(xyz[0]*xyz[0] + xyz[1]*xyz[1]);
          digits[counter].phi = atan2(xyz[1],xyz[0]);
@@ -301,12 +288,6 @@ void AliL3HoughTransformer::TransformLine()
        <<"No input data "<<ENDLOG;
       return;
     }
-  if(!fTransform)
-    {
-      LOG(AliL3Log::kError,"AliL3HoughTransformer::TransformLine","Transformer")
-       <<"No AliL3Transform object"<<ENDLOG;
-      return;
-    }
   
   for(Int_t i=NRows[GetPatch()][0]; i<=NRows[GetPatch()][1]; i++)
     {
@@ -325,9 +306,9 @@ void AliL3HoughTransformer::TransformLine()
            continue;
          Int_t sector,row;
          Float_t xyz[3];
-         fTransform->Slice2Sector(GetSlice(),i,sector,row);
-         fTransform->Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
-         Float_t eta = fTransform->GetEta(xyz);
+         AliL3Transform::Slice2Sector(GetSlice(),i,sector,row);
+         AliL3Transform::Raw2Local(xyz,sector,row,(Int_t)pad,(Int_t)time);
+         Float_t eta = AliL3Transform::GetEta(xyz);
          Int_t eta_index = GetEtaIndex(eta);//(Int_t)(eta/etaslice);
          if(eta_index < 0 || eta_index >= GetNEtaSegments())
            continue;
index 18119d446e816e6b08e4ad51204dcd4cc3c01497..b6e5a2a2e1c738cc0c0b01c67d53159e33e74b4f 100644 (file)
@@ -8,7 +8,7 @@
 void GetGoodParticles(Int_t minslice,Int_t maxslice,char *eventfile,char *digitfile,Int_t event)
 {
 
-  Int_t good_number = 10; //Minimum number of points on a good track
+  Int_t good_number = 70; //Minimum number of points on a good track
   
   struct GoodTrack goodtracks[15000];
   Int_t nt=0;
@@ -49,7 +49,7 @@ void GetGoodParticles(Int_t minslice,Int_t maxslice,char *eventfile,char *digitf
   for(Int_t ii=0; ii<np; ii++)
     good[ii] = 0;
 
-  AliL3Transform *transform = new AliL3Transform();
+
 
   TFile *digfile = TFile::Open(digitfile);
   Char_t dname[100];
@@ -67,7 +67,7 @@ void GetGoodParticles(Int_t minslice,Int_t maxslice,char *eventfile,char *digitf
       Int_t sec,row;
       param->AdjustSectorRow(digits->GetID(),sec,row);
       Int_t sl,padrow;
-      transform->Sector2Slice(sl,padrow,sec,row);
+      AliL3Transform::Sector2Slice(sl,padrow,sec,row);
       if(sl < minslice) continue;
       if(sl > maxslice) break;
       digits->First();
@@ -158,6 +158,5 @@ void GetGoodParticles(Int_t minslice,Int_t maxslice,char *eventfile,char *digitf
   evfile->Close();
   digfile->Close();
 
-  delete transform;
 
 }
index 681b7d320bbba1b42ce333e627f0ce222e7ba9eb..f2cf811359a75bf96c526244894e6ab9ed528e24 100644 (file)
@@ -16,8 +16,8 @@ int main(int argc,char **argv)
   unsigned int ndigits=0;
   
   AliL3MemHandler file; //Does all the file/data handling
-  AliL3Transform transform; //Storing all detector-spesific quantities, needed by the clusterfinder.
-  AliL3ClustFinderNew cf(&transform); //The cluster finder itself.
+  //AliL3Transform::Init(path); //Storing all detector-spesific quantities, needed by the clusterfinder.
+  AliL3ClustFinderNew cf; //The cluster finder itself.
 
   //Open the data file:
   if(!file.SetBinaryInput(argv[1]))
index c3b85b7b1bcceb71d07ae8fdc674e0443d168ba4..6213abae51c5b792ae57c97eeab5f8748f6cfe6c 100644 (file)
@@ -15,7 +15,6 @@ AliL3Trigger::AliL3Trigger()
 {
   fDataSize=0;
   fTracks=0;
-  fTransform=0;
   fDigitRowData=0;
   fOutput=0;
   fVertex=0;
@@ -25,18 +24,13 @@ AliL3Trigger::~AliL3Trigger()
 {
   if(fTracks)
     delete fTracks;
-  if(fTransform)
-    delete fTransform;
 }
 
 void AliL3Trigger::InitTrigger()
 {
   if(fTracks)
     delete fTracks;
-  if(fTransform)
-    delete fTransform;
   fTracks = new AliL3TrackArray();
-  fTransform = new AliL3Transform;
 }
 
 void AliL3Trigger::InitPatch(Int_t slice,Int_t patch)
@@ -104,8 +98,8 @@ void AliL3Trigger::RemovePileupData()
          AliL3Track *track = fTracks->GetCheckedTrack(j);
          if(!track) continue;
          track->GetCrossingPoint(i,hit);
-         fTransform->Slice2Sector(fSlice,i,sector,row);
-         fTransform->Local2Raw(hit,sector,row);
+         AliL3Transform::Slice2Sector(fSlice,i,sector,row);
+         AliL3Transform::Local2Raw(hit,sector,row);
          row_cross[j].pad = (Int_t)rint(hit[1]);
          row_cross[j].time = (Int_t)rint(hit[2]);
        }
index f9c5c3a7344cf6adcc3a3af5bb38db4d37fae8ff..9004bd846589859014e18e785303061c6717a1dd 100644 (file)
@@ -6,7 +6,6 @@
 class AliL3TrackSegmentData;
 class AliL3DigitRowData;
 class AliL3TrackArray;
-class AliL3Transform;
 class AliL3Vertex;
 
 class AliL3Trigger {
@@ -16,7 +15,6 @@ class AliL3Trigger {
   AliL3DigitRowData *fDigitRowData; //!
   AliL3DigitRowData *fOutput; //!
   AliL3Vertex *fVertex; //!
-  AliL3Transform *fTransform;//!
   Int_t fDataSize;
 
   Float_t fZcut;