How to get magnetic field value from the simulated data

  • The field information is stored into the same container as the geometry data – “FairBaseParSet”. From this container you can get field parameters. But you should not use it directly, because it is already done on the level of the “FairRunAna” class in the method “Init()”.
  • You can access the magnetic field directly:
  • FairField *field = fRun->GetField(); 
    
  • The value of the magnetic filed in the space point can be obtained by any of the following methods:
  • field->GetBx(x,y,z);
    field->GetBy(x,y,z);
    field->GetBz(x,y,z);
    
    Double_t point[3],b[3];
    field->GetFieldValue(point,b);