Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MoleculeGunMessenger Class Reference

#include <G4MoleculeGunMessenger.hh>

+ Inheritance diagram for G4MoleculeGunMessenger:

Public Member Functions

 G4MoleculeGunMessenger (G4MoleculeGun *)
 
 ~G4MoleculeGunMessenger () override
 
void SetNewValue (G4UIcommand *command, G4String newValue) override
 
G4String GetCurrentValue (G4UIcommand *command) override
 
const std::vector< G4MoleculeShootMessenger * > & GetShootMessengers () const
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool CommandsShouldBeInMaster () const
 

Protected Member Functions

template<typename T >
G4MoleculeShootMessengerCreateNewType (const G4String &name)
 
- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String LtoS (G4long l)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (const G4String &s)
 
G4long StoL (const G4String &s)
 
G4double StoD (const 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

G4MoleculeGunfpMoleculeGun
 
G4UIcmdWithAStringfpGunNewGunType
 
std::vector< G4MoleculeShootMessenger * > fMultipleGun
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Detailed Description

Definition at line 90 of file G4MoleculeGunMessenger.hh.

Constructor & Destructor Documentation

◆ G4MoleculeGunMessenger()

G4MoleculeGunMessenger::G4MoleculeGunMessenger ( G4MoleculeGun * gun)

Definition at line 45 of file G4MoleculeGunMessenger.cc.

45 :
46 G4UImessenger("/chem/gun/", "")
47{
48 fpGunNewGunType = new G4UIcmdWithAString("/chem/gun/newShoot",
49 this);
50 fpMoleculeGun = gun;
51}
G4UIcmdWithAString * fpGunNewGunType
G4UImessenger()=default

◆ ~G4MoleculeGunMessenger()

G4MoleculeGunMessenger::~G4MoleculeGunMessenger ( )
override

Definition at line 55 of file G4MoleculeGunMessenger.cc.

56{
57 delete fpGunNewGunType;
58}

Member Function Documentation

◆ CreateNewType()

template<typename T >
G4MoleculeShootMessenger * G4MoleculeGunMessenger::CreateNewType ( const G4String & name)
inlineprotected

Definition at line 111 of file G4MoleculeGunMessenger.hh.

112 {
114 auto shoot =
116 this,
117 moleculeShoot);
118 fMultipleGun.push_back(shoot);
120 return shoot;
121 }
#define G4shared_ptr
Definition G4memory.hh:32
std::vector< G4MoleculeShootMessenger * > fMultipleGun
void AddMoleculeShoot(G4shared_ptr< G4MoleculeShoot >)
ThreeVector shoot(const G4int Ap, const G4int Af)

Referenced by SetNewValue().

◆ GetCurrentValue()

G4String G4MoleculeGunMessenger::GetCurrentValue ( G4UIcommand * command)
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 62 of file G4MoleculeGunMessenger.cc.

63{
64 return "";
65}

◆ GetShootMessengers()

const std::vector< G4MoleculeShootMessenger * > & G4MoleculeGunMessenger::GetShootMessengers ( ) const
inline

Definition at line 101 of file G4MoleculeGunMessenger.hh.

102 {
103 return fMultipleGun;
104 }

◆ SetNewValue()

void G4MoleculeGunMessenger::SetNewValue ( G4UIcommand * command,
G4String newValue )
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 69 of file G4MoleculeGunMessenger.cc.

71{
72 if (command == fpGunNewGunType)
73 {
74 std::istringstream iss (newValue);
75
76 G4String shootName;
77 iss >> shootName;
78
79 G4String shootType;
80 iss >> shootType;
81
82 if(shootType.empty() || shootType.empty())
83 {
84 CreateNewType<G4Track>(shootName);
85 }
86 else
87 {
89 }
90 }
91}
G4MoleculeShootMessenger * CreateNewType(const G4String &name)

Member Data Documentation

◆ fMultipleGun

std::vector<G4MoleculeShootMessenger*> G4MoleculeGunMessenger::fMultipleGun
protected

Definition at line 123 of file G4MoleculeGunMessenger.hh.

Referenced by CreateNewType(), and GetShootMessengers().

◆ fpGunNewGunType

G4UIcmdWithAString* G4MoleculeGunMessenger::fpGunNewGunType
protected

◆ fpMoleculeGun

G4MoleculeGun* G4MoleculeGunMessenger::fpMoleculeGun
protected

Definition at line 107 of file G4MoleculeGunMessenger.hh.

Referenced by CreateNewType(), and G4MoleculeGunMessenger().


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