1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // $Id: ESinglePhoton.hh 2765 2006-11-15 14:59:23Z moreggia $ |
---|
3 | // A.Thea created Jun, 9 2004 |
---|
4 | |
---|
5 | #ifndef __ESINGLEPHOTON_HH_ |
---|
6 | #define __ESINGLEPHOTON_HH_ |
---|
7 | |
---|
8 | #include "TObject.h" |
---|
9 | #include "TVector3.h" |
---|
10 | #include <TArrayC.h> |
---|
11 | |
---|
12 | class ESinglePhoton : public TObject { |
---|
13 | public: |
---|
14 | ESinglePhoton(); |
---|
15 | |
---|
16 | virtual ~ESinglePhoton(); |
---|
17 | |
---|
18 | virtual void Clear( Option_t* ="" ); |
---|
19 | |
---|
20 | //getters |
---|
21 | inline UChar_t GetType() const {return fType;} |
---|
22 | inline UInt_t GetBunchId() const {return fBunchId;} |
---|
23 | inline UChar_t GetHistory() const {return fHistory;} |
---|
24 | inline Char_t GetAllHistory(UInt_t i) const {return fAllHistory[i];} |
---|
25 | inline Bool_t IsAbsorbed() const {return fAbsorbed;} |
---|
26 | inline Bool_t IsCloudAbsorbed() const {return fCloudAbsorbed;} |
---|
27 | inline Bool_t IsOutFoV() const {return fOutFoV;} |
---|
28 | inline Float_t GetDate() const {return fDate;} |
---|
29 | inline Float_t GetShowerAge() const {return fShowerAge;} |
---|
30 | inline Float_t GetTof() const {return fTof;} |
---|
31 | inline Float_t GetWl() const {return fWl;} |
---|
32 | inline Int_t GetNbinter() const {return fNbinter;} |
---|
33 | inline TVector3 GetShowerPos() const; |
---|
34 | inline TVector3 GetPos() const; |
---|
35 | inline TVector3 GetMScatDir() const; |
---|
36 | inline Float_t GetLastTrans(TString type) const; |
---|
37 | |
---|
38 | //setters |
---|
39 | inline void SetType ( UInt_t type ) { fType = type; } |
---|
40 | inline void SetHistory( UInt_t hist ) { fHistory = hist; } |
---|
41 | inline void SetAllHistory(Int_t i, Char_t hist ) { fAllHistory[i] = hist; } |
---|
42 | inline void SetAbsorbed(Bool_t f = true) {fAbsorbed = f;} |
---|
43 | inline void SetCloudAbsorbed(Bool_t f = true) {fCloudAbsorbed = f;} |
---|
44 | inline void SetOutFoV(Bool_t f = true) {fOutFoV = f;} |
---|
45 | inline void SetDate(Float_t d) {fDate = d;} |
---|
46 | inline void SetShowerAge(Float_t d) {fShowerAge = d;} |
---|
47 | inline void SetTof( Float_t tof ) {fTof = tof; } |
---|
48 | inline void SetWl( Float_t wl ) {fWl = wl; } |
---|
49 | inline void SetNbinter ( Int_t nb ) { fNbinter = nb; } |
---|
50 | inline void SetNbMaxInter ( Int_t nb ) {fAllHistory.Set(nb); for(Int_t i=0;i<nb;i++) fAllHistory[i] = 0;} |
---|
51 | inline void SetShowerPos( const TVector3& v ); |
---|
52 | inline void SetPos( const TVector3& v ); |
---|
53 | inline void SetMScatDir( const TVector3& v ); |
---|
54 | inline void SetBunchId(UInt_t id) {fBunchId = id;} |
---|
55 | inline void SetLastTrans( Float_t trans, TString type ); |
---|
56 | |
---|
57 | |
---|
58 | private: |
---|
59 | |
---|
60 | UChar_t fType; // photon type |
---|
61 | UInt_t fBunchId; // id of the bunch that has given this photon |
---|
62 | UChar_t fHistory; // how photon has been created |
---|
63 | // 0 : direct |
---|
64 | // 1 : reflected |
---|
65 | // 2 : rayleigh scattered |
---|
66 | // 3 : clouds scattered |
---|
67 | // 4 : aerosols scattered |
---|
68 | TArrayC fAllHistory; // summary of all interactions in atmosphere (all values > 0) |
---|
69 | Bool_t fAbsorbed; // true if photon has been absorbed during its final transfer to pupil |
---|
70 | Bool_t fCloudAbsorbed; // true if photon has been cloud absorbed during its final transfer to pupil |
---|
71 | Float_t fLastTotTrans; // total transmission over the final path to detector |
---|
72 | Float_t fLastRaylTrans; // Rayleigh transmission over the final path to detector |
---|
73 | Float_t fLastOzoneTrans; // Ozone transmission over the final path to detector |
---|
74 | Float_t fLastAeroTrans; // Aerosols transmission over the final path to detector |
---|
75 | Float_t fLastCloudTrans; // Cloud transmission over the final path to detector |
---|
76 | Bool_t fOutFoV; // (ONLY a flag : no simu for it) true if entering dir on pupil > FoV |
---|
77 | Float_t fDate; // date of creation |
---|
78 | Float_t fShowerAge; // shower age at photon creation |
---|
79 | Float_t fTof; // time of flight since creation UNTIL PUPIL |
---|
80 | Float_t fWl; // wavelength |
---|
81 | Int_t fNbinter; // number of interactions undergone |
---|
82 | Float_t fShowerPosX; // X.position of creation |
---|
83 | Float_t fShowerPosY; // Y.position of creation |
---|
84 | Float_t fShowerPosZ; // Z.position of creation |
---|
85 | Float_t fPosX; // last position.X before reaching pupil |
---|
86 | Float_t fPosY; // last position.Y before reaching pupil |
---|
87 | Float_t fPosZ; // last position.Z before reaching pupil |
---|
88 | |
---|
89 | // only for MScattAnalysis (MCRadiativeTransfer) |
---|
90 | Float_t fMScatDirX; // last direction.X before going toward detector |
---|
91 | Float_t fMScatDirY; // last direction.Y before going toward detector |
---|
92 | Float_t fMScatDirZ; // last direction.Z before going toward detector |
---|
93 | |
---|
94 | ClassDef(ESinglePhoton,1) |
---|
95 | |
---|
96 | }; |
---|
97 | |
---|
98 | //_________________________________________________________________________________________ |
---|
99 | inline TVector3 ESinglePhoton::GetShowerPos() const { |
---|
100 | TVector3 rtn(fShowerPosX,fShowerPosY,fShowerPosZ); |
---|
101 | return rtn; |
---|
102 | } |
---|
103 | |
---|
104 | //_________________________________________________________________________________________ |
---|
105 | inline void ESinglePhoton::SetShowerPos( const TVector3& v ){ |
---|
106 | fShowerPosX = v.X(); |
---|
107 | fShowerPosY = v.Y(); |
---|
108 | fShowerPosZ = v.Z(); |
---|
109 | } |
---|
110 | |
---|
111 | //_________________________________________________________________________________________ |
---|
112 | inline TVector3 ESinglePhoton::GetPos() const { |
---|
113 | TVector3 rtn(fPosX,fPosY,fPosZ); |
---|
114 | return rtn; |
---|
115 | } |
---|
116 | |
---|
117 | //_________________________________________________________________________________________ |
---|
118 | inline TVector3 ESinglePhoton::GetMScatDir() const { |
---|
119 | TVector3 rtn(fMScatDirX,fMScatDirY,fMScatDirZ); |
---|
120 | return rtn; |
---|
121 | } |
---|
122 | |
---|
123 | //_________________________________________________________________________________________ |
---|
124 | inline void ESinglePhoton::SetPos( const TVector3& v ){ |
---|
125 | fPosX = v.X(); |
---|
126 | fPosY = v.Y(); |
---|
127 | fPosZ = v.Z(); |
---|
128 | } |
---|
129 | |
---|
130 | //_________________________________________________________________________________________ |
---|
131 | inline void ESinglePhoton::SetMScatDir( const TVector3& v ){ |
---|
132 | fMScatDirX = v.X(); |
---|
133 | fMScatDirY = v.Y(); |
---|
134 | fMScatDirZ = v.Z(); |
---|
135 | } |
---|
136 | |
---|
137 | //_________________________________________________________________________________________ |
---|
138 | inline void ESinglePhoton::SetLastTrans(Float_t trans, TString type) { |
---|
139 | // |
---|
140 | // |
---|
141 | // |
---|
142 | if(type == "tot") fLastTotTrans = trans; |
---|
143 | else if(type == "rayl") fLastRaylTrans = trans; |
---|
144 | else if(type == "ozone") fLastOzoneTrans = trans; |
---|
145 | else if(type == "aero") fLastAeroTrans = trans; |
---|
146 | else if(type == "cloud") fLastCloudTrans = trans; |
---|
147 | else Fatal("SetLastTrans","Wrong argument = %s",type.Data()); |
---|
148 | } |
---|
149 | |
---|
150 | //_________________________________________________________________________________________ |
---|
151 | inline Float_t ESinglePhoton::GetLastTrans(TString type) const { |
---|
152 | // |
---|
153 | // |
---|
154 | // |
---|
155 | Float_t rtn(0.); |
---|
156 | if(type == "tot") rtn = fLastTotTrans; |
---|
157 | else if(type == "rayl") rtn = fLastRaylTrans; |
---|
158 | else if(type == "ozone") rtn = fLastOzoneTrans; |
---|
159 | else if(type == "aero") rtn = fLastAeroTrans; |
---|
160 | else if(type == "cloud") rtn = fLastCloudTrans; |
---|
161 | else Fatal("GetLastTrans","Wrong argument = %s",type.Data()); |
---|
162 | return rtn; |
---|
163 | } |
---|
164 | |
---|
165 | #endif /* __ESINGLEPHOTON_HH_ */ |
---|
166 | |
---|