Geant4  10.02.p03
CML2AcceleratorConstructionMessenger Class Reference

#include <ML2AcceleratorConstructionMessenger.hh>

Inheritance diagram for CML2AcceleratorConstructionMessenger:
Collaboration diagram for CML2AcceleratorConstructionMessenger:

Public Member Functions

 CML2AcceleratorConstructionMessenger (CML2AcceleratorConstruction *acceleratorConstructor)
 
 ~CML2AcceleratorConstructionMessenger (void)
 
void SetNewValue (G4UIcommand *cmd, G4String newValue)
 
void SetReferenceWorld (G4bool bOV)
 
- 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

CML2AcceleratorConstructionpAcceleratorConstructor
 
G4UIcmdWithAStringAcceleratorName
 
G4UIcmdWithAStringacceleratorMacFileName
 
G4UIcmdWithADoubleAndUnitrotationX
 
G4UIcmdWithADoubleAndUnitisoCentre
 
G4UIcmdWithABoolbRotate90Y
 
G4bool bOnlyVisio
 

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 62 of file ML2AcceleratorConstructionMessenger.hh.

Constructor & Destructor Documentation

◆ CML2AcceleratorConstructionMessenger()

CML2AcceleratorConstructionMessenger::CML2AcceleratorConstructionMessenger ( CML2AcceleratorConstruction acceleratorConstructor)

Definition at line 51 of file ML2AcceleratorConstructionMessenger.cc.

51  : pAcceleratorConstructor (acceleratorConstructor)
52 {
53  bOnlyVisio=false;
54  AcceleratorName=new G4UIcmdWithAString("/accelerator/AcceleratorName",this);
56  AcceleratorName->SetGuidance("accelerator name to select among those implemented (acc1)");
58 
59  acceleratorMacFileName=new G4UIcmdWithAString("/accelerator/AcceleratorMacFileName",this);
61  acceleratorMacFileName->SetGuidance("full path and macro file name containing specific setup data for the accelerator chosen");
63 
64 
65  rotationX =new G4UIcmdWithADoubleAndUnit("/accelerator/rotationX", this);
66  rotationX ->SetDefaultUnit("deg");
68  rotationX->SetGuidance("angles of rotation along X [deg]");
69 
70  isoCentre=new G4UIcmdWithADoubleAndUnit("/accelerator/isoCentre", this);
72  isoCentre->SetDefaultValue(1000.);
73  isoCentre->SetGuidance("distance between the isocentre and the target of the accelerator");
75 
76 
77  bRotate90Y =new G4UIcmdWithABool("/accelerator/rotation90Y", this);
78  bRotate90Y ->SetDefaultValue(false);
79  bRotate90Y->SetGuidance("to rotate the accelerator of 90 deg around the Y axis (true)");
81 }
void SetDefaultValue(G4bool defVal)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetDefaultValue(const char *defVal)
void SetDefaultUnit(const char *defUnit)
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:

◆ ~CML2AcceleratorConstructionMessenger()

CML2AcceleratorConstructionMessenger::~CML2AcceleratorConstructionMessenger ( void  )

Member Function Documentation

◆ SetNewValue()

void CML2AcceleratorConstructionMessenger::SetNewValue ( G4UIcommand cmd,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 91 of file ML2AcceleratorConstructionMessenger.cc.

92 {
93 
94  if (cmd==AcceleratorName)
96 
97  if (cmd==acceleratorMacFileName)
99 
100 
101  if (cmd==rotationX)
102  {
103  if (bOnlyVisio)
104  {
105  G4RotationMatrix *rm=pAcceleratorConstructor->rotateAccelerator(rotationX ->GetNewDoubleValue(newValue));
108 // what follows seems to be necessary to have a good refresh
110  G4String command;
111  command = "/run/beamOn 0";
112  UI->ApplyCommand(command);
113  command = "/vis/viewer/flush";
114  UI->ApplyCommand(command);
115  }
116  else
117  {
118  pAcceleratorConstructor->addAcceleratorRotationsX(rotationX ->GetNewDoubleValue(newValue));
119  }
120  }
121 
122  if (cmd==isoCentre)
123  {
124  isoCentre->GetNewUnitValue(newValue);
126  }
127  if (cmd==bRotate90Y)
129 }
static G4double GetNewDoubleValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
void setRotation(G4RotationMatrix *val)
static CML2PrimaryGenerationAction * GetInstance(void)
static CML2PhantomConstruction * GetInstance(void)
static G4double GetNewUnitValue(const char *paramString)
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
Here is the call graph for this function:

◆ SetReferenceWorld()

void CML2AcceleratorConstructionMessenger::SetReferenceWorld ( G4bool  bOV)
inline

Definition at line 68 of file ML2AcceleratorConstructionMessenger.hh.

Here is the caller graph for this function:

Member Data Documentation

◆ acceleratorMacFileName

G4UIcmdWithAString * CML2AcceleratorConstructionMessenger::acceleratorMacFileName
private

Definition at line 72 of file ML2AcceleratorConstructionMessenger.hh.

◆ AcceleratorName

G4UIcmdWithAString* CML2AcceleratorConstructionMessenger::AcceleratorName
private

Definition at line 72 of file ML2AcceleratorConstructionMessenger.hh.

◆ bOnlyVisio

G4bool CML2AcceleratorConstructionMessenger::bOnlyVisio
private

Definition at line 76 of file ML2AcceleratorConstructionMessenger.hh.

◆ bRotate90Y

G4UIcmdWithABool* CML2AcceleratorConstructionMessenger::bRotate90Y
private

Definition at line 74 of file ML2AcceleratorConstructionMessenger.hh.

◆ isoCentre

G4UIcmdWithADoubleAndUnit * CML2AcceleratorConstructionMessenger::isoCentre
private

Definition at line 73 of file ML2AcceleratorConstructionMessenger.hh.

◆ pAcceleratorConstructor

CML2AcceleratorConstruction* CML2AcceleratorConstructionMessenger::pAcceleratorConstructor
private

Definition at line 70 of file ML2AcceleratorConstructionMessenger.hh.

◆ rotationX

G4UIcmdWithADoubleAndUnit* CML2AcceleratorConstructionMessenger::rotationX
private

Definition at line 73 of file ML2AcceleratorConstructionMessenger.hh.


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