Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4HcalPrototypeDetectorMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4HcalPrototypeDetectorMessenger.cc
1 // sPHENIX prototype detector messager
2 // Dec 2013, hexc
3 // Jan 2, 2014: Added more messenger commands
4 
6 
8 
9 #include <Geant4/G4ApplicationState.hh> // for G4State_Idle, G4State...
10 #include <Geant4/G4String.hh> // for G4String
11 #include <Geant4/G4UIcmdWithADoubleAndUnit.hh>
12 #include <Geant4/G4UIcmdWithAString.hh>
13 #include <Geant4/G4UIcmdWithoutParameter.hh>
14 #include <Geant4/G4UIdirectory.hh>
15 
16 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
17 
19  : fPHG4HcalPrototypeDetector(Det)
20 {
21  sPhnxDir = new G4UIdirectory("/sPhnx/");
22  sPhnxDir->SetGuidance("UI commands for modifying the prototype detector properties.");
23 
24  detDir = new G4UIdirectory("/sPhnx/det/");
25  detDir->SetGuidance("UI commands for changing the detector geometry.");
26 
27  fMaterCmd = new G4UIcmdWithAString("/sPhnx/det/setMat", this);
28  fMaterCmd->SetGuidance("Select material of the world.");
29  fMaterCmd->SetParameterName("choice", false);
30  fMaterCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
31 
32  fUpdateCmd = new G4UIcmdWithoutParameter("/sPhnx/det/update", this);
33  fUpdateCmd->SetGuidance("Update geometry.");
34  fUpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
35  fUpdateCmd->SetGuidance("if you changed geometrical value(s).");
36  fUpdateCmd->AvailableForStates(G4State_Idle);
37 
38  outerHcalDPhiCmd = new G4UIcmdWithADoubleAndUnit("/sPhnx/det/setOuterHcalAngularSpan", this);
39  outerHcalDPhiCmd->SetGuidance("Change the outer hcal angular span (default: 0.28 rad).");
40  outerHcalDPhiCmd->SetGuidance("Need to run the detector update command after running this command!");
41  outerHcalDPhiCmd->SetParameterName("hcal2DPhi", false);
42  outerHcalDPhiCmd->SetUnitCategory("radian");
43  outerHcalDPhiCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
44 
45  outerPlateTiltAngleCmd = new G4UIcmdWithADoubleAndUnit("/sPhnx/det/setOuterPlateTiltAngule", this);
46  outerPlateTiltAngleCmd->SetGuidance("Change the outer plate tilt angle (default: 0.12 rad).");
47  outerPlateTiltAngleCmd->SetGuidance("Need to run the detector update command after running this command!");
48  outerPlateTiltAngleCmd->SetParameterName("hcal2TiltAngle", false);
49  outerPlateTiltAngleCmd->SetUnitCategory("radian");
50  outerPlateTiltAngleCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
51 
52  innerHcalDPhiCmd = new G4UIcmdWithADoubleAndUnit("/sPhnx/det/setInnerHcalAngularSpan", this);
53  innerHcalDPhiCmd->SetGuidance("Change the inner hcal angular span (default: 0.28 rad).");
54  innerHcalDPhiCmd->SetGuidance("Need to run the detector update command after running this command!");
55  innerHcalDPhiCmd->SetParameterName("hcal1DPhi", false);
56  innerHcalDPhiCmd->SetUnitCategory("radian");
57  innerHcalDPhiCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
58 
59  innerPlateTiltAngleCmd = new G4UIcmdWithADoubleAndUnit("/sPhnx/det/setInnerPlateTiltAngule", this);
60  innerPlateTiltAngleCmd->SetGuidance("Change the inner plate tilt angle (default: 0.30 rad).");
61  innerPlateTiltAngleCmd->SetGuidance("Need to run the detector update command after running this command!");
62  innerPlateTiltAngleCmd->SetParameterName("hcal1TiltAngle", false);
63  innerPlateTiltAngleCmd->SetUnitCategory("radian");
64  innerPlateTiltAngleCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
65 }
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
70 {
71  delete fMaterCmd;
72  delete fUpdateCmd;
73  delete outerHcalDPhiCmd;
74  delete innerHcalDPhiCmd;
77 }
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
80 
81 void PHG4HcalPrototypeDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
82 {
83  if (command == fMaterCmd)
84  {
86  }
87 
88  if (command == fUpdateCmd)
89  {
91  }
92 
93  if (command == outerHcalDPhiCmd)
94  {
95  fPHG4HcalPrototypeDetector->SetOuterHcalDPhi(outerHcalDPhiCmd->GetNewDoubleValue(newValue));
96  }
97 
98  if (command == outerPlateTiltAngleCmd)
99  {
101  }
102 
103  if (command == innerHcalDPhiCmd)
104  {
105  fPHG4HcalPrototypeDetector->SetInnerHcalDPhi(innerHcalDPhiCmd->GetNewDoubleValue(newValue));
106  }
107 
108  if (command == innerPlateTiltAngleCmd)
109  {
111  }
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......