Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
CexmcRunManagerMessenger Class Reference

#include <CexmcRunManagerMessenger.hh>

Inheritance diagram for CexmcRunManagerMessenger:
G4UImessenger

Public Member Functions

 CexmcRunManagerMessenger (CexmcRunManager *runManager)
 
 ~CexmcRunManagerMessenger ()
 
void SetNewValue (G4UIcommand *cmd, G4String value)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 

Detailed Description

Definition at line 57 of file CexmcRunManagerMessenger.hh.

Constructor & Destructor Documentation

CexmcRunManagerMessenger::CexmcRunManagerMessenger ( CexmcRunManager runManager)
explicit

Definition at line 53 of file CexmcRunManagerMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, CexmcMessenger::geometryDirName, CexmcMessenger::physicsDirName, CexmcMessenger::runDirName, G4UIcmdWithAString::SetCandidates(), G4UIcmdWithAString::SetDefaultValue(), G4UIcmdWithABool::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithABool::SetParameterName(), and CexmcMessenger::visDirName.

54  :
55  runManager( runManager ), setProductionModel( NULL ), setGdmlFile( NULL ),
56  setGuiMacro( NULL ), setEventCountPolicy( NULL ),
57  setEventDataVerboseLevel( NULL ),
58 #ifdef CEXMC_USE_PERSISTENCY
59  replayEvents( NULL ), seekTo( NULL ), skipInteractionsWithoutEDT( NULL ),
60 #endif
61  registerScenePrimitives( NULL ), validateGdmlFile( NULL )
62 {
63  setProductionModel = new G4UIcmdWithAString(
64  ( CexmcMessenger::physicsDirName + "productionModel" ).c_str(), this );
65  setProductionModel->SetGuidance( "Set production model (e.g. pi0 or eta)" );
66  setProductionModel->SetParameterName( "ProductionModel", false );
67  setProductionModel->SetCandidates( "pi0 eta" );
68  setProductionModel->AvailableForStates( G4State_PreInit );
69 
70  setGdmlFile = new G4UIcmdWithAString(
71  ( CexmcMessenger::geometryDirName + "gdmlFile" ).c_str(), this );
72  setGdmlFile->SetGuidance( "GDML file to read geometry from" );
73  setGdmlFile->SetParameterName( "GdmlFile", false );
74  setGdmlFile->AvailableForStates( G4State_PreInit );
75 
76  setGuiMacro = new G4UIcmdWithAString(
77  ( CexmcMessenger::runDirName + "guiMacro" ).c_str(), this );
78  setGuiMacro->SetGuidance( "Set Gui macro file" );
79  setGuiMacro->SetParameterName( "GuiMacro", false );
81 
82  setEventCountPolicy = new G4UIcmdWithAString(
83  ( CexmcMessenger::runDirName + "eventCountPolicy" ).c_str(), this );
84  setEventCountPolicy->SetGuidance( "How number of events is interpreted.\n"
85  " all - all events are accounted,\n"
86  " interaction - events with studied interaction triggered,\n"
87  " trigger - only events with trigger" );
88  setEventCountPolicy->SetParameterName( "EventCountPolicy", false );
89  setEventCountPolicy->SetCandidates( "all interaction trigger" );
90  setEventCountPolicy->SetDefaultValue( "all" );
91  setEventCountPolicy->AvailableForStates( G4State_PreInit, G4State_Idle );
92 
93  setEventDataVerboseLevel = new G4UIcmdWithAString(
94  ( CexmcMessenger::runDirName + "eventDataVerboseLevel" ).c_str(),
95  this );
96  setEventDataVerboseLevel->SetGuidance( "When events will be saved.\n"
97  " nosave - never,\n"
98  " trigger - when energy deposit triggered (EDT),\n"
99  " interaction - when studied interaction triggered (TPT)" );
100  setEventDataVerboseLevel->SetParameterName( "EventDataVerboseLevel",
101  false );
102  setEventDataVerboseLevel->SetCandidates( "nosave trigger interaction" );
103  setEventDataVerboseLevel->SetDefaultValue( "trigger" );
104  setEventDataVerboseLevel->AvailableForStates( G4State_PreInit,
105  G4State_Idle );
106 
107 #ifdef CEXMC_USE_PERSISTENCY
108  replayEvents = new G4UIcmdWithAnInteger(
109  ( CexmcMessenger::runDirName + "replay" ).c_str(), this );
110  replayEvents->SetGuidance( "Replay specified number of events "
111  "\n (available only if a project is read)."
112  "\n If number of events is 0 (or not specified) then all"
113  "\n run will be replayed" );
114  replayEvents->SetParameterName( "ReplayEvents", true );
115  replayEvents->SetRange( "ReplayEvents >= 0" );
116  replayEvents->SetDefaultValue( 0 );
117  replayEvents->AvailableForStates( G4State_PreInit, G4State_Idle );
118 
119  seekTo = new G4UIcmdWithAnInteger(
120  ( CexmcMessenger::runDirName + "seekto" ).c_str(), this );
121  seekTo->SetGuidance( "Seek to specified event id "
122  "(available only if a project is read)."
123  "\n 'seekto 0' brings to the start of run, 'seekto 4' - to the"
124  "\n first recorded event with interaction after fourth recorded"
125  "\n event with trigger" );
126  seekTo->SetParameterName( "SeekTo", false );
127  seekTo->SetRange( "SeekTo >= 0" );
128  seekTo->SetDefaultValue( 0 );
129  seekTo->AvailableForStates( G4State_PreInit, G4State_Idle );
130 
131  skipInteractionsWithoutEDT = new G4UIcmdWithABool(
132  ( CexmcMessenger::runDirName + "skipInteractionsWithoutEDT" ).c_str(),
133  this );
134  skipInteractionsWithoutEDT->SetGuidance( "Do not write interactions into "
135  ".fdb file\n if event was not triggered (effective only when a "
136  "project is read and then\n written to another project and only if "
137  "event data verbose level is\n 'trigger')" );
138  skipInteractionsWithoutEDT->SetParameterName( "skipInteractionsWithoutEDT",
139  true );
140  skipInteractionsWithoutEDT->SetDefaultValue( true );
141  skipInteractionsWithoutEDT->AvailableForStates( G4State_PreInit,
142  G4State_Idle );
143 #endif
144 
145  registerScenePrimitives = new G4UIcmdWithoutParameter(
146  ( CexmcMessenger::visDirName + "registerScenePrimitives" ).c_str(),
147  this );
148  registerScenePrimitives->SetGuidance( "Register custom scene primitives "
149  "(radial lines,\n inner crystals highlights etc.)" );
150  registerScenePrimitives->AvailableForStates( G4State_PreInit,
151  G4State_Idle );
152 
153  validateGdmlFile = new G4UIcmdWithABool(
154  ( CexmcMessenger::geometryDirName + "validateGdmlFile" ).c_str(),
155  this );
156  validateGdmlFile->SetGuidance( "If GDML file will be validated or not" );
157  validateGdmlFile->SetParameterName( "ValidateGdmlFile", true );
158  validateGdmlFile->SetDefaultValue( true );
159  validateGdmlFile->AvailableForStates( G4State_PreInit );
160 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4String physicsDirName
static G4String runDirName
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
void SetDefaultValue(const char *defVal)
void SetCandidates(const char *candidateList)
static G4String visDirName
static G4String geometryDirName
CexmcRunManagerMessenger::~CexmcRunManagerMessenger ( )

Definition at line 163 of file CexmcRunManagerMessenger.cc.

164 {
165  delete setProductionModel;
166  delete setGdmlFile;
167  delete setGuiMacro;
168  delete setEventCountPolicy;
169  delete setEventDataVerboseLevel;
170 #ifdef CEXMC_USE_PERSISTENCY
171  delete replayEvents;
172  delete seekTo;
173  delete skipInteractionsWithoutEDT;
174 #endif
175  delete registerScenePrimitives;
176  delete validateGdmlFile;
177 }

Member Function Documentation

void CexmcRunManagerMessenger::SetNewValue ( G4UIcommand cmd,
G4String  value 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 180 of file CexmcRunManagerMessenger.cc.

References CexmcCountAllEvents, CexmcCountEventsWithInteraction, CexmcCountEventsWithTrigger, CexmcEtaProduction, CexmcPionZeroProduction, CexmcUnknownProductionModel, CexmcWriteEventDataOnEveryEDT, CexmcWriteEventDataOnEveryTPT, CexmcWriteNoEventData, G4UIcmdWithABool::GetNewBoolValue(), G4UIcmdWithAnInteger::GetNewIntValue(), CexmcRunManager::RegisterScenePrimitives(), CexmcRunManager::SetEventCountPolicy(), CexmcRunManager::SetEventDataVerboseLevel(), CexmcRunManager::SetGdmlFileName(), CexmcRunManager::SetGdmlFileValidation(), CexmcRunManager::SetGuiMacroName(), and CexmcRunManager::SetProductionModelType().

182 {
183  do
184  {
185  if ( cmd == setProductionModel )
186  {
187  CexmcProductionModelType productionModelType(
189  do
190  {
191  if ( value == "pi0" )
192  {
193  productionModelType = CexmcPionZeroProduction;
194  break;
195  }
196  if ( value == "eta" )
197  {
198  productionModelType = CexmcEtaProduction;
199  break;
200  }
201  } while ( false );
202  runManager->SetProductionModelType( productionModelType );
203  break;
204  }
205  if ( cmd == setGdmlFile )
206  {
207  runManager->SetGdmlFileName( value );
208  break;
209  }
210  if ( cmd == setGuiMacro )
211  {
212  runManager->SetGuiMacroName( value );
213  break;
214  }
215  if ( cmd == setEventCountPolicy )
216  {
217  CexmcEventCountPolicy eventCountPolicy( CexmcCountAllEvents );
218  do
219  {
220  if ( value == "interaction" )
221  {
222  eventCountPolicy = CexmcCountEventsWithInteraction;
223  break;
224  }
225  if ( value == "trigger" )
226  {
227  eventCountPolicy = CexmcCountEventsWithTrigger;
228  break;
229  }
230  } while ( false );
231  runManager->SetEventCountPolicy( eventCountPolicy );
232  break;
233  }
234  if ( cmd == setEventDataVerboseLevel )
235  {
236  CexmcEventDataVerboseLevel eventDataVerboseLevel(
238  do
239  {
240  if ( value == "nosave" )
241  {
242  eventDataVerboseLevel = CexmcWriteNoEventData;
243  break;
244  }
245  if ( value == "trigger" )
246  {
247  eventDataVerboseLevel = CexmcWriteEventDataOnEveryEDT;
248  break;
249  }
250  if ( value == "interaction" )
251  {
252  eventDataVerboseLevel = CexmcWriteEventDataOnEveryTPT;
253  break;
254  }
255  } while ( false );
256  runManager->SetEventDataVerboseLevel( eventDataVerboseLevel );
257  break;
258  }
259 #ifdef CEXMC_USE_PERSISTENCY
260  if ( cmd == replayEvents )
261  {
262  runManager->ReplayEvents(
264  break;
265  }
266  if ( cmd == seekTo )
267  {
268  runManager->SeekTo( G4UIcmdWithAnInteger::GetNewIntValue( value ) );
269  break;
270  }
271  if ( cmd == skipInteractionsWithoutEDT )
272  {
273  runManager->SkipInteractionsWithoutEDTonWrite(
275  break;
276  }
277 #endif
278  if ( cmd == registerScenePrimitives )
279  {
280  runManager->RegisterScenePrimitives();
281  break;
282  }
283  if ( cmd == validateGdmlFile )
284  {
285  runManager->SetGdmlFileValidation(
287  break;
288  }
289  } while ( false );
290 }
static G4int GetNewIntValue(const char *paramString)
CexmcProductionModelType
Definition: CexmcCommon.hh:91
static G4bool GetNewBoolValue(const char *paramString)
void SetGdmlFileValidation(G4bool on=true)
void RegisterScenePrimitives(void)
CexmcEventCountPolicy
Definition: CexmcCommon.hh:107
void SetGdmlFileName(const G4String &gdmlFileName_)
void SetGuiMacroName(const G4String &guiMacroName_)
CexmcEventDataVerboseLevel
Definition: CexmcCommon.hh:184
void SetProductionModelType(CexmcProductionModelType productionModelType_)
void SetEventCountPolicy(CexmcEventCountPolicy value)
void SetEventDataVerboseLevel(CexmcEventDataVerboseLevel value)

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