ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CCalPrimaryGeneratorMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CCalPrimaryGeneratorMessenger.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
27 // File: CCalPrimaryGeneratorMessenger.cc
28 // Description: CCalPrimaryGeneratorMessenger adds new commands for
29 // primary generator action
33 
34 #include "globals.hh"
35 #include "G4PhysicalConstants.hh"
36 #include "G4UImanager.hh"
37 #include "G4UIcmdWithAString.hh"
39 #include "G4UIcmdWithADouble.hh"
40 #include "G4UIcmdWithABool.hh"
41 #include "G4UIcmdWithAnInteger.hh"
42 
44 
45  verboseCmd = new G4UIcmdWithAnInteger("/CCal/generator/verbose",this);
46  verboseCmd->SetGuidance("set Verbosity level ");
47  verboseCmd->SetParameterName("value",true);
50 
51  rndmCmd = new G4UIcmdWithAString("/CCal/generator/random",this);
52  rndmCmd->SetGuidance("Choose randomly energy and direction of the incident particle.");
53  rndmCmd->SetGuidance(" Choice : on,off(default)");
54  rndmCmd->SetParameterName("choice",true);
55  rndmCmd->SetDefaultValue("off");
56  rndmCmd->SetCandidates("on off ON OFF");
58 
59  scanCmd = new G4UIcmdWithAString("/CCal/generator/scan",this);
60  scanCmd->SetGuidance("Scan eta and phi ranges with single incident particle");
61  scanCmd->SetGuidance(" Choice : on,off(default)");
62  scanCmd->SetGuidance(" Ranges : etamin/max, phimin/max are set by other commands ");
63  scanCmd->SetParameterName("choice",true);
64  scanCmd->SetDefaultValue("off");
65  scanCmd->SetCandidates("on off ON OFF");
67 
68  minEnergyCmd = new G4UIcmdWithADoubleAndUnit("/CCal/generator/minEnergy",this);
69  minEnergyCmd->SetGuidance("Set minimum Energy for the incident particle.");
70  minEnergyCmd->SetParameterName("value",true);
74 
75  maxEnergyCmd = new G4UIcmdWithADoubleAndUnit("/CCal/generator/maxEnergy",this);
76  maxEnergyCmd->SetGuidance("Set maximum Energy for the incident particle.");
77  maxEnergyCmd->SetParameterName("value",true);
81 
82  minPhiCmd = new G4UIcmdWithADoubleAndUnit("/CCal/generator/minPhi",this);
83  minPhiCmd->SetGuidance("Set minimum Phi angle for the incident particle direction");
84  minPhiCmd->SetGuidance(" Choice : from 0 to 2*pi ");
85  minPhiCmd->SetParameterName("value",true);
87  minPhiCmd->SetDefaultUnit("radian");
89 
90  maxPhiCmd = new G4UIcmdWithADoubleAndUnit("/CCal/generator/maxPhi",this);
91  maxPhiCmd->SetGuidance("Set maximum Phi angle for the incident particle direction");
92  maxPhiCmd->SetGuidance(" Choice : from 0 to 2*pi ");
93  maxPhiCmd->SetParameterName("value",true);
95  maxPhiCmd->SetDefaultUnit("radian");
97 
98  stepsPhiCmd = new G4UIcmdWithAnInteger("/CCal/generator/stepsPhi",this);
99  stepsPhiCmd->SetGuidance("number of steps along Phi for scan ");
100  stepsPhiCmd->SetParameterName("value",true);
103 
104  minEtaCmd = new G4UIcmdWithADouble("/CCal/generator/minEta",this);
105  minEtaCmd->SetGuidance("Set minimum Eta angle for the incident particle direction");
106  minEtaCmd->SetGuidance(" Choice : from 0 to infinity");
107  minEtaCmd->SetParameterName("value",true);
110 
111  maxEtaCmd = new G4UIcmdWithADouble("/CCal/generator/maxEta",this);
112  maxEtaCmd->SetGuidance("Set maximum Eta angle for the incident particle direction");
113  maxEtaCmd->SetGuidance(" Choice : from 0 to infinity");
114  maxEtaCmd->SetParameterName("value",true);
117 
118  stepsEtaCmd = new G4UIcmdWithAnInteger("/CCal/generator/stepsEta",this);
119  stepsEtaCmd->SetGuidance("number of steps along Eta for scan ");
120  stepsEtaCmd->SetParameterName("value",true);
123 
124  runNoCmd = new G4UIcmdWithAnInteger("/CCal/generator/runNo",this);
125  runNoCmd->SetGuidance("set the run number ");
126  runNoCmd->SetParameterName("value",true);
129 
130 }
131 
133 
134  if (verboseCmd)
135  delete verboseCmd;
136  if (scanCmd)
137  delete rndmCmd;
138  if (scanCmd)
139  delete scanCmd;
140  if (minEnergyCmd)
141  delete minEnergyCmd;
142  if (maxEnergyCmd)
143  delete maxEnergyCmd;
144  if (minPhiCmd)
145  delete minPhiCmd;
146  if (maxPhiCmd)
147  delete maxPhiCmd;
148  if (stepsPhiCmd)
149  delete stepsPhiCmd;
150  if (minEtaCmd)
151  delete minEtaCmd;
152  if (maxEtaCmd)
153  delete maxEtaCmd;
154  if (stepsEtaCmd)
155  delete stepsEtaCmd;
156  if (runNoCmd)
157  delete runNoCmd;
158 
159 }
160 
162  G4String newValues) {
163  if (command == verboseCmd)
165  else if (command == rndmCmd)
166  myAction->SetRandom(newValues);
167  else if (command == scanCmd)
168  myAction->SetScan(newValues);
169  else if (command == minEnergyCmd)
171  else if (command == maxEnergyCmd)
173  else if (command == minPhiCmd)
175  else if (command == maxPhiCmd)
177  else if (command == stepsPhiCmd)
179  else if (command == minEtaCmd)
181  else if (command == maxEtaCmd)
183  else if (command == stepsEtaCmd)
185  else if (command == runNoCmd)
187 
188 }