// $Id: OpticalAdaptor.hh,v 1.23 2005/04/26 15:38:54 thea Exp $ // Author: D.Demarco, M.Pallavicini /***************************************************************************** * ESAF: Euso Simulation and Analysis Framework * * * * Id: OpticalAdaptor * * Package: Optics * * Coordinator: Alessandro.Thea * * * *****************************************************************************/ #ifndef __OPTICALADAPTOR_HH__ #define __OPTICALADAPTOR_HH__ #include "DetectorPhotonTransporter.hh" #include "PmtGeometry.hh" #include "Config.hh" #include "EsafRandom.hh" #include "Interpolate.hh" #include #include using namespace TMath; //////////////////////////////////////////////////////////////////////////////// // // // OpticalAdapter // // // // Abstract class for all the optical adapters // // // //////////////////////////////////////////////////////////////////////////////// class OpticalAdaptor: public DetectorPhotonTransporter { public: enum OAFilterType { kSquare = 1, kBG3 = 2, kMultilayer = 3 }; virtual Photon *Transport(Photon *) const = 0; inline EVector goLocal(const EVector &v) const; inline EVector goGlobal(const EVector &v) const; inline Bool_t isReflectedByCathode() const; Double_t IsHit( const Photon& ph) const; //IsAbsorbed virtual Bool_t IsAbsorbed( Photon* p ) const; int whichFace(Photon *p) const; vector intPoints(Photon *p) const; Bool_t isInside(const EVector &v, int face) const; // getters OAFilterType GetFilterType() const { return fFilterType; } Double_t GetSide() const { return fSide; } Double_t GetHeight() const { return fHeight; } Double_t GetReflectivity() const { return fReflectivity; } inline virtual Double_t GetThickness() const { return fHeight; } inline virtual const TVector3& Position() const { return pmt->Position(); } void SetGeometry( const PmtGeometry* ); protected: OpticalAdaptor(); static Interpolate* fgBG3; static Interpolate* fgMultiLayer; const PmtGeometry *pmt; TVector3 fXaxis; TVector3 fYaxis; TVector3 fZaxis; Double_t fSide; // adapter's size lenght Double_t fHeight; // height of the adapter Double_t fReflectivity; // cathode reflectivity Double_t fRadiomEff; // radiometric efficiency TRotation fRot; // transf. to local frame TRotation fInvRot; // transf. to world frame Double_t fFilterThickness; OAFilterType fFilterType; EsafConfigClass(Optics,OpticalAdaptor) ClassDef(OpticalAdaptor,0) }; inline EVector OpticalAdaptor::goLocal(const EVector &v) const { EVector nv=v; nv.Transform(fInvRot); return nv; } inline EVector OpticalAdaptor::goGlobal(const EVector &v) const { EVector nv=v; nv.Transform(fRot); return nv; } inline Bool_t OpticalAdaptor::isReflectedByCathode() const { TRandom* rndm = EsafRandom::Get(); if(rndm->Rndm() > fReflectivity) return kFALSE; else return kTRUE; } #endif /* OPTICALADAPTOR_HH */