27 fBesEmcGeometry = besEMCGeometry;
29 BesdetDir =
new G4UIdirectory(
"/calor/" );
30 BesdetDir->SetGuidance(
"Bes calorimeter detector control." );
32 verboseCmd =
new G4UIcmdWithAnInteger(
"/calor/verbose",
this );
33 verboseCmd->SetGuidance(
"Set Verbose level of calor management category." );
34 verboseCmd->SetGuidance(
" 0 : Important information" );
35 verboseCmd->SetGuidance(
" 1 : Base information" );
36 verboseCmd->SetGuidance(
" 2 : More..." );
37 verboseCmd->SetParameterName(
"level",
true );
38 verboseCmd->SetRange(
"level>=0" );
39 verboseCmd->SetDefaultValue( 0 );
41 CryMaterCmd =
new G4UIcmdWithAString(
"/calor/setCryMat",
this );
42 CryMaterCmd->SetGuidance(
"Select Material of the Crystal." );
43 CryMaterCmd->SetParameterName(
"choice",
true,
true );
46 CasingMaterCmd =
new G4UIcmdWithAString(
"/calor/setCasMat",
this );
47 CasingMaterCmd->SetGuidance(
"Select Material of the Casing." );
48 CasingMaterCmd->SetParameterName(
"choice",
true,
true );
51 CasingThickCmd =
new G4UIcmdWith3VectorAndUnit(
"/calor/setCasThick",
this );
52 CasingThickCmd->SetGuidance(
"Set Thickness of the Casing" );
53 CasingThickCmd->SetParameterName(
"TyvekThk",
"AlThk",
"MylarThk",
true );
54 CasingThickCmd->SetRange(
"Size>=0." );
55 CasingThickCmd->SetUnitCategory(
"Length" );
56 CasingThickCmd->SetDefaultValue( fBesEmcGeometry->GetCasingThickness() / mm );
57 CasingThickCmd->SetDefaultUnit(
"mm" );
60 SizeRminCmd =
new G4UIcmdWithADoubleAndUnit(
"/calor/setSizeRmin",
this );
61 SizeRminCmd->SetGuidance(
"Set Rmin size of the barrel calorimeter" );
62 SizeRminCmd->SetParameterName(
"Size",
true );
63 SizeRminCmd->SetRange(
"Size>0." );
64 SizeRminCmd->SetUnitCategory(
"Length" );
65 SizeRminCmd->SetDefaultValue( fBesEmcGeometry->GetBSCRmin() / cm );
66 SizeRminCmd->SetDefaultUnit(
"cm" );
69 NbPhiCmd =
new G4UIcmdWithAnInteger(
"/calor/setNbPhi",
this );
70 NbPhiCmd->SetGuidance(
"Set number of crystals at phi direction." );
71 NbPhiCmd->SetParameterName(
"NbCrystals",
false );
72 NbPhiCmd->SetRange(
"NbCrystals>0 && NbCrystals<=150" );
75 NbThetaCmd =
new G4UIcmdWithAnInteger(
"/calor/setNbTheta",
this );
76 NbThetaCmd->SetGuidance(
"Set number of crystals at theta direction." );
77 NbThetaCmd->SetParameterName(
"NbCrystals",
false );
78 NbThetaCmd->SetRange(
"NbCrystals>0 && NbCrystals<=22" );
81 StartIDThetaCmd =
new G4UIcmdWithAnInteger(
"/calor/setStartTheta",
this );
82 StartIDThetaCmd->SetGuidance(
"Set ID of starting crystals at theta direction." );
83 StartIDThetaCmd->SetParameterName(
"IDCrystal",
false );
84 StartIDThetaCmd->SetRange(
"IDCrystal>=0 && IDCrystal<22" );
87 LengthCmd =
new G4UIcmdWithADoubleAndUnit(
"/calor/setCryLength",
this );
88 LengthCmd->SetGuidance(
"Set Length of crystals of barrel calorimeter" );
89 LengthCmd->SetParameterName(
"Size",
true );
90 LengthCmd->SetRange(
"Size>0." );
91 LengthCmd->SetUnitCategory(
"Length" );
92 LengthCmd->SetDefaultValue( fBesEmcGeometry->GetBSCCryLength() / cm );
93 LengthCmd->SetDefaultUnit(
"cm" );
96 UpdateCmd =
new G4UIcmdWithoutParameter(
"/calor/update",
this );
97 UpdateCmd->SetGuidance(
"Update calorimeter geometry." );
98 UpdateCmd->SetGuidance(
"This command MUST be applied before \"beamOn\" " );
99 UpdateCmd->SetGuidance(
"if you changed geometrical value(s)." );
102 MagFieldCmd =
new G4UIcmdWithADoubleAndUnit(
"/calor/setField",
this );
103 MagFieldCmd->SetGuidance(
"Define magnetic field." );
104 MagFieldCmd->SetGuidance(
"Magnetic field will be in Z direction." );
105 MagFieldCmd->SetParameterName(
"Bz",
true );
106 MagFieldCmd->SetRange(
"Bz>=0." );
107 MagFieldCmd->SetUnitCategory(
"Magnetic flux density" );
108 MagFieldCmd->SetDefaultValue( BesEmc->GetMagField() / tesla );
109 MagFieldCmd->SetDefaultUnit(
"tesla" );
133 if ( command == verboseCmd )
134 { BesEmc->SetVerboseLevel( verboseCmd->GetNewIntValue( newValue ) ); }
136 if ( command == CryMaterCmd ) { BesEmc->SetCrystalMaterial( newValue ); }
138 if ( command == CasingMaterCmd ) { BesEmc->SetCasingMaterial( newValue ); }
140 if ( command == CasingThickCmd )
141 { BesEmc->SetCasingThickness( CasingThickCmd->GetNew3VectorValue( newValue ) ); }
143 if ( command == SizeRminCmd )
144 { BesEmc->SetBSCRmin( SizeRminCmd->GetNewDoubleValue( newValue ) ); }
146 if ( command == NbPhiCmd ) { BesEmc->SetBSCNbPhi( NbPhiCmd->GetNewIntValue( newValue ) ); }
148 if ( command == NbThetaCmd )
149 { BesEmc->SetBSCNbTheta( NbThetaCmd->GetNewIntValue( newValue ) ); }
151 if ( command == StartIDThetaCmd )
152 { BesEmc->SetStartIDTheta( StartIDThetaCmd->GetNewIntValue( newValue ) ); }
154 if ( command == LengthCmd )
155 { BesEmc->SetBSCCrystalLength( LengthCmd->GetNewDoubleValue( newValue ) ); }
157 if ( command == UpdateCmd ) { BesEmc->UpdateGeometry(); }
159 if ( command == MagFieldCmd )
160 { BesEmc->SetMagField( MagFieldCmd->GetNewDoubleValue( newValue ) ); }
168 if ( command == verboseCmd )
169 { cv = verboseCmd->ConvertToString( BesEmc->GetVerboseLevel() ); }
171 if ( command == CryMaterCmd ) { cv = BesEmc->GetCrystalMaterial()->GetName(); }
173 if ( command == CasingMaterCmd ) { cv = BesEmc->GetCasingMaterial()->GetName(); }