LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ExN03DetectorMessenger Class Reference

#include "ExN03DetectorMessenger.hh"

Inheritance diagram for ExN03DetectorMessenger:

Public Member Functions

 ExN03DetectorMessenger (ExN03DetectorConstruction *)
 
 ~ExN03DetectorMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 

Private Attributes

ExN03DetectorConstructionExN03Detector
 
G4UIdirectory * N03Dir
 
G4UIdirectory * detDir
 
G4UIcmdWithAString * AbsMaterCmd
 
G4UIcmdWithAString * GapMaterCmd
 
G4UIcmdWithADoubleAndUnit * AbsThickCmd
 
G4UIcmdWithADoubleAndUnit * GapThickCmd
 
G4UIcmdWithADoubleAndUnit * SizeYZCmd
 
G4UIcmdWithAnInteger * NbLayersCmd
 
G4UIcmdWithADoubleAndUnit * MagFieldCmd
 
G4UIcmdWithoutParameter * UpdateCmd
 

Detailed Description

Definition at line 49 of file ExN03DetectorMessenger.hh.

Constructor & Destructor Documentation

ExN03DetectorMessenger::ExN03DetectorMessenger ( ExN03DetectorConstruction ExN03Det)

Definition at line 45 of file ExN03DetectorMessenger.cc.

References AbsMaterCmd, AbsThickCmd, detDir, GapMaterCmd, GapThickCmd, MagFieldCmd, N03Dir, NbLayersCmd, SizeYZCmd, and UpdateCmd.

47 :ExN03Detector(ExN03Det)
48 {
49  N03Dir = new G4UIdirectory("/N03/");
50  N03Dir->SetGuidance("UI commands of this example");
51 
52  detDir = new G4UIdirectory("/N03/det/");
53  detDir->SetGuidance("detector control");
54 
55  AbsMaterCmd = new G4UIcmdWithAString("/N03/det/setAbsMat",this);
56  AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
57  AbsMaterCmd->SetParameterName("choice",false);
58  AbsMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
59 
60  GapMaterCmd = new G4UIcmdWithAString("/N03/det/setGapMat",this);
61  GapMaterCmd->SetGuidance("Select Material of the Gap.");
62  GapMaterCmd->SetParameterName("choice",false);
63  GapMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
64 
65  AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setAbsThick",this);
66  AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
67  AbsThickCmd->SetParameterName("Size",false);
68  AbsThickCmd->SetRange("Size>=0.");
69  AbsThickCmd->SetUnitCategory("Length");
70  AbsThickCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
71 
72  GapThickCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setGapThick",this);
73  GapThickCmd->SetGuidance("Set Thickness of the Gap");
74  GapThickCmd->SetParameterName("Size",false);
75  GapThickCmd->SetRange("Size>=0.");
76  GapThickCmd->SetUnitCategory("Length");
77  GapThickCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
78 
79  SizeYZCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setSizeYZ",this);
80  SizeYZCmd->SetGuidance("Set tranverse size of the calorimeter");
81  SizeYZCmd->SetParameterName("Size",false);
82  SizeYZCmd->SetRange("Size>0.");
83  SizeYZCmd->SetUnitCategory("Length");
84  SizeYZCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
85 
86  NbLayersCmd = new G4UIcmdWithAnInteger("/N03/det/setNbOfLayers",this);
87  NbLayersCmd->SetGuidance("Set number of layers.");
88  NbLayersCmd->SetParameterName("NbLayers",false);
89  NbLayersCmd->SetRange("NbLayers>0 && NbLayers<500");
90  NbLayersCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
91 
92  UpdateCmd = new G4UIcmdWithoutParameter("/N03/det/update",this);
93  UpdateCmd->SetGuidance("Update calorimeter geometry.");
94  UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
95  UpdateCmd->SetGuidance("if you changed geometrical value(s).");
96  UpdateCmd->AvailableForStates(G4State_Idle);
97 
98  MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setField",this);
99  MagFieldCmd->SetGuidance("Define magnetic field.");
100  MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
101  MagFieldCmd->SetParameterName("Bz",false);
102  MagFieldCmd->SetUnitCategory("Magnetic flux density");
103  MagFieldCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
104 }
G4UIcmdWithADoubleAndUnit * AbsThickCmd
G4UIcmdWithAnInteger * NbLayersCmd
G4UIcmdWithADoubleAndUnit * SizeYZCmd
G4UIcmdWithoutParameter * UpdateCmd
ExN03DetectorConstruction * ExN03Detector
G4UIcmdWithAString * AbsMaterCmd
G4UIcmdWithAString * GapMaterCmd
G4UIcmdWithADoubleAndUnit * GapThickCmd
G4UIcmdWithADoubleAndUnit * MagFieldCmd
ExN03DetectorMessenger::~ExN03DetectorMessenger ( )

Definition at line 108 of file ExN03DetectorMessenger.cc.

References AbsMaterCmd, AbsThickCmd, detDir, GapMaterCmd, GapThickCmd, MagFieldCmd, N03Dir, NbLayersCmd, SizeYZCmd, and UpdateCmd.

109 {
110  delete NbLayersCmd;
111  delete AbsMaterCmd; delete GapMaterCmd;
112  delete AbsThickCmd; delete GapThickCmd;
113  delete SizeYZCmd; delete UpdateCmd;
114  delete MagFieldCmd;
115  delete detDir;
116  delete N03Dir;
117 }
G4UIcmdWithADoubleAndUnit * AbsThickCmd
G4UIcmdWithAnInteger * NbLayersCmd
G4UIcmdWithADoubleAndUnit * SizeYZCmd
G4UIcmdWithoutParameter * UpdateCmd
G4UIcmdWithAString * AbsMaterCmd
G4UIcmdWithAString * GapMaterCmd
G4UIcmdWithADoubleAndUnit * GapThickCmd
G4UIcmdWithADoubleAndUnit * MagFieldCmd

Member Function Documentation

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

Definition at line 121 of file ExN03DetectorMessenger.cc.

References AbsMaterCmd, AbsThickCmd, ExN03Detector, GapMaterCmd, GapThickCmd, MagFieldCmd, NbLayersCmd, ExN03DetectorConstruction::SetAbsorberMaterial(), ExN03DetectorConstruction::SetAbsorberThickness(), ExN03DetectorConstruction::SetCalorSizeYZ(), ExN03DetectorConstruction::SetGapMaterial(), ExN03DetectorConstruction::SetGapThickness(), ExN03DetectorConstruction::SetMagField(), ExN03DetectorConstruction::SetNbOfLayers(), SizeYZCmd, UpdateCmd, and ExN03DetectorConstruction::UpdateGeometry().

122 {
123  if( command == AbsMaterCmd )
124  { ExN03Detector->SetAbsorberMaterial(newValue);}
125 
126  if( command == GapMaterCmd )
127  { ExN03Detector->SetGapMaterial(newValue);}
128 
129  if( command == AbsThickCmd )
131  ->GetNewDoubleValue(newValue));}
132 
133  if( command == GapThickCmd )
134  { ExN03Detector->SetGapThickness(GapThickCmd->GetNewDoubleValue(newValue));}
135 
136  if( command == SizeYZCmd )
137  { ExN03Detector->SetCalorSizeYZ(SizeYZCmd->GetNewDoubleValue(newValue));}
138 
139  if( command == NbLayersCmd )
140  { ExN03Detector->SetNbOfLayers(NbLayersCmd->GetNewIntValue(newValue));}
141 
142  if( command == UpdateCmd )
144 
145  if( command == MagFieldCmd )
146  { ExN03Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
147 }
G4UIcmdWithADoubleAndUnit * AbsThickCmd
G4UIcmdWithAnInteger * NbLayersCmd
G4UIcmdWithADoubleAndUnit * SizeYZCmd
G4UIcmdWithoutParameter * UpdateCmd
ExN03DetectorConstruction * ExN03Detector
G4UIcmdWithAString * AbsMaterCmd
G4UIcmdWithAString * GapMaterCmd
G4UIcmdWithADoubleAndUnit * GapThickCmd
G4UIcmdWithADoubleAndUnit * MagFieldCmd

Member Data Documentation

G4UIcmdWithAString* ExN03DetectorMessenger::AbsMaterCmd
private
G4UIcmdWithADoubleAndUnit* ExN03DetectorMessenger::AbsThickCmd
private
G4UIdirectory* ExN03DetectorMessenger::detDir
private

Definition at line 61 of file ExN03DetectorMessenger.hh.

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

ExN03DetectorConstruction* ExN03DetectorMessenger::ExN03Detector
private

Definition at line 58 of file ExN03DetectorMessenger.hh.

Referenced by SetNewValue().

G4UIcmdWithAString* ExN03DetectorMessenger::GapMaterCmd
private
G4UIcmdWithADoubleAndUnit* ExN03DetectorMessenger::GapThickCmd
private
G4UIcmdWithADoubleAndUnit* ExN03DetectorMessenger::MagFieldCmd
private
G4UIdirectory* ExN03DetectorMessenger::N03Dir
private

Definition at line 60 of file ExN03DetectorMessenger.hh.

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

G4UIcmdWithAnInteger* ExN03DetectorMessenger::NbLayersCmd
private
G4UIcmdWithADoubleAndUnit* ExN03DetectorMessenger::SizeYZCmd
private
G4UIcmdWithoutParameter* ExN03DetectorMessenger::UpdateCmd
private

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