#ifndef OAGEOMINFO_IBEAMLINEPOINT_HXX #define OAGEOMINFO_IBEAMLINEPOINT_HXX namespace COMET{ class IBeamlinePoint; } /// Class to represent a point in the beamline coordinate system /// /// A point is defined by it's longitudinal distance along the beamline axis (Longitudinal()), /// and it's coordinates in the transverse plane which is perpendicular to /// the beamline axis at every point. /// /// Within the transverse plane, a point is described by both a polar /// coordinate system (TransverseDist() and TransverseAngle()) or a /// cartesian system (TransverseHeight() and TransverseHorizontal()). /// /// Since for COMET all the beamline sits within the X-Z plane, the polar /// angle in the transverse plane is defined with respect to the Y-axis /// /// A beamline point can be invalid, meaning that the global 3D coordinate /// that was used to generate this point couldn't be mapped to a beamline /// coordinate, for example when it is too far away from any part of the /// beamline axis. Always use IsValid() to check for this; the other /// methods will contain rubbish if IsValid() returns false. class COMET::IBeamlinePoint{ public: IBeamlinePoint():fLongitudinal(0),fTransverseR(-1),fTransversePhi(0),fValid(false),fComponent(-1){} /// @group Is this point valid? /// @{ bool IsValid()const{return fValid;} void IsValid(bool val){fValid=val;} /// @} /// @group The index of the beamline section that this point is /// contained in. /// @{ int Component()const{return fComponent;} void Component(int val){fComponent=val;} /// @} /// @group The distance along the beamline axis /// @{ double Longitudinal()const{return fLongitudinal;} void Longitudinal(double val){fLongitudinal=val;} /// @} /// @group The angle in the transverse plane with respect to Y /// (vertically upwards) /// @{ double TransverseAngle()const{return fTransversePhi;} void TransverseAngle(double val){fTransversePhi=val;} /// @} /// @group The distance to the beamline axis in the /// transverse plane /// @{ double TransverseDist() const{return fTransverseR; } void TransverseDist (double val){fTransverseR=val;} /// @} /// @group The height above the beamline axis /// @{ double TransverseHeight() const{return fTransverseHeight; } void TransverseHeight (double val){fTransverseHeight=val;} /// @} /// @group The horizontal distance in the transverse plane with /// respect to the beamline axis /// @{ double TransverseHorizontal()const{return fTransverseHorizontal;} void TransverseHorizontal(double val){fTransverseHorizontal=val;} /// @} IBeamlinePoint& operator=(const IBeamlinePoint& rhs){ fLongitudinal=rhs.fLongitudinal; fTransverseR=rhs.fTransverseR; fTransversePhi=rhs.fTransversePhi; fValid=rhs.fValid; fComponent=rhs.fComponent; fTransverseHeight=rhs.fTransverseHeight; fTransverseHorizontal=rhs.fTransverseHorizontal; return *this; } private: double fLongitudinal,fTransverseR,fTransversePhi; double fTransverseHeight,fTransverseHorizontal; bool fValid; int fComponent; }; #endif // OAGEOMINFO_IBEAMLINEPOINT_HXX