// ESAF : Euso Simulation and Analysis Framework
// $Id: SinglePhoton.cc,v 1.28 2006/11/15 15:51:28 moreggia Exp $
// S. Moreggia created 27 October 2003

#include "SinglePhoton.hh"
#include <stdexcept>
#include "EConst.hh"
#include "EsafRandom.hh"
#include "Ground.hh"
#include "RadiativeFactory.hh"

ClassImp(SinglePhoton)

using namespace EConst;

//_____________________________________________________________________________
SinglePhoton::SinglePhoton() : EsafMsgSource() {
    //
    // ctor
    //
}

//_____________________________________________________________________________
SinglePhoton::SinglePhoton(Double_t date, Double_t wl, const EarthVector& pos,
                           const EarthVector& dir, PhotonType type,
			   PhotonStatus status, UInt_t bid, Double_t age) : EsafMsgSource() {
    //
    // ctor (photon in the shower)
    //
    fBunchId = bid;
    fType = type;
    fStatus = status;
    fDate = date;
    fWl = wl;
    fShowerAge = age;
    fPos = pos;
    fShowerPos = fPos;
    fPosInAtmo = fPos;
    fDir = dir.Unit();
    fTof = 0;
    fAbsorbed = 0;
    fCloudAbsorbed = 0;
    fNbInter = 0;
    fLastTotTrans = -1;
    fLastRaylTrans = -1;
    fLastAeroTrans = -1;
    fLastOzoneTrans = -1;
    fOutFoV = false;
}

//_____________________________________________________________________________
SinglePhoton::SinglePhoton(const SinglePhoton& s) : EsafMsgSource() {
    //
    // copy ctor
    //
    fBunchId = s.fBunchId;
    fType = s.fType;
    fStatus = s.fStatus;
    fDate = s.fDate;
    fWl = s.fWl;
    fShowerAge = s.fShowerAge;
    fPos = s.fPos;
    fShowerPos = s.fShowerPos;
    fPosInAtmo = s.fPosInAtmo;
    fDir = s.fDir;
    fTof = s.fTof;
    fAbsorbed = s.fAbsorbed;
    fCloudAbsorbed = s.fCloudAbsorbed;
    fNbInter = s.fNbInter;
    fLastTotTrans = s.fLastTotTrans;
    fLastRaylTrans = s.fLastRaylTrans;
    fLastAeroTrans = s.fLastAeroTrans;
    fLastOzoneTrans = s.fLastOzoneTrans;
    fOutFoV = s.fOutFoV;
}

//_____________________________________________________________________________
SinglePhoton::SinglePhoton(PhotonType type, Double_t date, Double_t tof, Double_t wl, const EarthVector& showerpos,
                           const EarthVector& pos,const EarthVector& dir, PhotonStatus status, UInt_t bid, Double_t age) : EsafMsgSource() {
    //
    // ctor (out of the shower, during radiative transfer)
    //
    fBunchId = bid;
    fType = type;
    fStatus = status;
    fDate = date;
    fTof = tof;
    fWl = wl;
    fShowerAge = age;
    fShowerPos = showerpos;
    fPos = pos;
    fPosInAtmo = pos;
    fDir = dir.Unit();
    fAbsorbed = 0;
    fCloudAbsorbed = 0;
    fNbInter = 0;
    fLastTotTrans = -1;
    fLastRaylTrans = -1;
    fLastAeroTrans = -1;
    fLastOzoneTrans = -1;
    fOutFoV = false;
}

//_____________________________________________________________________________
SinglePhoton::SinglePhoton(const BunchOfPhotons& b,Double_t wl,const EarthVector& dir,PhotonStatus status) : EsafMsgSource() {
    //
    // ctor from a bunch
    //
    fType = b.GetType();
    fBunchId = b.GetId();
    fStatus = status;
    fDate = b.GetDate();
    fTof = b.GetTof();
    fWl = wl;
    fShowerAge = b.GetShowerAge();
    fPos = b.GetPos();
    fPosInAtmo = fPos;
    fShowerPos = b.GetShowerPos();
    fDir = dir.Unit();
    fAbsorbed = 0;
    fCloudAbsorbed = 0;
    fNbInter = 0;
    fLastTotTrans = -1;
    fLastRaylTrans = -1;
    fLastAeroTrans = -1;
    fLastOzoneTrans = -1;
    fOutFoV = false;
}

//_____________________________________________________________________________
SinglePhoton::~SinglePhoton(){
    //
    // dtor
    //
}

//_____________________________________________________________________________
void SinglePhoton::AddToPosTof(const EarthVector& v) {
    //
    // Increment the position AND the TOF
    //

    fTof += v.Mag() / Clight();
    fPos += v;
}


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.