Geant4  10.02.p03
CexmcPrimaryGeneratorAction Class Reference

#include <CexmcPrimaryGeneratorAction.hh>

Inheritance diagram for CexmcPrimaryGeneratorAction:
Collaboration diagram for CexmcPrimaryGeneratorAction:

Public Member Functions

 CexmcPrimaryGeneratorAction (CexmcPhysicsManager *physicsManager)
 
 ~CexmcPrimaryGeneratorAction ()
 
void GeneratePrimaries (G4Event *event)
 
void SetFwhmPosX (G4double value, G4bool fromMessenger=true)
 
void SetFwhmPosY (G4double value, G4bool fromMessenger=true)
 
void SetFwhmDirX (G4double value, G4bool fromMessenger=true)
 
void SetFwhmDirY (G4double value, G4bool fromMessenger=true)
 
void SetFwhmMomentumAmp (G4double value, G4bool fromMessenger=true)
 
G4double GetFwhmPosX (void) const
 
G4double GetFwhmPosY (void) const
 
G4double GetFwhmDirX (void) const
 
G4double GetFwhmDirY (void) const
 
G4double GetFwhmMomentumAmp (void) const
 
CexmcParticleGunGetParticleGun (void)
 
- Public Member Functions inherited from G4VUserPrimaryGeneratorAction
 G4VUserPrimaryGeneratorAction ()
 
virtual ~G4VUserPrimaryGeneratorAction ()
 

Private Attributes

CexmcParticleGunparticleGun
 
G4double fwhmPosX
 
G4double fwhmPosY
 
G4double fwhmDirX
 
G4double fwhmDirY
 
G4double fwhmMomentumAmp
 
CexmcPrimaryGeneratorActionMessengermessenger
 

Detailed Description

Definition at line 56 of file CexmcPrimaryGeneratorAction.hh.

Constructor & Destructor Documentation

◆ CexmcPrimaryGeneratorAction()

CexmcPrimaryGeneratorAction::CexmcPrimaryGeneratorAction ( CexmcPhysicsManager physicsManager)
explicit

◆ ~CexmcPrimaryGeneratorAction()

CexmcPrimaryGeneratorAction::~CexmcPrimaryGeneratorAction ( )

Definition at line 64 of file CexmcPrimaryGeneratorAction.cc.

65 {
66  delete particleGun;
67  delete messenger;
68 }
CexmcPrimaryGeneratorActionMessenger * messenger

Member Function Documentation

◆ GeneratePrimaries()

void CexmcPrimaryGeneratorAction::GeneratePrimaries ( G4Event event)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 71 of file CexmcPrimaryGeneratorAction.cc.

72 {
74 
75  const G4ThreeVector & origPos( particleGun->GetOrigPosition() );
76  const G4ThreeVector & origDir( particleGun->GetOrigDirection() );
77  G4double origMomentumAmp( particleGun->GetOrigMomentumAmp() );
78 
79  G4double randPosX( G4RandGauss::shoot( origPos.x(),
81  G4double randPosY( G4RandGauss::shoot( origPos.y(),
83  G4ThreeVector newPos( randPosX, randPosY, origPos.z() );
84 
85  G4double randAngleX( G4RandGauss::shoot( origDir.x(),
87  G4double randAngleY( G4RandGauss::shoot( origDir.y(),
89  G4ThreeVector newAngle( randAngleX, randAngleY, origDir.z() );
90 
91  G4double newMomentumAmp( G4RandGauss::shoot( origMomentumAmp,
92  fwhmMomentumAmp * origMomentumAmp *
94 
97  particleGun->SetParticleMomentum( newMomentumAmp );
98 
100 }
ThreeVector shoot(const G4int Ap, const G4int Af)
const G4ThreeVector & GetOrigPosition(void) const
void SetParticleMomentum(G4double aMomentum)
G4double GetOrigMomentumAmp(void) const
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
virtual void GeneratePrimaryVertex(G4Event *evt)
void SetParticlePosition(G4ThreeVector aPosition)
void PrepareForNewEvent(void)
const G4ThreeVector & GetOrigDirection(void) const
const G4double CexmcFwhmToStddev(0.42466)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ GetFwhmDirX()

G4double CexmcPrimaryGeneratorAction::GetFwhmDirX ( void  ) const
inline

Definition at line 172 of file CexmcPrimaryGeneratorAction.hh.

173 {
174  return fwhmDirX;
175 }
Here is the caller graph for this function:

◆ GetFwhmDirY()

G4double CexmcPrimaryGeneratorAction::GetFwhmDirY ( void  ) const
inline

Definition at line 178 of file CexmcPrimaryGeneratorAction.hh.

179 {
180  return fwhmDirY;
181 }
Here is the caller graph for this function:

◆ GetFwhmMomentumAmp()

G4double CexmcPrimaryGeneratorAction::GetFwhmMomentumAmp ( void  ) const
inline

Definition at line 184 of file CexmcPrimaryGeneratorAction.hh.

185 {
186  return fwhmMomentumAmp;
187 }
Here is the caller graph for this function:

◆ GetFwhmPosX()

G4double CexmcPrimaryGeneratorAction::GetFwhmPosX ( void  ) const
inline

Definition at line 160 of file CexmcPrimaryGeneratorAction.hh.

161 {
162  return fwhmPosX;
163 }
Here is the caller graph for this function:

◆ GetFwhmPosY()

G4double CexmcPrimaryGeneratorAction::GetFwhmPosY ( void  ) const
inline

Definition at line 166 of file CexmcPrimaryGeneratorAction.hh.

167 {
168  return fwhmPosY;
169 }
Here is the caller graph for this function:

◆ GetParticleGun()

CexmcParticleGun * CexmcPrimaryGeneratorAction::GetParticleGun ( void  )

Definition at line 103 of file CexmcPrimaryGeneratorAction.cc.

104 {
105  return particleGun;
106 }
Here is the caller graph for this function:

◆ SetFwhmDirX()

void CexmcPrimaryGeneratorAction::SetFwhmDirX ( G4double  value,
G4bool  fromMessenger = true 
)
inline

Definition at line 130 of file CexmcPrimaryGeneratorAction.hh.

132 {
133  if ( fromMessenger )
135 
136  fwhmDirX = value;
137 }
void ThrowExceptionIfProjectIsRead(CexmcExceptionType type, G4bool extraCond=true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetFwhmDirY()

void CexmcPrimaryGeneratorAction::SetFwhmDirY ( G4double  value,
G4bool  fromMessenger = true 
)
inline

Definition at line 140 of file CexmcPrimaryGeneratorAction.hh.

142 {
143  if ( fromMessenger )
145 
146  fwhmDirY = value;
147 }
void ThrowExceptionIfProjectIsRead(CexmcExceptionType type, G4bool extraCond=true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetFwhmMomentumAmp()

void CexmcPrimaryGeneratorAction::SetFwhmMomentumAmp ( G4double  value,
G4bool  fromMessenger = true 
)
inline

Definition at line 150 of file CexmcPrimaryGeneratorAction.hh.

152 {
153  if ( fromMessenger )
155 
156  fwhmMomentumAmp = value;
157 }
void ThrowExceptionIfProjectIsRead(CexmcExceptionType type, G4bool extraCond=true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetFwhmPosX()

void CexmcPrimaryGeneratorAction::SetFwhmPosX ( G4double  value,
G4bool  fromMessenger = true 
)
inline

Definition at line 110 of file CexmcPrimaryGeneratorAction.hh.

112 {
113  if ( fromMessenger )
115 
116  fwhmPosX = value;
117 }
void ThrowExceptionIfProjectIsRead(CexmcExceptionType type, G4bool extraCond=true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetFwhmPosY()

void CexmcPrimaryGeneratorAction::SetFwhmPosY ( G4double  value,
G4bool  fromMessenger = true 
)
inline

Definition at line 120 of file CexmcPrimaryGeneratorAction.hh.

122 {
123  if ( fromMessenger )
125 
126  fwhmPosY = value;
127 }
void ThrowExceptionIfProjectIsRead(CexmcExceptionType type, G4bool extraCond=true)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fwhmDirX

G4double CexmcPrimaryGeneratorAction::fwhmDirX
private

Definition at line 99 of file CexmcPrimaryGeneratorAction.hh.

◆ fwhmDirY

G4double CexmcPrimaryGeneratorAction::fwhmDirY
private

Definition at line 101 of file CexmcPrimaryGeneratorAction.hh.

◆ fwhmMomentumAmp

G4double CexmcPrimaryGeneratorAction::fwhmMomentumAmp
private

Definition at line 103 of file CexmcPrimaryGeneratorAction.hh.

◆ fwhmPosX

G4double CexmcPrimaryGeneratorAction::fwhmPosX
private

Definition at line 95 of file CexmcPrimaryGeneratorAction.hh.

◆ fwhmPosY

G4double CexmcPrimaryGeneratorAction::fwhmPosY
private

Definition at line 97 of file CexmcPrimaryGeneratorAction.hh.

◆ messenger

CexmcPrimaryGeneratorActionMessenger* CexmcPrimaryGeneratorAction::messenger
private

Definition at line 106 of file CexmcPrimaryGeneratorAction.hh.

◆ particleGun

CexmcParticleGun* CexmcPrimaryGeneratorAction::particleGun
private

Definition at line 93 of file CexmcPrimaryGeneratorAction.hh.


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