Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:07

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 #include <iosfwd>  // for std
0011 
0012 class G4UIcommand;
0013 
0014 using namespace std;
0015 
0016 Fun4AllMessenger::Fun4AllMessenger(Fun4AllServer* ffa)
0017   : se(ffa)
0018 {
0019   m_Fun4AllDir = new G4UIdirectory("/Fun4All/");
0020   m_Fun4AllDir->SetGuidance("UI commands to run Fun4All commands");
0021   m_RunCmd = new G4UIcmdWithAnInteger("/Fun4All/run", this);
0022   m_RunCmd->SetGuidance("Run Event(s)");
0023   m_RunCmd->SetParameterName("nEvents", true);
0024   m_RunCmd->AvailableForStates(G4State_Idle);
0025 }
0026 
0027 Fun4AllMessenger::~Fun4AllMessenger()
0028 {
0029   delete m_RunCmd;
0030   delete m_Fun4AllDir;
0031 }
0032 
0033 void Fun4AllMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0034 {
0035   if (command == m_RunCmd)
0036   {
0037     se->run(m_RunCmd->GetNewIntValue(newValue));
0038   }
0039 }