Universita' di GenovaINFN Sezione di Genova  
AIRWATCH / EUSO Genova

SinglePhoton - source file

// ESAF : Euso Simulation and Analysis Framework
// $Id: SinglePhoton.cc,v 1.24 2005/10/28 17:19:53 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) : EsafMsgSource() {
    //
    // ctor (photon in the shower)
    //
    fBunchId = bid;
    fType = type;
    fStatus = status;
    fDate = date;
    fWl = wl;
    fPos = pos;
    fShowerPos = fPos;
    fDir = dir.Unit();
    fTof = 0;
    fAbsorbed = 0;
    fNbInter = 0;
    fLastTotTrans = -1;
    fLastRaylTrans = -1;
    fLastAeroTrans = -1;
    fLastOzoneTrans = -1;
    fOutFoV = false;
}

//_____________________________________________________________________________
 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) : EsafMsgSource() {
    //
    // ctor (out of the shower, during radiative transfer)
    //
    fBunchId = bid;
    fType = type;
    fStatus = status;
    fDate = date;
    fTof = tof;
    fWl = wl;
    fShowerPos = showerpos;
    fPos = pos;
    fDir = dir.Unit();
    fAbsorbed = 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;
    fPos = b.GetPos();
    fShowerPos = b.GetShowerPos();
    fDir = dir.Unit();
    fAbsorbed = 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;
}
About Us | EUSO Official Website | Web pages created by Roberto Pesce and Alessandro Thea - Last Update Wed Nov 16 16:57:39 2005 Wed Nov 16 16:29:22 2005