File indexing completed on 2025-01-31 09:21:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 #include <G4UIcmdWithAnInteger.hh>
0045 #include "CexmcEventActionMessenger.hh"
0046 #include "CexmcEventAction.hh"
0047 #include "CexmcMessenger.hh"
0048
0049
0050 CexmcEventActionMessenger::CexmcEventActionMessenger(
0051 CexmcEventAction * eventAction_ ) :
0052 eventAction( eventAction_ ), setVerboseLevel( NULL ),
0053 setVerboseDrawLevel( NULL )
0054 {
0055 setVerboseLevel = new G4UIcmdWithAnInteger(
0056 ( CexmcMessenger::eventDirName + "verbose" ).c_str() , this );
0057 setVerboseLevel->SetGuidance( "\n 0 - do not print messages,\n"
0058 " 1 - print messages if studied interaction "
0059 "triggered,\n"
0060 " 2 - print messages on event trigger\n"
0061 " (reconstructed data will also be printed in "
0062 "this case),\n"
0063 " 3 - print messages if studied interaction or "
0064 "event\n triggered,\n"
0065 " 4 - print messages on every event" );
0066 setVerboseLevel->SetParameterName( "Verbose", false );
0067 setVerboseLevel->SetRange( "Verbose >= 0 && Verbose <= 4" );
0068 setVerboseLevel->SetDefaultValue( 0 );
0069 setVerboseLevel->AvailableForStates( G4State_PreInit, G4State_Idle );
0070
0071 setVerboseDrawLevel = new G4UIcmdWithAnInteger(
0072 ( CexmcMessenger::visDirName + "verbose" ).c_str() , this );
0073 setVerboseDrawLevel->SetGuidance( "\n 0 - draw nothing,\n"
0074 " 1 - draw trajectories and track points if studied "
0075 "interaction\n triggered,\n"
0076 " 2 - draw trajectories and track points on event "
0077 "trigger\n"
0078 " (reconstructed data will also be drawn in "
0079 "this case),\n"
0080 " 3 - draw trajectories and track points if "
0081 "studied interaction\n or event "
0082 "triggered,\n"
0083 " 4 - draw trajectories and/or track points on "
0084 "every event" );
0085 setVerboseDrawLevel->SetParameterName( "VerboseDraw", false );
0086 setVerboseDrawLevel->SetRange( "VerboseDraw >= 0 && VerboseDraw <= 4" );
0087 setVerboseDrawLevel->SetDefaultValue( 4 );
0088 setVerboseDrawLevel->AvailableForStates( G4State_PreInit, G4State_Idle );
0089 }
0090
0091
0092 CexmcEventActionMessenger::~CexmcEventActionMessenger()
0093 {
0094 delete setVerboseLevel;
0095 delete setVerboseDrawLevel;
0096 }
0097
0098
0099 void CexmcEventActionMessenger::SetNewValue( G4UIcommand * cmd,
0100 G4String value )
0101 {
0102 do
0103 {
0104 if ( cmd == setVerboseLevel )
0105 {
0106 eventAction->SetVerboseOnCexmcLevel(
0107 G4UIcmdWithAnInteger::GetNewIntValue( value ) );
0108 break;
0109 }
0110 if ( cmd == setVerboseDrawLevel )
0111 {
0112 eventAction->SetVerboseDrawLevel(
0113 G4UIcmdWithAnInteger::GetNewIntValue( value ) );
0114 break;
0115 }
0116 } while ( false );
0117 }
0118