125 if (!aMaterialPropertiesTable)
129 aMaterialPropertiesTable->
GetProperty(
"WLSCOMPONENT");
134 G4int NumPhotons = 1;
138 G4double MeanNumberOfPhotons = aMaterialPropertiesTable->
139 GetConstProperty(
"WLSMEANNUMBERPHOTONS");
143 if (NumPhotons <= 0) {
167 WLSTime = aMaterialPropertiesTable->
168 GetConstProperty(
"WLSTIMECONSTANT");
176 G4int NumberOfPhotons = NumPhotons;
178 for (
G4int i = 0; i < NumPhotons; i++) {
184 for (
G4int j = 1; j <= 100; j++) {
189 sampledEnergy = WLSIntegral->
GetEnergy(CIIvalue);
192 G4cout <<
"sampledEnergy = " << sampledEnergy <<
G4endl;
196 if (sampledEnergy <= primaryEnergy)
break;
201 if (sampledEnergy > primaryEnergy) {
203 G4cout <<
" *** One less WLS photon will be returned ***" <<
G4endl;
206 if (NumberOfPhotons == 0) {
208 G4cout <<
" *** No WLS photon can be sampled for this primary ***"
219 G4double sint = std::sqrt((1.-cost)*(1.+cost));
241 G4ThreeVector perp = photonMomentum.cross(photonPolarization);
244 sinp = std::sin(phi);
245 cosp = std::cos(phi);
247 photonPolarization = cosp * photonPolarization + sinp * perp;
249 photonPolarization = photonPolarization.unit();
257 (photonPolarization.x(),
258 photonPolarization.y(),
259 photonPolarization.z());
273 new G4Track(aWLSPhoton,aSecondaryTime,aSecondaryPosition);
284 G4cout <<
"\n Exiting from G4OpWLS::DoIt -- NumberOfSecondaries = "
309 for (
G4int i=0 ; i < numOfMaterials; i++)
317 G4Material* aMaterial = (*theMaterialTable)[i];
322 if (aMaterialPropertiesTable) {
325 aMaterialPropertiesTable->
GetProperty(
"WLSCOMPONENT");
332 G4double currentIN = (*theWLSVector)[0];
334 if (currentIN >= 0.0) {
342 aPhysicsOrderedFreeVector->
343 InsertValues(currentPM , currentCII);
358 currentPM = theWLSVector->
Energy(j);
359 currentIN = (*theWLSVector)[j];
361 currentCII = 0.5 * (prevIN + currentIN);
363 currentCII = prevCII +
364 (currentPM - prevPM) * currentCII;
366 aPhysicsOrderedFreeVector->
367 InsertValues(currentPM, currentCII);
370 prevCII = currentCII;
403 if ( aMaterialPropertyTable ) {
404 AttenuationLengthVector = aMaterialPropertyTable->
405 GetProperty(
"WLSABSLENGTH");
406 if ( AttenuationLengthVector ){
407 AttenuationLength = AttenuationLengthVector->
408 Value(thePhotonEnergy);
418 return AttenuationLength;
435 else if (name ==
"exponential")
445 "generator does not exist");
G4long G4Poisson(G4double mean)
G4int GetNumberOfSecondaries() const
void BuildThePhysicsTable()
G4MaterialPropertyVector * GetProperty(const char *key)
G4double GetKineticEnergy() const
CLHEP::Hep3Vector G4ThreeVector
G4double GetTotalEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep)
static G4MaterialTable * GetMaterialTable()
std::vector< G4Material * > G4MaterialTable
static G4VWLSTimeGeneratorProfile * WLSTimeGeneratorProfile
void SetTouchableHandle(const G4TouchableHandle &apValue)
size_t GetVectorLength() const
#define G4MUTEX_INITIALIZER
static void UseTimeProfile(const G4String name)
G4GLOB_DLL std::ostream G4cout
virtual G4double GenerateTime(const G4double time_constant)=0
const G4ThreeVector & GetPosition() const
void BuildPhysicsTable(const G4ParticleDefinition &aParticleType)
void SetProcessSubType(G4int)
void SetPolarization(G4double polX, G4double polY, G4double polZ)
G4double Energy(size_t index) const
static size_t GetNumberOfMaterials()
const G4String & GetProcessName() const
void SetKineticEnergy(G4double aEnergy)
const G4TouchableHandle & GetTouchableHandle() const
G4double GetEnergy(G4double aValue)
G4Material * GetMaterial() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4OpticalPhoton * OpticalPhoton()
virtual void Initialize(const G4Track &)
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
void SetNumberOfSecondaries(G4int totSecondaries)
void SetParentID(const G4int aValue)
G4StepPoint * GetPostStepPoint() const
G4ParticleChange aParticleChange
G4bool ConstPropertyExists(const char *key)
G4OpWLS(const G4String &processName="OpWLS", G4ProcessType type=fOptical)
void AddSecondary(G4Track *aSecondary)
void insertAt(size_t, G4PhysicsVector *)
G4double GetGlobalTime() const
void ProposeTrackStatus(G4TrackStatus status)
G4PhysicsTable * theIntegralTable
G4ThreeVector G4ParticleMomentum
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)