LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 48 of file ExN03DetectorMessenger.hh.

Constructor & Destructor Documentation

ExN03DetectorMessenger::ExN03DetectorMessenger ( ExN03DetectorConstruction ExN03Det)

Definition at line 44 of file ExN03DetectorMessenger.cc.

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

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

Definition at line 107 of file ExN03DetectorMessenger.cc.

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

108 {
109  delete NbLayersCmd;
110  delete AbsMaterCmd; delete GapMaterCmd;
111  delete AbsThickCmd; delete GapThickCmd;
112  delete SizeYZCmd; delete UpdateCmd;
113  delete MagFieldCmd;
114  delete detDir;
115  delete N03Dir;
116 }
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 120 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().

121 {
122  if( command == AbsMaterCmd )
123  { ExN03Detector->SetAbsorberMaterial(newValue);}
124 
125  if( command == GapMaterCmd )
126  { ExN03Detector->SetGapMaterial(newValue);}
127 
128  if( command == AbsThickCmd )
130  ->GetNewDoubleValue(newValue));}
131 
132  if( command == GapThickCmd )
133  { ExN03Detector->SetGapThickness(GapThickCmd->GetNewDoubleValue(newValue));}
134 
135  if( command == SizeYZCmd )
136  { ExN03Detector->SetCalorSizeYZ(SizeYZCmd->GetNewDoubleValue(newValue));}
137 
138  if( command == NbLayersCmd )
139  { ExN03Detector->SetNbOfLayers(NbLayersCmd->GetNewIntValue(newValue));}
140 
141  if( command == UpdateCmd )
143 
144  if( command == MagFieldCmd )
145  { ExN03Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
146 }
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 60 of file ExN03DetectorMessenger.hh.

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

ExN03DetectorConstruction* ExN03DetectorMessenger::ExN03Detector
private

Definition at line 57 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 59 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: