Geant4  10.02.p03
XrayFluoMercuryDetectorMessenger Class Reference

#include <XrayFluoMercuryDetectorMessenger.hh>

Inheritance diagram for XrayFluoMercuryDetectorMessenger:
Collaboration diagram for XrayFluoMercuryDetectorMessenger:

Public Member Functions

 XrayFluoMercuryDetectorMessenger (XrayFluoMercuryDetectorConstruction *)
 
 ~XrayFluoMercuryDetectorMessenger ()
 
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

XrayFluoMercuryDetectorConstructionDetector
 
G4UIdirectorydetDir
 
G4UIcmdWithoutParameterUpdateCmd
 
G4UIcmdWithAStringsampleCmd
 
G4UIcmdWithAStringdetectorCmd
 
G4UIcmdWithADoubleAndUnitlatitudeAngleCmd
 
G4UIcmdWithADoubleAndUnitorbitHeightCmd
 

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 XrayFluoMercuryDetectorMessenger.hh.

Constructor & Destructor Documentation

◆ XrayFluoMercuryDetectorMessenger()

XrayFluoMercuryDetectorMessenger::XrayFluoMercuryDetectorMessenger ( XrayFluoMercuryDetectorConstruction Det)

Definition at line 51 of file XrayFluoMercuryDetectorMessenger.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/mercuryMaterial",this);
65  sampleCmd->SetGuidance("select a diferent material for the mercury");
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  latitudeAngleCmd = new G4UIcmdWithADoubleAndUnit( "/apparate/latitude",this );
79  latitudeAngleCmd->SetGuidance( "Set latitude angle of the spacecraft" );
80  latitudeAngleCmd->SetGuidance( "After this, /apparate/update must be executed before BeamOn" );
81  latitudeAngleCmd->SetGuidance( "Default: 45 deg " );
82  latitudeAngleCmd->SetParameterName( "Latitude Angle", true, true );
86 
87  orbitHeightCmd = new G4UIcmdWithADoubleAndUnit( "/apparate/orbitHeight",this );
88  orbitHeightCmd->SetGuidance( "Set height of the spacecraft above Mercuey Surface" );
89  orbitHeightCmd->SetGuidance( "After this, /apparate/update must be executed before BeamOn" );
90  orbitHeightCmd->SetGuidance( "Default: 400 km " );
91  orbitHeightCmd->SetParameterName( "Spacecraft Altitude", true, true );
93  orbitHeightCmd->SetUnitCategory( "Length" );
95 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCategory(const char *unitCategory)
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)
XrayFluoMercuryDetectorConstruction * Detector
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Here is the call graph for this function:

◆ ~XrayFluoMercuryDetectorMessenger()

XrayFluoMercuryDetectorMessenger::~XrayFluoMercuryDetectorMessenger ( )

Definition at line 99 of file XrayFluoMercuryDetectorMessenger.cc.

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

Member Function Documentation

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 107 of file XrayFluoMercuryDetectorMessenger.cc.

108 {
109  if( command == UpdateCmd )
110  {
111  //This triggers a full re-build of the geometry. The method in the
112  //geometry will take care of that.
114  return;
115  }
116  else if ( command == sampleCmd )
117  { Detector->SetMercuryMaterial(newValue);}
118 
119  else if ( command == detectorCmd )
120  { Detector->SetDetectorType(newValue);}
121 
122  else if ( command == latitudeAngleCmd )
123  {
124  G4double newAngle = latitudeAngleCmd->GetNewDoubleValue(newValue);
125  Detector->SetLatitude(newAngle);
126  }
127 
128  else if ( command == orbitHeightCmd )
129  {
130  G4double newAngle = orbitHeightCmd->GetNewDoubleValue(newValue);
131  Detector->SetOribitHeight(newAngle);
132  }
133  //Notify the run manager that the geometry has been modified
135 
136 }
void GeometryHasBeenModified(G4bool prop=true)
static G4double GetNewDoubleValue(const char *paramString)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
XrayFluoMercuryDetectorConstruction * Detector
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

Member Data Documentation

◆ detDir

G4UIdirectory* XrayFluoMercuryDetectorMessenger::detDir
private

Definition at line 67 of file XrayFluoMercuryDetectorMessenger.hh.

◆ Detector

XrayFluoMercuryDetectorConstruction* XrayFluoMercuryDetectorMessenger::Detector
private

Definition at line 66 of file XrayFluoMercuryDetectorMessenger.hh.

◆ detectorCmd

G4UIcmdWithAString* XrayFluoMercuryDetectorMessenger::detectorCmd
private

Definition at line 71 of file XrayFluoMercuryDetectorMessenger.hh.

◆ latitudeAngleCmd

G4UIcmdWithADoubleAndUnit* XrayFluoMercuryDetectorMessenger::latitudeAngleCmd
private

Definition at line 73 of file XrayFluoMercuryDetectorMessenger.hh.

◆ orbitHeightCmd

G4UIcmdWithADoubleAndUnit* XrayFluoMercuryDetectorMessenger::orbitHeightCmd
private

Definition at line 74 of file XrayFluoMercuryDetectorMessenger.hh.

◆ sampleCmd

G4UIcmdWithAString* XrayFluoMercuryDetectorMessenger::sampleCmd
private

Definition at line 70 of file XrayFluoMercuryDetectorMessenger.hh.

◆ UpdateCmd

G4UIcmdWithoutParameter* XrayFluoMercuryDetectorMessenger::UpdateCmd
private

Definition at line 69 of file XrayFluoMercuryDetectorMessenger.hh.


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