DetectorMessenger Class Reference

#include <DetectorMessenger.hh>

Inheritance diagram for DetectorMessenger:

Inheritance graph
[legend]
Collaboration diagram for DetectorMessenger:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 DetectorMessenger (DetectorConstruction *)
 ~DetectorMessenger ()
void SetNewValue (G4UIcommand *, G4String)

Private Attributes

DetectorConstructionm_detector
G4UIdirectory * m_detDir
G4UIcmdWithAString * m_materialCmd
G4UIcmdWithADoubleAndUnit * m_thicknessCmd
G4UIcmdWithADoubleAndUnit * m_radiusCmd
G4UIcmdWithADoubleAndUnit * m_lengthCmd
G4UIcmdWithADoubleAndUnit * m_magFieldCmd
G4UIcmdWithADoubleAndUnit * m_stepMaxCmd
G4UIcmdWithoutParameter * m_updateCmd


Detailed Description

Definition at line 21 of file DetectorMessenger.hh.


Constructor & Destructor Documentation

DetectorMessenger::DetectorMessenger ( DetectorConstruction Det  ) 

Definition at line 16 of file DetectorMessenger.cc.

00017 :m_detector(Det)
00018 { 
00019   m_detDir = new G4UIdirectory("/tutorial/det/");
00020   m_detDir->SetGuidance("detector construction commands");
00021 
00022   m_materialCmd = new G4UIcmdWithAString ("/tutorial/det/spacecraftMaterial", this);
00023   m_materialCmd->SetGuidance("Select spacecraft material");
00024   m_materialCmd->SetParameterName("spacecraftMaterial",false);
00025 
00026   m_thicknessCmd = new G4UIcmdWithADoubleAndUnit("/tutorial/det/spacecraftThickness",this);
00027   m_thicknessCmd->SetGuidance("Select spacecraft thickness");
00028   m_thicknessCmd->SetParameterName("spacecraftThickness",false);
00029   m_thicknessCmd->SetRange("spacecraftThickness>0.");
00030   m_thicknessCmd->SetUnitCategory("Length");
00031   
00032   m_radiusCmd = new G4UIcmdWithADoubleAndUnit ("/tutorial/det/cabinRadius", this);
00033   m_radiusCmd->SetGuidance("Select spacecraft radius");
00034   m_radiusCmd->SetParameterName("cabinRadius",false);
00035   m_radiusCmd->SetUnitCategory("Length");
00036 
00037   m_lengthCmd = new G4UIcmdWithADoubleAndUnit ("/tutorial/det/cabinLength", this);
00038   m_lengthCmd->SetGuidance("Select spacecraft length");
00039   m_lengthCmd->SetParameterName("spacecraftLength",false);
00040   m_lengthCmd->SetRange("cabinLength>0.&&cabinLength<20*m");
00041   m_lengthCmd->SetUnitCategory("Length");
00042       
00043   m_magFieldCmd = new G4UIcmdWithADoubleAndUnit("/tutorial/det/setField",this);  
00044   m_magFieldCmd->SetGuidance("Define magnetic field.");
00045   m_magFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
00046   m_magFieldCmd->SetParameterName("Bz",false);
00047   m_magFieldCmd->SetUnitCategory("Magnetic flux density");
00048   m_magFieldCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
00049       
00050   m_stepMaxCmd = new G4UIcmdWithADoubleAndUnit("/tutorial/det/stepMax",this);  
00051   m_stepMaxCmd->SetGuidance("Define a step max");
00052   m_stepMaxCmd->SetParameterName("stepMax",false);
00053   m_stepMaxCmd->SetUnitCategory("Length");
00054   m_stepMaxCmd->AvailableForStates(G4State_Idle);
00055        
00056   m_updateCmd = new G4UIcmdWithoutParameter("/tutorial/det/update",this);
00057   m_updateCmd->SetGuidance("force to recompute geometry.");
00058   m_updateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
00059   m_updateCmd->SetGuidance("if you changed geometrical value(s).");
00060   m_updateCmd->AvailableForStates(G4State_Idle);
00061 }

DetectorMessenger::~DetectorMessenger (  ) 

Definition at line 65 of file DetectorMessenger.cc.

00066 {
00067   delete m_materialCmd;
00068   delete m_thicknessCmd;  
00069   delete m_radiusCmd;
00070   delete m_lengthCmd;
00071   delete m_magFieldCmd;
00072   delete m_stepMaxCmd;    
00073   delete m_updateCmd;
00074   
00075   delete m_detDir;  
00076 }


Member Function Documentation

void DetectorMessenger::SetNewValue ( G4UIcommand *  command,
G4String  newValue 
)

Definition at line 80 of file DetectorMessenger.cc.

00081 {
00082   if( command == m_materialCmd )
00083    { m_detector->SetSpacecraftMaterial(newValue);}
00084      
00085   if( command == m_thicknessCmd )
00086    { m_detector->SetSpacecraftThickness(m_thicknessCmd->GetNewDoubleValue(newValue));} 
00087             
00088   if( command == m_radiusCmd )
00089    { m_detector->SetCabinRadius(m_radiusCmd->GetNewDoubleValue(newValue));}
00090    
00091   if( command == m_lengthCmd )
00092    { m_detector->SetCabinLength(m_lengthCmd->GetNewDoubleValue(newValue));}
00093    
00094   if( command == m_magFieldCmd )
00095    { m_detector->SetMagField(m_magFieldCmd->GetNewDoubleValue(newValue));}
00096    
00097   if( command == m_stepMaxCmd )
00098    { m_detector->SetMaxStep(m_stepMaxCmd->GetNewDoubleValue(newValue));}
00099                     
00100   if( command == m_updateCmd )
00101    { m_detector->UpdateGeometry();}
00102 }


Member Data Documentation

Definition at line 32 of file DetectorMessenger.hh.

Referenced by SetNewValue().

G4UIdirectory* DetectorMessenger::m_detDir [private]

Definition at line 34 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), and ~DetectorMessenger().

G4UIcmdWithAString* DetectorMessenger::m_materialCmd [private]

Definition at line 36 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), SetNewValue(), and ~DetectorMessenger().

G4UIcmdWithADoubleAndUnit* DetectorMessenger::m_thicknessCmd [private]

Definition at line 37 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), SetNewValue(), and ~DetectorMessenger().

G4UIcmdWithADoubleAndUnit* DetectorMessenger::m_radiusCmd [private]

Definition at line 38 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), SetNewValue(), and ~DetectorMessenger().

G4UIcmdWithADoubleAndUnit* DetectorMessenger::m_lengthCmd [private]

Definition at line 39 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), SetNewValue(), and ~DetectorMessenger().

G4UIcmdWithADoubleAndUnit* DetectorMessenger::m_magFieldCmd [private]

Definition at line 40 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), SetNewValue(), and ~DetectorMessenger().

G4UIcmdWithADoubleAndUnit* DetectorMessenger::m_stepMaxCmd [private]

Definition at line 41 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), SetNewValue(), and ~DetectorMessenger().

G4UIcmdWithoutParameter* DetectorMessenger::m_updateCmd [private]

Definition at line 43 of file DetectorMessenger.hh.

Referenced by DetectorMessenger(), SetNewValue(), and ~DetectorMessenger().


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

Generated on Fri Nov 21 10:21:35 2008 for jour4d by  doxygen 1.5.7.1