#ifndef _T49MagneticField_INCLUDED_ #define _T49MagneticField_INCLUDED_ #include #include #include using std::string; using std::vector; class T49MagneticFieldMapPoint { public: /* Field vector */ Float_t x; /* Bx */ Float_t y; /* By */ Float_t z; /* Bz */ }; class T49MagneticFieldMap { public: /* Grid parameters */ Int_t n[3]; Float_t origin[3]; Float_t step[3]; /* Map boundaries, calculated from the above */ Double_t xmin, xmax; Double_t ymin, ymax; Double_t zmin, zmax; /* Where the actual data is stored */ vector< vector< vector< T49MagneticFieldMapPoint > > > mapPoints; }; class T49MagneticField { public: virtual ~T49MagneticField(); Bool_t Init(void); Bool_t magfld(const Float_t x, const Float_t y, const Float_t z, Double_t h[3]); Bool_t PointIsWithinMap(const Double_t x, const Double_t y, const Double_t z); private: void T49MagneticField::fieldAt(const T49MagneticFieldMap &map, const Double_t x, const Double_t y, const Double_t z, Double_t b[3]) const; /* Field map information */ Float_t fVersion; string fComment; Float_t fDate; /* Flags of the map */ string fType; /* map type (KEY5) */ Float_t fScale[2]; /* NMR scaling factors for calculated map */ Int_t fPolarity; /* 0 means field off, -1 changes field sign */ vector fFieldMaps; ClassDef(T49MagneticField, 0) }; #endif /* _T49MagneticField_INCLUDED_ */