]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliTracker.cxx
Support for automatic pedestal estimation per pad (Marian and Matevz).
[u/mrichter/AliRoot.git] / STEER / AliTracker.cxx
index d53c66c21afa880e967e6594d865645268831661..68f67faaa10647d0ca39999907a6d1c624f3c76b 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/* $Header$ */
+/* $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 <TClass.h>
 #include <TMath.h>
 
 #include "AliTracker.h"
 #include "AliCluster.h"
 #include "AliKalmanTrack.h"
 
+Bool_t AliTracker::fgUniformField=kTRUE;
+Double_t AliTracker::fgBz=0.;
+const AliMagF *AliTracker::fgkFieldMap=0;
+
 ClassImp(AliTracker)
 
+AliTracker::AliTracker():
+  fX(0),
+  fY(0),
+  fZ(0),
+  fSigmaX(0.005),
+  fSigmaY(0.005),
+  fSigmaZ(0.010)
+{
+  //--------------------------------------------------------------------
+  // The default constructor.
+  //--------------------------------------------------------------------
+  if (!fgkFieldMap) AliWarning("Field map is not set. Call AliTracker::SetFieldMap before creating a tracker!");
+}
+
+void AliTracker::SetFieldMap(const AliMagF* map, Bool_t uni) {
+  //--------------------------------------------------------------------
+  //This passes the field map to the reconstruction.
+  //--------------------------------------------------------------------
+  if (map==0) AliFatalClass("Can't access the field map !");
+
+  if (fgkFieldMap) {
+     AliWarningClass("The magnetic field map has been already set !");
+     return;
+  }
+
+  fgUniformField=uni;
+  fgkFieldMap=map;
+
+  //Float_t r[3]={0.,0.,0.},b[3]; map->Field(r,b);
+  //Double_t bz=-b[2];
+  Double_t bz=-map->SolenoidField();
+  fgBz=TMath::Sign(1e-13,bz) + bz;
+
+}
+
 //__________________________________________________________________________
 void AliTracker::CookLabel(AliKalmanTrack *t, Float_t wrong) const {
   //--------------------------------------------------------------------
@@ -61,11 +101,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;
@@ -85,5 +129,3 @@ void AliTracker::UseClusters(const AliKalmanTrack *t, Int_t from) const {
      c->Use();   
   }
 }
-
-