QwGeant4
QweakSimCerenkovDetectorMessenger Class Reference

Scans the input file for /Cerenkov/xyz commands. More...

#include <QweakSimCerenkovDetectorMessenger.hh>

Inherits G4UImessenger.

+ Collaboration diagram for QweakSimCerenkovDetectorMessenger:

Public Member Functions

 QweakSimCerenkovDetectorMessenger (QweakSimCerenkovDetector *, G4int octant=1)
 
 ~QweakSimCerenkovDetectorMessenger ()
 
G4int GetOctant ()
 
void SetNewValue (G4UIcommand *, G4String)
 
void CreateCommands (QweakSimCerenkovDetector *)
 

Private Attributes

QweakSimCerenkovDetectormyCerenkovDetector
 
G4int fOctant
 
G4UIdirectory * DirPerOctant
 
G4UIcmdWithADoubleAndUnit * ContainerXPositionCmd
 
G4UIcmdWithADoubleAndUnit * ContainerYPositionCmd
 
G4UIcmdWithADoubleAndUnit * ContainerZPositionCmd
 
G4UIcmdWithADoubleAndUnit * ContainerXRotationCmd
 
G4UIcmdWithADoubleAndUnit * ContainerYRotationCmd
 
G4UIcmdWithADoubleAndUnit * ContainerZRotationCmd
 

Static Private Attributes

static G4UIdirectory * Dir = 0
 
static G4UIcmdWithAString * ContainerMatCmd = 0
 
static G4UIcmdWithAString * DetectorMatCmd = 0
 
static G4UIcmdWithAString * PreRadiatorMatCmd = 0
 
static G4UIcmdWithADoubleAndUnit * ContainerThicknessCmd = 0
 
static G4UIcmdWithADoubleAndUnit * TiltingAngleCmd = 0
 
static G4UIcmdWithADoubleAndUnit * KinkAngleCmd = 0
 
static G4UIcmdWithAnInteger * NumberOfDetectorsCmd = 0
 

Detailed Description

Scans the input file for /Cerenkov/xyz commands.

Placeholder for a long explaination

Definition at line 45 of file QweakSimCerenkovDetectorMessenger.hh.

Constructor & Destructor Documentation

QweakSimCerenkovDetectorMessenger::QweakSimCerenkovDetectorMessenger ( QweakSimCerenkovDetector theCerenkovDetector,
G4int  octant = 1 
)

Definition at line 39 of file QweakSimCerenkovDetectorMessenger.cc.

References ContainerMatCmd, ContainerThicknessCmd, ContainerXPositionCmd, ContainerXRotationCmd, ContainerYPositionCmd, ContainerYRotationCmd, ContainerZPositionCmd, ContainerZRotationCmd, DetectorMatCmd, Dir, DirPerOctant, KinkAngleCmd, NumberOfDetectorsCmd, PreRadiatorMatCmd, and TiltingAngleCmd.

40 :myCerenkovDetector(theCerenkovDetector),fOctant(octant)
41 {
42  G4String Dir_name = "/Cerenkov";
43  if (Dir == 0) {
44  Dir = new G4UIdirectory(G4String(Dir_name+"/"));
45  Dir -> SetGuidance("Cerenkov Detector control.");
46  }
47 
48  if (NumberOfDetectorsCmd == 0) {
49  NumberOfDetectorsCmd = new G4UIcmdWithAnInteger(G4String(Dir_name + "/SetNumberOfDetectors"),this);
50  NumberOfDetectorsCmd->SetGuidance("Set the number of detectors");
51  NumberOfDetectorsCmd->SetParameterName("n",false);
52  NumberOfDetectorsCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
53  }
54 
55  if (ContainerThicknessCmd == 0) {
56  ContainerThicknessCmd = new G4UIcmdWithADoubleAndUnit(G4String(Dir_name + "/SetThickness"),this);
57  ContainerThicknessCmd->SetGuidance("Set the thickness (length in Z) of the Cherenkov container");
58  ContainerThicknessCmd->SetParameterName("Size",true);
59  ContainerThicknessCmd->SetUnitCategory("Length");
60  ContainerThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
61  }
62 
63  if (TiltingAngleCmd == 0) {
64  TiltingAngleCmd = new G4UIcmdWithADoubleAndUnit(G4String(Dir_name + "/SetTiltingAngle"),this);
65  TiltingAngleCmd->SetGuidance("Set the tilting angle of the Cerenkov Detector");
66  TiltingAngleCmd->SetParameterName("Angle",true);
67  TiltingAngleCmd->SetDefaultUnit("degree");
68  TiltingAngleCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
69  }
70 
71  if (KinkAngleCmd == 0) {
72  KinkAngleCmd = new G4UIcmdWithADoubleAndUnit(G4String(Dir_name + "/SetKinkAngle"),this);
73  KinkAngleCmd->SetGuidance("Set the kink angle for the V-shape ");
74  KinkAngleCmd->SetParameterName("Angle",true);
75  KinkAngleCmd->SetDefaultUnit("degree");
76  KinkAngleCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
77  }
78 
79  if (ContainerMatCmd == 0) {
80  ContainerMatCmd = new G4UIcmdWithAString(G4String(Dir_name + "/SetContainerMaterial"),this);
81  ContainerMatCmd->SetGuidance("Select Material of the Cerenkov Container.");
82  ContainerMatCmd->SetParameterName("choice",false);
83  ContainerMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
84  }
85 
86  if (DetectorMatCmd == 0) {
87  DetectorMatCmd = new G4UIcmdWithAString(G4String(Dir_name + "/SetCerenkovMaterial"),this);
88  DetectorMatCmd->SetGuidance("Select Material of the Cerenkov Detector.");
89  DetectorMatCmd->SetParameterName("choice",false);
90  DetectorMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
91  }
92 
93  if (PreRadiatorMatCmd == 0) {
94  PreRadiatorMatCmd = new G4UIcmdWithAString(G4String(Dir_name + "/SetPreradiatorMaterial"),this);
95  PreRadiatorMatCmd->SetGuidance("Select Material of the Pre-radiator.");
96  PreRadiatorMatCmd->SetParameterName("choice",false);
97  PreRadiatorMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
98  }
99 
100  //Added Cerenkov octant number to the command list. The messenger is now dependent on the octant number.
101  //K. Bartlett Aug 6, 2012
102 
103  G4String DirPerOctant_name = "/Cerenkov/Cerenkov" + G4UIcommand::ConvertToString(octant+1);
104  DirPerOctant = new G4UIdirectory(G4String(DirPerOctant_name + "/"));
105  DirPerOctant -> SetGuidance("Individual Cerenkov detector control.");
106 
107  ContainerZPositionCmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerOctant_name + "/SetCenterPositionInZ"),this);
108  ContainerZPositionCmd->SetGuidance("Set the Z position of the Cerenkov container center");
109  ContainerZPositionCmd->SetParameterName("Size",true);
110  ContainerZPositionCmd->SetUnitCategory("Length");
111  ContainerZPositionCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
112 
113  ContainerYPositionCmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerOctant_name + "/SetCenterPositionInY"),this);
114  ContainerYPositionCmd->SetGuidance("Set the Y position of the Cerenkov container center");
115  ContainerYPositionCmd->SetParameterName("Size",true);
116  ContainerYPositionCmd->SetUnitCategory("Length");
117  ContainerYPositionCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
118 
119  ContainerXPositionCmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerOctant_name + "/SetCenterPositionInX"),this);
120  ContainerXPositionCmd->SetGuidance("Set the X position of the Cerenkov container center");
121  ContainerXPositionCmd->SetParameterName("Size",true);
122  ContainerXPositionCmd->SetUnitCategory("Length");
123  ContainerXPositionCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
124 
125  ContainerZRotationCmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerOctant_name + "/SetRotationInZ"),this);
126  ContainerZRotationCmd->SetGuidance("Set the Z rotation of the Cerenkov container");
127  ContainerZRotationCmd->SetParameterName("zrot",true);
128  ContainerZRotationCmd->SetUnitCategory("Angle");
129  ContainerZRotationCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
130 
131  ContainerYRotationCmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerOctant_name + "/SetRotationInY"),this);
132  ContainerYRotationCmd->SetGuidance("Set the Y rotation of the Cerenkov container");
133  ContainerYRotationCmd->SetParameterName("yrot",true);
134  ContainerYRotationCmd->SetUnitCategory("Angle");
135  ContainerYRotationCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
136 
137  ContainerXRotationCmd = new G4UIcmdWithADoubleAndUnit(G4String(DirPerOctant_name + "/SetRotationInX"),this);
138  ContainerXRotationCmd->SetGuidance("Set the X rotation of the Cerenkov container");
139  ContainerXRotationCmd->SetParameterName("xrot",true);
140  ContainerXRotationCmd->SetUnitCategory("Angle");
141  ContainerXRotationCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
142 
143 }
static G4UIcmdWithADoubleAndUnit * TiltingAngleCmd
static G4UIcmdWithADoubleAndUnit * ContainerThicknessCmd
static G4UIcmdWithADoubleAndUnit * KinkAngleCmd
QweakSimCerenkovDetectorMessenger::~QweakSimCerenkovDetectorMessenger ( )

Definition at line 147 of file QweakSimCerenkovDetectorMessenger.cc.

References ContainerXPositionCmd, ContainerXRotationCmd, ContainerYPositionCmd, ContainerYRotationCmd, ContainerZPositionCmd, ContainerZRotationCmd, and DirPerOctant.

148 {
155  if (DirPerOctant) delete DirPerOctant;
156 
157  // Someone could implement all these static pointers as smart pointers so they
158  // get deleted on destruction....
159 // if (NumberOfDetectorsCmd) { delete NumberOfDetectorsCmd; NumberOfDetectorsCmd = 0; }
160 // if (ContainerThicknessCmd) { delete ContainerThicknessCmd; ContainerThicknessCmd = 0; }
161 // if (DetectorMatCmd) { delete DetectorMatCmd; DetectorMatCmd = 0; }
162 // if (PreRadiatorMatCmd) { delete PreRadiatorMatCmd; PreRadiatorMatCmd = 0; }
163 // if (ContainerMatCmd) { delete ContainerMatCmd; ContainerMatCmd = 0; }
164 // if (TiltingAngleCmd) { delete TiltingAngleCmd; TiltingAngleCmd = 0; }
165 // if (KinkAngleCmd) { delete KinkAngleCmd; KinkAngleCmd = 0; }
166 // if (Dir) { delete Dir; Dir = 0; }
167 }

Member Function Documentation

void QweakSimCerenkovDetectorMessenger::CreateCommands ( QweakSimCerenkovDetector )
G4int QweakSimCerenkovDetectorMessenger::GetOctant ( )
inline
void QweakSimCerenkovDetectorMessenger::SetNewValue ( G4UIcommand *  command,
G4String  newValue 
)

Definition at line 171 of file QweakSimCerenkovDetectorMessenger.cc.

References ContainerMatCmd, ContainerThicknessCmd, ContainerXPositionCmd, ContainerXRotationCmd, ContainerYPositionCmd, ContainerYRotationCmd, ContainerZPositionCmd, ContainerZRotationCmd, DetectorMatCmd, fOctant, KinkAngleCmd, myCerenkovDetector, NumberOfDetectorsCmd, PreRadiatorMatCmd, QweakSimCerenkovDetector::SetCerenkovDetectorCenterPositionInX(), QweakSimCerenkovDetector::SetCerenkovDetectorCenterPositionInY(), QweakSimCerenkovDetector::SetCerenkovDetectorCenterPositionInZ(), QweakSimCerenkovDetector::SetCerenkovDetectorMaterial(), QweakSimCerenkovDetector::SetCerenkovDetectorRotationInX(), QweakSimCerenkovDetector::SetCerenkovDetectorRotationInY(), QweakSimCerenkovDetector::SetCerenkovDetectorRotationInZ(), QweakSimCerenkovDetector::SetCerenkovDetectorThickness(), QweakSimCerenkovDetector::SetCerenkovDetectorTiltAngle(), QweakSimCerenkovDetector::SetContainerMaterial(), QweakSimCerenkovDetector::SetNumberOfDetectors(), QweakSimCerenkovDetector::SetPreradiatorMaterial(), and TiltingAngleCmd.

172 {
173  G4cout << "#### Calling QweakSimCerenkovDetectorMessenger::SetNewValue() " << newValue << G4endl;
174 
175  if( command == NumberOfDetectorsCmd )
176  {
177  G4cout << "#### Messenger: Setting Number of Detectors to " << newValue << G4endl;
178 
180  }
181 
182  if( command == ContainerThicknessCmd )
183  {
184  G4cout << "#### Messenger: Setting CerenkovDetector Container Thickness to " << newValue << G4endl;
185 
187  }
188 
189  if( command == ContainerXPositionCmd )
190  {
191  G4cout << "#### Messenger: Setting CerenkovDetector Container X position to " << newValue << G4endl;
192 
194  }
195 
196  if( command == ContainerYPositionCmd )
197  {
198  G4cout << "#### Messenger: Setting CerenkovDetector Container Y position to " << newValue << G4endl;
199 
201  }
202 
203  if( command == ContainerZPositionCmd )
204  {
205  G4cout << "#### Messenger: Setting CerenkovDetector Container Z position to " << newValue << G4endl;
206 
208  }
209 
210  if( command == ContainerXRotationCmd )
211  {
212  G4cout << "#### Messenger: Setting CerenkovDetector Container X position to " << newValue << G4endl;
213 
215  }
216 
217  if( command == ContainerYRotationCmd )
218  {
219  G4cout << "#### Messenger: Setting CerenkovDetector Container Y position to " << newValue << G4endl;
220 
222  }
223 
224  if( command == ContainerZRotationCmd )
225  {
226  G4cout << "#### Messenger: Setting CerenkovDetector Container Z position to " << newValue << G4endl;
227 
229  }
230 
231  if( command == ContainerMatCmd )
232  {
233  G4cout << "#### Messenger: Setting CerenkovDetector Container Material to " << newValue << G4endl;
234 
236  }
237 
238  if( command == DetectorMatCmd )
239  {
240  G4cout << "#### Messenger: Setting Cerenkov Detector Material to " << newValue << G4endl;
241 
243  }
244 
245  if( command == PreRadiatorMatCmd )
246  {
247  G4cout << "#### Messenger: Setting PreRadiator Material to " << newValue << G4endl;
248 
250  }
251 
252  if( command == TiltingAngleCmd )
253  {
254  G4cout << "#### Messenger: Setting Cerenkov Detector Tilting Angle to " << newValue << G4endl;
255 
256  myCerenkovDetector->SetCerenkovDetectorTiltAngle(TiltingAngleCmd->GetNewDoubleValue(newValue));
257  }
258 
259  if( command == KinkAngleCmd )
260  {
261  G4cout << "#### Messenger: Setting Cerenkov Detector Kink Angle to " << newValue << G4endl;
262 
263  // myCerenkovDetector->SetKinkAngle(newValue);
264  }
265 
266 
267  G4cout << "#### Leaving QweakSimCerenkovDetector Messenger::SetNewValue() " << newValue << G4endl;
268 }
void SetCerenkovDetectorRotationInZ(G4double zRot, G4int octant)
void SetCerenkovDetectorThickness(G4double thickness)
void SetCerenkovDetectorRotationInX(G4double xRot, G4int octant)
void SetContainerMaterial(G4String materialName)
void SetCerenkovDetectorMaterial(G4String materialName)
static G4UIcmdWithADoubleAndUnit * TiltingAngleCmd
void SetCerenkovDetectorRotationInY(G4double yRot, G4int octant)
void SetCerenkovDetectorTiltAngle(G4double tiltangle)
static G4UIcmdWithADoubleAndUnit * ContainerThicknessCmd
static G4UIcmdWithADoubleAndUnit * KinkAngleCmd
void SetPreradiatorMaterial(G4String materialName)
void SetCerenkovDetectorCenterPositionInX(G4double xPos, G4int octant)
void SetCerenkovDetectorCenterPositionInZ(G4double zPos, G4int octant)
void SetCerenkovDetectorCenterPositionInY(G4double yPos, G4int octant)

+ Here is the call graph for this function:

Field Documentation

G4UIcmdWithAString * QweakSimCerenkovDetectorMessenger::ContainerMatCmd = 0
staticprivate
G4UIcmdWithADoubleAndUnit * QweakSimCerenkovDetectorMessenger::ContainerThicknessCmd = 0
staticprivate
G4UIcmdWithADoubleAndUnit* QweakSimCerenkovDetectorMessenger::ContainerXPositionCmd
private
G4UIcmdWithADoubleAndUnit* QweakSimCerenkovDetectorMessenger::ContainerXRotationCmd
private
G4UIcmdWithADoubleAndUnit* QweakSimCerenkovDetectorMessenger::ContainerYPositionCmd
private
G4UIcmdWithADoubleAndUnit* QweakSimCerenkovDetectorMessenger::ContainerYRotationCmd
private
G4UIcmdWithADoubleAndUnit* QweakSimCerenkovDetectorMessenger::ContainerZPositionCmd
private
G4UIcmdWithADoubleAndUnit* QweakSimCerenkovDetectorMessenger::ContainerZRotationCmd
private
G4UIcmdWithAString * QweakSimCerenkovDetectorMessenger::DetectorMatCmd = 0
staticprivate
G4UIdirectory * QweakSimCerenkovDetectorMessenger::Dir = 0
staticprivate
G4UIdirectory* QweakSimCerenkovDetectorMessenger::DirPerOctant
private
G4int QweakSimCerenkovDetectorMessenger::fOctant
private

Definition at line 71 of file QweakSimCerenkovDetectorMessenger.hh.

Referenced by GetOctant(), and SetNewValue().

G4UIcmdWithADoubleAndUnit * QweakSimCerenkovDetectorMessenger::KinkAngleCmd = 0
staticprivate
QweakSimCerenkovDetector* QweakSimCerenkovDetectorMessenger::myCerenkovDetector
private

Definition at line 56 of file QweakSimCerenkovDetectorMessenger.hh.

Referenced by SetNewValue().

G4UIcmdWithAnInteger * QweakSimCerenkovDetectorMessenger::NumberOfDetectorsCmd = 0
staticprivate
G4UIcmdWithAString * QweakSimCerenkovDetectorMessenger::PreRadiatorMatCmd = 0
staticprivate
G4UIcmdWithADoubleAndUnit * QweakSimCerenkovDetectorMessenger::TiltingAngleCmd = 0
staticprivate

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