94{
97
99 {
100 G4cout <<
"\n** G4OpWLS2: Photon absorbed! **" <<
G4endl;
101 }
102
103 G4MaterialPropertiesTable* MPT =
105 if(!MPT)
106 {
108 }
109
110 G4PhysicsFreeVector* WLSIntegral = nullptr;
112 {
114 }
115 else
116 {
117
120 }
121
123
124
125 if(primaryEnergy < WLSIntegral->GetMinValue())
126 {
128 }
129
130 G4int NumPhotons = 1;
132 {
136 if(NumPhotons <= 0)
137 {
138
141 }
142 }
143
146 std::vector<G4Track*> proposedSecondaries;
147
148
149
152
153 for(
G4int i = 0; i < NumPhotons; ++i)
154 {
155
157
158
159 if(sampledEnergy > primaryEnergy)
160 {
162 ed << "Sampled photon energy " << sampledEnergy << " is greater than "
163 <<
"the primary photon energy " << primaryEnergy <<
G4endl;
165 }
167 {
168 G4cout <<
"G4OpWLS2: Created photon with energy: " << sampledEnergy
170 }
171
172
174 G4double sint = std::sqrt((1. - cost) * (1. + cost));
179
180 G4ThreeVector photonPolarization(cost * cosp, cost * sinp, -sint);
182
184 sinp = std::sin(phi);
185 cosp = std::cos(phi);
186 photonPolarization = (cosp * photonPolarization + sinp * perp).unit();
187
188
189 auto sec_dp =
191 sec_dp->SetPolarization(photonPolarization);
192 sec_dp->SetKineticEnergy(sampledEnergy);
193
197 G4Track* secTrack = new G4Track(sec_dp, secTime, secPos);
198
201
202 proposedSecondaries.push_back(secTrack);
203 }
204
206 for(auto sec : proposedSecondaries)
207 {
209 }
211 {
212 G4cout <<
"\n Exiting from G4OpWLS2::DoIt -- NumberOfSecondaries = "
214 }
215
217}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4ThreeVector G4ParticleMomentum
G4long G4Poisson(G4double mean)
CLHEP::Hep3Vector G4ThreeVector
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
G4double GetEnergy(const G4double value) const
G4double GetMaxEnergy() 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 &)
G4ParticleChange aParticleChange