Major update of the HLT Hough transform and ITS tracking code. Hough transform tracks...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 31 Mar 2005 04:48:59 +0000 (04:48 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 31 Mar 2005 04:48:59 +0000 (04:48 +0000)
22 files changed:
HLT/ITS/AliL3ITStrack.cxx
HLT/ITS/AliL3ITStrack.h
HLT/ITS/AliL3ITStracker.cxx
HLT/hough/AliL3Hough.cxx
HLT/hough/AliL3HoughKalmanTrack.cxx [new file with mode: 0644]
HLT/hough/AliL3HoughKalmanTrack.h [new file with mode: 0644]
HLT/hough/AliL3HoughLinkDef.h
HLT/hough/AliL3HoughTrack.cxx
HLT/hough/AliL3HoughTrack.h
HLT/hough/AliL3HoughTransformerRow.cxx
HLT/hough/AliL3HoughTransformerRow.h
HLT/libAliL3Hough.pkg
HLT/libAliL3Src.pkg
HLT/src/AliHLTReconstructor.cxx
HLT/src/AliHLTReconstructor.h
HLT/src/AliL3SrcLinkDef.h
HLT/src/AliL3TPCtracker.cxx [new file with mode: 0644]
HLT/src/AliL3TPCtracker.h [new file with mode: 0644]
HLT/src/AliL3Track.cxx
HLT/src/AliL3Track.h
HLT/src/AliL3TrackArray.cxx
HLT/src/AliL3TrackSegmentData.h

index 1a96f67d0d13c055ef5d19daeb25f2257dce2b9f..d75392f5a6e3e464b3532117fe8c699acc82751a 100644 (file)
 
 #include <TMath.h>
 
-#include "AliL3StandardIncludes.h"
-
-#include "AliESDHLTtrack.h"
 #include "AliL3ITStrack.h"
 
 ClassImp(AliL3ITStrack)
 
 //____________________________________________________________________________
 AliL3ITStrack::AliL3ITStrack()
-              :AliITStrackV2(),fESDHLTtrack(0)
+              :AliITStrackV2()
 {
   //------------------------------------------------------------------
   //Constructor
@@ -38,115 +35,21 @@ AliL3ITStrack::AliL3ITStrack()
 }
 
 //____________________________________________________________________________
-AliL3ITStrack::AliL3ITStrack(const AliL3ITStrack& t) 
-              : AliITStrackV2(t), fESDHLTtrack(0)
+AliL3ITStrack::AliL3ITStrack(AliESDtrack& t)
+              :AliITStrackV2(t)
 {
   //------------------------------------------------------------------
-  //Copy constructor
+  //Constructor
   //------------------------------------------------------------------
-  fESDHLTtrack=t.fESDHLTtrack;
 }
 
 //____________________________________________________________________________
-AliL3ITStrack::AliL3ITStrack(AliESDHLTtrack& t, Double_t zvertex) throw (const Char_t *) 
-              : AliITStrackV2(), fESDHLTtrack(0) 
-{
-  // The method constructs an AliL3ITStrack object from an ESD HLT track
-  fESDHLTtrack=&t;
-  Set(t,zvertex);
-}
-
-//____________________________________________________________________________
-AliL3ITStrack::AliL3ITStrack(const AliESDHLTtrack& t, Double_t zvertex) throw (const Char_t *) 
-              : AliITStrackV2(), fESDHLTtrack(0) 
+AliL3ITStrack::AliL3ITStrack(const AliL3ITStrack& t) 
+              : AliITStrackV2(t)
 {
-  // The method constructs an AliL3ITStrack object from an ESD HLT track
-  Set(t,zvertex);
-}
-
-//____________________________________________________________________________
-void AliL3ITStrack::Set(const AliESDHLTtrack& t, Double_t zvertex) throw (const Char_t *) {
-  // The method constructs an AliL3ITStrack object from an ESD HLT track
-  SetChi2(0.);
-  if(t.GetNHits()==1)
-    SetNumberOfClusters(0);
-  else
-    SetNumberOfClusters(t.GetNHits());
-  SetLabel(t.GetMCid());
-  SetMass(0.13957);
-
-  fdEdx=0;
-  fAlpha = fmod((t.GetSector()+0.5)*(2*TMath::Pi()/18),2*TMath::Pi());
-  if      (fAlpha < -TMath::Pi()) fAlpha += 2*TMath::Pi();
-  else if (fAlpha >= TMath::Pi()) fAlpha -= 2*TMath::Pi();
-
-  //First the emiision angle
-  Double_t psi = t.GetPsi()-(t.GetSector()+0.5)*(2*TMath::Pi()/18);
-
-  //Then local x,y coordinates
-  Double_t radius = t.GetPt()*GetConvConst();
-  Double_t xhit = 82.97; //Position at first TPC padrow
-  Double_t trackphi0 = psi + (-t.GetCharge())*TMath::Pi()/2;
-  Double_t x0 = t.GetFirstPointX()*TMath::Cos(fAlpha) + t.GetFirstPointY()*TMath::Sin(fAlpha);
-  Double_t y0 = t.GetFirstPointY()*TMath::Cos(fAlpha) - t.GetFirstPointX()*TMath::Sin(fAlpha);
-  Double_t centerx = radius *  cos(trackphi0) + x0;
-  Double_t centery = radius *  sin(trackphi0) + y0;
-  Double_t aa = (xhit - centerx)*(xhit - centerx);
-  Double_t r2 = radius*radius;
-  if(aa > r2) throw "AliITStrackV2: conversion failed !\n";
-  Double_t aa2 = sqrt(r2 - aa);
-  Double_t y1 = centery + aa2;
-  Double_t y2 = centery - aa2;
-  Double_t yhit = y1;
-  if(fabs(y2) < fabs(y1)) yhit = y2;
-
-  //Local z coordinate
-  Double_t angle1 = atan2((yhit - centery),(xhit - centerx));
-  if(angle1 < 0) angle1 += 2.*TMath::Pi();
-  Double_t angle2 = atan2((x0-centery),(y0-centerx));
-  if(angle2 < 0) angle2 += 2.*TMath::Pi();
-  Double_t diffangle = angle1 - angle2;
-  diffangle = fmod(diffangle,2.*TMath::Pi());
-  if(((-t.GetCharge())*diffangle) < 0) diffangle = diffangle - (-t.GetCharge())*2.*TMath::Pi();
-  Double_t stot = fabs(diffangle)*radius;
-  Double_t zhit;
-  if(t.GetNHits()==1)
-    zhit = zvertex + stot*t.GetTgl();
-  else
-    zhit = t.GetFirstPointZ() + stot*t.GetTgl();
-
-  //Local sine of track azimuthal angle
-  if((-t.GetCharge())<0)
-    radius = -radius;
-  Double_t sinbeta = -1.*(centerx - xhit)/radius;
-
-  //Filling of the track paramaters
-  fX=xhit;
-  fP0=yhit;
-  fP1=zhit;
-  fP2=sinbeta;
-  fP3=t.GetTgl();
-  fP4=1./radius;
-
-  //and covariance matrix
-  fC22=0.005*0.005;
-  fC33=0.005*0.005;
-  fC00=fC22*82.97*82.97;
-  fC11=fC33*82.97*82.97;
-  //  fC44=(0.005+0.025*t.GetPt())*(0.005+0.025*t.GetPt())*fP4*fP4;
-  //  fC44=(0.01+0.01*t.GetPt())*(0.01+0.01*t.GetPt())*fP4*fP4;
-  fC44=0.01*0.01*fP4*fP4;
-
-  fC10=0;
-  fC20=0;   fC21=0;
-  fC30=0;   fC31=0;   fC32=0;
-  fC40=0;   fC41=0;   fC42=0;   fC43=0;
-
-  fESDtrack=0;
-
-  SetFakeRatio(0.);
+  //------------------------------------------------------------------
+  //Copy constructor
+  //------------------------------------------------------------------
 }
 
 //_____________________________________________________________________________
index 2c1fb60fed8cb374b0f86e580490607cd37a30e3..1e1dcd3158a1edebf1d8de655a063ce3c80ea6d5 100644 (file)
 
 #include <AliITStrackV2.h>
 
-class AliESDHLTtrack;
-
 class AliL3ITStrack : public AliITStrackV2 {
 public:
   AliL3ITStrack();
+  AliL3ITStrack(AliESDtrack& t);
   AliL3ITStrack(const AliL3ITStrack& t);
-  AliL3ITStrack(AliESDHLTtrack& t, Double_t zvertex) throw (const Char_t *);
-  AliL3ITStrack(const AliESDHLTtrack& t, Double_t zvertex) throw (const Char_t *);
 
   Int_t Compare(const TObject *o) const;
 
-  // Set and get the pointer to the HLT ESD track
-  AliESDHLTtrack *GetESDHLTtrack() const {return fESDHLTtrack; }
-  void SetESDHLTtrack(AliESDHLTtrack *esdhlttrack) { fESDHLTtrack = esdhlttrack; }
   Bool_t GetPxPyPzAt(Double_t x,Double_t *p) const;
 
-protected:
-  void Set(const AliESDHLTtrack& t, Double_t zvertex) throw (const Char_t *);
-
-  AliESDHLTtrack *fESDHLTtrack;   //! pointer to the connected ESD HLT track
-
-  ClassDef(AliL3ITStrack,1)   //HLT ITS reconstructed track
+  ClassDef(AliL3ITStrack,2)   //HLT ITS reconstructed track
 };
 
 #endif
index 0ded8444f12eda85e17143f0c95315e4b745b696..3d752f1fa58c25248dde98d8f85a6d16215473a1 100644 (file)
@@ -68,16 +68,15 @@ Int_t AliL3ITStracker::Clusters2Tracks(AliESD *event) {
 
   {/* Read HLT ESD tracks */
     Int_t nentr;
-    nentr=event->GetNumberOfHLTHoughTracks();
+    nentr=event->GetNumberOfTracks();
     Info("Clusters2Tracks", "Number of ESD HLT tracks: %d\n", nentr);
     while (nentr--) {
 
-      AliESDHLTtrack *esd=event->GetHLTHoughTrack(nentr);
-      if (esd->GetWeight() > 500) continue;
+      AliESDtrack *esd=event->GetTrack(nentr);
 
       AliL3ITStrack *t=0;
       try {
-        t=new AliL3ITStrack(*esd,GetZ());
+        t=new AliL3ITStrack(*esd);
       } catch (const Char_t *msg) {
         Warning("Clusters2Tracks",msg);
         delete t;
@@ -106,11 +105,9 @@ Int_t AliL3ITStracker::Clusters2Tracks(AliESD *event) {
   for (fPass=0; fPass<2; fPass++) {
      Int_t &constraint=fConstraint[fPass]; if (constraint<0) continue;
      for (Int_t i=0; i<nentr; i++) {
-       //       Info("Clusters2Tracks"," %d ",i);
        AliL3ITStrack *t=(AliL3ITStrack*)itsTracks.UncheckedAt(i);
        if (t==0) continue;              //this track has been already tracked
        Int_t tpcLabel=t->GetLabel(); //save the TPC track label
-       //       Info("Clusters2Tracks","Pt:%f",1/t->Get1Pt());
        ResetTrackToFollow(*t);
        ResetBestTrack();
 
@@ -131,10 +128,7 @@ Int_t AliL3ITStracker::Clusters2Tracks(AliESD *event) {
        fBestTrack.SetLabel(tpcLabel);
        fBestTrack.CookdEdx();
        CookLabel(&fBestTrack,0.); //For comparison only
-       // Specific to the AliL3ITStracker
-       //       fBestTrack.UpdateESDtrack(AliESDtrack::kITSin);
-       t->GetESDHLTtrack()->UpdateTrackParams(&fBestTrack);
-       //
+       fBestTrack.UpdateESDtrack(AliESDtrack::kITSin);
        UseClusters(&fBestTrack);
        delete itsTracks.RemoveAt(i);
        ntrk++;
@@ -152,55 +146,8 @@ Int_t AliL3ITStracker::PropagateBack(AliESD *event) {
   //--------------------------------------------------------------------
   // This functions propagates reconstructed ITS tracks back
   //--------------------------------------------------------------------
-  Int_t nentr=event->GetNumberOfHLTHoughTracks();
-  Info("PropagateBack", "Number of HLT ESD tracks: %d\n", nentr);
-
-  Int_t ntrk=0;
-  for (Int_t i=0; i<nentr; i++) {
-     AliESDHLTtrack *esd=event->GetHLTHoughTrack(i);
-     if (esd->GetWeight() > 500) continue;
-
-     AliL3ITStrack *t=0;
-     try {
-        t=new AliL3ITStrack(*esd,GetZ());
-     } catch (const Char_t *msg) {
-        Warning("PropagateBack",msg);
-        delete t;
-        continue;
-     }
-
-     ResetTrackToFollow(*t);
-
-     // propagete to vertex [SR, GSI 17.02.2003]
-     // Start Time measurement [SR, GSI 17.02.2003], corrected by I.Belikov
-     if (fTrackToFollow.PropagateTo(3.,0.0028,65.19)) {
-       if (fTrackToFollow.PropagateToVertex()) {
-          fTrackToFollow.StartTimeIntegral();
-       }
-       fTrackToFollow.PropagateTo(3.,-0.0028,65.19);
-     }
-
-     fTrackToFollow.ResetCovariance(); fTrackToFollow.ResetClusters();
-     if (RefitAt(49.,&fTrackToFollow,t)) {
-        if (CorrectForDeadZoneMaterial(&fTrackToFollow)!=0) {
-          Warning("PropagateBack",
-                  "failed to correct for the material in the dead zone !\n");
-          delete t;
-          continue;
-        }
-        fTrackToFollow.SetLabel(t->GetLabel());
-        //fTrackToFollow.CookdEdx();
-        CookLabel(&fTrackToFollow,0.); //For comparison only
-       //      cout<<" Backtrack "<<fTrackToFollow.GetLabel()<<" "<<fTrackToFollow.GetNumberOfClusters()<<" "<<fTrackToFollow.fFakeRatio<<endl;
-       fTrackToFollow.UpdateESDtrack(AliESDtrack::kITSout);
-        //UseClusters(&fTrackToFollow);
-        ntrk++;
-     }
-     delete t;
-  }
-
-  Info("PropagateBack","Number of back propagated HLT ITS tracks: %d\n",ntrk);
-
+  Int_t nentr=event->GetNumberOfTracks();
+  Info("PropagateBack", "The method is not yet implemented! %d\n", nentr);
   return 0;
 }
 
@@ -210,7 +157,7 @@ Int_t AliL3ITStracker::RefitInward(AliESD *event) {
   // "inward propagated" TPC tracks
   //--------------------------------------------------------------------
 
-  Int_t nentr=event->GetNumberOfHLTHoughTracks();
+  Int_t nentr=event->GetNumberOfTracks();
   Info("RefitInward", "The method is not yet implemented! %d",nentr);
   return 0;
 }
index 4fcece9d912cb04c7916faab46912d7a0f9dc1a8..a9c302248a67fa71ecedd5c4f9c27cce9ca72527 100644 (file)
@@ -31,6 +31,7 @@
 #include "AliL3TrackArray.h"
 #include "AliL3HoughTrack.h"
 #include "AliL3DDLDataFileHandler.h"
+#include "AliL3HoughKalmanTrack.h"
 
 #include "TThread.h"
 
@@ -1006,6 +1007,11 @@ void AliL3Hough::FindTrackCandidatesRow()
   for(Int_t i=0; i<npatches; i++)
     {
       AliL3HoughBaseTransformer *tr = fHoughTransformer[i];
+      AliL3Histogram *h = tr->GetHistogram(0);
+      Float_t deltax = h->GetBinWidthX()*AliL3HoughTransformerRow::GetDAlpha();
+      Float_t deltay = h->GetBinWidthY()*AliL3HoughTransformerRow::GetDAlpha();
+      Float_t deltaeta = (tr->GetEtaMax()-tr->GetEtaMin())/tr->GetNEtaSegments()*AliL3HoughTransformerRow::GetDEta();
+      Float_t zvertex = tr->GetZVertex();
       fTracks[i]->Reset();
       fPeakFinder->Reset();
       
@@ -1022,31 +1028,29 @@ void AliL3Hough::FindTrackCandidatesRow()
 #endif
          fPeakFinder->SetThreshold(fPeakThreshold[i]);
          fPeakFinder->FindAdaptedRowPeaks(1,0,0);//Maxima finder for HoughTransformerRow
-
-         //fPeakFinder->FindMaxima(fPeakThreshold[i]); //Simple maxima finder
        }
   
       for(Int_t k=0; k<fPeakFinder->GetEntries(); k++)
        {
          //      if(fPeakFinder->GetWeight(k) < 0) continue;
          AliL3HoughTrack *track = (AliL3HoughTrack*)fTracks[i]->NextTrack();
-         Float_t psi = atan((fPeakFinder->GetXPeak(k)-fPeakFinder->GetYPeak(k))/(AliL3HoughTransformerRow::GetBeta1()-AliL3HoughTransformerRow::GetBeta2()));
-         Float_t kappa = 2.0*(fPeakFinder->GetXPeak(k)*cos(psi)-AliL3HoughTransformerRow::GetBeta1()*sin(psi));
-         //          track->SetTrackParameters(fPeakFinder->GetXPeak(k),fPeakFinder->GetYPeak(k),fPeakFinder->GetWeight(k));
-         track->SetTrackParameters(kappa,psi,fPeakFinder->GetWeight(k));
+         Double_t starteta = tr->GetEta(fPeakFinder->GetStartEta(k),fCurrentSlice);
+         Double_t endeta = tr->GetEta(fPeakFinder->GetEndEta(k),fCurrentSlice);
+         Double_t eta = (starteta+endeta)/2.0;
+         track->SetTrackParametersRow(fPeakFinder->GetXPeak(k),fPeakFinder->GetYPeak(k),eta,fPeakFinder->GetWeight(k));
+         track->SetPterr(deltax); track->SetPsierr(deltay); track->SetTglerr(deltaeta);
          track->SetBinXY(fPeakFinder->GetXPeak(k),fPeakFinder->GetYPeak(k),fPeakFinder->GetXPeakSize(k),fPeakFinder->GetYPeakSize(k));
+         track->SetZ0(zvertex);
          Int_t etaindex = (fPeakFinder->GetStartEta(k)+fPeakFinder->GetEndEta(k))/2;
          track->SetEtaIndex(etaindex);
-         Float_t starteta = tr->GetEta(fPeakFinder->GetStartEta(k),fCurrentSlice);
-         Float_t endeta = tr->GetEta(fPeakFinder->GetEndEta(k),fCurrentSlice);
-         track->SetEta((starteta+endeta)/2.0);
-         track->SetRowRange(AliL3Transform::GetFirstRow(0),AliL3Transform::GetLastRow(5));
+         Int_t rows[2];
+         ((AliL3HoughTransformerRow *)tr)->GetTrackLength(fPeakFinder->GetXPeak(k),fPeakFinder->GetYPeak(k),rows);
+         track->SetRowRange(rows[0],rows[1]);
          track->SetSector(fCurrentSlice);
          track->SetSlice(fCurrentSlice);
 #ifdef do_mc
          Int_t label = tr->GetTrackID(etaindex,fPeakFinder->GetXPeak(k),fPeakFinder->GetYPeak(k));
          track->SetMCid(label);
-         //      cout<<"Track found with label "<<label<<" at "<<fPeakFinder->GetXPeak(k)<<" "<<fPeakFinder->GetYPeak(k)<<" with weight "<<fPeakFinder->GetWeight(k)<<endl; 
 #endif
        }
       LOG(AliL3Log::kInformational,"AliL3Hough::FindTrackCandidates()","")
@@ -1316,26 +1320,15 @@ Int_t AliL3Hough::FillESD(AliESD *esd)
       AliL3HoughTrack *tpt = (AliL3HoughTrack *)fGlobalTracks->GetCheckedTrack(i);
       if(!tpt) continue; 
       
-      AliESDHLTtrack *esdtrack = new AliESDHLTtrack(); 
-
-      esdtrack->SetRowRange(tpt->GetFirstRow(),tpt->GetLastRow());
-      esdtrack->SetNHits(tpt->GetNHits());
-      esdtrack->SetFirstPoint(tpt->GetFirstPointX(),tpt->GetFirstPointY(),tpt->GetFirstPointZ());
-      esdtrack->SetLastPoint(tpt->GetLastPointX(),tpt->GetLastPointY(),tpt->GetLastPointZ());
-      esdtrack->SetPt(tpt->GetPt());
-      esdtrack->SetPsi(tpt->GetPsi());
-      esdtrack->SetTgl(tpt->GetTgl());
-      esdtrack->SetCharge(tpt->GetCharge());
-      esdtrack->SetMCid(tpt->GetMCid());
-      esdtrack->SetWeight(tpt->GetWeight());
-      esdtrack->SetSector(tpt->GetSector());
-      esdtrack->SetBinXY(tpt->GetBinX(),tpt->GetBinY(),tpt->GetSizeX(),tpt->GetSizeY());
-      esdtrack->SetPID(tpt->GetPID());
-      esdtrack->ComesFromMainVertex(tpt->ComesFromMainVertex());
-
-      esd->AddHLTHoughTrack(esdtrack);
+      if(tpt->GetWeight()<0) continue;
+      AliL3HoughKalmanTrack *tpctrack = new AliL3HoughKalmanTrack(*tpt);
+      if(!tpctrack) continue;
+      AliESDtrack *esdtrack2 = new AliESDtrack() ; 
+      esdtrack2->UpdateTrackParams(tpctrack,AliESDtrack::kTPCin);
+      esd->AddTrack(esdtrack2);
       nglobaltracks++;
-      delete esdtrack;
+      delete esdtrack2;
+      delete tpctrack;
     }
   return nglobaltracks;
 }
diff --git a/HLT/hough/AliL3HoughKalmanTrack.cxx b/HLT/hough/AliL3HoughKalmanTrack.cxx
new file mode 100644 (file)
index 0000000..a6e4015
--- /dev/null
@@ -0,0 +1,142 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//-------------------------------------------------------------------------
+//          Implementation of the HLT TPC Hough Kalman track class
+//
+//          Origin: Cvetan Cheshkov, CERN, Cvetan.Cheshkov@cern.ch
+//-------------------------------------------------------------------------
+
+#include "AliL3HoughKalmanTrack.h"
+
+#include "AliL3StandardIncludes.h"
+#include "AliL3HoughTrack.h"
+#include "AliL3HoughBaseTransformer.h"
+#include "AliL3HoughTransformerRow.h"
+#include "AliL3Histogram.h"
+
+Int_t CalcExternalParams(const AliL3HoughTrack& t, Double_t deltax, Double_t deltay, Double_t deltaeta, const Double_t zvertex, const Double_t xhit, Double_t xx[5]);
+
+ClassImp(AliL3HoughKalmanTrack)
+
+//____________________________________________________________________________
+AliL3HoughKalmanTrack::AliL3HoughKalmanTrack(const AliL3HoughTrack& t) throw (const Char_t *) 
+              : AliTPCtrack() 
+{
+  // The method constructs an AliL3HoughKalmanTrack object
+  // from an HLT Hough track
+
+  SetChi2(0.);
+  SetNumberOfClusters(t.GetLastRow()-t.GetFirstRow());
+  SetLabel(t.GetMCid());
+  SetFakeRatio(0.);
+  SetMass(0.13957);
+
+  fdEdx=0;
+  fAlpha = fmod((t.GetSector()+0.5)*(2*TMath::Pi()/18),2*TMath::Pi());
+  if      (fAlpha < -TMath::Pi()) fAlpha += 2*TMath::Pi();
+  else if (fAlpha >= TMath::Pi()) fAlpha -= 2*TMath::Pi();
+
+  const Double_t xhit = 82.97;
+  const Double_t zvertex = t.GetFirstPointZ();
+  Double_t xx[5];
+  Double_t deltax = t.GetPterr();
+  Double_t deltay = t.GetPsierr();
+  Double_t deltaeta = t.GetTglerr();
+  if(CalcExternalParams(t,0,0,0,zvertex,xhit,xx)==0) throw "AliL3HoughKalmanTrack: conversion failed !\n";
+
+  //Filling of the track paramaters
+  fX=xhit;
+  fP0=xx[0];
+  fP1=xx[1];
+  fP2=xx[2];
+  fP3=xx[3];
+  fP4=xx[4];
+
+  //and covariance matrix
+  //For the moment estimate the covariance matrix numerically
+  Double_t xx1[5];
+  if(CalcExternalParams(t,deltax,0,0,zvertex,xhit,xx1)==0) throw "AliL3HoughKalmanTrack: conversion failed !\n";
+  Double_t xx2[5];
+  if(CalcExternalParams(t,0,deltay,0,zvertex,xhit,xx2)==0) throw "AliL3HoughKalmanTrack: conversion failed !\n";
+  Double_t xx3[5];
+  if(CalcExternalParams(t,0,0,deltaeta,zvertex,xhit,xx3)==0) throw "AliL3HoughKalmanTrack: conversion failed !\n";
+
+  Double_t dx1[5],dx2[5],dx3[5];
+  for(Int_t i=0;i<5;i++) {
+    dx1[i]=xx1[i]-xx[i];
+    dx2[i]=xx2[i]-xx[i];
+    dx3[i]=xx3[i]-xx[i];
+  }
+
+  fC00=dx1[0]*dx1[0]+dx2[0]*dx2[0];
+  fC22=dx1[2]*dx1[2]+dx2[2]*dx2[2];
+  fC44=dx1[4]*dx1[4]+dx2[4]*dx2[4];
+  fC20=dx1[2]*dx1[0]+dx2[2]*dx2[0];
+  fC40=dx1[4]*dx1[0]+dx2[4]*dx2[0];
+  fC42=dx1[4]*dx1[2]+dx2[4]*dx2[2];
+  fC33=dx3[3]*dx3[3];
+  fC11=dx3[1]*dx3[1];
+  fC31=dx3[3]*dx3[1];
+  fC10=fC30=fC21=fC41=fC32=fC43=0;
+  fC20=fC42=fC40=0;
+
+}
+
+//____________________________________________________________________________
+Int_t CalcExternalParams(const AliL3HoughTrack& t, Double_t deltax, Double_t deltay, Double_t deltaeta, const Double_t zvertex, const Double_t xhit, Double_t xx[5])
+{
+  // Translate the parameters of the Hough tracks into
+  // AliKalmanTrack paramters
+
+  //First get the emiision angle and track curvature
+  Double_t binx = t.GetBinX()+deltax;
+  Double_t biny = t.GetBinY()+deltay;
+  Double_t psi = atan((binx-biny)/(AliL3HoughTransformerRow::GetBeta1()-AliL3HoughTransformerRow::GetBeta2()));
+  Double_t kappa = 2.0*(binx*cos(psi)-AliL3HoughTransformerRow::GetBeta1()*sin(psi));
+  Double_t radius = 1./kappa;
+
+  //Local y coordinate
+  Double_t centerx = -1.*radius*sin(psi);
+  Double_t centery = radius*cos(psi);
+  Double_t aa = (xhit - centerx)*(xhit - centerx);
+  Double_t r2 = radius*radius;
+  if(aa > r2) return 0;
+  Double_t aa2 = sqrt(r2 - aa);
+  Double_t y1 = centery + aa2;
+  Double_t y2 = centery - aa2;
+  Double_t yhit = y1;
+  if(fabs(y2) < fabs(y1)) yhit = y2;
+
+  //Local z coordinate
+  Double_t stot = sqrt(xhit*xhit+yhit*yhit);
+  Double_t zhit;
+
+  //Lambda
+  Double_t eta=t.GetPseudoRapidity()+deltaeta;
+  Double_t theta = 2*atan(exp(-1.*eta));
+  Double_t tanl = 1./tan(theta);
+  zhit = zvertex + stot*tanl;
+
+  //Local sine of track azimuthal angle
+  Double_t sinbeta = centerx/radius;
+
+  xx[0] = yhit;
+  xx[1] = zhit;
+  xx[2] = sinbeta;
+  xx[3] = tanl;
+  xx[4] = kappa;
+  return 1;
+}
diff --git a/HLT/hough/AliL3HoughKalmanTrack.h b/HLT/hough/AliL3HoughKalmanTrack.h
new file mode 100644 (file)
index 0000000..52dc74c
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef ALIL3HOUGHKALMANTRACK_H
+#define ALIL3HOUGHKALMANTRACK_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//-------------------------------------------------------------------------
+//             High Level Trigger TPC Hough Kalman Track Class
+//
+//        Origin: Cvetan Cheshkov, CERN, Cvetan.Cheshkov@cern.ch 
+//-------------------------------------------------------------------------
+
+
+/*****************************************************************************
+ *                          October 11, 2004                                 *
+ * The class inherits from the off-line AliTPCtrack class.                   *
+ * It is used to transform AliL3HoughTrack into AliTPCTrack, which is        *
+ * then stored as AliESDtrack object in the ESD                              *
+ *****************************************************************************/
+
+#include <AliTPCtrack.h>
+
+class AliL3HoughTrack;
+class AliL3HoughBaseTransformer;
+
+class AliL3HoughKalmanTrack : public AliTPCtrack {
+public:
+  AliL3HoughKalmanTrack(const AliL3HoughTrack& t) throw (const Char_t *);
+
+  ClassDef(AliL3HoughKalmanTrack,1)   //HLT TPC Hough track
+};
+
+#endif
index 2c4e70fcae478d668966398d945eb4ec999763e5..7389df00e25b651f049ca51de7c4992d1e5805aa 100644 (file)
@@ -15,6 +15,7 @@
 #pragma link C++ class AliL3HoughTransformerRow;
 #ifndef macosx
 #pragma link C++ class AliL3HoughTrack;
+#pragma link C++ class AliL3HoughKalmanTrack;
 #endif
 #pragma link C++ class AliL3HoughMaxFinder;
 #pragma link C++ class AliL3HoughEval;
index 0b19bd6f381af724263f673173b72bf4ef5681af..76739ed444ee57b57c93f291e715d1040c9e5ddb 100644 (file)
@@ -9,6 +9,7 @@
 #include "AliL3Track.h"
 #include "AliL3HoughTrack.h"
 #include "AliL3Transform.h"
+#include "AliL3HoughTransformerRow.h"
 
 #if __GNUC__ == 3
 using namespace std;
@@ -55,6 +56,9 @@ void AliL3HoughTrack::Set(AliL3Track *track)
   SetEta(tpt->GetEta());
   SetTgl(tpt->GetTgl());
   SetPsi(tpt->GetPsi());
+  SetPterr(tpt->GetPterr());
+  SetTglerr(tpt->GetTglerr());
+  SetPsierr(tpt->GetPsierr());
   SetCenterX(tpt->GetCenterX());
   SetCenterY(tpt->GetCenterY());
   SetFirstPoint(tpt->GetFirstPointX(),tpt->GetFirstPointY(),tpt->GetFirstPointZ());
@@ -197,6 +201,26 @@ void AliL3HoughTrack::SetTrackParameters(Double_t kappa,Double_t eangle,Int_t we
   fIsHelix = true;
 }
 
+void AliL3HoughTrack::SetTrackParametersRow(Double_t alpha1,Double_t alpha2,Double_t eta,Int_t weight)
+{
+  //Set track parameters for HoughTransformerRow
+  //This includes curvature,emission angle and eta
+  Double_t psi = atan((alpha1-alpha2)/(AliL3HoughTransformerRow::GetBeta1()-AliL3HoughTransformerRow::GetBeta2()));
+  Double_t kappa = 2.0*(alpha1*cos(psi)-AliL3HoughTransformerRow::GetBeta1()*sin(psi));
+  SetTrackParameters(kappa,psi,weight);
+
+  Double_t zovr;
+  Double_t etaparam1 = AliL3HoughTransformerRow::GetEtaCalcParam1();
+  Double_t etaparam2 = AliL3HoughTransformerRow::GetEtaCalcParam2();
+  if(eta>0)
+    zovr = (etaparam1 - sqrt(etaparam1*etaparam1 - 4.*etaparam2*eta))/(2.*etaparam2);
+  else
+    zovr = -1.*(etaparam1 - sqrt(etaparam1*etaparam1 + 4.*etaparam2*eta))/(2.*etaparam2);
+  Double_t r = sqrt(1.+zovr*zovr);
+  Double_t exacteta = 0.5*log((1+zovr/r)/(1-zovr/r));
+  SetEta(exacteta);
+}
+
 void AliL3HoughTrack::SetLineParameters(Double_t psi,Double_t D,Int_t weight,Int_t *rowrange,Int_t /*ref_row*/)
 {
   //Initialize a track piece, not yet a track
index aced4279eb637b18398e4fd6f81c5590e69c7f60..c5e084bc14c7af3d09e1b1560471d490e73cc8b7 100644 (file)
@@ -17,6 +17,7 @@ class AliL3HoughTrack : public AliL3Track {
   Bool_t IsHelix() const {return fIsHelix;}
   void UpdateToFirstRow();
   void SetTrackParameters(Double_t kappa,Double_t eangle,Int_t weight);  
+  void SetTrackParametersRow(Double_t alpha1,Double_t alpha2,Double_t eta,Int_t weight);  
   void SetLineParameters(Double_t psi,Double_t D,Int_t weight,Int_t *rowrange,Int_t refrow);
 
   Int_t GetWeight()  const {return fWeight;}
index 3f83aea20323aa85661ad9d711a0205d30db3112..6851f79f446872cff8c45bdf8d10a30156b0522b 100644 (file)
@@ -29,6 +29,11 @@ ClassImp(AliL3HoughTransformerRow)
 
 Float_t AliL3HoughTransformerRow::fgBeta1 = 1.0/AliL3Transform::Row2X(84);
 Float_t AliL3HoughTransformerRow::fgBeta2 = 1.0/(AliL3Transform::Row2X(158)*(1.0+tan(AliL3Transform::Pi()*10/180)*tan(AliL3Transform::Pi()*10/180)));
+Float_t AliL3HoughTransformerRow::fgDAlpha = 0.22;
+Float_t AliL3HoughTransformerRow::fgDEta   = 0.40;
+Double_t AliL3HoughTransformerRow::fgEtaCalcParam1 = 1.0289;
+Double_t AliL3HoughTransformerRow::fgEtaCalcParam2 = 0.15192;
+Double_t AliL3HoughTransformerRow::fgEtaCalcParam3 = 1./(32.*600.*600.);
 
 AliL3HoughTransformerRow::AliL3HoughTransformerRow()
 {
@@ -51,11 +56,9 @@ AliL3HoughTransformerRow::AliL3HoughTransformerRow()
 
   fStartPadParams = 0;
   fEndPadParams = 0;
-  fLUTr2 = 0;
+  fLUTr = 0;
   fLUTforwardZ = 0;
-  fLUTforwardZ2 = 0;
   fLUTbackwardZ = 0;
-  fLUTbackwardZ2 = 0;
 
 }
 
@@ -81,11 +84,9 @@ AliL3HoughTransformerRow::AliL3HoughTransformerRow(Int_t slice,Int_t patch,Int_t
 
   fStartPadParams = 0;
   fEndPadParams = 0;
-  fLUTr2 = 0;
+  fLUTr = 0;
   fLUTforwardZ = 0;
-  fLUTforwardZ2 = 0;
   fLUTbackwardZ = 0;
-  fLUTbackwardZ2 = 0;
 
 }
 
@@ -197,36 +198,26 @@ AliL3HoughTransformerRow::~AliL3HoughTransformerRow()
       delete [] fEndPadParams;
       fEndPadParams = 0;
     }
-  if(fLUTr2)
+  if(fLUTr)
     {
       for(Int_t i = AliL3Transform::GetFirstRow(0); i<=AliL3Transform::GetLastRow(5); i++)
        {
-         if(!fLUTr2[i]) continue;
-         delete [] fLUTr2[i];
+         if(!fLUTr[i]) continue;
+         delete [] fLUTr[i];
        }
-      delete [] fLUTr2;
-      fLUTr2 = 0;
+      delete [] fLUTr;
+      fLUTr = 0;
     }
   if(fLUTforwardZ)
     {
       delete[] fLUTforwardZ;
       fLUTforwardZ=0;
     }
-  if(fLUTforwardZ2)
-    {
-      delete[] fLUTforwardZ2;
-      fLUTforwardZ2=0;
-    }
   if(fLUTbackwardZ)
     {
       delete[] fLUTbackwardZ;
       fLUTbackwardZ=0;
     }
-  if(fLUTbackwardZ2)
-    {
-      delete[] fLUTbackwardZ2;
-      fLUTbackwardZ2=0;
-    }
 }
 
 void AliL3HoughTransformerRow::DeleteHistograms()
@@ -455,8 +446,8 @@ void AliL3HoughTransformerRow::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t
                  if((maxlastrow-maxfirstrow) < fTrackNRows[xbin + ybin*nxbins]) {
                    fTrackNRows[xbin + ybin*nxbins] = maxlastrow-maxfirstrow;
                    fInitialGapCount[xbin + ybin*nxbins] = 1;
-                    if((maxlastrow-maxfirstrow+1)<MIN_TRACK_LENGTH)
-                      fInitialGapCount[xbin + ybin*nxbins] = MAX_N_GAPS+1;
+                   if((maxlastrow-maxfirstrow+1)<MIN_TRACK_LENGTH)
+                     fInitialGapCount[xbin + ybin*nxbins] = MAX_N_GAPS+1;
                    if(maxtrackpt < 0.9*0.1*AliL3Transform::GetSolenoidField())
                      fInitialGapCount[xbin + ybin*nxbins] = MAX_N_GAPS;
                    fTrackFirstRow[xbin + ybin*nxbins] = maxfirstrow;
@@ -487,8 +478,8 @@ void AliL3HoughTransformerRow::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t
        <<"Transformer: Allocating about "<<nrows*100*sizeof(AliL3PadHoughParams)<<" bytes to fEndPadParams"<<ENDLOG;
       fEndPadParams = new AliL3PadHoughParams*[nrows];
       LOG(AliL3Log::kInformational,"AliL3HoughTransformerRow::CreateHistograms()","")
-       <<"Transformer: Allocating about "<<nrows*100*sizeof(Float_t)<<" bytes to fLUTr2"<<ENDLOG;
-      fLUTr2 = new Float_t*[nrows];
+       <<"Transformer: Allocating about "<<nrows*100*sizeof(Float_t)<<" bytes to fLUTr"<<ENDLOG;
+      fLUTr = new Float_t*[nrows];
 
       Float_t beta1 = fgBeta1;
       Float_t beta2 = fgBeta2;
@@ -513,11 +504,11 @@ void AliL3HoughTransformerRow::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t
 
          fStartPadParams[i] = new AliL3PadHoughParams[npads];
          fEndPadParams[i] = new AliL3PadHoughParams[npads];
-         fLUTr2[i] = new Float_t[npads];
+         fLUTr[i] = new Float_t[npads];
          for(Int_t pad=0; pad<npads; pad++)
            {
              Float_t y = (pad-0.5*(npads-1))*padpitch;
-             fLUTr2[i][pad] = x2 + y*y;
+             fLUTr[i][pad] = sqrt(x2 + y*y);
              Float_t starty = (pad-0.5*npads)*padpitch;
              Float_t r1 = x2 + starty*starty;
              Float_t xoverr1 = x/r1;
@@ -600,23 +591,15 @@ void AliL3HoughTransformerRow::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t
       LOG(AliL3Log::kInformational,"AliL3HoughTransformerRow::CreateHistograms()","")
        <<"Transformer: Allocating "<<ntimebins*sizeof(Float_t)<<" bytes to fLUTforwardZ"<<ENDLOG;
       fLUTforwardZ = new Float_t[ntimebins];
-      LOG(AliL3Log::kInformational,"AliL3HoughTransformerRow::CreateHistograms()","")
-       <<"Transformer: Allocating "<<ntimebins*sizeof(Float_t)<<" bytes to fLUTforwardZ2"<<ENDLOG;
-      fLUTforwardZ2 = new Float_t[ntimebins];
       LOG(AliL3Log::kInformational,"AliL3HoughTransformerRow::CreateHistograms()","")
        <<"Transformer: Allocating "<<ntimebins*sizeof(Float_t)<<" bytes to fLUTbackwardZ"<<ENDLOG;
       fLUTbackwardZ = new Float_t[ntimebins];
-      LOG(AliL3Log::kInformational,"AliL3HoughTransformerRow::CreateHistograms()","")
-       <<"Transformer: Allocating "<<ntimebins*sizeof(Float_t)<<" bytes to fLUTbackwardZ2"<<ENDLOG;
-      fLUTbackwardZ2 = new Float_t[ntimebins];
       for(Int_t i=0; i<ntimebins; i++){
        Float_t z;
        z=AliL3Transform::GetZFast(0,i,GetZVertex());
        fLUTforwardZ[i]=z;
-       fLUTforwardZ2[i]=z*z;
        z=AliL3Transform::GetZFast(18,i,GetZVertex());
        fLUTbackwardZ[i]=z;
-       fLUTbackwardZ2[i]=z*z;
       }
     }
 }
@@ -697,6 +680,11 @@ void AliL3HoughTransformerRow::TransformCircleFromDigitArray()
 {
   //Do the Hough Transform
 
+  //Load the parameters used by the fast calculation of eta
+  Double_t etaparam1 = GetEtaCalcParam1();
+  Double_t etaparam2 = GetEtaCalcParam2();
+  Double_t etaparam3 = GetEtaCalcParam3();
+
   Int_t netasegments = GetNEtaSegments();
   Double_t etamin = GetEtaMin();
   Double_t etaslice = (GetEtaMax() - etamin)/netasegments;
@@ -726,15 +714,10 @@ void AliL3HoughTransformerRow::TransformCircleFromDigitArray()
   Int_t ilastpatch = GetLastPatch();
   Int_t islice = GetSlice();
   Float_t *lutz;
-  Float_t *lutz2;
-  if(islice < 18) {
+  if(islice < 18)
     lutz = fLUTforwardZ;
-    lutz2 = fLUTforwardZ2;
-  }
-  else {
+  else
     lutz = fLUTbackwardZ;
-    lutz2 = fLUTbackwardZ2;
-  }
 
   //Loop over the padrows:
   for(UChar_t i=AliL3Transform::GetFirstRow(ipatch); i<=AliL3Transform::GetLastRow(ipatch); i++)
@@ -743,9 +726,7 @@ void AliL3HoughTransformerRow::TransformCircleFromDigitArray()
       //Flush eta clusters array
       memset(etaclust,0,netasegments*sizeof(AliL3EtaRow));  
 
-      Float_t x = AliL3Transform::Row2X((Int_t)i);
-      Float_t x2 = x*x;
-      Float_t radius2=0;
+      Float_t radius=0;
 
       //Get the data on this padrow:
       AliL3DigitData *digPt = tempPt->fDigitData;
@@ -767,19 +748,14 @@ void AliL3HoughTransformerRow::TransformCircleFromDigitArray()
 
          if(pad != lastpad)
            {
-             radius2 = fLUTr2[(Int_t)i][(Int_t)pad];
+             radius = fLUTr[(Int_t)i][(Int_t)pad];
              lastetaindex = -1;
            }
 
-         //Transform data to local cartesian coordinates:
          Float_t z = lutz[(Int_t)time];
-         Float_t z2 = lutz2[(Int_t)time];
-         // Acceptance cut : to be verified
-         //      if(radius2<0.72406166*z2) continue;
-         if(x2<0.8464*z2) continue;
-         //Calculate the eta:
-         Double_t r = sqrt(radius2+z2);
-         Double_t eta = 0.5 * log((r+z)/(r-z));
+         Double_t radiuscorr = radius*(1.+etaparam3*radius*radius);
+         Double_t zovr = z/radiuscorr;
+         Double_t eta = (etaparam1-etaparam2*fabs(zovr))*zovr;
          //Get the corresponding index, which determines which histogram to fill:
          Int_t etaindex = (Int_t)((eta-etamin)/etaslice);
 
@@ -846,6 +822,11 @@ void AliL3HoughTransformerRow::TransformCircleFromRawStream()
 {
   //Do the Hough Transform
 
+  //Load the parameters used by the fast calculation of eta
+  Double_t etaparam1 = GetEtaCalcParam1();
+  Double_t etaparam2 = GetEtaCalcParam2();
+  Double_t etaparam3 = GetEtaCalcParam3();
+
   Int_t netasegments = GetNEtaSegments();
   Double_t etamin = GetEtaMin();
   Double_t etaslice = (GetEtaMax() - etamin)/netasegments;
@@ -876,24 +857,17 @@ void AliL3HoughTransformerRow::TransformCircleFromRawStream()
   Int_t ilastpatch = GetLastPatch();
   Int_t islice = GetSlice();
   Float_t *lutz;
-  Float_t *lutz2;
-  if(islice < 18) {
+  if(islice < 18)
     lutz = fLUTforwardZ;
-    lutz2 = fLUTforwardZ2;
-  }
-  else {
+  else
     lutz = fLUTbackwardZ;
-    lutz2 = fLUTbackwardZ2;
-  }
 
   //Flush eta clusters array
   memset(etaclust,0,netasegments*sizeof(AliL3EtaRow));  
 
   UChar_t i=0;
   Int_t npads=0;
-  Float_t x=0;
-  Float_t x2=0;
-  Float_t radius2=0;
+  Float_t radius=0;
   UChar_t pad=0;
 
   //Loop over the rawdata:
@@ -926,9 +900,7 @@ void AliL3HoughTransformerRow::TransformCircleFromRawStream()
       //Flush eta clusters array
       memset(etaclust,0,netasegments*sizeof(AliL3EtaRow));  
 
-      x = AliL3Transform::Row2X((Int_t)i);
-      x2 = x*x;
-      radius2=0;
+      radius=0;
 
     }
 
@@ -946,7 +918,7 @@ void AliL3HoughTransformerRow::TransformCircleFromRawStream()
        continue;
       }
       */
-      radius2 = fLUTr2[(Int_t)i][(Int_t)pad];
+      radius = fLUTr[(Int_t)i][(Int_t)pad];
       lastetaindex = -1;
     } 
 
@@ -963,14 +935,10 @@ void AliL3HoughTransformerRow::TransformCircleFromRawStream()
     if(fTPCRawStream->GetSignal() <= lowerthreshold)
       continue;
 
-    //Transform data to local cartesian coordinates:
     Float_t z = lutz[(Int_t)time];
-    Float_t z2 = lutz2[(Int_t)time];
-    //    if(radius2<0.72406166*z2) continue;
-    if(x2<0.8464*z2) continue;
-    //Calculate the eta:
-    Double_t r = sqrt(radius2+z2);
-    Double_t eta = 0.5 * log((r+z)/(r-z));
+    Double_t radiuscorr = radius*(1.+etaparam3*radius*radius);
+    Double_t zovr = z/radiuscorr;
+    Double_t eta = (etaparam1-etaparam2*fabs(zovr))*zovr;
     //Get the corresponding index, which determines which histogram to fill:
     Int_t etaindex = (Int_t)((eta-etamin)/etaslice);
 
@@ -1077,6 +1045,23 @@ Int_t AliL3HoughTransformerRow::GetTrackID(Int_t etaindex,Double_t alpha1,Double
 #endif
 }
 
+Int_t AliL3HoughTransformerRow::GetTrackLength(Double_t alpha1,Double_t alpha2,Int_t *rows) const
+{
+  // Returns the track length for a given peak found in the Hough space
+
+  AliL3Histogram *hist = fParamSpace[0];
+  Int_t bin = hist->FindBin(alpha1,alpha2);
+  if(bin==-1) {
+    LOG(AliL3Log::kWarning,"AliL3HoughTransformerRow::GetTrackLength()","")
+      <<"Track candidate outside Hough space boundaries: "<<alpha1<<" "<<alpha2<<ENDLOG;
+    return -1;
+  }
+  rows[0] = fTrackFirstRow[bin];
+  rows[1] = fTrackLastRow[bin];
+  
+  return 0;
+}
+
 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
@@ -1271,11 +1256,9 @@ void AliL3HoughTransformerRow::SetTransformerArrays(AliL3HoughTransformerRow *tr
 
     fStartPadParams = tr->fStartPadParams;
     fEndPadParams = tr->fEndPadParams;
-    fLUTr2 = tr->fLUTr2;
+    fLUTr = tr->fLUTr;
     fLUTforwardZ = tr->fLUTforwardZ;
-    fLUTforwardZ2 = tr->fLUTforwardZ2;
     fLUTbackwardZ = tr->fLUTbackwardZ;
-    fLUTbackwardZ2 = tr->fLUTbackwardZ2;
 
     fParamSpace = tr->fParamSpace;
 
index 3dacd1f5f0bd8d7233c5312964671a0e6b2c9f6a..d8a94faf9b0deef0acbbcde1aadd52ffa76a591b 100644 (file)
@@ -13,7 +13,6 @@ struct AliL3EtaRow {
   UChar_t fStartPad; //First pad in the cluster
   UChar_t fEndPad; //Last pad in the cluster
   Bool_t fIsFound; //Is the cluster already found
-  Float_t fStartY; //Y position of the first pad in the cluster
 #ifdef do_mc
   Int_t fMcLabels[MaxTrack]; //Array to store mc labels inside cluster
 #endif
@@ -51,6 +50,7 @@ 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;
+  Int_t GetTrackLength(Double_t alpha1,Double_t alpha2,Int_t *rows) const;
   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]; }
@@ -61,6 +61,11 @@ class AliL3HoughTransformerRow : public AliL3HoughBaseTransformer {
   UChar_t *GetTrackLastRow() const { return fTrackLastRow; }
   static Float_t GetBeta1() {return fgBeta1;}
   static Float_t GetBeta2() {return fgBeta2;}
+  static Float_t GetDAlpha() {return fgDAlpha;}
+  static Float_t GetDEta() {return fgDEta;}
+  static Double_t GetEtaCalcParam1() {return fgEtaCalcParam1;}
+  static Double_t GetEtaCalcParam2() {return fgEtaCalcParam2;}
+  static Double_t GetEtaCalcParam3() {return fgEtaCalcParam3;}
 
   void SetTPCRawStream(AliTPCRawStream *rawstream) {fTPCRawStream=rawstream;}
 
@@ -83,12 +88,10 @@ class AliL3HoughTransformerRow : public AliL3HoughBaseTransformer {
 
   AliL3PadHoughParams **fStartPadParams; //!
   AliL3PadHoughParams **fEndPadParams; //!
-  Float_t **fLUTr2; //!
+  Float_t **fLUTr; //!
 
   Float_t *fLUTforwardZ; //!
-  Float_t *fLUTforwardZ2; //!
   Float_t *fLUTbackwardZ; //!
-  Float_t *fLUTbackwardZ2; //!
 
   AliL3Histogram **fParamSpace; //!
 
@@ -110,6 +113,9 @@ class AliL3HoughTransformerRow : public AliL3HoughBaseTransformer {
   void SetTransformerArrays(AliL3HoughTransformerRow *tr);
 
   static Float_t fgBeta1,fgBeta2; // Two curves which define the Hough space
+  static Float_t fgDAlpha, fgDEta; // Correlation factor between Hough space bin size and resolution
+  static Double_t fgEtaCalcParam1, fgEtaCalcParam2; // Parameters used for fast calculation of eta during the binning of Hough space
+  static Double_t fgEtaCalcParam3; // Parameter used during the eta binning of the Hough Space in order to account for finite track radii
 
   AliTPCRawStream *fTPCRawStream; // Pointer to the raw stream in case of fast reading of the raw data (fast_raw flag)
 
index 602740562181cb7e7d79ed3ba286361561e51f0b..b9e08a7ad4c26a6da133d52d0cec93cf522ab955 100644 (file)
@@ -17,6 +17,7 @@ hough/AliL3HoughMaxFinder.cxx \
 hough/AliL3HoughMerger.cxx \
 hough/AliL3HoughTest.cxx \
 hough/AliL3HoughTrack.cxx \
+hough/AliL3HoughKalmanTrack.cxx \
 hough/AliL3HoughTransformer.cxx \
 hough/AliL3HoughTransformerGlobal.cxx \
 hough/AliL3HoughTransformerLUT.cxx \
index 3956c0d71b90fab69be931b2c43dee8b7cdc84ba..4c6c9a372a85a37b91eaa84b08377266710696d4 100644 (file)
@@ -28,6 +28,7 @@ src/AliL3VertexArray.cxx \
 src/AliL3VertexFinder.cxx \
 src/AliLevel3.cxx \
 src/AliHLTReconstructor.cxx \
+src/AliL3TPCtracker.cxx \
 src/AliL3Log.cxx \
 src/AliL3TPCBeamTestMemHandler.cxx
 
@@ -40,6 +41,6 @@ PACKCXXFLAGS := ${HLTCXXFLAGS}
 PACKCFLAGS   := ${HLTCLFAGS}
 PACKDCXXFLAGS:= ${HLTDCXXFLAGS}
 
-EINCLUDE += HLT/src HLT/hough HLT/comp HLT/misc TPC ITS STEER CONTAINERS RAW
+EINCLUDE += HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS TPC ITS STEER CONTAINERS RAW
 
 SUBDIR:=src
index 8c5b774416ac80ac2d078dd9cf446f53a6ead3b7..4dfb1b7926eb44f4161b33fda9c0d6b4c79a044c 100644 (file)
 #include "AliL3HoughTrack.h"
 #include "AliL3TrackArray.h"
 
+#include "AliRun.h"
+#include "AliITS.h"
+#include "AliITSgeom.h"
+#include "AliL3ITStracker.h"
+#include "AliL3TPCtracker.h"
+
 #if __GNUC__== 3
 using namespace std;
 #endif
@@ -46,7 +52,7 @@ AliHLTReconstructor::AliHLTReconstructor(): AliReconstructor()
   AliL3Log::fgLevel=AliL3Log::kWarning;
 #endif
   fDoTracker=1;
-  fDoHough=1;
+  fDoHough=0;
   fDoBench=0;
   fDoCleanUp=1;
 }
@@ -158,6 +164,8 @@ void AliHLTReconstructor::ReconstructWithConformalMapping(AliRunLoader* runLoade
 void AliHLTReconstructor::ReconstructWithHoughTransform(AliRunLoader* runLoader,Int_t iEvent) const
 {
   //reconstruct with hough
+  //not used anymore, Hough tracking is moved out of the local
+  //reconstruction chain
   Float_t ptmin = 0.1*AliL3Transform::GetSolenoidField();
 
   Float_t zvertex = 0;
@@ -305,4 +313,46 @@ void AliHLTReconstructor::FillESDforHoughTransform(AliESD* esd,Int_t iEvent) con
 
   delete fTracks;
 }
+
+AliTracker* AliHLTReconstructor::CreateTracker(AliRunLoader* runLoader) const
+{
+  //Create HLT trackers for TPC and ITS
+
+  TString opt = GetOption();
+  if(!opt.CompareTo("TPC")) {
+    // Create Hough tracker for TPC
+    return new AliL3TPCtracker(runLoader);
+  }
+  if(!opt.CompareTo("ITS")) {
+    // Create ITS tracker
+    AliITSgeom* geom = GetITSgeom(runLoader);
+    if (!geom) return NULL;
+    return new AliL3ITStracker(geom);
+  }
+
+  return NULL;
+}
+
+//_____________________________________________________________________________
+AliITSgeom* AliHLTReconstructor::GetITSgeom(AliRunLoader* runLoader) const
+{
+// get the ITS geometry
+
+  if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
+  if (!runLoader->GetAliRun()) {
+    Error("GetITSgeom", "couldn't get AliRun object");
+    return NULL;
+  }
+  AliITS* its = (AliITS*) runLoader->GetAliRun()->GetDetector("ITS");
+  if (!its) {
+    Error("GetITSgeom", "couldn't get ITS detector");
+    return NULL;
+  }
+  if (!its->GetITSgeom()) {
+    Error("GetITSgeom", "no ITS geometry available");
+    return NULL;
+  }
+  return its->GetITSgeom();
+}
+
 #endif
index 42cf7d316fe0502e9de9a2e388221a31bc656970..cbb8b629d063eb432ebe4388c123f91a61411401 100644 (file)
@@ -8,6 +8,8 @@
 #ifdef use_reconstruction
 #include "AliReconstructor.h"
 
+class AliITSgeom;
+
 class AliHLTReconstructor: public AliReconstructor {
 public:
   AliHLTReconstructor();
@@ -15,6 +17,7 @@ public:
   virtual ~AliHLTReconstructor();
 
   virtual void         Reconstruct(AliRunLoader* runLoader) const;
+  virtual AliTracker*  CreateTracker(AliRunLoader*) const;
   virtual void         FillESD(AliRunLoader* runLoader, AliESD* esd) const;
   void SetDoBench(Bool_t b){fDoBench=b;}
   void SetDoCleanup(Bool_t b){fDoCleanUp=b;}
@@ -25,6 +28,7 @@ private:
   void FillESDforConformalMapping(AliESD* esd,Int_t iEvent) const;
   void FillESDforHoughTransform(AliESD* esd,Int_t iEvent) const;
 
+  AliITSgeom*          GetITSgeom(AliRunLoader* runLoader) const;
 
   Bool_t fDoHough;   //do the hough transform
   Bool_t fDoTracker; //do the standard conformal tracker
index a81d717bdf9fa59f01c617421790fc2dd728a7ff..da705197fe74c79e806063e7f1f8148590faff1e 100644 (file)
@@ -38,6 +38,7 @@
 #pragma link C++ class AliL3Evaluate; 
 #ifdef use_reconstruction
 #pragma link C++ class AliHLTReconstructor;
+#pragma link C++ class AliL3TPCtracker;
 #endif
 #endif
 
diff --git a/HLT/src/AliL3TPCtracker.cxx b/HLT/src/AliL3TPCtracker.cxx
new file mode 100644 (file)
index 0000000..7fc8aa4
--- /dev/null
@@ -0,0 +1,90 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//-------------------------------------------------------------------------
+//       Implementation of the HLT TPC hough transform tracker class
+//
+//    It reads directly TPC digits using runloader and runs the HT
+//    algorithm over them.
+//    It stores the reconstructed hough tracks in the HLT ESD using the
+//    the off-line AliESDtrack format.
+//
+//       Origin: Cvetan Cheshkov, CERN, Cvetan.Cheshkov@cern.ch
+//-------------------------------------------------------------------------
+
+#include "AliESD.h"
+#include "AliRunLoader.h"
+#include "AliL3TPCtracker.h"
+#include "AliL3Hough.h"
+
+ClassImp(AliL3TPCtracker)
+
+AliL3TPCtracker::AliL3TPCtracker(AliRunLoader *runLoader):AliTracker()
+{
+  //--------------------------------------------------------------
+  // Constructor
+  //--------------------------------------------------------------
+
+  if(AliL3Transform::GetVersion() == AliL3Transform::kVdefault) {
+    Bool_t isinit=AliL3Transform::Init(runLoader);
+    if(!isinit) AliWarning("Could not init AliL3Transform settings, using defaults!");
+  }
+
+  fRunLoader = runLoader;
+}
+
+Int_t AliL3TPCtracker::Clusters2Tracks(AliESD *event)
+{
+  //--------------------------------------------------------------------
+  // This method reconstructs HLT TPC Hough tracks
+  //--------------------------------------------------------------------
+  
+  if (!fRunLoader) {
+    AliError("Missing runloader!");
+    return kTRUE;
+  }
+  
+  Float_t ptmin = 0.1*AliL3Transform::GetSolenoidField();
+
+  Float_t zvertex = GetZ();
+
+  AliInfo(Form("Hough Transform will run with ptmin=%f and zvertex=%f",ptmin,zvertex));
+
+  AliL3Hough *hough = new AliL3Hough();
+    
+  hough->SetThreshold(4);
+  hough->CalcTransformerParams(ptmin);
+  hough->SetPeakThreshold(70,-1);
+  hough->SetRunLoader(fRunLoader);
+  hough->Init("./", kFALSE, 100, kFALSE,4,0,0,zvertex);
+  hough->SetAddHistograms();
+
+  for(Int_t slice=0; slice<=35; slice++)
+    {
+      hough->ReadData(slice);
+      hough->Transform();
+      hough->AddAllHistogramsRows();
+      hough->FindTrackCandidatesRow();
+      hough->AddTracks();
+    }
+
+  Int_t ntrk = hough->FillESD(event);
+
+  Info("Clusters2Tracks","Number of found tracks: %d\n",ntrk);
+  
+  delete hough;
+
+  return 0;
+}
diff --git a/HLT/src/AliL3TPCtracker.h b/HLT/src/AliL3TPCtracker.h
new file mode 100644 (file)
index 0000000..b1e393f
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef ALIL3TPCTRACKER_H
+#define ALIL3TPCTRACKER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//-------------------------------------------------------------------------
+//                          High Level Trigger TPC tracker
+//       This class encapsulates the Hough transform HLT tracking
+//       algorithm. It is used to call the algorithm inside the off-line
+//       reconstruction chain. So far the tracker uses AliRunLoader to
+//       to get the TPC digits. In the future all the references to
+//       runloaders will be removed and the tracker will take as an input
+//       the digits tree.
+//      
+//           Origin: Cvetan Cheshkov, CERN, Cvetan.Cheshkov@cern.ch 
+//-------------------------------------------------------------------------
+
+#include "AliTracker.h"
+#include "AliLog.h"
+
+#include "AliL3Transform.h"
+
+class AliRunLoader;
+class AliESD;
+
+//-------------------------------------------------------------------------
+class AliL3TPCtracker : public AliTracker {
+public:
+  AliL3TPCtracker(AliRunLoader *runLoader);
+
+  Int_t Clusters2Tracks(AliESD *event);
+
+  Int_t PropagateBack(AliESD */*event*/) {return 0;}
+  Int_t RefitInward(AliESD */*event*/) {return 0;}
+  Int_t LoadClusters(TTree */*cf*/) {return 0;}
+  void  UnloadClusters() {return;}
+
+  AliCluster *GetCluster(Int_t /*index*/) const {return NULL;}
+
+private:
+  AliRunLoader *fRunLoader; // Pointer to the runloader
+
+  ClassDef(AliL3TPCtracker,1)   //HLT TPC Hough tracker
+};
+
+#endif
index d7d954f42dcd0b7622c56b1acb55128d5b5e4baa..39871c69fb696440acdd5e94ff98f7d41db39067 100644 (file)
@@ -78,6 +78,9 @@ void AliL3Track::Set(AliL3Track *tpt)
   SetPt(tpt->GetPt());
   SetPsi(tpt->GetPsi());
   SetTgl(tpt->GetTgl());
+  SetPterr(tpt->GetPterr());
+  SetPsierr(tpt->GetPsierr());
+  SetTglerr(tpt->GetTglerr());
   SetCharge(tpt->GetCharge());
   SetHits(tpt->GetNHits(),(UInt_t *)tpt->GetHitNumbers());
 #ifdef do_mc
index bd48ae5118540612dfd41fe7c3bd3e9b6a34b650..e8e4e0db12a42061226cce3e19e2e54fb58ef89e 100644 (file)
@@ -50,6 +50,10 @@ class AliL3Track {
   Double_t GetR0() const {return fR0;}
   Double_t GetZ0() const {return fFirstPoint[2];}
   Float_t GetPID() const {return fPID;}
+
+  Double_t GetPterr() const {return fPterr;}
+  Double_t GetPsierr() const {return fPsierr;}
+  Double_t GetTglerr() const {return fTanlerr;}
   
   Double_t GetKappa() const {return fKappa;}
   Double_t GetRadius() const {return fRadius;}
index 2265a0cd27ebae26ecfd8e442b135df6aff2af71..b31ab1418b7c59f903ff1e4a2d98da460d665c79 100644 (file)
@@ -209,6 +209,9 @@ void AliL3TrackArray::FillTracks(Int_t ntracks, AliL3TrackSegmentData* tr){
     track->SetPt(trs->fPt);
     track->SetPsi(trs->fPsi);
     track->SetTgl(trs->fTgl);
+    track->SetPterr(trs->fPterr);
+    track->SetPsierr(trs->fPsierr);
+    track->SetTglerr(trs->fTglerr);
     track->SetNHits(trs->fNPoints);
     track->SetCharge(trs->fCharge);
     track->SetFirstPoint(trs->fX,trs->fY,trs->fZ);
@@ -237,11 +240,14 @@ void AliL3TrackArray::FillTracks(Int_t ntracks, AliL3TrackSegmentData* tr,Int_t
   for(Int_t i=0; i<ntracks; i++){
     AliL3Track *track = NextTrack(); 
     track->SetPt(trs->fPt);
+    track->SetPterr(trs->fPterr);
     Float_t psi[1];
     psi[0]=trs->fPsi;
     AliL3Transform::Local2GlobalAngle(psi,slice);
     track->SetPsi(psi[0]);
     track->SetTgl(trs->fTgl);
+    track->SetPsierr(trs->fPsierr);
+    track->SetTglerr(trs->fTglerr);
     track->SetNHits(trs->fNPoints);
     track->SetCharge(trs->fCharge);
     Float_t first[3];
@@ -304,11 +310,14 @@ UInt_t AliL3TrackArray::WriteTracks(AliL3TrackSegmentData* tr)
     tP->fY = track->GetFirstPointY();
     tP->fZ = track->GetFirstPointZ();
     tP->fPt = track->GetPt();
+    tP->fPterr = track->GetPterr();
     tP->fLastX = track->GetLastPointX();
     tP->fLastY = track->GetLastPointY();
     tP->fLastZ = track->GetLastPointZ();
     tP->fPsi = track->GetPsi();
     tP->fTgl = track->GetTgl();
+    tP->fPsierr = track->GetPsierr();
+    tP->fTglerr = track->GetTglerr();
     tP->fCharge = track->GetCharge();
     tP->fNPoints = track->GetNHits();
 #ifdef ROWHOUGHPARAMS
@@ -359,11 +368,14 @@ UInt_t AliL3TrackArray::WriteConfMapTracks(AliL3TrackSegmentData* tr)
 //    tP->fY = track->GetFirstPointY();
 //    tP->fZ = track->GetFirstPointZ();
     tP->fPt = track->GetPt();
+    tP->fPterr = track->GetPterr();
 //    tP->fLastX = track->GetLastPointX();
 //    tP->fLastY = track->GetLastPointY();
 //    tP->fLastZ = track->GetLastPointZ();
     tP->fPsi = track->GetPsi();
     tP->fTgl = track->GetTgl();
+    tP->fPsierr = track->GetPsierr();
+    tP->fTglerr = track->GetTglerr();
     tP->fCharge = track->GetCharge();
 #ifdef ROWHOUGHPARAMS
     tP->fTrackID = track->GetMCid();
index 321db7a970d0fe1e1e6414f887c409c593e5be5d..8ca6a77cd20ee487f485f0bf802f047796695ecb 100644 (file)
@@ -16,6 +16,9 @@ struct AliL3TrackSegmentData
        Double_t fPt;
        Double_t fPsi;
         Double_t fTgl;
+       Double_t fPterr;
+       Double_t fPsierr;
+        Double_t fTglerr;
         Int_t fCharge;
 #ifdef ROWHOUGHPARAMS
       /* needed for PDC */