// ------------------------------------------------------------------------- // ----- HadesField source file ----- // ----- Created 28/02/06 by M. Al/Turany ----- // ------------------------------------------------------------------------- #include "iomanip.h" #include "iostream.h" #include "HadesField.h" // ----- Standard constructor ------------------------------------------ HadesField::HadesField() : FairField("Hades Field") { fField= new HMdcTrackGField("Hades Field"); } // ----- Destructor ---------------------------------------------------- HadesField::~HadesField() { } // ------------------------------------------------------------------------- // ----- Screen output ------------------------------------------------- void HadesField::Print() { } // ------------------------------------------------------------------------- void HadesField::Init() { TString work = getenv("VMCWORKDIR"); TString field=work+"/geometry/FIELD.DAT"; fField->init(field.Data()); } void HadesField::GetFieldValue(const Double_t point[3], Double_t* bField) { /* Double_t rho2g=point[0]*point[0]+point[1]*point[1]; Double_t rhog=TMath::Sqrt(rho2g); Double_t phig=TMath::ATan2(point[1],point[0]); if(phig < 0.)phig+=6.283185308; Int_t phigd=57.29577951*phig; Int_t rem= phigd % 60; // cout << "rem " << phigd << " " << rem << endl; Double_t point1[3]; Double_t tanTheta=TMath::Tan(rem); Double_t tanTheta2=tanTheta*tanTheta; point1[0]=TMath::Sqrt(rho2g/(1+tanTheta2)); // cout << " rho2g-point1[0]*point1[0] " << rho2g-point1[0]*point1[0] << endl; Double_t x2= rho2g-point1[0]*point1[0]; if (x2<0)x2=0; point1[1]=TMath::Sqrt(rho2g-x2); point1[2]=point[2]; */ // cout << "Xin = " << point[0] << " Yin = " << point[1] <<" Zin = " << point[2] <