Geant4  10.02.p03
XrayFluoPlaneDetectorMessenger Class Reference

#include <XrayFluoPlaneDetectorMessenger.hh>

Inheritance diagram for XrayFluoPlaneDetectorMessenger:
Collaboration diagram for XrayFluoPlaneDetectorMessenger:

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
 
G4bool CommandsShouldBeInMaster () const
 

Private Attributes

XrayFluoPlaneDetectorConstructionDetector
 
G4UIdirectorydetDir
 
G4UIcmdWithoutParameterUpdateCmd
 
G4UIcmdWithAStringsampleCmd
 
G4UIcmdWithAStringdetectorCmd
 
G4UIcmdWithABoolgranularityFlagCmd
 
G4UIcmdWithADoubleAndUnitgrainDiaCmd
 

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 56 of file XrayFluoPlaneDetectorMessenger.hh.

Constructor & Destructor Documentation

◆ XrayFluoPlaneDetectorMessenger()

XrayFluoPlaneDetectorMessenger::XrayFluoPlaneDetectorMessenger ( XrayFluoPlaneDetectorConstruction Det)

Definition at line 51 of file XrayFluoPlaneDetectorMessenger.cc.

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

◆ ~XrayFluoPlaneDetectorMessenger()

XrayFluoPlaneDetectorMessenger::~XrayFluoPlaneDetectorMessenger ( )

Definition at line 98 of file XrayFluoPlaneDetectorMessenger.cc.

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

Member Function Documentation

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 106 of file XrayFluoPlaneDetectorMessenger.cc.

107 {
108  if( command == UpdateCmd )
109  {
110  //This triggers a full re-build of the geometry. The method in the
111  //geometry will take care of that.
113  return;
114  }
115  else if ( command == sampleCmd )
116  {
117  Detector->SetPlaneMaterial(newValue);
118  }
119  else if ( command == detectorCmd )
120  {
121  Detector->SetDetectorType(newValue);
122  }
123  else if ( command == grainDiaCmd )
124  {
125  G4double newSize = grainDiaCmd->GetNewDoubleValue(newValue);
126  Detector->SetGrainDia(newSize);
127  }
128  else if ( command == granularityFlagCmd )
129  {
131  G4bool newGranFlag = granularityFlagCmd->GetNewBoolValue(newValue);
132  Detector->SetPlaneGranularity(newGranFlag);
133  }
134  //Notify the run manager that the geometry has been modified
136 
137 }
void GeometryHasBeenModified(G4bool prop=true)
static G4double GetNewDoubleValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
bool G4bool
Definition: G4Types.hh:79
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
XrayFluoPlaneDetectorConstruction * Detector
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

Member Data Documentation

◆ detDir

G4UIdirectory* XrayFluoPlaneDetectorMessenger::detDir
private

Definition at line 67 of file XrayFluoPlaneDetectorMessenger.hh.

◆ Detector

XrayFluoPlaneDetectorConstruction* XrayFluoPlaneDetectorMessenger::Detector
private

Definition at line 66 of file XrayFluoPlaneDetectorMessenger.hh.

◆ detectorCmd

G4UIcmdWithAString* XrayFluoPlaneDetectorMessenger::detectorCmd
private

Definition at line 71 of file XrayFluoPlaneDetectorMessenger.hh.

◆ grainDiaCmd

G4UIcmdWithADoubleAndUnit* XrayFluoPlaneDetectorMessenger::grainDiaCmd
private

Definition at line 73 of file XrayFluoPlaneDetectorMessenger.hh.

◆ granularityFlagCmd

G4UIcmdWithABool* XrayFluoPlaneDetectorMessenger::granularityFlagCmd
private

Definition at line 72 of file XrayFluoPlaneDetectorMessenger.hh.

◆ sampleCmd

G4UIcmdWithAString* XrayFluoPlaneDetectorMessenger::sampleCmd
private

Definition at line 70 of file XrayFluoPlaneDetectorMessenger.hh.

◆ UpdateCmd

G4UIcmdWithoutParameter* XrayFluoPlaneDetectorMessenger::UpdateCmd
private

Definition at line 69 of file XrayFluoPlaneDetectorMessenger.hh.


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