/** FOPIField.h ** @author P Buehler ** @since 20.12.2011 ** @version1.0 ** The FOPI magnetic field **/ #ifndef FOPIFIELD_H #define FOPIFIELD_H 1 #include "FairField.h" #include "TGeoMatrix.h" #include "TVector3.h" #include "TLorentzVector.h" #include "TMatrixD.h" #include #include #include #include class PndConstPar; class FOPIField : public FairField { public: /** Default constructor **/ FOPIField(); FOPIField(Double_t mfvalnorm); /** Standard constructor ** @param name Object name ** @param xMin,xMax x region of field (global coordinates) ** @param yMin,yMax y region of field (global coordinates) ** @param zMin,zMax z region of field (global coordinates) ** @param bX,bY,bZ Field values [kG] **/ FOPIField(const char* name, Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax); /** Constructor from PndFieldPar **/ FOPIField(PndConstPar* fieldPar); /** Destructor **/ virtual ~FOPIField(); void FillParContainer(); /** Set the field region ** @param xMin,xMax x region of field (global coordinates) ** @param yMin,yMax y region of field (global coordinates) ** @param zMin,zMax z region of field (global coordinates) **/ void SetFieldRegion(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax); void SetAlignment(Double_t x, Double_t y, Double_t z, Double_t phi, Double_t theta, Double_t psi); /** Set the target offset, taroff **/ void SetTargetOffset(Double_t value) { taroff = value; } /** Set central field value **/ void SetFieldNorm(Double_t mfvalnorm) { fldval = mfvalnorm; } /** Get components of field at a given point ** @param x,y,z Point coordinates [cm] **/ void Alignment(Double_t x, Double_t y, Double_t z); virtual Double_t GetNewPointX(Double_t x, Double_t y, Double_t z); virtual Double_t GetNewPointY(Double_t x, Double_t y, Double_t z); virtual Double_t GetNewPointZ(Double_t x, Double_t y, Double_t z); void CompField(Double_t x, Double_t y, Double_t z); virtual Double_t GetBx(Double_t x, Double_t y, Double_t z); virtual Double_t GetBy(Double_t x, Double_t y, Double_t z); virtual Double_t GetBz(Double_t x, Double_t y, Double_t z); /** Accessors to field region **/ Double_t GetXmin() const { return fXmin; } Double_t GetXmax() const { return fXmax; } Double_t GetYmin() const { return fYmin; } Double_t GetYmax() const { return fYmax; } Double_t GetZmin() const { return fZmin; } Double_t GetZmax() const { return fZmax; } /** Accessors to field values **/ TVector3 GetBxyz() const { return TVector3(fBx,fBy,fBz); } void GetFieldValue(const Double_t point[3], Double_t* bField); /** Screen output **/ virtual void Print(); ClassDef(FOPIField, 1); private: /** Limits of the field region **/ Double_t fXmin; Double_t fXmax; Double_t fYmin; Double_t fYmax; Double_t fZmin; Double_t fZmax; /** Transformed point**/ Bool_t falign; Double_t fnpx; Double_t fnpy; Double_t fnpz; /** Field components inside the field region **/ Double_t fBx; Double_t fBy; Double_t fBz; /** Target offset: distance between center of magnet and target **/ Double_t taroff; /** Value of the magnetic field normalization **/ Double_t fldval; TGeoTranslation* trans; TGeoRotation* rot; TGeoCombiTrans fTransformation; }; #endif