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

#include <XrayFluoDetectorMessenger.hh>

Inheritance diagram for XrayFluoDetectorMessenger:
G4UImessenger

Public Member Functions

 XrayFluoDetectorMessenger (XrayFluoDetectorConstruction *)
 
 ~XrayFluoDetectorMessenger ()
 
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 54 of file XrayFluoDetectorMessenger.hh.

Constructor & Destructor Documentation

XrayFluoDetectorMessenger::XrayFluoDetectorMessenger ( XrayFluoDetectorConstruction Det)

Definition at line 48 of file XrayFluoDetectorMessenger.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().

49 :Detector(Det)
50 {
51  detDir = new G4UIdirectory("/apparate/");
52  detDir->SetGuidance("detector control.");
53 
54  UpdateCmd = new G4UIcmdWithoutParameter("/apparate/update",this);
55  UpdateCmd->SetGuidance("Update apparate geometry.");
56  UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
57  UpdateCmd->SetGuidance("if you changed geometrical value(s): /apparate/GrainDiameter and /apparate/sampleGranularity");
58 
59  UpdateCmd->AvailableForStates(G4State_Idle);
60 
61  sampleCmd = new G4UIcmdWithAString("/apparate/sampleMaterial",this);
62  sampleCmd->SetGuidance("select a diferent material for the sample: materials can be: Dolorite, Anorthosite, Mars1, HawaiianWD, HawaiianRF, IceBasalt, IcelandicWD, IcelandicRF, Gabbro, GabbroWD, GabbroRF, HPGe OR choosen from Nist database (see /material/nist/listMaterials for details");
63  sampleCmd->SetParameterName("material",true);
64  sampleCmd->SetDefaultValue("mars1");
65  sampleCmd->AvailableForStates(G4State_Idle);
66 
67  detectorCmd = new G4UIcmdWithAString("/apparate/detector",this);
68  detectorCmd->SetGuidance("select a diferent detectorType");
69  detectorCmd->SetParameterName("detector",true);
70  detectorCmd->SetDefaultValue("sili");
71  detectorCmd->SetCandidates("sili hpge");
72  detectorCmd->AvailableForStates(G4State_Idle);
73 
74  grainDiaCmd = new G4UIcmdWithADoubleAndUnit( "/apparate/GrainDiameter",this );
75  grainDiaCmd->SetGuidance( "Set diameter of grains" );
76  grainDiaCmd->SetGuidance( "After this, /apparate/update must be executed before BeamOn" );
77  grainDiaCmd->SetGuidance( "Default: 0.5 mm " );
78  grainDiaCmd->SetParameterName( "Grain Diameter", true, true );
79  grainDiaCmd->SetDefaultUnit( "mm" );
80  grainDiaCmd->SetUnitCategory( "Length" );
81  grainDiaCmd->AvailableForStates(G4State_Idle);
82 
83  granularityFlagCmd= new G4UIcmdWithABool("/apparate/sampleGranularity",this);
84  granularityFlagCmd->SetGuidance("Set if sample granularity is present");
85  granularityFlagCmd->SetGuidance( "After this, /apparate/update must be executed before BeamOn" );
86  granularityFlagCmd->SetParameterName("Granularity Flag",true);
87  granularityFlagCmd->SetDefaultValue(false);
88  granularityFlagCmd->AvailableForStates(G4State_Idle);
89 
90  OhmicPosThicknessCmd = new G4UIcmdWithADoubleAndUnit( "/apparate/ohmicPosThickness",this );
91  OhmicPosThicknessCmd->SetGuidance( "Changes thickness of the detector anode" );
92  OhmicPosThicknessCmd->SetGuidance( "After this, /apparate/update must be executed before BeamOn" );
93  OhmicPosThicknessCmd->SetGuidance( "Default: 0.005 mm " );
94  OhmicPosThicknessCmd->SetParameterName( "OhmicPos Thickness", true, true );
95  OhmicPosThicknessCmd->SetDefaultUnit( "mm" );
96  OhmicPosThicknessCmd->SetUnitCategory( "Length" );
97  OhmicPosThicknessCmd->AvailableForStates(G4State_Idle);
98 }
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)
XrayFluoDetectorMessenger::~XrayFluoDetectorMessenger ( )

Definition at line 102 of file XrayFluoDetectorMessenger.cc.

103 {
104  delete UpdateCmd;
105  delete detDir;
106 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 110 of file XrayFluoDetectorMessenger.cc.

References XrayFluoDetectorConstruction::DeleteGrainObjects(), G4UIcmdWithABool::GetNewBoolValue(), G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), XrayFluoDetectorConstruction::SetDetectorType(), XrayFluoDetectorConstruction::SetGrainDia(), XrayFluoDetectorConstruction::SetOhmicPosThickness(), XrayFluoDetectorConstruction::SetSampleGranularity(), XrayFluoDetectorConstruction::SetSampleMaterial(), and XrayFluoDetectorConstruction::UpdateGeometry().

111 {
112  if( command == UpdateCmd )
113  { Detector->UpdateGeometry(); }
114 
115  else if ( command == sampleCmd )
116  { Detector->SetSampleMaterial(newValue);}
117 
118  else if ( command == detectorCmd )
119  { Detector->SetDetectorType(newValue);}
120 
121  else if ( command == grainDiaCmd )
122  {
123  G4double newSize = grainDiaCmd->GetNewDoubleValue(newValue);
124  Detector->SetGrainDia(newSize);
125  }
126 
127  else if ( command == granularityFlagCmd )
128  {
129  Detector->DeleteGrainObjects();
130  G4bool newGranFlag = granularityFlagCmd->GetNewBoolValue(newValue);
131  Detector->SetSampleGranularity(newGranFlag);
132  }
133  else if ( command == OhmicPosThicknessCmd )
134  {
135  G4double newSize = OhmicPosThicknessCmd->GetNewDoubleValue(newValue);
136  Detector->SetOhmicPosThickness(newSize);
137  }
138 }
static G4double GetNewDoubleValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
void SetSampleMaterial(G4String newMaterial)
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
void SetSampleGranularity(G4bool granularity)

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