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

#include <CexmcPrimaryGeneratorActionMessenger.hh>

Inheritance diagram for CexmcPrimaryGeneratorActionMessenger:
Collaboration diagram for CexmcPrimaryGeneratorActionMessenger:

Public Member Functions

 CexmcPrimaryGeneratorActionMessenger (CexmcPrimaryGeneratorAction *primaryGeneratorAction)
 
 ~CexmcPrimaryGeneratorActionMessenger ()
 
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
 

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 55 of file CexmcPrimaryGeneratorActionMessenger.hh.

Constructor & Destructor Documentation

CexmcPrimaryGeneratorActionMessenger::CexmcPrimaryGeneratorActionMessenger ( CexmcPrimaryGeneratorAction primaryGeneratorAction)
explicit

Definition at line 51 of file CexmcPrimaryGeneratorActionMessenger.cc.

52  :
53  primaryGeneratorAction( primaryGeneratorAction ),
54  fwhmPosX( NULL ), fwhmPosY( NULL ), fwhmDirX( NULL ), fwhmDirY( NULL ),
55  fwhmMomentumAmp( NULL )
56 {
57  fwhmPosX = new G4UIcmdWithADoubleAndUnit(
58  ( CexmcMessenger::gunDirName + "fwhmPosX" ).c_str(), this );
59  fwhmPosX->SetGuidance( "Set positional fwhm of the beam along X axis" );
60  fwhmPosX->SetParameterName( "FwhmPosX", false );
61  fwhmPosX->SetDefaultValue( 0 );
62  fwhmPosX->SetUnitCandidates( "mm cm m" );
63  fwhmPosX->SetDefaultUnit( "cm" );
65 
66  fwhmPosY = new G4UIcmdWithADoubleAndUnit(
67  ( CexmcMessenger::gunDirName + "fwhmPosY" ).c_str(), this );
68  fwhmPosY->SetGuidance( "Set positional fwhm of the beam along Y axis" );
69  fwhmPosY->SetParameterName( "FwhmPosY", false );
70  fwhmPosY->SetDefaultValue( 0 );
71  fwhmPosY->SetUnitCandidates( "mm cm m" );
72  fwhmPosY->SetDefaultUnit( "cm" );
74 
75  fwhmDirX = new G4UIcmdWithADoubleAndUnit(
76  ( CexmcMessenger::gunDirName + "fwhmDirX" ).c_str(), this );
77  fwhmDirX->SetGuidance( "Set directional fwhm of the beam along X axis" );
78  fwhmDirX->SetParameterName( "FwhmDirX", false );
79  fwhmDirX->SetDefaultValue( 0 );
80  fwhmDirX->SetUnitCandidates( "deg rad" );
81  fwhmDirX->SetDefaultUnit( "deg" );
83 
84  fwhmDirY = new G4UIcmdWithADoubleAndUnit(
85  ( CexmcMessenger::gunDirName + "fwhmDirY" ).c_str(), this );
86  fwhmDirY->SetGuidance( "Set directional fwhm of the beam along Y axis" );
87  fwhmDirY->SetParameterName( "FwhmDirY", false );
88  fwhmDirY->SetDefaultValue( 0 );
89  fwhmDirY->SetUnitCandidates( "deg rad" );
90  fwhmDirY->SetDefaultUnit( "deg" );
92 
93  fwhmMomentumAmp = new G4UIcmdWithADouble(
94  ( CexmcMessenger::gunDirName + "fwhmMomentumAmp" ).c_str(), this );
95  fwhmMomentumAmp->SetGuidance( "Set fwhm of the beam momentum as fraction "
96  "of its value" );
97  fwhmMomentumAmp->SetParameterName( "FwhmMomentumAmp", false );
98  fwhmMomentumAmp->SetDefaultValue( 0 );
99  fwhmMomentumAmp->AvailableForStates( G4State_PreInit, G4State_Idle );
100 }
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultUnit(const char *defUnit)
static G4String gunDirName
void SetDefaultValue(G4double defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCandidates(const char *candidateList)

Here is the call graph for this function:

CexmcPrimaryGeneratorActionMessenger::~CexmcPrimaryGeneratorActionMessenger ( )

Definition at line 103 of file CexmcPrimaryGeneratorActionMessenger.cc.

104 {
105  delete fwhmPosX;
106  delete fwhmPosY;
107  delete fwhmDirX;
108  delete fwhmDirY;
109  delete fwhmMomentumAmp;
110 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 113 of file CexmcPrimaryGeneratorActionMessenger.cc.

115 {
116  do
117  {
118  if ( cmd == fwhmPosX )
119  {
120  primaryGeneratorAction->SetFwhmPosX(
122  break;
123  }
124  if ( cmd == fwhmPosY )
125  {
126  primaryGeneratorAction->SetFwhmPosY(
128  break;
129  }
130  if ( cmd == fwhmDirX )
131  {
132  primaryGeneratorAction->SetFwhmDirX(
134  break;
135  }
136  if ( cmd == fwhmDirY )
137  {
138  primaryGeneratorAction->SetFwhmDirY(
140  break;
141  }
142  if ( cmd == fwhmMomentumAmp )
143  {
144  primaryGeneratorAction->SetFwhmMomentumAmp(
146  break;
147  }
148  } while ( false );
149 }
static G4double GetNewDoubleValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
void SetFwhmDirY(G4double value, G4bool fromMessenger=true)
void SetFwhmPosX(G4double value, G4bool fromMessenger=true)
void SetFwhmDirX(G4double value, G4bool fromMessenger=true)
void SetFwhmMomentumAmp(G4double value, G4bool fromMessenger=true)
void SetFwhmPosY(G4double value, G4bool fromMessenger=true)

Here is the call graph for this function:


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