#include "LGTrackingMessenger.hh" #include "LGTrackingAction.hh" #include "G4UIdirectory.hh" #include "G4UIcmdWithAnInteger.hh" LGTrackingMessenger::LGTrackingMessenger(LGTrackingAction* tracking_Act) : tracking_Action(tracking_Act) { tracking_Dir = new G4UIdirectory("/visibility/"); tracking_Dir->SetGuidance("tracking visibility commands"); tracking_Cmd = new G4UIcmdWithAnInteger("/visibility/visibility", this); tracking_Cmd->SetGuidance("set the trajectory which creates what you want to observe"); tracking_Cmd->SetParameterName("Visibility Number", true); tracking_Cmd->SetDefaultValue(1); tracking_Cmd->SetRange("1: Primary only 2: Secondaries only 3: e- only 4: e+ only 5: Gammas only 6: Optical photons only 7: All secondaries without optical photons"); tracking_Cmd->AvailableForStates(G4State_Idle); } LGTrackingMessenger::~LGTrackingMessenger() { delete tracking_Dir; delete tracking_Cmd; } void LGTrackingMessenger::SetNewValue(G4UIcommand* command, G4String new_Value) { if (command == tracking_Cmd) { tracking_Action->setNewTrackingVis(tracking_Cmd->GetNewIntValue(new_Value)); } }