Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4AllMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4AllMessenger.cc
1 #include "Fun4AllMessenger.h"
2 
4 
5 #include <Geant4/G4ApplicationState.hh> // for G4State_Idle
6 #include <Geant4/G4String.hh>
7 #include <Geant4/G4UIcmdWithAnInteger.hh>
8 #include <Geant4/G4UIdirectory.hh> // for G4UIdirectory
9 
10 #include <iosfwd> // for std
11 
12 class G4UIcommand;
13 
14 using namespace std;
15 
17  : se(ffa)
18 {
19  m_Fun4AllDir = new G4UIdirectory("/Fun4All/");
20  m_Fun4AllDir->SetGuidance("UI commands to run Fun4All commands");
21  m_RunCmd = new G4UIcmdWithAnInteger("/Fun4All/run", this);
22  m_RunCmd->SetGuidance("Run Event(s)");
23  m_RunCmd->SetParameterName("nEvents", 1);
24  m_RunCmd->AvailableForStates(G4State_Idle);
25 }
26 
28 {
29  delete m_RunCmd;
30  delete m_Fun4AllDir;
31 }
32 
33 void Fun4AllMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
34 {
35  if (command == m_RunCmd)
36  {
37  se->run(m_RunCmd->GetNewIntValue(newValue));
38  }
39 }