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

#include <XrayFluoDetectorMessenger.hh>

Inheritance diagram for XrayFluoDetectorMessenger:
Collaboration diagram for XrayFluoDetectorMessenger:

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
 
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 54 of file XrayFluoDetectorMessenger.hh.

Constructor & Destructor Documentation

XrayFluoDetectorMessenger::XrayFluoDetectorMessenger ( XrayFluoDetectorConstruction Det)

Definition at line 49 of file XrayFluoDetectorMessenger.cc.

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

Here is the call graph for this function:

XrayFluoDetectorMessenger::~XrayFluoDetectorMessenger ( )

Definition at line 103 of file XrayFluoDetectorMessenger.cc.

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

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 111 of file XrayFluoDetectorMessenger.cc.

112 {
113  if( command == UpdateCmd )
114  {
115  //This triggers a full re-build of the geometry. The method in the
116  //geometry will take care of that.
117  Detector->UpdateGeometry();
118  return;
119  }
120  else if ( command == sampleCmd )
121  {
122  Detector->SetSampleMaterial(newValue);
123  }
124 
125  else if ( command == detectorCmd )
126  {
127  Detector->SetDetectorType(newValue);
128  }
129  else if ( command == grainDiaCmd )
130  {
131  G4double newSize = grainDiaCmd->GetNewDoubleValue(newValue);
132  Detector->SetGrainDia(newSize);
133  }
134 
135  else if ( command == granularityFlagCmd )
136  {
137  Detector->DeleteGrainObjects();
138  G4bool newGranFlag = granularityFlagCmd->GetNewBoolValue(newValue);
139  Detector->SetSampleGranularity(newGranFlag);
140  }
141  else if ( command == OhmicPosThicknessCmd )
142  {
143  G4double newSize = OhmicPosThicknessCmd->GetNewDoubleValue(newValue);
144  Detector->SetOhmicPosThickness(newSize);
145  }
146  //Notify the run manager that the geometry has been modified
148 }
void GeometryHasBeenModified(G4bool prop=true)
static G4double GetNewDoubleValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
void SetSampleMaterial(G4String newMaterial)
bool G4bool
Definition: G4Types.hh:79
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
double G4double
Definition: G4Types.hh:76
void SetSampleGranularity(G4bool granularity)

Here is the call graph for this function:


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