BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEmcDetectorMessenger Class Reference

#include <BesEmcDetectorMessenger.hh>

+ Inheritance diagram for BesEmcDetectorMessenger:

Public Member Functions

 BesEmcDetectorMessenger (BesEmcConstruction *, BesEmcGeometry *)
 
 ~BesEmcDetectorMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 
G4String GetCurrentValue (G4UIcommand *)
 

Detailed Description

Definition at line 27 of file BesEmcDetectorMessenger.hh.

Constructor & Destructor Documentation

◆ BesEmcDetectorMessenger()

BesEmcDetectorMessenger::BesEmcDetectorMessenger ( BesEmcConstruction BesDet,
BesEmcGeometry besEMCGeometry 
)

Definition at line 24 of file BesEmcDetectorMessenger.cc.

27:BesEmc(BesDet)
28{
29 fBesEmcGeometry=besEMCGeometry;
30
31 BesdetDir = new G4UIdirectory("/calor/");
32 BesdetDir->SetGuidance("Bes calorimeter detector control.");
33
34 verboseCmd = new G4UIcmdWithAnInteger("/calor/verbose",this);
35 verboseCmd->SetGuidance("Set Verbose level of calor management category.");
36 verboseCmd->SetGuidance(" 0 : Important information");
37 verboseCmd->SetGuidance(" 1 : Base information");
38 verboseCmd->SetGuidance(" 2 : More...");
39 verboseCmd->SetParameterName("level",true);
40 verboseCmd->SetRange("level>=0");
41 verboseCmd->SetDefaultValue(0);
42
43 CryMaterCmd = new G4UIcmdWithAString("/calor/setCryMat",this);
44 CryMaterCmd->SetGuidance("Select Material of the Crystal.");
45 CryMaterCmd->SetParameterName("choice",true,true);
46 // CryMaterCmd->AvailableForStates(Idle);
47
48 CasingMaterCmd = new G4UIcmdWithAString("/calor/setCasMat",this);
49 CasingMaterCmd->SetGuidance("Select Material of the Casing.");
50 CasingMaterCmd->SetParameterName("choice",true,true);
51 // CasingMaterCmd->AvailableForStates(Idle);
52
53 CasingThickCmd = new G4UIcmdWith3VectorAndUnit("/calor/setCasThick",this);
54 CasingThickCmd->SetGuidance("Set Thickness of the Casing");
55 CasingThickCmd->SetParameterName("TyvekThk","AlThk","MylarThk",true);
56 CasingThickCmd->SetRange("Size>=0.");
57 CasingThickCmd->SetUnitCategory("Length");
58 CasingThickCmd->SetDefaultValue(fBesEmcGeometry->GetCasingThickness()/mm);
59 CasingThickCmd->SetDefaultUnit("mm");
60 // CasingThickCmd->AvailableForStates(Idle);
61
62 SizeRminCmd = new G4UIcmdWithADoubleAndUnit("/calor/setSizeRmin",this);
63 SizeRminCmd->SetGuidance("Set Rmin size of the barrel calorimeter");
64 SizeRminCmd->SetParameterName("Size",true);
65 SizeRminCmd->SetRange("Size>0.");
66 SizeRminCmd->SetUnitCategory("Length");
67 SizeRminCmd->SetDefaultValue(fBesEmcGeometry->GetBSCRmin()/cm);
68 SizeRminCmd->SetDefaultUnit("cm");
69 // SizeRminCmd->AvailableForStates(Idle);
70
71 NbPhiCmd = new G4UIcmdWithAnInteger("/calor/setNbPhi",this);
72 NbPhiCmd->SetGuidance("Set number of crystals at phi direction.");
73 NbPhiCmd->SetParameterName("NbCrystals",false);
74 NbPhiCmd->SetRange("NbCrystals>0 && NbCrystals<=150");
75 // NbPhiCmd->AvailableForStates(Idle);
76
77 NbThetaCmd = new G4UIcmdWithAnInteger("/calor/setNbTheta",this);
78 NbThetaCmd->SetGuidance("Set number of crystals at theta direction.");
79 NbThetaCmd->SetParameterName("NbCrystals",false);
80 NbThetaCmd->SetRange("NbCrystals>0 && NbCrystals<=22");
81 // NbThetaCmd->AvailableForStates(Idle);
82
83 StartIDThetaCmd = new G4UIcmdWithAnInteger("/calor/setStartTheta",this);
84 StartIDThetaCmd->SetGuidance("Set ID of starting crystals at theta direction.");
85 StartIDThetaCmd->SetParameterName("IDCrystal",false);
86 StartIDThetaCmd->SetRange("IDCrystal>=0 && IDCrystal<22");
87 // StartIDThetaCmd->AvailableForStates(Idle);
88
89 LengthCmd = new G4UIcmdWithADoubleAndUnit("/calor/setCryLength",this);
90 LengthCmd->SetGuidance("Set Length of crystals of barrel calorimeter");
91 LengthCmd->SetParameterName("Size",true);
92 LengthCmd->SetRange("Size>0.");
93 LengthCmd->SetUnitCategory("Length");
94 LengthCmd->SetDefaultValue(fBesEmcGeometry->GetBSCCryLength()/cm);
95 LengthCmd->SetDefaultUnit("cm");
96 // LengthCmd->AvailableForStates(Idle);
97
98 UpdateCmd = new G4UIcmdWithoutParameter("/calor/update",this);
99 UpdateCmd->SetGuidance("Update calorimeter geometry.");
100 UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
101 UpdateCmd->SetGuidance("if you changed geometrical value(s).");
102 // UpdateCmd->AvailableForStates(Idle);
103
104 MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/calor/setField",this);
105 MagFieldCmd->SetGuidance("Define magnetic field.");
106 MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
107 MagFieldCmd->SetParameterName("Bz",true);
108 MagFieldCmd->SetRange("Bz>=0.");
109 MagFieldCmd->SetUnitCategory("Magnetic flux density");
110 MagFieldCmd->SetDefaultValue(BesEmc->GetMagField()/tesla);
111 MagFieldCmd->SetDefaultUnit("tesla");
112 // MagFieldCmd->AvailableForStates(Idle);
113}
G4double GetBSCCryLength()
G4double GetBSCRmin()
G4ThreeVector GetCasingThickness()

◆ ~BesEmcDetectorMessenger()

BesEmcDetectorMessenger::~BesEmcDetectorMessenger ( )

Definition at line 117 of file BesEmcDetectorMessenger.cc.

118{
119 delete verboseCmd;
120 delete LengthCmd;
121 delete NbPhiCmd; delete NbThetaCmd;
122 delete StartIDThetaCmd;
123 delete CryMaterCmd; delete CasingMaterCmd;
124 delete CasingThickCmd;
125 delete SizeRminCmd;
126 delete UpdateCmd;
127 delete MagFieldCmd;
128 delete BesdetDir;
129}

Member Function Documentation

◆ GetCurrentValue()

G4String BesEmcDetectorMessenger::GetCurrentValue ( G4UIcommand *  command)

Definition at line 173 of file BesEmcDetectorMessenger.cc.

174{
175 G4String cv;
176
177 if( command == verboseCmd )
178 { cv = verboseCmd->ConvertToString(BesEmc->GetVerboseLevel()); }
179
180 if( command == CryMaterCmd )
181 { cv = BesEmc->GetCrystalMaterial()->GetName(); }
182
183 if( command == CasingMaterCmd )
184 { cv = BesEmc->GetCasingMaterial()->GetName(); }
185
186 return cv;
187}
G4Material * GetCasingMaterial()
G4Material * GetCrystalMaterial()

◆ SetNewValue()

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

Definition at line 133 of file BesEmcDetectorMessenger.cc.

134{
135 if( command == verboseCmd )
136 {
137 BesEmc->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue));
138 }
139
140 if( command == CryMaterCmd )
141 { BesEmc->SetCrystalMaterial(newValue);}
142
143 if( command == CasingMaterCmd )
144 { BesEmc->SetCasingMaterial(newValue);}
145
146 if( command == CasingThickCmd )
147 { BesEmc->SetCasingThickness(CasingThickCmd->GetNew3VectorValue(newValue));}
148
149 if( command == SizeRminCmd )
150 { BesEmc->SetBSCRmin(SizeRminCmd->GetNewDoubleValue(newValue));}
151
152 if( command == NbPhiCmd )
153 { BesEmc->SetBSCNbPhi(NbPhiCmd->GetNewIntValue(newValue));}
154
155 if( command == NbThetaCmd )
156 { BesEmc->SetBSCNbTheta(NbThetaCmd->GetNewIntValue(newValue));}
157
158 if( command == StartIDThetaCmd )
159 { BesEmc->SetStartIDTheta(StartIDThetaCmd->GetNewIntValue(newValue));}
160
161 if( command == LengthCmd )
162 { BesEmc->SetBSCCrystalLength(LengthCmd->GetNewDoubleValue(newValue));}
163
164 if( command == UpdateCmd )
165 { BesEmc->UpdateGeometry(); }
166
167 if( command == MagFieldCmd )
168 { BesEmc->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
169}
void SetMagField(G4double)
void SetCasingThickness(G4ThreeVector)
void SetBSCCrystalLength(G4double)
void SetCrystalMaterial(G4String)
void SetCasingMaterial(G4String)
void SetVerboseLevel(G4int val)

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