#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};
class SinglePhoton : public EsafMsgSource {
public:
SinglePhoton();
SinglePhoton(Double_t,Double_t,const EarthVector&,const EarthVector&,PhotonType, PhotonStatus status = Direct, UInt_t bid = 0, Double_t age = -1);
SinglePhoton(PhotonType,Double_t,Double_t,Double_t,const EarthVector&,const EarthVector&,const EarthVector&,PhotonStatus status = Direct, UInt_t bid = 0, Double_t age = -1);
SinglePhoton(const BunchOfPhotons&,Double_t,const EarthVector&,PhotonStatus = Direct);
SinglePhoton(const SinglePhoton&);
virtual ~SinglePhoton();
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 Double_t ShowerAge() const {return fShowerAge;}
inline const EarthVector& Pos() const {return fPos;}
inline const EarthVector& ShowerPos() const {return fShowerPos;}
inline const EarthVector& PosInAtmo() const {return fPosInAtmo;}
inline const EarthVector& Dir() const {return fDir;}
inline const EarthVector& MScatDir() const {return fMScatDir;}
inline Bool_t IsAbsorbed() const {return fAbsorbed;}
inline Bool_t IsCloudAbsorbed() const {return fCloudAbsorbed;}
inline Bool_t IsOutFoV() const {return fOutFoV;}
inline Int_t NbOfInteractions() const {return fNbInter;}
inline Double_t GetLastTrans(string type) const;
inline const vector<Int_t>& GetHistories() const {return fHistory;}
inline void SetAbsorbed(Bool_t f = true) {fAbsorbed = f;}
inline void SetCloudAbsorbed(Bool_t f = true) {fCloudAbsorbed = f;}
inline void SetOutFoV(Bool_t f = true) {fOutFoV = f;}
inline void AddToPos(const EarthVector& v) {fPos += v;}
inline void SetPosInAtmo(const EarthVector& v) {fPosInAtmo = v;}
inline void SetShowerAge(Double_t age) {fShowerAge = age;}
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 SetPos(const EarthVector& pos) {fPos = pos;}
inline void SetMScatDir(const EarthVector& dir) {fMScatDir = dir.Unit();}
inline void SetLastTrans(Double_t trans, string type);
void AddToPosTof(const EarthVector&);
protected:
UInt_t fBunchId;
PhotonType fType;
PhotonStatus fStatus;
vector<Int_t> fHistory;
Double_t fDate;
mutable Double_t fTof;
Double_t fWl;
EarthVector fShowerPos;
EarthVector fPosInAtmo;
Double_t fShowerAge;
mutable EarthVector fPos;
EarthVector fDir;
EarthVector fMScatDir;
Bool_t fAbsorbed;
Bool_t fCloudAbsorbed;
Bool_t fOutFoV;
Double_t fLastTotTrans;
Double_t fLastRaylTrans;
Double_t fLastOzoneTrans;
Double_t fLastAeroTrans;
Double_t fLastCloudTrans;
Int_t fNbInter;
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) << "<SetLastTrans> Wrong argument = "<<type<<MsgDispatch;
}
inline Double_t SinglePhoton::GetLastTrans(string type) const {
Double_t rtn(0.);
if(type == "tot") rtn = fLastTotTrans;
else if(type == "rayl") rtn = fLastRaylTrans;
else if(type == "ozone") rtn = fLastOzoneTrans;
else if(type == "aero") rtn = fLastAeroTrans;
else if(type == "cloud") rtn = fLastCloudTrans;
else Msg(EsafMsg::Panic) << "<GetLastTrans> Wrong argument = "<<type<<MsgDispatch;
return rtn;
}
#endif
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.