// ESAF : Euso Simulation and Analysis Framework // $Id: SinglePhoton.hh,v 1.26 2005/10/31 11:08:15 moreggia Exp $ // S. Moreggia created 27 October 2003 // Single photon description in atmosphere #ifndef __SINGLEPHOTON_HH__ #define __SINGLEPHOTON_HH__ #include "EarthVector.hh" #include "BunchOfPhotons.hh" #include "EsafMsgSource.hh" enum PhotonStatus {None=-1,Direct,Reflected,RaylScat,CloudScat,AeroScat,OutAtmo,ScatAbsorb,LostByCut}; // NB : OutAtmo means photon has gone out of atmosphere during scattering simulation // ScatAbsorb means photon has been absorbed during scattering simulation // LostByCut means nothing physical, photon is lost by cut for algo optimization (higher scat orders + TOF cut) // class SinglePhoton : public EsafMsgSource { public: // ctors SinglePhoton(); SinglePhoton(Double_t,Double_t,const EarthVector&,const EarthVector&,PhotonType, PhotonStatus status = Direct, UInt_t bid = 0); SinglePhoton(PhotonType,Double_t,Double_t,Double_t,const EarthVector&,const EarthVector&,const EarthVector&,PhotonStatus status = Direct, UInt_t bid = 0); SinglePhoton(const BunchOfPhotons&,Double_t,const EarthVector&,PhotonStatus = Direct); // dtor virtual ~SinglePhoton(); // GetMembers methods inline UInt_t BunchId() const {return fBunchId;} inline PhotonType Type() const {return fType;} inline PhotonStatus Status() const {return fStatus;} inline Double_t Date() const {return fDate;} inline Double_t Tof() const {return fTof;} inline Double_t Wl() const {return fWl;} inline const EarthVector& Pos() const {return fPos;} inline const EarthVector& ShowerPos() const {return fShowerPos;} inline const EarthVector& Dir() const {return fDir;} inline Bool_t IsAbsorbed() const {return fAbsorbed;} inline Bool_t IsOutFoV() const {return fOutFoV;} inline Int_t NbOfInteractions() const {return fNbInter;} inline Double_t GetLastTrans(string type) const; inline const vector& GetHistories() const {return fHistory;} // SetMember methods inline void SetAbsorbed(Bool_t f = true) {fAbsorbed = f;} inline void SetOutFoV(Bool_t f = true) {fOutFoV = f;} inline void AddToPos(const EarthVector& v) {fPos += v;} inline void AddToTof(Double_t t) {fTof += t;} inline void AddInteraction() {fNbInter++;} inline void AddHistory(PhotonStatus status) {fHistory.push_back(status);} inline void SetStatus(PhotonStatus st) {fStatus = st;} inline void SetDir(const EarthVector& dir) {fDir = dir.Unit();} inline void SetLastTrans(Double_t trans, string type); void AddToPosTof(const EarthVector&); protected: UInt_t fBunchId; // identity of the bunch giving this single photon PhotonType fType; // type of photon PhotonStatus fStatus; // SinglePhoton origin vector fHistory; // [fNbInter] summary of all interactions in atmosphere Double_t fDate; // date of creation mutable Double_t fTof; // tof between creation and pupil Double_t fWl; // wavelength EarthVector fShowerPos; // position in the shower mutable EarthVector fPos;// position anywhere else EarthVector fDir; // direction Bool_t fAbsorbed; // true if absorbed during trans to detector Bool_t fOutFoV; // (ONLY a flag : no simu for it) true if entering dir on pupil > FoV Double_t fLastTotTrans; // total transmission over the final path to detector Double_t fLastRaylTrans; // Rayleigh transmission over the final path to detector Double_t fLastOzoneTrans;// Ozone transmission over the final path to detector Double_t fLastAeroTrans; // Aerosols transmission over the final path to detector Double_t fLastCloudTrans;// Cloud transmission over the final path to detector Int_t fNbInter; // nb of undergone interactions ClassDef(SinglePhoton,0) }; //_________________________________________________________________________________________ inline void SinglePhoton::SetLastTrans(Double_t trans, string type) { // // // if(type == "tot") fLastTotTrans = trans; else if(type == "rayl") fLastRaylTrans = trans; else if(type == "ozone") fLastOzoneTrans = trans; else if(type == "aero") fLastAeroTrans = trans; else if(type == "cloud") fLastCloudTrans = trans; else Msg(EsafMsg::Panic) << " Wrong argument = "< Wrong argument = "<