Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4MoleculeShootMessenger Class Reference

#include <G4MoleculeGunMessenger.hh>

Inheritance diagram for G4MoleculeShootMessenger:
Collaboration diagram for G4MoleculeShootMessenger:

Public Member Functions

 G4MoleculeShootMessenger (const G4String &name, G4MoleculeGunMessenger *, G4shared_ptr< G4MoleculeShoot >)
 
virtual ~G4MoleculeShootMessenger ()
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4shared_ptr< G4MoleculeShoot > & GetShoot ()
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Protected Attributes

G4UIcmdWithAStringfpGunSpecies
 
G4UIcmdWith3VectorAndUnitfpGunPosition
 
G4UIcmdWith3VectorAndUnitfpGunRdnmPosition
 
G4UIcmdWithADoubleAndUnitfpGunTime
 
G4UIcmdWithAnIntegerfpGunN
 
G4UIcmdWithAStringfpGunType
 
G4shared_ptr< G4MoleculeShootfpShoot
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

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)
 

Detailed Description

Definition at line 64 of file G4MoleculeGunMessenger.hh.

Constructor & Destructor Documentation

G4MoleculeShootMessenger::G4MoleculeShootMessenger ( const G4String name,
G4MoleculeGunMessenger ,
G4shared_ptr< G4MoleculeShoot shoot 
)

Definition at line 98 of file G4MoleculeGunMessenger.cc.

101  :
103 {
104  G4String dir("/chem/gun/");
105  dir += name;
106  CreateDirectory(dir, "");
107 
108  G4String tmp = dir;
109  tmp += "/species";
110  fpGunSpecies = new G4UIcmdWithAString(tmp, this);
111 
112  tmp = dir;
113  tmp += "/position";
114  fpGunPosition = new G4UIcmdWith3VectorAndUnit(tmp, this);
115 
116  tmp = dir;
117  tmp += "/time";
118  fpGunTime = new G4UIcmdWithADoubleAndUnit(tmp, this);
119 
120  tmp = dir;
121  tmp += "/number";
122  fpGunN = new G4UIcmdWithAnInteger(tmp, this);
123 
124  tmp = dir;
125  tmp += "/rndmPosition";
127 
128  tmp = dir;
129  tmp += "/type";
130  fpGunType = new G4UIcmdWithAString(tmp, this);
131 
132 // fpShoot.reset(new TG4MoleculeShoot<G4Track>());
133 }
G4UIcmdWith3VectorAndUnit * fpGunPosition
const XML_Char * name
Definition: expat.h:151
ThreeVector shoot(const G4int Ap, const G4int Af)
void CreateDirectory(const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
G4UIcmdWith3VectorAndUnit * fpGunRdnmPosition
G4UIcmdWithAnInteger * fpGunN
G4UIcmdWithADoubleAndUnit * fpGunTime
G4shared_ptr< G4MoleculeShoot > fpShoot
G4UIcmdWithAString * fpGunSpecies
G4UIcmdWithAString * fpGunType

Here is the call graph for this function:

G4MoleculeShootMessenger::~G4MoleculeShootMessenger ( )
virtual

Definition at line 137 of file G4MoleculeGunMessenger.cc.

138 {
139  if (fpGunSpecies) delete fpGunSpecies;
140  if (fpGunPosition) delete fpGunPosition;
141  if (fpGunTime) delete fpGunTime;
142  if (fpGunN) delete fpGunN;
143 }
G4UIcmdWith3VectorAndUnit * fpGunPosition
G4UIcmdWithAnInteger * fpGunN
G4UIcmdWithADoubleAndUnit * fpGunTime
G4UIcmdWithAString * fpGunSpecies

Member Function Documentation

G4String G4MoleculeShootMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 183 of file G4MoleculeGunMessenger.cc.

184 {
185  if (command == fpGunSpecies)
186  {
187  return fpShoot->fMoleculeName;
188  }
189  else if (command == fpGunPosition)
190  {
192  }
193  else if (command == fpGunRdnmPosition)
194  {
195  if(fpShoot->fBoxSize)
196  {
198  }
200  }
201  else if (command == fpGunTime)
202  {
204  }
205  else if (command == fpGunN)
206  {
207  return fpGunN->ConvertToString(fpShoot->fNumber);
208  }
209  return "";
210 }
G4UIcmdWith3VectorAndUnit * fpGunPosition
CLHEP::Hep3Vector G4ThreeVector
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372
G4UIcmdWith3VectorAndUnit * fpGunRdnmPosition
G4UIcmdWithAnInteger * fpGunN
G4UIcmdWithADoubleAndUnit * fpGunTime
G4shared_ptr< G4MoleculeShoot > fpShoot
G4String ConvertToStringWithBestUnit(G4double val)
G4UIcmdWithAString * fpGunSpecies
G4String ConvertToStringWithBestUnit(G4ThreeVector vec)

Here is the call graph for this function:

G4shared_ptr<G4MoleculeShoot>& G4MoleculeShootMessenger::GetShoot ( )
inline

Definition at line 74 of file G4MoleculeGunMessenger.hh.

74  {
75  return fpShoot;
76  }
G4shared_ptr< G4MoleculeShoot > fpShoot

Here is the caller graph for this function:

void G4MoleculeShootMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 147 of file G4MoleculeGunMessenger.cc.

148 {
149  if (command == fpGunSpecies)
150  {
151  fpShoot->fMoleculeName = newValue;
152  }
153  else if (command == fpGunPosition)
154  {
155  fpShoot->fPosition = fpGunPosition->GetNew3VectorValue(newValue);
156  }
157  else if(command == fpGunRdnmPosition)
158  {
159  fpShoot->fBoxSize = new G4ThreeVector(fpGunRdnmPosition->GetNew3VectorValue(newValue));
160  }
161  else if (command == fpGunTime)
162  {
163  fpShoot->fTime = fpGunTime->GetNewDoubleValue(newValue);
164  }
165  else if (command == fpGunN)
166  {
167  fpShoot->fNumber = fpGunN->GetNewIntValue(newValue);
168  }
169  else if (command == fpGunType)
170  {
171  if(newValue == "CM")
172  {
173 // G4cout << "**** Change type" << G4endl;
174 // TG4MoleculeShoot<G4ContinuousMedium>* casted = reinterpret_cast<TG4MoleculeShoot<G4ContinuousMedium>*>(fpShoot.get());
175 // fpShoot.reset(casted);
176  fpShoot = fpShoot.get()->ChangeType<G4ContinuousMedium>();
177  }
178  }
179 }
G4UIcmdWith3VectorAndUnit * fpGunPosition
CLHEP::Hep3Vector G4ThreeVector
static G4int GetNewIntValue(const char *paramString)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
G4UIcmdWith3VectorAndUnit * fpGunRdnmPosition
G4UIcmdWithAnInteger * fpGunN
G4UIcmdWithADoubleAndUnit * fpGunTime
G4shared_ptr< G4MoleculeShoot > fpShoot
G4UIcmdWithAString * fpGunSpecies
G4UIcmdWithAString * fpGunType
int G4ContinuousMedium

Here is the call graph for this function:

Member Data Documentation

G4UIcmdWithAnInteger* G4MoleculeShootMessenger::fpGunN
protected

Definition at line 83 of file G4MoleculeGunMessenger.hh.

G4UIcmdWith3VectorAndUnit* G4MoleculeShootMessenger::fpGunPosition
protected

Definition at line 80 of file G4MoleculeGunMessenger.hh.

G4UIcmdWith3VectorAndUnit* G4MoleculeShootMessenger::fpGunRdnmPosition
protected

Definition at line 81 of file G4MoleculeGunMessenger.hh.

G4UIcmdWithAString* G4MoleculeShootMessenger::fpGunSpecies
protected

Definition at line 79 of file G4MoleculeGunMessenger.hh.

G4UIcmdWithADoubleAndUnit* G4MoleculeShootMessenger::fpGunTime
protected

Definition at line 82 of file G4MoleculeGunMessenger.hh.

G4UIcmdWithAString* G4MoleculeShootMessenger::fpGunType
protected

Definition at line 84 of file G4MoleculeGunMessenger.hh.

G4shared_ptr<G4MoleculeShoot> G4MoleculeShootMessenger::fpShoot
protected

Definition at line 85 of file G4MoleculeGunMessenger.hh.


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