source: JEM-EUSO/esaf_lal/tags/v1_r0/esaf/packages/simulation/lightsources/src/SinglePhoton.cc @ 117

Last change on this file since 117 was 117, checked in by moretto, 11 years ago

ESAF version compilable on mac OS

File size: 3.8 KB
Line 
1// ESAF : Euso Simulation and Analysis Framework
2// $Id: SinglePhoton.cc 2768 2006-11-15 15:51:28Z moreggia $
3// S. Moreggia created 27 October 2003
4
5#include "SinglePhoton.hh"
6#include <stdexcept>
7#include "EConst.hh"
8#include "EsafRandom.hh"
9#include "Ground.hh"
10#include "RadiativeFactory.hh"
11
12ClassImp(SinglePhoton)
13
14using namespace EConst;
15
16//_____________________________________________________________________________
17SinglePhoton::SinglePhoton() : EsafMsgSource() {
18    //
19    // ctor
20    //
21}
22
23//_____________________________________________________________________________
24SinglePhoton::SinglePhoton(Double_t date, Double_t wl, const EarthVector& pos, 
25                           const EarthVector& dir, PhotonType type,
26                           PhotonStatus status, UInt_t bid, Double_t age) : EsafMsgSource() {
27    //
28    // ctor (photon in the shower)
29    //
30    fBunchId = bid;
31    fType = type;
32    fStatus = status;
33    fDate = date;
34    fWl = wl;
35    fShowerAge = age;
36    fPos = pos;
37    fShowerPos = fPos;
38    fPosInAtmo = fPos;
39    fDir = dir.Unit();
40    fTof = 0;
41    fAbsorbed = 0;
42    fCloudAbsorbed = 0;
43    fNbInter = 0;
44    fLastTotTrans = -1;
45    fLastRaylTrans = -1;
46    fLastAeroTrans = -1;
47    fLastOzoneTrans = -1;
48    fOutFoV = false;
49}
50
51//_____________________________________________________________________________
52SinglePhoton::SinglePhoton(const SinglePhoton& s) : EsafMsgSource() {
53    //
54    // copy ctor
55    //
56    fBunchId = s.fBunchId;
57    fType = s.fType;
58    fStatus = s.fStatus;
59    fDate = s.fDate;
60    fWl = s.fWl;
61    fShowerAge = s.fShowerAge;
62    fPos = s.fPos;
63    fShowerPos = s.fShowerPos;
64    fPosInAtmo = s.fPosInAtmo;
65    fDir = s.fDir;
66    fTof = s.fTof;
67    fAbsorbed = s.fAbsorbed;
68    fCloudAbsorbed = s.fCloudAbsorbed;
69    fNbInter = s.fNbInter;
70    fLastTotTrans = s.fLastTotTrans;
71    fLastRaylTrans = s.fLastRaylTrans;
72    fLastAeroTrans = s.fLastAeroTrans;
73    fLastOzoneTrans = s.fLastOzoneTrans;
74    fOutFoV = s.fOutFoV;
75}
76
77//_____________________________________________________________________________
78SinglePhoton::SinglePhoton(PhotonType type, Double_t date, Double_t tof, Double_t wl, const EarthVector& showerpos,
79                           const EarthVector& pos,const EarthVector& dir, PhotonStatus status, UInt_t bid, Double_t age) : EsafMsgSource() {
80    //
81    // ctor (out of the shower, during radiative transfer)
82    //
83    fBunchId = bid;
84    fType = type;
85    fStatus = status;
86    fDate = date;
87    fTof = tof;
88    fWl = wl;
89    fShowerAge = age;
90    fShowerPos = showerpos;
91    fPos = pos;
92    fPosInAtmo = pos;
93    fDir = dir.Unit();
94    fAbsorbed = 0;
95    fCloudAbsorbed = 0;
96    fNbInter = 0;
97    fLastTotTrans = -1;
98    fLastRaylTrans = -1;
99    fLastAeroTrans = -1;
100    fLastOzoneTrans = -1;
101    fOutFoV = false;
102}
103
104//_____________________________________________________________________________
105SinglePhoton::SinglePhoton(const BunchOfPhotons& b,Double_t wl,const EarthVector& dir,PhotonStatus status) : EsafMsgSource() {
106    //
107    // ctor from a bunch
108    //
109    fType = b.GetType();
110    fBunchId = b.GetId();
111    fStatus = status;
112    fDate = b.GetDate();
113    fTof = b.GetTof();
114    fWl = wl;
115    fShowerAge = b.GetShowerAge();
116    fPos = b.GetPos();
117    fPosInAtmo = fPos;
118    fShowerPos = b.GetShowerPos();
119    fDir = dir.Unit();
120    fAbsorbed = 0;
121    fCloudAbsorbed = 0;
122    fNbInter = 0;
123    fLastTotTrans = -1;
124    fLastRaylTrans = -1;
125    fLastAeroTrans = -1;
126    fLastOzoneTrans = -1;
127    fOutFoV = false;
128}
129
130//_____________________________________________________________________________
131SinglePhoton::~SinglePhoton(){
132    //
133    // dtor
134    //
135}
136
137//_____________________________________________________________________________
138void SinglePhoton::AddToPosTof(const EarthVector& v) {
139    //
140    // Increment the position AND the TOF
141    //
142   
143    fTof += v.Mag() / Clight();
144    fPos += v;
145}
Note: See TracBrowser for help on using the repository browser.