94{
95 std::vector<G4Track*> proposedSecondaries;
98
100 {
101 G4cout <<
"\n** G4OpWLS2: Photon absorbed! **" <<
G4endl;
102 }
103
107 if(!MPT)
108 {
110 }
112 {
114 }
115
116 G4int NumPhotons = 1;
118 {
122 if(NumPhotons <= 0)
123 {
124
127 }
128 }
129
130
131
135
139
140
142 G4int NumberOfPhotons = NumPhotons;
143
144 for(
G4int i = 0; i < NumPhotons; ++i)
145 {
147
148 for(
G4int j = 1; j <= 100; ++j)
149 {
150
152 sampledEnergy = WLSIntegral->
GetEnergy(CIIvalue);
153 if(sampledEnergy <= primaryEnergy)
154 break;
155 }
156
157 if(sampledEnergy > primaryEnergy)
158 {
160 {
161 G4cout <<
" *** G4OpWLS2: One less WLS2 photon will be returned ***"
163 }
164 NumberOfPhotons--;
165 if(NumberOfPhotons == 0)
166 {
168 {
169 G4cout <<
" *** G4OpWLS2: No WLS2 photon can be sampled for this "
170 "primary ***"
172 }
173
176 }
177 continue;
178 }
180 {
181 G4cout <<
"G4OpWLS2: Created photon with energy: " << sampledEnergy
183 }
184
185
187 G4double sint = std::sqrt((1. - cost) * (1. + cost));
192
193 G4ThreeVector photonPolarization(cost * cosp, cost * sinp, -sint);
195
197 sinp = std::sin(phi);
198 cosp = std::cos(phi);
199 photonPolarization = (cosp * photonPolarization + sinp * perp).unit();
200
201
202 auto sec_dp =
204 sec_dp->SetPolarization(photonPolarization);
205 sec_dp->SetKineticEnergy(sampledEnergy);
206
211
214
215 proposedSecondaries.push_back(secTrack);
216 }
217
219 for(auto sec : proposedSecondaries)
220 {
222 }
224 {
225 G4cout <<
"\n Exiting from G4OpWLS2::DoIt -- NumberOfSecondaries = "
227 }
228
230}
G4long G4Poisson(G4double mean)
Hep3Vector cross(const Hep3Vector &) const
G4double GetKineticEnergy() const
G4bool ConstPropertyExists(const G4String &key) const
G4double GetConstProperty(const G4String &key) const
std::size_t GetIndex() const
void AddSecondary(G4Track *aSecondary)
void Initialize(const G4Track &) override
G4double GetEnergy(const G4double value) const
G4double GetMaxValue() const
G4double GetGlobalTime() const
const G4ThreeVector & GetPosition() const
G4StepPoint * GetPostStepPoint() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
const G4TouchableHandle & GetTouchableHandle() const
void SetParentID(const G4int aValue)
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void ProposeTrackStatus(G4TrackStatus status)
G4int GetNumberOfSecondaries() const
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange
virtual G4double GenerateTime(const G4double time_constant)=0