QwGeant4
EventActionMessenger Class Reference

#include <EventActionMessenger.hh>

Inherits G4UImessenger.

+ Collaboration diagram for EventActionMessenger:

Public Member Functions

 EventActionMessenger (EventAction *)
 
virtual ~EventActionMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 

Private Attributes

EventActionfEventAction
 
G4UIcmdWithAnInteger * fPrintCmd
 
G4UIcmdWithAnInteger * fCmd
 

Detailed Description

Definition at line 55 of file EventActionMessenger.hh.

Constructor & Destructor Documentation

EventActionMessenger::EventActionMessenger ( EventAction evAct)

Definition at line 51 of file EventActionMessenger.cc.

References fCmd, and fPrintCmd.

52  : fEventAction(evAct)
53 {
54  fPrintCmd = new G4UIcmdWithAnInteger("/testhadr/PrintModulo",this);
55  fPrintCmd->SetGuidance("Print events modulo n");
56  fPrintCmd->SetParameterName("EventNb",false);
57  fPrintCmd->SetRange("EventNb>0");
58  fPrintCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
59 
60  fCmd = new G4UIcmdWithAnInteger("/testhadr/DebugEvent",this);
61  fCmd->SetGuidance("D event to debug");
62  fCmd->SetParameterName("fNb",false);
63  fCmd->SetRange("fNb>0");
64  fCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
65 
66 }
G4UIcmdWithAnInteger * fPrintCmd
G4UIcmdWithAnInteger * fCmd
EventActionMessenger::~EventActionMessenger ( )
virtual

Definition at line 70 of file EventActionMessenger.cc.

References fCmd, and fPrintCmd.

71 {
72  delete fPrintCmd;
73  delete fCmd;
74 }
G4UIcmdWithAnInteger * fPrintCmd
G4UIcmdWithAnInteger * fCmd

Member Function Documentation

void EventActionMessenger::SetNewValue ( G4UIcommand *  command,
G4String  newValue 
)
virtual

Definition at line 78 of file EventActionMessenger.cc.

References EventAction::AddEventToDebug(), fCmd, fEventAction, fPrintCmd, and EventAction::SetPrintModulo().

80 {
81  if(command == fPrintCmd)
82  {fEventAction->SetPrintModulo(fPrintCmd->GetNewIntValue(newValue));}
83  if(command == fCmd)
84  {fEventAction->AddEventToDebug(fCmd->GetNewIntValue(newValue));}
85 }
G4UIcmdWithAnInteger * fPrintCmd
G4UIcmdWithAnInteger * fCmd
void SetPrintModulo(G4int val)
Definition: EventAction.hh:84
void AddEventToDebug(G4int val)
Definition: EventAction.hh:89

+ Here is the call graph for this function:

Field Documentation

G4UIcmdWithAnInteger* EventActionMessenger::fCmd
private
EventAction* EventActionMessenger::fEventAction
private

Definition at line 66 of file EventActionMessenger.hh.

Referenced by SetNewValue().

G4UIcmdWithAnInteger* EventActionMessenger::fPrintCmd
private

The documentation for this class was generated from the following files: