--- PamVMC/include/PamVMCFieldMgr.h 2009/02/19 16:50:36 1.1 +++ PamVMC/include/PamVMCFieldMgr.h 2009/06/12 18:39:18 1.5 @@ -1,6 +1,7 @@ #ifndef PAMVMCFIELDMGR_H #define PAMVMCFIELDMGR_H #include +#include #include "TString.h" @@ -16,8 +17,14 @@ #include "TrkParams.h" #endif -class PamVMCFieldMgr: public TObject { +#if ROOT_VERSION_CODE >= 333572 + #include + class PamVMCFieldMgr: public TVirtualMagField +#else + class PamVMCFieldMgr: public TObject +#endif +{ private: static PamVMCFieldMgr * fm; @@ -44,28 +51,28 @@ #endif } - void Field(const Double_t* x, Double_t* b) const { - + void Field(const Double_t* x, Double_t* B) { #ifdef PAMFIELD float xm[3]={x[0],x[1],x[2]-ZCAL-CALS3-ZSPEBP-HORMG}; - b[0] = TrkParams::GetBX((float *)xm)*10; - b[1] = TrkParams::GetBY((float *)xm)*10; - b[2] = TrkParams::GetBZ((float *)xm)*10; + B[0] = TrkParams::GetBX((float *)xm)*10; + B[1] = TrkParams::GetBY((float *)xm)*10; + B[2] = TrkParams::GetBZ((float *)xm)*10; #else if(x) { - for (Int_t i=0; i<3; i++) b[i] = 0.0; + for (Int_t i=0; i<3; i++) B[i] = 0.0; } else { - b[0]=b[1]=b[2]=0.0; + B[0]=B[1]=B[2]=0.0; } #endif } - void Field(const Float_t* x, Float_t* b) const { + + void Field(const Float_t* x, Float_t* b) { #ifdef PAMFIELD @@ -74,16 +81,17 @@ b[0] = TrkParams::GetBX((float *)xm)*10; b[1] = TrkParams::GetBY((float *)xm)*10; b[2] = TrkParams::GetBZ((float *)xm)*10; - + #else - if(x) { - for (Int_t i=0; i<3; i++) b[i] = 0.0; - } else { - b[0]=b[1]=b[2]=0.0; + if(x) { + for (Int_t i=0; i<3; i++) b[i] = 0.0; + } else { + b[0]=b[1]=b[2]=0.0; } #endif - + } + }; #endif