56 G4bool WLSPrimaryGeneratorAction::fFirst =
false;
108 for (
G4int i=0 ; i < numOfMaterials; i++) {
113 G4Material* aMaterial = (*theMaterialTable)[i];
118 if (aMaterialPropertiesTable) {
120 aMaterialPropertiesTable->
GetProperty(
"WLSCOMPONENT");
123 G4double currentIN = (*theWLSVector)[0];
124 if (currentIN >= 0.0) {
127 aPhysicsOrderedFreeVector->
128 InsertValues(currentPM , currentCII);
137 currentPM = theWLSVector->
Energy(j);
138 currentIN = (*theWLSVector)[j];
139 currentCII = 0.5 * (prevIN + currentIN);
140 currentCII = prevCII + (currentPM - prevPM) * currentCII;
141 aPhysicsOrderedFreeVector->
142 InsertValues(currentPM, currentCII);
144 prevCII = currentCII;
164 #ifdef use_sampledEnergy
169 for (
size_t j=0 ; j<theMaterialTable->size() ; j++) {
170 G4Material* fMaterial = (*theMaterialTable)[j];
171 if (fMaterial->
GetName() ==
"PMMA" ) {
175 aMaterialPropertiesTable->
GetProperty(
"WLSCOMPONENT");
185 sampledEnergy = WLSIntegral->
GetEnergy(CIIvalue);
203 void WLSPrimaryGeneratorAction::SetOptPhotonPolar()
206 SetOptPhotonPolar(angle);
215 G4cout <<
"-> warning from WLSPrimaryGeneratorAction::SetOptPhotonPolar()"
216 <<
": the ParticleGun is not an opticalphoton" <<
G4endl;
226 if (modul2 > 0.) e_perpend = (1./std::sqrt(modul2))*product;
229 G4ThreeVector polar = std::cos(angle)*e_paralle + std::sin(angle)*e_perpend;
236 void WLSPrimaryGeneratorAction::SetOptPhotonTime()
G4ParticleDefinition * GetParticleDefinition()
G4MaterialPropertyVector * GetProperty(const char *key)
Definition of the WLSPrimaryGeneratorAction class.
void GeneratePrimaryVertex(G4Event *)
const G4String & GetName() const
Definition of the WLSPrimaryGeneratorMessenger class.
static G4MaterialTable * GetMaterialTable()
std::vector< G4Material * > G4MaterialTable
size_t GetVectorLength() const
G4PhysicsTable * fIntegralTable
const G4String & GetParticleName() const
Definition of the WLSDetectorConstruction class.
void SetParticleTime(G4double aTime)
G4GLOB_DLL std::ostream G4cout
void SetParticlePolarization(G4ThreeVector aVal)
G4double Energy(size_t index) const
static size_t GetNumberOfMaterials()
G4double GetEnergy(G4double aValue)
virtual ~WLSPrimaryGeneratorAction()
WLSPrimaryGeneratorAction(WLSDetectorConstruction *)
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
G4ThreeVector GetParticleMomentumDirection()
void SetDecayTimeConstant(G4double)
virtual void GeneratePrimaries(G4Event *)
void insertAt(size_t, G4PhysicsVector *)
Hep3Vector cross(const Hep3Vector &) const
void BuildEmissionSpectrum()
void SetOptPhotonPolar(G4double)