114 for (
G4int i=0 ; i < numOfMaterials; i++) {
119 G4Material* aMaterial = (*theMaterialTable)[i];
124 if (aMaterialPropertiesTable) {
126 aMaterialPropertiesTable->
GetProperty(
"WLSCOMPONENT");
129 G4double currentIN = (*theWLSVector)[0];
130 if (currentIN >= 0.0) {
133 aPhysicsOrderedFreeVector->
134 InsertValues(currentPM , currentCII);
143 currentPM = theWLSVector->
Energy(j);
144 currentIN = (*theWLSVector)[j];
145 currentCII = 0.5 * (prevIN + currentIN);
146 currentCII = prevCII + (currentPM - prevPM) * currentCII;
147 aPhysicsOrderedFreeVector->
148 InsertValues(currentPM, currentCII);
150 prevCII = currentCII;
169 #ifdef use_sampledEnergy
174 for (
size_t j=0 ; j<theMaterialTable->size() ; j++) {
175 G4Material* fMaterial = (*theMaterialTable)[j];
176 if (fMaterial->
GetName() ==
"PMMA" ) {
180 aMaterialPropertiesTable->
GetProperty(
"WLSCOMPONENT");
190 sampledEnergy = WLSIntegral->
GetEnergy(CIIvalue);
223 G4cout <<
"-> warning from WLSPrimaryGeneratorAction::SetOptPhotonPolar()"
224 <<
": the ParticleGun is not an opticalphoton" <<
G4endl;
234 if (modul2 > 0.) e_perpend = (1./std::sqrt(modul2))*product;
237 G4ThreeVector polar = std::cos(angle)*e_paralle + std::sin(angle)*e_perpend;
G4double Energy(size_t index) const
void SetParticleTime(G4double aTime)
static size_t GetNumberOfMaterials()
WLSPrimaryGeneratorMessenger * fGunMessenger
static G4MaterialTable * GetMaterialTable()
void GeneratePrimaryVertex(G4Event *)
virtual ~WLSPrimaryGeneratorAction()
G4double GetEnergy(G4double aValue)
const G4String & GetParticleName() const
Definition of the WLSDetectorConstruction class.
G4GeneralParticleSource * fParticleGun
void SetParticlePolarization(G4ThreeVector aVal)
static double normal(HepRandomEngine *eptr)
void insertAt(size_t, G4PhysicsVector *)
virtual void GeneratePrimaries(G4Event *)
Definition of the WLSPrimaryGeneratorMessenger class.
const G4String & GetName() const
#define G4MUTEX_INITIALIZER
WLSPrimaryGeneratorAction(WLSDetectorConstruction *)
G4ThreeVector GetParticleMomentumDirection() const
static constexpr double deg
G4PhysicsTable * fIntegralTable
G4ParticleDefinition * GetParticleDefinition() const
static constexpr double eV
WLSDetectorConstruction * fDetector
Hep3Vector cross(const Hep3Vector &) const
std::vector< G4Material * > G4MaterialTable
Definition of the WLSPrimaryGeneratorAction class.
G4GLOB_DLL std::ostream G4cout
G4MaterialPropertyVector * GetProperty(const char *key, G4bool warning=false)
void SetDecayTimeConstant(G4double)
void BuildEmissionSpectrum()
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
size_t GetVectorLength() const