95 std::vector<G4Track*> proposedSecondaries;
101 G4cout <<
"\n** G4OpWLS2: Photon absorbed! **" <<
G4endl;
116 G4int NumPhotons = 1;
142 G4int NumberOfPhotons = NumPhotons;
144 for(
G4int i = 0; i < NumPhotons; ++i)
148 for(
G4int j = 1; j <= 100; ++j)
152 sampledEnergy = WLSIntegral->
GetEnergy(CIIvalue);
153 if(sampledEnergy <= primaryEnergy)
157 if(sampledEnergy > primaryEnergy)
161 G4cout <<
" *** G4OpWLS2: One less WLS2 photon will be returned ***"
165 if(NumberOfPhotons == 0)
169 G4cout <<
" *** G4OpWLS2: No WLS2 photon can be sampled for this "
181 G4cout <<
"G4OpWLS2: Created photon with energy: " << sampledEnergy
187 G4double sint = std::sqrt((1. - cost) * (1. + cost));
193 G4ThreeVector photonPolarization(cost * cosp, cost * sinp, -sint);
197 sinp = std::sin(phi);
198 cosp = std::cos(phi);
199 photonPolarization = (cosp * photonPolarization + sinp * perp).unit();
204 sec_dp->SetPolarization(photonPolarization);
205 sec_dp->SetKineticEnergy(sampledEnergy);
215 proposedSecondaries.push_back(secTrack);
219 for(
auto sec : proposedSecondaries)
225 G4cout <<
"\n Exiting from G4OpWLS2::DoIt -- NumberOfSecondaries = "
247 for(std::size_t i = 0; i < numOfMaterials; ++i)
254 (*materialTable)[i]->GetMaterialPropertiesTable();
262 G4double currentIN = (*wlsVector)[0];
268 physVector->InsertValues(currentPM, currentCII);
279 currentPM = wlsVector->
Energy(j);
280 currentIN = (*wlsVector)[j];
282 prevCII + 0.5 * (currentPM - prevPM) * (prevIN + currentIN);
284 physVector->InsertValues(currentPM, currentCII);
287 prevCII = currentCII;
311 attLength = attVector->
Value(thePhotonEnergy, idx_wls2);
329 else if(name ==
"exponential")
337 "generator does not exist");
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::vector< G4Material * > G4MaterialTable
G4long G4Poisson(G4double mean)
G4GLOB_DLL std::ostream G4cout
Hep3Vector cross(const Hep3Vector &) const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
G4bool ConstPropertyExists(const G4String &key) const
G4double GetConstProperty(const G4String &key) const
G4MaterialPropertyVector * GetProperty(const char *key) const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
static std::size_t GetNumberOfMaterials()
std::size_t GetIndex() const
static G4MaterialTable * GetMaterialTable()
void SetVerboseLevel(G4int)
virtual void Initialise()
virtual void UseTimeProfile(const G4String name)
virtual void BuildPhysicsTable(const G4ParticleDefinition &aParticleType) override
virtual void PreparePhysicsTable(const G4ParticleDefinition &) override
virtual G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
G4PhysicsTable * theIntegralTable
G4VWLSTimeGeneratorProfile * WLSTimeGeneratorProfile
virtual G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *) override
G4OpWLS2(const G4String &processName="OpWLS2", G4ProcessType type=fOptical)
void SetWLS2VerboseLevel(G4int)
G4int GetWLS2VerboseLevel() const
G4String GetWLS2TimeProfile() const
void SetWLS2TimeProfile(const G4String &)
static G4OpticalParameters * Instance()
static G4OpticalPhoton * OpticalPhoton()
void AddSecondary(G4Track *aSecondary)
void Initialize(const G4Track &) override
void insertAt(std::size_t, G4PhysicsVector *)
G4double GetEnergy(const G4double value) const
G4double GetMaxValue() const
G4double Energy(const std::size_t index) const
G4double Value(const G4double energy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
G4double GetGlobalTime() const
const G4ThreeVector & GetPosition() const
G4StepPoint * GetPostStepPoint() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
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
void SetProcessSubType(G4int)
const G4String & GetProcessName() const
virtual G4double GenerateTime(const G4double time_constant)=0