Loading...
Searching...
No Matches
F03DetectorMessenger.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26/// \file field/field03/src/F03DetectorMessenger.cc
27/// \brief Implementation of the F03DetectorMessenger class
28//
29//
30//
31//
32//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34
36
38#include "G4UIcmdWithAString.hh"
39#include "G4UIcmdWithADoubleAndUnit.hh"
40#include "G4UIcmdWithoutParameter.hh"
41
42//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43
45 : fDetector(det)
46{
47 fDetDir = new G4UIdirectory("/calor/");
48 fDetDir->SetGuidance("F03 detector control.");
49
50 fAbsMaterCmd = new G4UIcmdWithAString("/calor/setAbsMat",this);
51 fAbsMaterCmd->SetGuidance("Select Material of the Absorber.");
52 fAbsMaterCmd->SetParameterName("choice",true);
53 fAbsMaterCmd->SetDefaultValue("Lead");
54 fAbsMaterCmd->AvailableForStates(G4State_Idle);
55 fAbsMaterCmd->SetToBeBroadcasted(false);
56
57 fWorldMaterCmd = new G4UIcmdWithAString("/calor/setWorldMat",this);
58 fWorldMaterCmd->SetGuidance("Select Material of the World.");
59 fWorldMaterCmd->SetParameterName("wchoice",true);
60 fWorldMaterCmd->SetDefaultValue("Air");
61 fWorldMaterCmd->AvailableForStates(G4State_Idle);
62 fWorldMaterCmd->SetToBeBroadcasted(false);
63
64 fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsThick",this);
65 fAbsThickCmd->SetGuidance("Set Thickness of the Absorber");
66 fAbsThickCmd->SetParameterName("SizeZ",false,false);
67 fAbsThickCmd->SetDefaultUnit("mm");
68 fAbsThickCmd->SetRange("SizeZ>0.");
69 fAbsThickCmd->AvailableForStates(G4State_Idle);
70 fAbsThickCmd->SetToBeBroadcasted(false);
71
72 fAbsRadCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsRad",this);
73 fAbsRadCmd->SetGuidance("Set radius of the Absorber");
74 fAbsRadCmd->SetParameterName("SizeR",false,false);
75 fAbsRadCmd->SetDefaultUnit("mm");
76 fAbsRadCmd->SetRange("SizeR>0.");
77 fAbsRadCmd->AvailableForStates(G4State_Idle);
78 fAbsRadCmd->SetToBeBroadcasted(false);
79
80 fAbsZposCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsZpos",this);
81 fAbsZposCmd->SetGuidance("Set Z pos. of the Absorber");
82 fAbsZposCmd->SetParameterName("Zpos",false,false);
83 fAbsZposCmd->SetDefaultUnit("mm");
84 fAbsZposCmd->AvailableForStates(G4State_Idle);
85 fAbsZposCmd->SetToBeBroadcasted(false);
86
87 fWorldZCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldZ",this);
88 fWorldZCmd->SetGuidance("Set Z size of the World");
89 fWorldZCmd->SetParameterName("WSizeZ",false,false);
90 fWorldZCmd->SetDefaultUnit("mm");
91 fWorldZCmd->SetRange("WSizeZ>0.");
92 fWorldZCmd->AvailableForStates(G4State_Idle);
93 fWorldZCmd->SetToBeBroadcasted(false);
94
95 fWorldRCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldR",this);
96 fWorldRCmd->SetGuidance("Set R size of the World");
97 fWorldRCmd->SetParameterName("WSizeR",false,false);
98 fWorldRCmd->SetDefaultUnit("mm");
99 fWorldRCmd->SetRange("WSizeR>0.");
100 fWorldRCmd->AvailableForStates(G4State_Idle);
101 fWorldRCmd->SetToBeBroadcasted(false);
102}
103
104//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
105
107{
108 delete fAbsMaterCmd;
109 delete fAbsThickCmd;
110 delete fAbsRadCmd;
111 delete fAbsZposCmd;
112 delete fWorldMaterCmd;
113 delete fWorldZCmd;
114 delete fWorldRCmd;
115 delete fDetDir;
116}
117
118//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119
121{
122 if( command == fAbsMaterCmd )
123 { fDetector->SetAbsorberMaterial(newValue);}
124
125 if( command == fWorldMaterCmd )
126 { fDetector->SetWorldMaterial(newValue);}
127
128 if( command == fAbsThickCmd )
129 {fDetector->SetAbsorberThickness(fAbsThickCmd->GetNewDoubleValue(newValue));}
130
131 if( command == fAbsRadCmd )
132 { fDetector->SetAbsorberRadius(fAbsRadCmd->GetNewDoubleValue(newValue));}
133
134 if( command == fAbsZposCmd )
135 { fDetector->SetAbsorberZpos(fAbsZposCmd->GetNewDoubleValue(newValue));}
136
137 if( command == fWorldZCmd )
138 { fDetector->SetWorldSizeZ(fWorldZCmd->GetNewDoubleValue(newValue));}
139
140 if( command == fWorldRCmd )
141 { fDetector->SetWorldSizeR(fWorldRCmd->GetNewDoubleValue(newValue));}
142}
143
144//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Definition of the F03DetectorConstruction class.
Definition of the F03DetectorMessenger class.
F03DetectorMessenger(F03DetectorConstruction *)
G4UIcmdWithAString * fWorldMaterCmd
G4UIcmdWithADoubleAndUnit * fWorldRCmd
G4UIcmdWithADoubleAndUnit * fAbsRadCmd
G4UIcmdWithADoubleAndUnit * fWorldZCmd
F03DetectorConstruction * fDetector
G4UIcmdWithAString * fAbsMaterCmd
void SetNewValue(G4UIcommand *, G4String) override
G4UIcmdWithADoubleAndUnit * fAbsThickCmd
G4UIcmdWithADoubleAndUnit * fAbsZposCmd

Applications | User Support | Publications | Collaboration