91{
92 std::vector<G4Track*> proposedSecondaries;
95
97 {
99 }
100
104 if(!MPT)
105 {
107 }
109 {
111 }
112
113 G4int NumPhotons = 1;
115 {
118 if(NumPhotons <= 0)
119 {
120
123 }
124 }
125
126
127
131
135
136
138 G4int NumberOfPhotons = NumPhotons;
139
140 for(
G4int i = 0; i < NumPhotons; ++i)
141 {
143
144 for(
G4int j = 1; j <= 100; ++j)
145 {
146
148 sampledEnergy = WLSIntegral->
GetEnergy(CIIvalue);
149 if(sampledEnergy <= primaryEnergy)
150 break;
151 }
152
153 if(sampledEnergy > primaryEnergy)
154 {
156 {
157 G4cout <<
" *** G4OpWLS: One less WLS photon will be returned ***"
159 }
160 NumberOfPhotons--;
161 if(NumberOfPhotons == 0)
162 {
164 {
166 << " *** G4OpWLS: No WLS photon can be sampled for this primary ***"
168 }
169
172 }
173 continue;
174 }
176 {
177 G4cout <<
"G4OpWLS: Created photon with energy: " << sampledEnergy
179 }
180
181
183 G4double sint = std::sqrt((1. - cost) * (1. + cost));
188
189 G4ThreeVector photonPolarization(cost * cosp, cost * sinp, -sint);
191
193 sinp = std::sin(phi);
194 cosp = std::cos(phi);
195 photonPolarization = (cosp * photonPolarization + sinp * perp).unit();
196
197
198 auto sec_dp =
200 sec_dp->SetPolarization(photonPolarization);
201 sec_dp->SetKineticEnergy(sampledEnergy);
202
207
210
211 proposedSecondaries.push_back(secTrack);
212 }
213
215 for(auto sec : proposedSecondaries)
216 {
218 }
220 {
221 G4cout <<
"\n Exiting from G4OpWLS::DoIt -- NumberOfSecondaries = "
223 }
224
226}
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