QwGeant4
QweakSimEventActionMessenger.cc
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 //
7 /**
8 
9  \file QweakSimEventActionMessenger.cc
10 
11  $Revision: 1.0 $
12  $Date: 2009/10/17 20:02:16 $
13 
14  \author Wouter Deconinck
15 
16 */
17 //=============================================================================
18 
20 
21 // user include
22 #include "QweakSimEventAction.hh"
24 
25 // ----------------------------------------------------------------------------
26 
28  : theEventAction(anEventAction)
29 {
30  G4cout << G4endl << "###### Calling QweakSimEventActionMessenger::QweakSimEventActionMessenger() " << G4endl << G4endl;
31 
32  theTriggerDir = new G4UIdirectory( "/Trigger/" );
33  theTriggerDir->SetGuidance("Software trigger.");
34 
35  theTriggerShowCommand = new G4UIcmdWithoutParameter("/Trigger/Show", this);
36  theTriggerShowCommand->SetGuidance("List trigger conditions.");
37  theTriggerShowCommand->AvailableForStates(G4State_PreInit,G4State_Idle);
38 
39  theTriggerEnableCommand = new G4UIcmdWithAString("/Trigger/Enable", this);
40  theTriggerEnableCommand->SetParameterName("trigger condition", false);
41  theTriggerEnableCommand->SetDefaultValue("3fold");
42  theTriggerEnableCommand->SetGuidance("Enable trigger condition.");
43  theTriggerEnableCommand->AvailableForStates(G4State_Idle);
44 
45  theTriggerDisableCommand = new G4UIcmdWithAString("/Trigger/Disable", this);
46  theTriggerDisableCommand->SetParameterName("trigger condition", false);
47  theTriggerDisableCommand->SetDefaultValue("3fold");
48  theTriggerDisableCommand->SetGuidance("Disable trigger condition.");
49  theTriggerDisableCommand->AvailableForStates(G4State_Idle);
50 
51  thePrintHitsCommand = new G4UIcmdWithABool("/Trigger/PrintHits", this);
52  thePrintHitsCommand->SetParameterName("printhits",true);
53  thePrintHitsCommand->SetDefaultValue("true");
54  thePrintHitsCommand->AvailableForStates(G4State_Init,G4State_Idle);
55 
56  G4cout << G4endl << "###### Leaving QweakSimEventActionMessenger::QweakSimEventActionMessenger() " << G4endl << G4endl;
57 }
58 
59 // ----------------------------------------------------------------------------
60 
62 {
63  G4cout << G4endl << "###### Calling QweakSimEventActionMessenger::~QweakSimEventActionMessenger() " << G4endl << G4endl;
64 
69  if (theTriggerDir) delete theTriggerDir;
70 
71  G4cout << G4endl << "###### Leaving QweakSimEventActionMessenger::~QweakSimEventActionMessenger() " << G4endl << G4endl;
72 }
73 
74 // ----------------------------------------------------------------------------
75 
76 void QweakSimEventActionMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
77 {
78  if ( command == theTriggerShowCommand )
79  {
81  }
82  if ( command == theTriggerEnableCommand )
83  {
84  theEventAction->EnableTrigger(newValue);
85  }
86  if ( command == theTriggerDisableCommand )
87  {
88  theEventAction->DisableTrigger(newValue);
89  }
90  if ( command == thePrintHitsCommand )
91  {
92  theEventAction->SetPrintHits(thePrintHitsCommand->GetNewBoolValue(newValue));
93  }
94 }
void EnableTrigger(const G4String value)
G4UIcmdWithoutParameter * theTriggerShowCommand
void SetPrintHits(bool value)
void SetNewValue(G4UIcommand *, G4String)
void DisableTrigger(const G4String value)
QweakSimEventActionMessenger(QweakSimEventAction *)
Mainly filling/storing the hit event structure at the end of an event.