Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:21:57

0001 #include "Fun4AllMessenger.h"
0002 
0003 #include <fun4all/Fun4AllServer.h>
0004 
0005 #include <Geant4/G4ApplicationState.hh>  // for G4State_Idle
0006 #include <Geant4/G4String.hh>
0007 #include <Geant4/G4UIcmdWithAnInteger.hh>
0008 #include <Geant4/G4UIdirectory.hh>  // for G4UIdirectory
0009 
0010 Fun4AllMessenger::Fun4AllMessenger(Fun4AllServer* ffa)
0011   : m_Fun4AllDir(new G4UIdirectory("/Fun4All/"))
0012   , m_RunCmd(new G4UIcmdWithAnInteger("/Fun4All/run", this))
0013   , se(ffa)
0014 {
0015   m_Fun4AllDir->SetGuidance("UI commands to run Fun4All commands");
0016 
0017   m_RunCmd->SetGuidance("Run Event(s)");
0018   m_RunCmd->SetParameterName("nEvents", true);
0019   m_RunCmd->AvailableForStates(G4State_Idle);
0020 }
0021 
0022 Fun4AllMessenger::~Fun4AllMessenger()
0023 {
0024   delete m_RunCmd;
0025   delete m_Fun4AllDir;
0026 }
0027 
0028 void Fun4AllMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0029 {
0030   if (command == m_RunCmd)
0031   {
0032     se->run(G4UIcmdWithAnInteger::GetNewIntValue(newValue));
0033   }
0034 }