#include "AliRun.h"
#include "AliMagF.h"
-#include "TFile.h"
-#include "TError.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) Fatal("AliTracker()","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) ::Fatal("SetFieldMap","Can't access the field map !");
+ AliKalmanTrack::SetConvConst(1000/0.299792458/map->SolenoidField());
+ fgkFieldMap=map;
+}
+
//__________________________________________________________________________
void AliTracker::CookLabel(AliKalmanTrack *t, Float_t wrong) const {
//--------------------------------------------------------------------
c->Use();
}
}
-
-////////////////////////////////////////////////////////////////////////
-Int_t AliTracker::SetFieldFactor() {
-//
-// Utility class to set the value of the magnetic field in the barrel
-// It supposes that the correct object gAlice is in the memory
-//
- AliKalmanTrack::
- SetConvConst(1000/0.299792458/gAlice->Field()->SolenoidField());
- Double_t field=gAlice->Field()->SolenoidField();
- ::Info("SetFieldFactor","Magnetic field in kGauss: %f\n",field);
- return 0;
-}
-////////////////////////////////////////////////////////////////////////
-Int_t AliTracker::SetFieldFactor(TFile *file, Bool_t deletegAlice) {
-//
-// Utility class to set the value of the magnetic field in the barrel
-// gAlice object is read from the file, and optionally deleted
-//
- if (!(gAlice=(AliRun*)file->Get("gAlice"))) {
- ::Warning
- ("SetFieldFactor","gAlice has not been found in file %s\n",file->GetName());
- return 1;
- }
- Int_t rc = SetFieldFactor();
- if (deletegAlice) {
- delete gAlice;
- gAlice = 0;
- }
- return rc;
-}
-////////////////////////////////////////////////////////////////////////
-Int_t AliTracker::SetFieldFactor(const char* fileName, Bool_t closeFile) {
-//
-// Utility class to set the value of the magnetic field in the barrel
-// gAlice object is read from the file, the file is optionally closed
-//
- TFile *file=TFile::Open(fileName);
- if (!file->IsOpen()) {
- ::Warning("AliTracker::SetFieldFactor","Cannnot open %s !\n",fileName);
- return 1;
- }
- Int_t rc = SetFieldFactor(file, closeFile) ;
- if (closeFile) file->Close();
- return rc;
-}
-////////////////////////////////////////////////////////////////////////
-
// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
//-------------------------------------------------------------------------
#include <TObject.h>
+#include "TError.h"
class AliKalmanTrack;
class AliCluster;
-class TFile;
class TTree;
class AliESD;
+class AliMagF;
class AliTracker : public TObject {
-
-
public:
enum {kTrackInward, kTrackBack, kTrackRefit} Propagation_t;
- AliTracker() { fX=fY=fZ=0.; fSigmaX=fSigmaY=fSigmaZ=0.; fEventN=0; fStoreBarrel = 1;}
+ AliTracker();
virtual ~AliTracker(){}
virtual Int_t Clusters2Tracks(AliESD *event)=0;
virtual Int_t PropagateBack(AliESD *event)=0;
}
void SetEventNumber(Int_t ev) { fEventN=ev; }
-
-
//protected:
virtual Int_t LoadClusters(TTree *)=0;
virtual void UnloadClusters()=0;
Double_t GetSigmaZ() const {return fSigmaZ;}
Int_t GetEventNumber() const {return fEventN;}
- static Int_t SetFieldFactor(const char* fileName, Bool_t closeFile = kTRUE);
- static Int_t SetFieldFactor(TFile* file, Bool_t deletegAlice = kTRUE);
- static Int_t SetFieldFactor();
+ static void SetFieldMap(const AliMagF* map);
+ static const AliMagF *GetFieldMap() {return fgkFieldMap;}
Int_t IsStoringBarrel() const {return fStoreBarrel;}
void SetStoreBarrel(Int_t s) {fStoreBarrel = s;}
private:
+ static const AliMagF *fgkFieldMap; //field map
Int_t fEventN;//event number
Int_t fStoreBarrel;