Geant4  10.02.p03
CexmcParticleGunMessenger Class Reference

#include <CexmcParticleGunMessenger.hh>

Inheritance diagram for CexmcParticleGunMessenger:
Collaboration diagram for CexmcParticleGunMessenger:

Public Member Functions

 CexmcParticleGunMessenger (CexmcParticleGun *particleGun)
 
 ~CexmcParticleGunMessenger ()
 
void SetNewValue (G4UIcommand *cmd, G4String value)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Private Attributes

CexmcParticleGunparticleGun
 
G4UIcmdWithAStringsetParticle
 
G4UIcmdWith3VectorAndUnitsetOrigPosition
 
G4UIcmdWith3VectorsetOrigDirection
 
G4UIcmdWithADoubleAndUnitsetOrigMomentumAmp
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 57 of file CexmcParticleGunMessenger.hh.

Constructor & Destructor Documentation

◆ CexmcParticleGunMessenger()

CexmcParticleGunMessenger::CexmcParticleGunMessenger ( CexmcParticleGun particleGun)
explicit

Definition at line 57 of file CexmcParticleGunMessenger.cc.

58  :
59  particleGun( particleGun ), setParticle( NULL ), setOrigPosition( NULL ),
60  setOrigDirection( NULL ), setOrigMomentumAmp( NULL )
61 {
63  ( CexmcMessenger::gunDirName + "particle" ).c_str(), this );
64  setParticle->SetGuidance( "Incident beam particle" );
65  setParticle->SetParameterName( "BeamParticle", false );
66  setParticle->SetCandidates( "pi-" );
67  setParticle->SetDefaultValue( "pi-" );
69 
71  ( CexmcMessenger::gunDirName + "position" ).c_str(), this );
72  setOrigPosition->SetGuidance( "Original position of the beam" );
73  setOrigPosition->SetParameterName( "PositionX", "PositionY", "PositionZ",
74  false );
75  setOrigPosition->SetUnitCandidates( "mm cm m" );
78 
80  ( CexmcMessenger::gunDirName + "direction" ).c_str(), this );
81  setOrigDirection->SetGuidance( "Original direction of the beam" );
82  setOrigDirection->SetParameterName( "DirectionX", "DirectionY",
83  "DirectionZ", false );
85  "DirectionX >= -1.0 && DirectionX <= 1.0 && "
86  "DirectionY >= -1.0 && DirectionY <= 1.0 && "
87  "DirectionZ >= -1.0 && DirectionZ <= 1.0" );
89 
91  ( CexmcMessenger::gunDirName + "momentumAmp" ).c_str(), this );
92  setOrigMomentumAmp->SetGuidance( "Original momentum of the beam" );
93  setOrigMomentumAmp->SetParameterName( "MomentumAmp", false );
94  setOrigMomentumAmp->SetRange( "MomentumAmp > 0" );
95  setOrigMomentumAmp->SetUnitCandidates( "eV keV MeV GeV" );
98 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithADoubleAndUnit * setOrigMomentumAmp
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
void SetDefaultValue(const char *defVal)
void SetDefaultUnit(const char *defUnit)
static G4String gunDirName
G4UIcmdWith3VectorAndUnit * setOrigPosition
void SetCandidates(const char *candidateList)
void SetUnitCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCandidates(const char *candidateList)
Here is the call graph for this function:

◆ ~CexmcParticleGunMessenger()

CexmcParticleGunMessenger::~CexmcParticleGunMessenger ( )

Definition at line 101 of file CexmcParticleGunMessenger.cc.

102 {
103  delete setParticle;
104  delete setOrigPosition;
105  delete setOrigDirection;
106  delete setOrigMomentumAmp;
107 }
G4UIcmdWithADoubleAndUnit * setOrigMomentumAmp
G4UIcmdWith3VectorAndUnit * setOrigPosition

Member Function Documentation

◆ SetNewValue()

void CexmcParticleGunMessenger::SetNewValue ( G4UIcommand cmd,
G4String  value 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 110 of file CexmcParticleGunMessenger.cc.

112 {
113  do
114  {
115  if ( cmd == setParticle )
116  {
117  G4ParticleDefinition * particleDefinition(
118  G4ParticleTable::GetParticleTable()->FindParticle( value ) );
119 
120  if ( ! particleDefinition )
122 
123  particleGun->SetBeamParticle( particleDefinition );
124 
125  CexmcRunManager * runManager( static_cast< CexmcRunManager * >(
127  runManager->BeamParticleChangeHook();
128  break;
129  }
130  if ( cmd == setOrigPosition )
131  {
134  break;
135  }
136  if ( cmd == setOrigDirection )
137  {
140  break;
141  }
142  if ( cmd == setOrigMomentumAmp )
143  {
146  break;
147  }
148  } while ( false );
149 }
G4UIcmdWithADoubleAndUnit * setOrigMomentumAmp
static G4ThreeVector GetNew3VectorValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
void SetOrigMomentumAmp(G4double momentumAmp, G4bool fromMessenger=true)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
void SetOrigPosition(const G4ThreeVector &position, G4bool fromMessenger=true)
static G4ParticleTable * GetParticleTable()
G4UIcmdWith3VectorAndUnit * setOrigPosition
void SetBeamParticle(G4ParticleDefinition *particleDefinition, G4bool fromMessenger=true)
void SetOrigDirection(const G4ThreeVector &direction, G4bool fromMessenger=true)
Here is the call graph for this function:

Member Data Documentation

◆ particleGun

CexmcParticleGun* CexmcParticleGunMessenger::particleGun
private

Definition at line 68 of file CexmcParticleGunMessenger.hh.

◆ setOrigDirection

G4UIcmdWith3Vector* CexmcParticleGunMessenger::setOrigDirection
private

Definition at line 74 of file CexmcParticleGunMessenger.hh.

◆ setOrigMomentumAmp

G4UIcmdWithADoubleAndUnit* CexmcParticleGunMessenger::setOrigMomentumAmp
private

Definition at line 76 of file CexmcParticleGunMessenger.hh.

◆ setOrigPosition

G4UIcmdWith3VectorAndUnit* CexmcParticleGunMessenger::setOrigPosition
private

Definition at line 72 of file CexmcParticleGunMessenger.hh.

◆ setParticle

G4UIcmdWithAString* CexmcParticleGunMessenger::setParticle
private

Definition at line 70 of file CexmcParticleGunMessenger.hh.


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