Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UltraActionInitializer Class Reference

#include <UltraActionInitializer.hh>

Inheritance diagram for UltraActionInitializer:
Collaboration diagram for UltraActionInitializer:

Public Member Functions

 UltraActionInitializer ()
 
 ~UltraActionInitializer ()
 
void Build () const
 
void BuildForMaster () const
 
- Public Member Functions inherited from G4VUserActionInitialization
 G4VUserActionInitialization ()
 
virtual ~G4VUserActionInitialization ()
 
virtual G4VSteppingVerboseInitializeSteppingVerbose () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserActionInitialization
void SetUserAction (G4VUserPrimaryGeneratorAction *) const
 
void SetUserAction (G4UserRunAction *) const
 
void SetUserAction (G4UserEventAction *) const
 
void SetUserAction (G4UserStackingAction *) const
 
void SetUserAction (G4UserTrackingAction *) const
 
void SetUserAction (G4UserSteppingAction *) const
 

Detailed Description

Definition at line 40 of file UltraActionInitializer.hh.

Constructor & Destructor Documentation

UltraActionInitializer::UltraActionInitializer ( )

Definition at line 45 of file UltraActionInitializer.cc.

45  :
47 {
48  //Note: We instantiate a GPS here, because we want to set the defaults.
49  //Since GPS distributions are shared among threads, we need to be sure
50  //that defaults are done only once.
51  //See comments in file G4GeneralParticleSource.hh
52  masterGPS = new G4GeneralParticleSource();
53  // Define here the user default properties for the General Particle Source (GPS)
54  // Can be modified through the GPS Messenger (/gps/... commands)
55 
57  G4String particleName;
58 
59  G4ParticleDefinition* opticalphoton = particleTable->FindParticle(particleName="opticalphoton");
60 
61  //....PARTICLE DEFINITIONS
62  masterGPS->SetParticleDefinition(opticalphoton);
63 
64  G4ThreeVector Polarization = G4ThreeVector(1.,1.,0.) ;
65  masterGPS->SetParticlePolarization(Polarization);
66 
67  // DEFINE A MONO-ENERGETIC SOURCE
68  G4SPSEneDistribution *eneDist = masterGPS->GetCurrentSource()->GetEneDist() ;
69  eneDist->SetEnergyDisType("Mono");
70  eneDist->SetMonoEnergy(3.0*eV);
71 
72  // SET POSITION DISTRIBUTION
73  G4SPSPosDistribution *posDist = masterGPS->GetCurrentSource()->GetPosDist() ;
74  posDist->SetPosDisType("Plane");
75  posDist->SetPosDisShape("Circle");
76  posDist->SetRadius(20.0*cm);
77 
78  #ifdef ULTRA_MIRROR_USE
79  #define ULTRA_REFLECTION_USE
80  #endif
81 
82  #ifdef ULTRA_GROUND_USE
83  #define ULTRA_REFLECTION_USE
84  #endif
85 
86  G4SPSAngDistribution *angDist = masterGPS->GetCurrentSource()->GetAngDist() ;
87 
88  #ifdef ULTRA_REFLECTION_USE
89  angDist->SetParticleMomentumDirection(G4ThreeVector(0.0,-1.0,0.0)) ;
90  posDist->SetPosRot1(G4ThreeVector(1.,0.,0.));
91  posDist->SetPosRot2(G4ThreeVector(0.,0.,-1.));
92  posDist->SetCentreCoords(G4ThreeVector(0.0*cm,90.0*cm,150.0*cm));
93 
94  #else
95  angDist->SetParticleMomentumDirection(G4ThreeVector(0.0,0.0,-1.0)) ;
96  posDist->SetCentreCoords(G4ThreeVector(0.0*cm,0.0*cm,150.0*cm));
97 
98  #endif
99 
100 }
G4SPSAngDistribution * GetAngDist() const
G4SPSEneDistribution * GetEneDist() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4SPSPosDistribution * GetPosDist() const
CLHEP::Hep3Vector G4ThreeVector
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
void SetCentreCoords(G4ThreeVector)
void SetParticlePolarization(G4ThreeVector aVal)
static constexpr double cm
Definition: G4SIunits.hh:119
static constexpr double eV
Definition: G4SIunits.hh:215
void SetPosRot1(G4ThreeVector)
static G4ParticleTable * GetParticleTable()
void SetPosRot2(G4ThreeVector)
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
G4SingleParticleSource * GetCurrentSource() const

Here is the call graph for this function:

UltraActionInitializer::~UltraActionInitializer ( )

Definition at line 104 of file UltraActionInitializer.cc.

105 {
106  delete masterGPS;
107 }

Member Function Documentation

void UltraActionInitializer::Build ( void  ) const
virtual

Implements G4VUserActionInitialization.

Definition at line 111 of file UltraActionInitializer.cc.

112 {
113 
114  // primary generator
116 
117  //Thread-local RunAction: same class, but code controlled by IsMaster()
120 }
void SetUserAction(G4VUserPrimaryGeneratorAction *) const

Here is the call graph for this function:

void UltraActionInitializer::BuildForMaster ( void  ) const
virtual

Reimplemented from G4VUserActionInitialization.

Definition at line 124 of file UltraActionInitializer.cc.

125 {
126  //Thread-local RunAction: same class, but code controlled by IsMaster()
128 }
void SetUserAction(G4VUserPrimaryGeneratorAction *) const

Here is the call graph for this function:


The documentation for this class was generated from the following files: