114 G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();
118 if (!aMaterialPropertiesTable)
122 aMaterialPropertiesTable->
GetProperty(
"WLSCOMPONENT");
127 G4int NumPhotons = 1;
131 G4double MeanNumberOfPhotons = aMaterialPropertiesTable->
132 GetConstProperty(
"WLSMEANNUMBERPHOTONS");
136 if (NumPhotons <= 0) {
150 G4double primaryEnergy = aTrack.GetDynamicParticle()->GetKineticEnergy();
160 WLSTime = aMaterialPropertiesTable->
161 GetConstProperty(
"WLSTIMECONSTANT");
169 G4int NumberOfPhotons = NumPhotons;
171 for (
G4int i = 0; i < NumPhotons; i++) {
177 for (
G4int j = 1; j <= 100; j++) {
182 sampledEnergy = WLSIntegral->
GetEnergy(CIIvalue);
185 G4cout <<
"sampledEnergy = " << sampledEnergy <<
G4endl;
189 if (sampledEnergy <= primaryEnergy)
break;
194 if (sampledEnergy > primaryEnergy) {
196 G4cout <<
" *** One less WLS photon will be returned ***" <<
G4endl;
199 if (NumberOfPhotons == 0) {
201 G4cout <<
" *** No WLS photon can be sampled for this primary ***" 212 G4double sint = std::sqrt((1.-cost)*(1.+cost));
237 sinp = std::sin(phi);
238 cosp = std::cos(phi);
240 photonPolarization = cosp * photonPolarization + sinp * perp;
242 photonPolarization = photonPolarization.
unit();
250 (photonPolarization.
x(),
251 photonPolarization.
y(),
252 photonPolarization.
z());
261 G4double aSecondaryTime = (pPostStepPoint->GetGlobalTime()) + TimeDelay;
263 G4ThreeVector aSecondaryPosition = pPostStepPoint->GetPosition();
265 G4Track* aSecondaryTrack =
266 new G4Track(aWLSPhoton,aSecondaryTime,aSecondaryPosition);
268 aSecondaryTrack->SetTouchableHandle(aTrack.GetTouchableHandle());
271 aSecondaryTrack->SetParentID(aTrack.GetTrackID());
277 G4cout <<
"\n Exiting from G4OpWLS::DoIt -- NumberOfSecondaries = " 305 for (
G4int i=0 ; i < numOfMaterials; i++)
313 G4Material* aMaterial = (*theMaterialTable)[i];
318 if (aMaterialPropertiesTable) {
321 aMaterialPropertiesTable->
GetProperty(
"WLSCOMPONENT");
328 G4double currentIN = (*theWLSVector)[0];
330 if (currentIN >= 0.0) {
338 aPhysicsOrderedFreeVector->
339 InsertValues(currentPM , currentCII);
354 currentPM = theWLSVector->
Energy(j);
355 currentIN = (*theWLSVector)[j];
357 currentCII = 0.5 * (prevIN + currentIN);
359 currentCII = prevCII +
360 (currentPM - prevPM) * currentCII;
362 aPhysicsOrderedFreeVector->
363 InsertValues(currentPM, currentCII);
366 prevCII = currentCII;
399 if ( aMaterialPropertyTable ) {
400 AttenuationLengthVector = aMaterialPropertyTable->
401 GetProperty(
"WLSABSLENGTH");
402 if ( AttenuationLengthVector ){
403 AttenuationLength = AttenuationLengthVector->
404 Value(thePhotonEnergy);
414 return AttenuationLength;
425 else if (name ==
"exponential")
435 "generator does not exist");
G4long G4Poisson(G4double mean)
G4MaterialPropertyVector * GetProperty(const char *key)
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
static G4MaterialTable * GetMaterialTable()
std::vector< G4Material * > G4MaterialTable
G4double GetTotalEnergy() const
void UseTimeProfile(const G4String name)
const G4String & GetProcessName() const
G4GLOB_DLL std::ostream G4cout
virtual G4double GenerateTime(const G4double time_constant)=0
Hep3Vector cross(const Hep3Vector &) const
void BuildPhysicsTable(const G4ParticleDefinition &aParticleType)
G4VWLSTimeGeneratorProfile * WLSTimeGeneratorProfile
static const double twopi
void SetProcessSubType(G4int)
size_t GetVectorLength() const
void SetPolarization(G4double polX, G4double polY, G4double polZ)
static size_t GetNumberOfMaterials()
void SetKineticEnergy(G4double aEnergy)
G4double GetEnergy(G4double aValue)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4OpticalPhoton * OpticalPhoton()
G4ParticleChange aParticleChange
G4bool ConstPropertyExists(const char *key)
G4OpWLS(const G4String &processName="OpWLS", G4ProcessType type=fOptical)
void insertAt(size_t, G4PhysicsVector *)
G4double Energy(size_t index) const
G4PhysicsTable * theIntegralTable
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)