// $Id: BunchPropagator.hh,v 1.19 2005/11/03 12:01:33 moreggia Exp $ // Author: Sylvain Moreggia 2004/09/29 /***************************************************************************** * ESAF: Euso Simulation and Analysis Framework * * * * Id: BunchPropagator * * Package: RadiativeTransfer * * Coordinator: Sylvain Moreggia * * * *****************************************************************************/ #ifndef __BUNCHPROPAGATOR_HH__ #define __BUNCHPROPAGATOR_HH__ #include "euso.hh" #include "EsafConfigurable.hh" #include "EsafMsgSource.hh" #include "DetectorGeometry.hh" #include "EarthVector.hh" class Ground; class ListPhotonsInAtmosphere; class BunchOfPhotons; //////////////////////////////////////////////////////////////////////////////// // // // BunchPropagator // // // // Propagate a bunch in the atmosphere // // // //////////////////////////////////////////////////////////////////////////////// // enum used to identify the appropriate needed propagator enum Medium {NONE = -1, GROUND = 0, CLEARSKY = 1, CLOUDY = 2, AEROSOLS = 3, TOA = 4}; // NONE : to stop the propagation // GROUND : has reached ground // CLEARSKY : clearsky conditions // CLOUDY : cloudy conditions // AEROSOLS : aerosols (not implemented yet) // TOA : top of atmosphere, set to 30km altitude during photons propagation class BunchPropagator : public EsafConfigurable, public EsafMsgSource { public: // ctor (should not be used) BunchPropagator(); // ctor, copy RadiatvieTransfer ground description BunchPropagator(const Ground*); // dtor virtual ~BunchPropagator(); // Transport a BunchOfPhotons in the relevant medium, // if relevant, generates SinglePhotons all along the travel (filling ListPhotonsInAtmosphere) virtual Medium Go(BunchOfPhotons&,ListPhotonsInAtmosphere&) const = 0; // Calculate the impact upon the next medium according to the given track // Return type of the medium where impact occurs // //TOFIX : public access to ListPhotonsInAtmosphere data (for track) Medium GetNextImpact(const EarthVector&,const EarthVector&,EarthVector&) const; Medium GetNextImpact(const BunchOfPhotons& b,EarthVector& res) const; // calculate final impact (ground or clearsky) // and return corresponding medium // //TOFIX : public access to ListPhotonsInAtmosphere data (for track) Medium GetFinalImpact(const EarthVector&,const EarthVector&,EarthVector&) const; Medium GetFinalImpact(const BunchOfPhotons& b,EarthVector& res) const; // Copy the RadiativeTransfer ground description object inline void CopyGround(const Ground* g) {fGround = g;} // copy of detector geometry defined in Detector part inline void CopyDetectorGeometry(const DetectorGeometry*, Bool_t, Bool_t); // Reset method virtual void Reset() = 0; inline void SetEndFoV(const EarthVector& v) {fEndFoV = v;} EsafConfigClass(RadiativeTransfer,BunchRadiativeTransfer) protected: const Ground* fGround; // copy of the RadativeTransfer ground description object // _must not be modified_ by the present class Bool_t fDecoupled; // in case detector geometry is decoupled from RT simu Bool_t fDetAtGrnd; // flag is true if ground detector simulation //GRNDetec const DetectorGeometry* fDetGeom; // copy of detector geometry defined in Detector part const DetectorGeometry* GetDetGeometry() const; EarthVector fEndFoV; //TOFIX when general FoV handling // return detector position inline EarthVector EUSO() const {if(fDetAtGrnd) return EarthVector(0,0,0); else return GetDetGeometry()->GetPos();} //GRNDetec inline Double_t EusoOmega(const EarthVector& pos) const; ClassDef(BunchPropagator,0) }; //_______________________________________________________________________________________________________________________ inline void BunchPropagator::CopyDetectorGeometry(const DetectorGeometry* dg, Bool_t decoupled, Bool_t GrndDetec) { // // copy of detector geometry defined in Detector part // if detector is at ground : GrndDetec is true // if RT / detector simu are decoupled : decoupled is true // fDetGeom = dg; fDecoupled = decoupled; fDetAtGrnd = GrndDetec; } //_______________________________________________________________________________________________________________________ inline const DetectorGeometry* BunchPropagator::GetDetGeometry() const { if(!fDetGeom) Msg(EsafMsg::Panic) << "DetectorGeometry not defined for Atmosphere Propagators" << MsgDispatch; return fDetGeom; } //_______________________________________________________________________________________________________________________ inline Double_t BunchPropagator::EusoOmega(const EarthVector& pos) const { if(fDecoupled) return GetDetGeometry()->MaxSolidAngle(pos); else return GetDetGeometry()->SolidAngle(pos); } #endif /* __BUNCHPROPAGATOR_HH__ */