Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
XrayFluoPlaneDetectorMessenger Class Reference

#include <XrayFluoPlaneDetectorMessenger.hh>

Inheritance diagram for XrayFluoPlaneDetectorMessenger:
G4UImessenger

Public Member Functions

 XrayFluoPlaneDetectorMessenger (XrayFluoPlaneDetectorConstruction *)
 
 ~XrayFluoPlaneDetectorMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 
- 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
 

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
 

Detailed Description

Definition at line 56 of file XrayFluoPlaneDetectorMessenger.hh.

Constructor & Destructor Documentation

XrayFluoPlaneDetectorMessenger::XrayFluoPlaneDetectorMessenger ( XrayFluoPlaneDetectorConstruction Det)

Definition at line 50 of file XrayFluoPlaneDetectorMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4UIcmdWithAString::SetCandidates(), G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), G4UIcmdWithAString::SetDefaultValue(), G4UIcmdWithABool::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithABool::SetParameterName(), G4UIcmdWithADoubleAndUnit::SetParameterName(), and G4UIcmdWithADoubleAndUnit::SetUnitCategory().

51 :Detector(Det)
52 {
53  detDir = new G4UIdirectory("/apparate/");
54  detDir->SetGuidance("detector control.");
55 
56  UpdateCmd = new G4UIcmdWithoutParameter("/apparate/update",this);
57  UpdateCmd->SetGuidance("Update apparate geometry.");
58  UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
59  UpdateCmd->SetGuidance("if you changed geometrical value(s): /apparate/GrainDiameter and /apparate/sampleGranularity");
60 
61  UpdateCmd->AvailableForStates(G4State_Idle);
62 
63  sampleCmd = new G4UIcmdWithAString("/apparate/planeMaterial",this);
64  sampleCmd->SetGuidance("select a diferent material for the plane");
65  sampleCmd->SetParameterName("material",true);
66  sampleCmd->SetDefaultValue("mars1");
67  sampleCmd->SetCandidates("Dolorite Anorthosite Mars1 IceBasalt");
68  sampleCmd->AvailableForStates(G4State_Idle);
69 
70  detectorCmd = new G4UIcmdWithAString("/apparate/detector",this);
71  detectorCmd->SetGuidance("select a diferent detectorType");
72  detectorCmd->SetParameterName("detector",true);
73  detectorCmd->SetDefaultValue("sili");
74  detectorCmd->SetCandidates("sili hpge");
75  detectorCmd->AvailableForStates(G4State_Idle);
76 
77  grainDiaCmd = new G4UIcmdWithADoubleAndUnit( "/apparate/GrainDiameter",this );
78  grainDiaCmd->SetGuidance( "Set diameter of grains" );
79  grainDiaCmd->SetGuidance( "After this, /apparate/update must be executed before BeamOn" );
80  grainDiaCmd->SetGuidance( "Default: 0.5 mm " );
81  grainDiaCmd->SetParameterName( "Grain Diameter", true, true );
82  grainDiaCmd->SetDefaultUnit( "mm" );
83  grainDiaCmd->SetUnitCategory( "Length" );
84  grainDiaCmd->AvailableForStates(G4State_Idle);
85 
86  granularityFlagCmd= new G4UIcmdWithABool("/apparate/sampleGranularity",this);
87  granularityFlagCmd->SetGuidance("Set if sample granularity is present");
88  granularityFlagCmd->SetGuidance( "After this, /apparate/update must be executed before BeamOn" );
89  granularityFlagCmd->SetParameterName("Granularity Flag",true);
90  granularityFlagCmd->SetDefaultValue(false);
91  granularityFlagCmd->AvailableForStates(G4State_Idle);
92 
93 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCategory(const char *unitCategory)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
void SetDefaultValue(const char *defVal)
void SetDefaultUnit(const char *defUnit)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
XrayFluoPlaneDetectorMessenger::~XrayFluoPlaneDetectorMessenger ( )

Definition at line 97 of file XrayFluoPlaneDetectorMessenger.cc.

98 {
99  delete UpdateCmd;
100  delete detDir;
101 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 105 of file XrayFluoPlaneDetectorMessenger.cc.

References XrayFluoPlaneDetectorConstruction::DeleteGrainObjects(), G4UIcmdWithABool::GetNewBoolValue(), G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), XrayFluoPlaneDetectorConstruction::SetDetectorType(), XrayFluoPlaneDetectorConstruction::SetGrainDia(), XrayFluoPlaneDetectorConstruction::SetPlaneGranularity(), XrayFluoPlaneDetectorConstruction::SetPlaneMaterial(), and XrayFluoPlaneDetectorConstruction::UpdateGeometry().

106 {
107  if( command == UpdateCmd )
108  { Detector->UpdateGeometry(); }
109 
110  else if ( command == sampleCmd )
111  { Detector->SetPlaneMaterial(newValue);}
112 
113  else if ( command == detectorCmd )
114  { Detector->SetDetectorType(newValue);}
115 
116  else if ( command == grainDiaCmd )
117  {
118  G4double newSize = grainDiaCmd->GetNewDoubleValue(newValue);
119  Detector->SetGrainDia(newSize);
120  }
121 
122  else if ( command == granularityFlagCmd )
123  {
124  Detector->DeleteGrainObjects();
125  G4bool newGranFlag = granularityFlagCmd->GetNewBoolValue(newValue);
126  Detector->SetPlaneGranularity(newGranFlag);
127  }
128 
129 }
static G4double GetNewDoubleValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76

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