#include <BesPrimaryGeneratorMessenger.hh>
Public Member Functions | |
BesPrimaryGeneratorMessenger (BesPrimaryGeneratorAction *mpga) | |
~BesPrimaryGeneratorMessenger () | |
void | SetNewValue (G4UIcommand *command, G4String newValues) |
G4String | GetCurrentValue (G4UIcommand *command) |
Private Attributes | |
BesPrimaryGeneratorAction * | myAction |
G4ParticleTable * | particleTable |
G4UIdirectory * | generatorDirectory |
G4UIcmdWithAString * | gennamCmd |
G4UIcmdWithAString * | genbesCmd |
G4UIcommand * | testerCmd |
G4UIcommand * | cosmicCmd |
Definition at line 24 of file BesPrimaryGeneratorMessenger.hh.
BesPrimaryGeneratorMessenger::BesPrimaryGeneratorMessenger | ( | BesPrimaryGeneratorAction * | mpga | ) |
Definition at line 19 of file BesPrimaryGeneratorMessenger.cc.
References cosmicCmd, genbesCmd, generatorDirectory, gennamCmd, genRecEmupikp::i, particleTable, and testerCmd.
00020 :myAction(mpga) 00021 { 00022 G4UIparameter* parameter; 00023 G4bool omittable; 00024 particleTable = G4ParticleTable::GetParticleTable(); 00025 00026 generatorDirectory = new G4UIdirectory("/generator/"); 00027 generatorDirectory->SetGuidance("BESIII event gnerator"); 00028 00029 gennamCmd = new G4UIcmdWithAString("/generator/name",this); 00030 gennamCmd->SetGuidance("Select your event gerator: genbes or tester"); 00031 gennamCmd->SetGuidance("The default generator is tester"); 00032 gennamCmd->SetParameterName("name",true); 00033 gennamCmd->SetDefaultValue("tester"); 00034 gennamCmd->SetCandidates("tester cosmic genbes"); 00035 00036 genbesCmd = new G4UIcmdWithAString("/generator/genbes",this); 00037 genbesCmd->SetGuidance("The BES data file"); 00038 genbesCmd->SetGuidance("directory/filename"); 00039 genbesCmd->SetParameterName("name",false); 00040 00041 testerCmd = new G4UIcommand("/generator/tester",this); 00042 testerCmd->SetGuidance("The BES TESTER generator"); 00043 testerCmd->SetGuidance("NP PID Cosmin Cosmax phimin phimax p delp"); 00044 00045 cosmicCmd = new G4UIcommand("/generator/cosmic",this); 00046 cosmicCmd->SetGuidance("The cosmic generator"); 00047 cosmicCmd->SetGuidance("PID x y z"); 00048 00049 parameter = new G4UIparameter("np",'i',omittable = true); 00050 parameter->SetGuidance("Number of particles in an event"); 00051 parameter->SetParameterRange("np > 0"); 00052 parameter->SetDefaultValue(1); 00053 testerCmd->SetParameter(parameter); 00054 00055 parameter = new G4UIparameter("pname",'s',omittable = true); 00056 parameter->SetGuidance("Particle name in Geant4"); 00057 parameter->SetDefaultValue("pi-"); 00058 G4String candidatelist; 00059 G4int nPtable = particleTable->entries(); 00060 for(G4int i=0;i<nPtable;i++) 00061 { 00062 candidatelist += particleTable->GetParticleName(i); 00063 candidatelist += " "; 00064 } 00065 parameter->SetParameterCandidates(candidatelist); 00066 testerCmd->SetParameter(parameter); 00067 00068 parameter = new G4UIparameter("cosmin",'d',omittable = true); 00069 parameter->SetGuidance("Minimum cos(theta)"); 00070 parameter->SetParameterRange("cosmin >= -1. && cosmin <= 1."); 00071 parameter->SetDefaultValue(-0.8); 00072 testerCmd->SetParameter(parameter); 00073 00074 parameter = new G4UIparameter("cosmax",'d',omittable = true); 00075 parameter->SetGuidance("Maximum cos(theta)"); 00076 parameter->SetParameterRange("cosmax >= -1. && cosmax <= 1."); 00077 parameter->SetDefaultValue(0.8); 00078 testerCmd->SetParameter(parameter); 00079 00080 parameter = new G4UIparameter("phimin",'d',omittable = true); 00081 parameter->SetGuidance("Minimum azimuthal angle in degree"); 00082 parameter->SetParameterRange("phimin >= 0. && phimin <= 360."); 00083 parameter->SetDefaultValue(0.); 00084 testerCmd->SetParameter(parameter); 00085 00086 parameter = new G4UIparameter("phimax",'d',omittable = true); 00087 parameter->SetGuidance("Maximum azimuthal angle in degree"); 00088 parameter->SetParameterRange("phimax >= 0. && phimax <= 360."); 00089 parameter->SetDefaultValue(360.); 00090 testerCmd->SetParameter(parameter); 00091 00092 parameter = new G4UIparameter("pp",'d',omittable = true); 00093 parameter->SetGuidance("Particle Momentum in GeV"); 00094 parameter->SetParameterRange("pp>=0."); 00095 parameter->SetDefaultValue(1.0); 00096 testerCmd->SetParameter(parameter); 00097 00098 parameter = new G4UIparameter("dp",'d',omittable = true); 00099 parameter->SetGuidance("Particle Momentum range in GeV"); 00100 parameter->SetParameterRange("dp>=0."); 00101 parameter->SetDefaultValue(0.0); 00102 testerCmd->SetParameter(parameter); 00103 00104 parameter = new G4UIparameter("x",'d',omittable = true); 00105 parameter->SetGuidance("Particle x position"); 00106 parameter->SetParameterRange("x >= -10000 && x <= 10000"); 00107 parameter->SetDefaultValue(0.); 00108 testerCmd->SetParameter(parameter); 00109 00110 parameter = new G4UIparameter("y",'d',omittable = true); 00111 parameter->SetGuidance("Particle y position"); 00112 parameter->SetParameterRange("y >= -10000 && y <= 10000"); 00113 parameter->SetDefaultValue(0.); 00114 testerCmd->SetParameter(parameter); 00115 00116 parameter = new G4UIparameter("z",'d',omittable = true); 00117 parameter->SetGuidance("Particle z position"); 00118 parameter->SetParameterRange("z >= -10000 && z <= 10000"); 00119 parameter->SetDefaultValue(0.); 00120 testerCmd->SetParameter(parameter); 00121 00122 parameter = new G4UIparameter("pname",'s',omittable = true); 00123 parameter->SetGuidance("Particle name in Geant4"); 00124 parameter->SetDefaultValue("mu-"); 00125 cosmicCmd->SetParameter(parameter); 00126 00127 parameter = new G4UIparameter("x",'d',omittable = true); 00128 parameter->SetGuidance("Particle x position"); 00129 parameter->SetParameterRange("x >= -10000 && x <= 10000"); 00130 parameter->SetDefaultValue(0.); 00131 cosmicCmd->SetParameter(parameter); 00132 00133 parameter = new G4UIparameter("y",'d',omittable = true); 00134 parameter->SetGuidance("Particle y position"); 00135 parameter->SetParameterRange("y >= -10000 && y <= 10000"); 00136 parameter->SetDefaultValue(0.); 00137 cosmicCmd->SetParameter(parameter); 00138 00139 parameter = new G4UIparameter("z",'d',omittable = true); 00140 parameter->SetGuidance("Particle z position"); 00141 parameter->SetParameterRange("z >= -10000 && z <= 10000"); 00142 parameter->SetDefaultValue(0.); 00143 cosmicCmd->SetParameter(parameter); 00144 00145 }
BesPrimaryGeneratorMessenger::~BesPrimaryGeneratorMessenger | ( | ) |
Definition at line 147 of file BesPrimaryGeneratorMessenger.cc.
References cosmicCmd, genbesCmd, generatorDirectory, gennamCmd, and testerCmd.
00148 { 00149 delete generatorDirectory; 00150 delete gennamCmd; 00151 delete genbesCmd; 00152 delete testerCmd; 00153 delete cosmicCmd; 00154 }
G4String BesPrimaryGeneratorMessenger::GetCurrentValue | ( | G4UIcommand * | command | ) |
Definition at line 195 of file BesPrimaryGeneratorMessenger.cc.
References genbesCmd, gennamCmd, BesPrimaryGeneratorAction::GetGenbesName(), BesPrimaryGeneratorAction::GetGeneratorName(), and myAction.
00196 { 00197 G4String cv; 00198 if( command == gennamCmd ) 00199 {cv = myAction->GetGeneratorName() ;} 00200 else if ( command == genbesCmd ) 00201 { cv = myAction->GetGenbesName();} 00202 return cv; 00203 }
void BesPrimaryGeneratorMessenger::SetNewValue | ( | G4UIcommand * | command, | |
G4String | newValues | |||
) |
Definition at line 156 of file BesPrimaryGeneratorMessenger.cc.
References cosmicCmd, genbesCmd, gennamCmd, is, myAction, BesPrimaryGeneratorAction::SetDeltaP(), BesPrimaryGeneratorAction::SetGenbesName(), BesPrimaryGeneratorAction::SetGeneratorName(), BesPrimaryGeneratorAction::SetMaxCos(), BesPrimaryGeneratorAction::SetMinCos(), BesPrimaryGeneratorAction::SetMomentum(), BesPrimaryGeneratorAction::SetNParticle(), BesPrimaryGeneratorAction::SetParticleName(), BesPrimaryGeneratorAction::SetPhiEnd(), BesPrimaryGeneratorAction::SetPhiStart(), BesPrimaryGeneratorAction::SetPosX(), BesPrimaryGeneratorAction::SetPosY(), BesPrimaryGeneratorAction::SetPosZ(), testerCmd, and x.
00157 { 00158 if( command == gennamCmd ) 00159 { myAction->SetGeneratorName(newValue); } 00160 else if( command == genbesCmd ) 00161 { myAction->SetGenbesName(newValue); } 00162 else if( command == testerCmd ) 00163 { G4int np1; 00164 G4String pname1; 00165 G4double cosmin1,cosmax1,phimin1,phimax1,pp1,dp1,x,y,z; 00166 std::istringstream is ((char*)newValue.data()); 00167 is >> np1 >> pname1 >> cosmin1 >> cosmax1 00168 >> phimin1 >> phimax1 >> pp1 >> dp1 >> x >> y >> z; 00169 00170 myAction->SetNParticle(np1); 00171 myAction->SetParticleName(pname1); 00172 myAction->SetMinCos(cosmin1); 00173 myAction->SetMaxCos(cosmax1); 00174 myAction->SetPhiStart(phimin1); 00175 myAction->SetPhiEnd(phimax1); 00176 myAction->SetMomentum(pp1); 00177 myAction->SetDeltaP(dp1); 00178 myAction->SetPosX(x); 00179 myAction->SetPosY(y); 00180 myAction->SetPosZ(z); 00181 } 00182 else if( command == cosmicCmd ) 00183 { 00184 G4String pname; 00185 G4double x,y,z; 00186 std::istringstream is ((char*)newValue.data()); 00187 is >> pname >> x >> y >> z; 00188 myAction->SetParticleName(pname); 00189 myAction->SetPosX(x); 00190 myAction->SetPosY(y); 00191 myAction->SetPosZ(z); 00192 } 00193 }
G4UIcommand* BesPrimaryGeneratorMessenger::cosmicCmd [private] |
Definition at line 42 of file BesPrimaryGeneratorMessenger.hh.
Referenced by BesPrimaryGeneratorMessenger(), SetNewValue(), and ~BesPrimaryGeneratorMessenger().
G4UIcmdWithAString* BesPrimaryGeneratorMessenger::genbesCmd [private] |
Definition at line 40 of file BesPrimaryGeneratorMessenger.hh.
Referenced by BesPrimaryGeneratorMessenger(), GetCurrentValue(), SetNewValue(), and ~BesPrimaryGeneratorMessenger().
G4UIdirectory* BesPrimaryGeneratorMessenger::generatorDirectory [private] |
Definition at line 38 of file BesPrimaryGeneratorMessenger.hh.
Referenced by BesPrimaryGeneratorMessenger(), and ~BesPrimaryGeneratorMessenger().
G4UIcmdWithAString* BesPrimaryGeneratorMessenger::gennamCmd [private] |
Definition at line 39 of file BesPrimaryGeneratorMessenger.hh.
Referenced by BesPrimaryGeneratorMessenger(), GetCurrentValue(), SetNewValue(), and ~BesPrimaryGeneratorMessenger().
Definition at line 35 of file BesPrimaryGeneratorMessenger.hh.
Referenced by GetCurrentValue(), and SetNewValue().
G4ParticleTable* BesPrimaryGeneratorMessenger::particleTable [private] |
Definition at line 36 of file BesPrimaryGeneratorMessenger.hh.
Referenced by BesPrimaryGeneratorMessenger().
G4UIcommand* BesPrimaryGeneratorMessenger::testerCmd [private] |
Definition at line 41 of file BesPrimaryGeneratorMessenger.hh.
Referenced by BesPrimaryGeneratorMessenger(), SetNewValue(), and ~BesPrimaryGeneratorMessenger().