91{
94
96 {
98 }
99
100 G4MaterialPropertiesTable* MPT =
102 if(!MPT)
103 {
105 }
106
107 G4PhysicsFreeVector* WLSIntegral = nullptr;
109 {
111 }
112 else
113 {
114
117 }
118
120
121
122 if(primaryEnergy < WLSIntegral->GetMinValue())
123 {
125 }
126
127 G4int NumPhotons = 1;
129 {
132 if(NumPhotons <= 0)
133 {
134
137 }
138 }
139
142 std::vector<G4Track*> proposedSecondaries;
143
144
145
148
149 for(
G4int i = 0; i < NumPhotons; ++i)
150 {
151
153
154
155 if(sampledEnergy > primaryEnergy)
156 {
158 ed << "Sampled photon energy " << sampledEnergy << " is greater than "
159 <<
"the primary photon energy " << primaryEnergy <<
G4endl;
161 }
163 {
164 G4cout <<
"G4OpWLS: Created photon with energy: " << sampledEnergy
166 }
167
168
170 G4double sint = std::sqrt((1. - cost) * (1. + cost));
175
176 G4ThreeVector photonPolarization(cost * cosp, cost * sinp, -sint);
178
180 sinp = std::sin(phi);
181 cosp = std::cos(phi);
182 photonPolarization = (cosp * photonPolarization + sinp * perp).unit();
183
184
185 auto sec_dp =
187 sec_dp->SetPolarization(photonPolarization);
188 sec_dp->SetKineticEnergy(sampledEnergy);
189
193 G4Track* secTrack = new G4Track(sec_dp, secTime, secPos);
194
197
198 proposedSecondaries.push_back(secTrack);
199 }
200
202 for(auto sec : proposedSecondaries)
203 {
205 }
207 {
208 G4cout <<
"\n Exiting from G4OpWLS::DoIt -- NumberOfSecondaries = "
210 }
211
213}
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