// $Id: Ground.hh,v 1.17 2005/04/14 15:57:44 moreggia Exp $
// Author: S.Moreggia   Oct, 27 2003

/*****************************************************************************
 * ESAF: Euso Simulation and Analysis Framework                              *
 *                                                                           *
 *  Id: Ground                                                               *
 *  Package: RadiativeTransfer                                               *
 *  Coordinator: Sylvain Moreggia                                            *
 *                                                                           *
 *****************************************************************************/


#ifndef __GROUND_HH__
#define __GROUND_HH__

#include "EsafConfigurable.hh"
#include "EarthVector.hh"
#include "BunchOfPhotons.hh"
#include "EsafMsgSource.hh"

class ListPhotonsInAtmosphere;


////////////////////////////////////////////////////////////////////////////////
//                                                                            //
// Ground                                                                     //
//                                                                            //
// Interface for ground description                                           //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////

class Ground : public EsafConfigurable, public EsafMsgSource {
public:
    Ground();
    // ctor
    virtual ~Ground();
    // dtor
        
    virtual EarthVector GetImpact(const EarthVector&, const EarthVector&) const = 0;
    inline EarthVector GetImpact(const BunchOfPhotons& b) const {return GetImpact(b.GetPos(),b.GetDir());}
    // Get an impact form starting position and direction in atmosphere
    // NB : if no impact,               return (0,0,HUGE)
    //      if track is underground,    return (0,0,-HUGE)

    virtual Double_t Brdf(const EarthVector& pos1, const EarthVector& pos2) const = 0;
    // Bidirectionnal reflectance distribution function
    // Returns the value for light going from pos1 to pos2

    virtual Double_t Albedo(const EarthVector&) const = 0;
    // Get albedo for a given position
    
    virtual Double_t Altitude(const EarthVector&) const = 0;
    // Get ground altitude at the vertical of the given point
    
    Bool_t IsUnderGround(const EarthVector& pos) const;
    // to know if position is underground
    
    virtual void Configure() = 0;
    // Configure
    
    virtual void Reset() = 0;
    // get ready for next event
    
    EsafConfigClass(RadiativeTransfer,Ground)

protected:
    
    ClassDef(Ground,0)
}; 

#endif /* __GROUND_HH__ */