use AliLog message scheme
[u/mrichter/AliRoot.git] / STEER / AliTracker.cxx
index c2d7f01..b287d03 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
+
 //-------------------------------------------------------------------------
 //               Implementation of the AliTracker class
-//
-//          Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+//  that is the base for AliTPCtracker, AliITStrackerV2 and AliTRDtracker    
+//        Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
 //-------------------------------------------------------------------------
+
 #include <TMath.h>
 
 #include "AliTracker.h"
 #include "AliCluster.h"
 #include "AliKalmanTrack.h"
+#include "AliLog.h"
+#include "AliRun.h"
+#include "AliMagF.h"
+
+extern AliRun* gAlice;
+
+const AliMagF *AliTracker::fgkFieldMap=0;
 
 ClassImp(AliTracker)
 
+AliTracker::AliTracker():
+  fEventN(0),
+  fStoreBarrel(1),
+  fX(0),
+  fY(0),
+  fZ(0),
+  fSigmaX(0.005),
+  fSigmaY(0.005),
+  fSigmaZ(0.010)
+{
+  //--------------------------------------------------------------------
+  // The default constructor.
+  //--------------------------------------------------------------------
+ AliMagF *field=gAlice->Field();
+ if (field==0) AliFatal("Can't access the field map !");
+ SetFieldMap(field);
+}
+
+void AliTracker::SetFieldMap(const AliMagF* map) {
+  //--------------------------------------------------------------------
+  //This passes the field map to the reconstruction.
+  //--------------------------------------------------------------------
+  if (map==0) AliFatalClass("Can't access the field map !");
+  AliKalmanTrack::SetConvConst(1000/0.299792458/map->SolenoidField());
+  fgkFieldMap=map;
+}
+
 //__________________________________________________________________________
 void AliTracker::CookLabel(AliKalmanTrack *t, Float_t wrong) const {
   //--------------------------------------------------------------------
@@ -58,11 +95,15 @@ void AliTracker::CookLabel(AliKalmanTrack *t, Float_t wrong) const {
     
   for (i=0; i<noc; i++) {
     AliCluster *c=clusters[i];
-    if (TMath::Abs(c->GetLabel(1)) == lab ||
-        TMath::Abs(c->GetLabel(2)) == lab ) max++;
+    //if (TMath::Abs(c->GetLabel(1)) == lab ||
+    //    TMath::Abs(c->GetLabel(2)) == lab ) max++;
+    if (TMath::Abs(c->GetLabel(0)!=lab))
+       if (TMath::Abs(c->GetLabel(1)) == lab ||
+           TMath::Abs(c->GetLabel(2)) == lab ) max++;
   }
 
   if ((1.- Float_t(max)/noc) > wrong) lab=-lab;
+  t->SetFakeRatio((1.- Float_t(max)/noc));
   t->SetLabel(lab);
 
   delete[] lb;
@@ -82,5 +123,3 @@ void AliTracker::UseClusters(const AliKalmanTrack *t, Int_t from) const {
      c->Use();   
   }
 }
-
-