#ifndef MARS_MMirrorHex
#define MARS_MMirrorHex

#ifndef MARS_MMirror
#include "MMirror.h"
#endif

class MMirrorHex : public MMirror
{
private:
    const static Double_t fgCos30;
    const static Double_t fgCos60;
    const static Double_t fgSin60;

    Double_t fD;  // half diameter D or better distance between opposite sides
    Double_t fMaxR;

    void SetD(Double_t d) { fD=d/2; fMaxR=fD/fgCos30; }

public:
    MMirrorHex() { SetD(24.75); }

    Double_t GetMaxR() const { return fMaxR; }

    // This should fit with Paint()
    Bool_t HasHit(const MQuaternion &p) const;
    // This should fit with HasHit()
    void Paint(Option_t *);
    Bool_t CanHit(const MQuaternion &p) const;
    Int_t ReadM(const TObjArray &tok);

    ClassDef(MMirrorHex, 0) // A spherical hexagon type mirror
};

#endif
