#ifndef __DRCOPTVOL_H__ #define __DRCOPTVOL_H__ /*! \brief Representation of an optical volume. The volume consists out of surfaces. These surfaces have an inside and an outside defined by the normalvector pointing outside. */ class DrcOptVol : public DrcOptDev { protected: //! Optical material. DrcOptMatAbs* m_optMat; private: /*! \brief Auxiliary function for assignment operator and copy constructor.. \param d The object to copy. */ void copy(const DrcOptVol& d); public: //! Constructor. DrcOptVol(); //! Destructor. virtual ~DrcOptVol(); /*! \brief Virtual copy constructor. \return Pointer to new allocated memory. */ DrcOptVol* clone() const; /*! \brief Copy constructor. \param d The object to copy. */ DrcOptVol(const DrcOptVol& d); /*! \brief Assignment operator. \param d The object to assign. */ DrcOptVol& operator=(const DrcOptVol& d); // implements pure virtual base class void propagate(DrcPhoton& ph); bool radiator() const {return true;}; //void transform(const TVector3& shift,const TRotation& rot); /*! \brief Set optical material. \param mat The material. */ void setOptMaterial(const DrcOptMatAbs& mat); /*! \brief Optical material. \return Pointer to material. */ DrcOptMatAbs& optMaterial() const { return *m_optMat; }; /*! \brief Handles refraction/reflection of photon. After this routine, the photons direction, position and fate is set. \param ph The photon. \param normal The normal vector of the surface of the volume the photon is in. \param n_outside The refractive index of the vacuum outside or the next volume. \return True if refraction occured, false if reflection occured. */ bool refract( DrcPhoton& ph, XYZVector normal, double n_outside=1.0) const; }; #endif