]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/AliHLTTPCTransform.cxx
The present commit corresponds to an important change in the way the
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCTransform.cxx
index d54f838dbed3bd9f5674db0939a46c61abe37f29..3351b294434d22af45be7dafd355558431a7ffc1 100644 (file)
 #include <AliTPCRF1D.h>
 #endif
 #ifdef use_root
+#include <TError.h>
 #include <TFile.h>
-#include <TUnixSystem.h>
+#include <TGeoGlobalMagField.h>
 #include <TTimeStamp.h>
-#include <TError.h>
+#include <TUnixSystem.h>
 #endif
 
 #include "AliHLTTPCLogging.h"
@@ -971,11 +972,12 @@ Bool_t AliHLTTPCTransform::Init(AliRunLoader *runLoader)
   }
   
   fgVersion=kValiroot;
-  SetBFieldFactor((Double_t)runLoader->GetAliRun()->Field()->Factor());
-  SetSolenoidBField(-
-                   (Double_t)runLoader->GetAliRun()->Field()->SolenoidField()/
-                   (Double_t)runLoader->GetAliRun()->Field()->Factor()
-                   );
+  AliMagF* mag = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+  double fc = mag ? mag->GetFactorSol() : 0;
+  double bz = mag ? -mag->SolenoidField() : 0;
+  if (fc!=0) bz/=fc;
+  SetBFieldFactor( fc );
+  SetSolenoidBField( bz );
   fgPadPitchWidthLow=param->GetInnerPadPitchWidth();
   fgPadPitchWidthUp=param->GetOuterPadPitchWidth();
   fgZWidth=param->GetZWidth();
@@ -1318,11 +1320,18 @@ Bool_t AliHLTTPCTransform::MakeInitFile(Char_t *rootfilename,Char_t *filename)
   }
   
   fgVersion=kValiroot;
-  SetBFieldFactor((Double_t)lgAlice->Field()->Factor());
-  SetSolenoidBField(-
-                   (Double_t)lgAlice->Field()->SolenoidField()/
-                   (Double_t)lgAlice->Field()->Factor()
-                   );
+  AliMagF* mag = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
+  double fc = mag ? mag->GetFactorSol() : 0;
+  double bz = mag ? -mag->SolenoidField() : 0;
+  if (fc!=0) bz/=fc;
+  SetBFieldFactor( fc );
+  SetSolenoidBField( bz );
+
+  //   SetBFieldFactor((Double_t)l((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Factor());
+  //   SetSolenoidBField(-
+  //               (Double_t)l((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->SolenoidField()/
+  //               (Double_t)l((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Factor()
+  //               );
   fgPadPitchWidthLow=param->GetInnerPadPitchWidth();
   fgPadPitchWidthUp=param->GetOuterPadPitchWidth();
   fgZWidth=param->GetZWidth();