QwGeant4
QweakSimBeamLineMessenger.cc
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 //
7 /**
8 
9  \file QweakSimBeamLineMessenger.cc
10  $Revision: 1.2 $
11  $Date: 2011/10/19 12:44 $
12  \author Peiqing Wang
13 
14 */
15 //=============================================================================
16 
17 
18 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
19 
21 
22 // user includes
23 #include "QweakSimBeamLine.hh"
25 
26 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
27 
29 :myBeamLine(myTar)
30 {
31  // BeamLine related
32  BeamLineDir = new G4UIdirectory("/BeamLine/");
33  BeamLineDir -> SetGuidance("beamline control.");
34 
35  BeamLineZPosCmd = new G4UIcmdWithADoubleAndUnit("/BeamLine/SetCenterPositionInZ",this);
36  BeamLineZPosCmd->SetGuidance("Set the Z position of the target center");
37  BeamLineZPosCmd->SetParameterName("Size",true);
38  //TargZPosCmd->SetRange("Size>=0.");
39  BeamLineZPosCmd->SetUnitCategory("Length");
40  BeamLineZPosCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
41 
42  BeamLineMatCmd = new G4UIcmdWithAString("/BeamLine/SetBeamLineMaterial",this);
43  BeamLineMatCmd->SetGuidance("Select Material of the BeamLine.");
44  BeamLineMatCmd->SetParameterName("choice",false);
45  BeamLineMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
46 
47 }
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50 
52 {
53  delete BeamLineZPosCmd;
54  delete BeamLineMatCmd;
55  delete BeamLineDir;
56 }
57 
58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59 
60 void QweakSimBeamLineMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
61 {
62  G4cout << "#### Calling QweakSimBeamLineMessenger::SetNewValue() " << newValue << G4endl;
63 
64  if( command == BeamLineZPosCmd )
65  {
66  G4cout << "#### Messenger: Setting BeamLine Z position to " << newValue << G4endl;
67 
68  myBeamLine->SetBeamLineCenterPositionInZ(BeamLineZPosCmd->GetNewDoubleValue(newValue));
69  }
70 
71  if( command == BeamLineMatCmd )
72  {
73  G4cout << "#### Messenger: Setting BeamLine Material to " << newValue << G4endl;
74 
76  }
77 
78 
79  G4cout << "#### Leaving QweakSimBeamLineMessenger::SetNewValue() " << newValue << G4endl;
80 }
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83 
void SetBeamLineCenterPositionInZ(G4double)
QweakSimBeamLineMessenger(QweakSimBeamLine *)
void SetNewValue(G4UIcommand *, G4String)
Definition of the BeamLine.
G4UIcmdWithADoubleAndUnit * BeamLineZPosCmd
void SetBeamLineMaterial(G4String)