34 #include "HGCal/TBStandaloneSimulator/interface/PrimaryGeneratorMessenger.hh"
35 #include "HGCal/TBStandaloneSimulator/interface/PrimaryGeneratorAction.hh"
37 #include "G4UIdirectory.hh"
38 #include "G4UIcmdWithAString.hh"
42 PrimaryGeneratorMessenger::PrimaryGeneratorMessenger(
43 PrimaryGeneratorAction* Gun)
46 dir =
new G4UIdirectory(
"/generator/");
47 dir-> SetGuidance(
"Control commands for primary generator");
49 select =
new G4UIcmdWithAString(
"/generator/select",
this);
50 select-> SetGuidance(
"select generator type");
51 select-> SetParameterName(
"generator_type",
false,
false);
52 select-> SetCandidates(
"particleGun pythia hepmcAscii");
53 select-> SetDefaultValue(
"particleGun");
55 RndmCmd =
new G4UIcmdWithAString(
"/generator/particleGun/rndm",
this);
56 RndmCmd->SetGuidance(
"Shoot randomly the incident particle.");
57 RndmCmd->SetGuidance(
" Choice : on(default), off");
58 RndmCmd->SetParameterName(
"choice",
true);
59 RndmCmd->SetDefaultValue(
"on");
60 RndmCmd->SetCandidates(
"on off");
61 RndmCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
66 PrimaryGeneratorMessenger::~PrimaryGeneratorMessenger()
76 void PrimaryGeneratorMessenger::SetNewValue(
77 G4UIcommand* command, G4String newValue)
79 if ( command == select) {
80 Action->SetGenerator(newValue);
81 G4cout <<
"current generator type: "
82 << Action-> GetGeneratorName() << G4endl;
83 }
else if( command == RndmCmd ) {
84 Action->SetRndmFlag(newValue);
92 G4String PrimaryGeneratorMessenger::GetCurrentValue(G4UIcommand* command)
96 if (command == select) {
97 cv = Action-> GetGeneratorName();