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

#include <ML2Acc1Messenger.hh>

Inheritance diagram for CML2Acc1Messenger:
Collaboration diagram for CML2Acc1Messenger:

Public Member Functions

 CML2Acc1Messenger (CML2Acc1 *acc1)
 
 ~CML2Acc1Messenger (void)
 
void SetNewValue (G4UIcommand *cmd, G4String newValue)
 
- 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 57 of file ML2Acc1Messenger.hh.

Constructor & Destructor Documentation

CML2Acc1Messenger::CML2Acc1Messenger ( CML2Acc1 acc1)

Definition at line 51 of file ML2Acc1Messenger.cc.

51  : pAcc1(acc1)
52 {
53  idEnergy=new G4UIcmdWithAnInteger("/accelerator/idEnergy",this);
54  idEnergy->SetDefaultValue(6);
55  pAcc1->setidEnergy(6);
56 
57  leavesA=new G4UIcmdWithADoubleAndUnit("/accelerator/leavesA", this);
58  leavesA->SetDefaultUnit("mm");
59  leavesA->SetDefaultValue(300.);
60  pAcc1->setLeavesAx(300.*mm);
61 
62  leavesB=new G4UIcmdWithADoubleAndUnit("/accelerator/leavesB", this);
63  leavesB->SetDefaultUnit("mm");
64  leavesB->SetDefaultValue(300.);
65  pAcc1->setLeavesBx(300.*mm);
66 
67  aperture1X=new G4UIcmdWithADoubleAndUnit("/accelerator/aperture1X", this);
68  aperture1X->SetDefaultUnit("mm");
69  aperture1X->SetDefaultValue(100.);
70  pAcc1->setJaw1X(100.*mm);
71 
72  aperture1Y=new G4UIcmdWithADoubleAndUnit("/accelerator/aperture1Y", this);
73  aperture1Y->SetDefaultUnit("mm");
74  aperture1Y->SetDefaultValue(100.);
75  pAcc1->setJaw1Y(100.*mm);
76 
77  aperture2X=new G4UIcmdWithADoubleAndUnit("/accelerator/aperture2X", this);
78  aperture2X->SetDefaultUnit("mm");
79  aperture2X->SetDefaultValue(-100.);
80  pAcc1->setJaw2X(-100.*mm);
81 
82  aperture2Y=new G4UIcmdWithADoubleAndUnit("/accelerator/aperture2Y", this);
83  aperture2Y->SetDefaultUnit("mm");
84  aperture2Y->SetDefaultValue(-100.);
85  pAcc1->setJaw2Y(-100.*mm);
86 }
static constexpr double mm
Definition: G4SIunits.hh:115
void setJaw2Y(G4double val)
Definition: ML2Acc1.hh:75
void setJaw1X(G4double val)
Definition: ML2Acc1.hh:72
void setLeavesBx(G4double val)
Definition: ML2Acc1.hh:79
void setLeavesAx(G4double val)
Definition: ML2Acc1.hh:78
void setidEnergy(G4int val)
Definition: ML2Acc1.hh:77
void SetDefaultUnit(const char *defUnit)
void setJaw1Y(G4double val)
Definition: ML2Acc1.hh:74
void SetDefaultValue(G4int defVal)
void setJaw2X(G4double val)
Definition: ML2Acc1.hh:73

Here is the call graph for this function:

CML2Acc1Messenger::~CML2Acc1Messenger ( void  )

Definition at line 88 of file ML2Acc1Messenger.cc.

89 {
90  delete idEnergy;
91  delete aperture1X;
92  delete aperture2X;
93  delete aperture1Y;
94  delete aperture2Y;
95  delete leavesA;
96  delete leavesB;
97 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 98 of file ML2Acc1Messenger.cc.

99 {
100  if (cmd==aperture1X)
101  {
102  aperture1X->GetNewUnitValue(newValue);
103  pAcc1->setJaw1X(aperture1X->GetNewDoubleValue(newValue));
104  }
105 
106  if (cmd==aperture1Y)
107  {
108  aperture1Y->GetNewUnitValue(newValue);
109  pAcc1->setJaw1Y(aperture1Y->GetNewDoubleValue(newValue));
110  }
111 
112  if (cmd==aperture2X)
113  {
114  aperture2X->GetNewUnitValue(newValue);
115  pAcc1->setJaw2X(aperture2X->GetNewDoubleValue(newValue));
116  }
117  if (cmd==aperture2Y)
118  {
119  aperture2Y->GetNewUnitValue(newValue);
120  pAcc1->setJaw2Y(aperture2Y->GetNewDoubleValue(newValue));
121  }
122 
123  if (cmd==leavesA)
124  {pAcc1->setLeavesAx(leavesA->GetNewDoubleValue(newValue));}
125 
126  if (cmd==leavesB)
127  {pAcc1->setLeavesBx(leavesA->GetNewDoubleValue(newValue));}
128 
129 
130  if (cmd==idEnergy)
131  {pAcc1->setidEnergy(idEnergy->GetNewIntValue(newValue));}
132 }
void setJaw2Y(G4double val)
Definition: ML2Acc1.hh:75
static G4int GetNewIntValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
void setJaw1X(G4double val)
Definition: ML2Acc1.hh:72
void setLeavesBx(G4double val)
Definition: ML2Acc1.hh:79
void setLeavesAx(G4double val)
Definition: ML2Acc1.hh:78
void setidEnergy(G4int val)
Definition: ML2Acc1.hh:77
void setJaw1Y(G4double val)
Definition: ML2Acc1.hh:74
void setJaw2X(G4double val)
Definition: ML2Acc1.hh:73
static G4double GetNewUnitValue(const char *paramString)

Here is the call graph for this function:


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