Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4UImanager.cc
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4UImanager.cc 110270 2018-05-17 14:38:26Z gcosmo $
28 //
29 //
30 // ---------------------------------------------------------------------
31 
32 #include "G4UImanager.hh"
33 #include "G4UIcommandTree.hh"
34 #include "G4UIcommand.hh"
35 #include "G4UIsession.hh"
36 #include "G4UIbatch.hh"
37 #include "G4UIcontrolMessenger.hh"
38 #include "G4UnitsMessenger.hh"
40 #include "G4ios.hh"
41 #include "G4strstreambuf.hh"
42 #include "G4StateManager.hh"
43 #include "G4UIaliasList.hh"
44 #include "G4Tokenizer.hh"
45 #include "G4MTcoutDestination.hh"
46 #include "G4UIbridge.hh"
47 #include "G4Threading.hh"
48 
49 #include <sstream>
50 #include <fstream>
51 
53 {
54  G4ThreadLocalStatic G4UImanager* _instance = nullptr;
55  return _instance;
56 }
57 
59 {
60  G4ThreadLocalStatic bool _instance = false;
61  return _instance;
62 }
63 
65 {
66  static G4UImanager* _instance = nullptr;
67  return _instance;
68 }
70 
72 
74 {
75  if(!fUImanager())
76  {
78  {
79  fUImanager() = new G4UImanager;
81  }
82  }
83  return fUImanager();
84 }
85 
87 { return fMasterUImanager(); }
88 
90  : G4VStateDependent(true),
91  UImessenger(0), UnitsMessenger(0), CoutMessenger(0),
92  isMaster(false),bridges(0),
93  ignoreCmdNotFound(false), stackCommandsForBroadcast(false),
94  threadID(-1), threadCout(0)
95 {
96  savedCommand = 0;
97  treeTop = new G4UIcommandTree("/");
99  G4String nullString;
100  savedParameters = nullString;
101  verboseLevel = 0;
102  saveHistory = false;
103  session = NULL;
104  g4UIWindow = NULL;
106  pauseAtBeginOfEvent = false;
107  pauseAtEndOfEvent = false;
108  maxHistSize = 20;
109  searchPath="";
110  commandStack = new std::vector<G4String>;
111 }
112 
114 {
118 }
119 
121 {
122  if(bridges)
123  {
124  std::vector<G4UIbridge*>::iterator itr = bridges->begin();
125  for(;itr!=bridges->end();itr++)
126  { delete *itr; }
127  delete bridges;
128  }
129  SetCoutDestination(NULL);
130  histVec.clear();
131  if(saveHistory) historyFile.close();
132  delete CoutMessenger;
133  delete UnitsMessenger;
134  delete UImessenger;
135  delete treeTop;
136  delete aliasList;
137  fUImanagerHasBeenKilled() = true;
138  fUImanager() = NULL;
139  if(commandStack)
140  {
141  commandStack->clear();
142  delete commandStack;
143  }
144  if(threadID >= 0)
145  {
146  if(threadCout) delete threadCout;
148  threadID = -1;
149  }
150 }
151 
153  : G4VStateDependent(true)
154 {
157  aliasList = ui.aliasList;
158  g4UIWindow = ui.g4UIWindow;
160  session = ui.session;
161  treeTop = ui.treeTop;
164  CoutMessenger = 0;
168  isMaster = ui.isMaster;
169  bridges = ui.bridges;
173  threadID = ui.threadID;
174  threadCout = ui.threadCout;
175  CreateMessenger();
176 }
177 
179 { return right; }
181 { return (this==&right); }
183 { return (this!=&right); }
184 
186 { doublePrecisionStr = val; }
188 { return doublePrecisionStr; }
189 
191 {
192  G4String theCommand = aCommand;
193  savedCommand = treeTop->FindPath( theCommand );
194  if( savedCommand == NULL )
195  {
196  G4cerr << "command not found" << G4endl;
197  return G4String();
198  }
199  return savedCommand->GetCurrentValue();
200 }
201 
203 G4int parameterNumber, G4bool reGet)
204 {
205  if(reGet || savedCommand == NULL)
206  {
207  savedParameters = GetCurrentValues( aCommand );
208  }
209  G4Tokenizer savedToken( savedParameters );
210  G4String token;
211  for(G4int i_thParameter=0;i_thParameter<parameterNumber;i_thParameter++)
212  {
213  token = savedToken();
214  if( token.isNull() ) return G4String();
215  if( token[(size_t)0] == '"' )
216  {
217  token.append(" ");
218  token.append(savedToken("\""));
219  }
220  }
221  return token;
222 }
223 
225 const char * aParameterName, G4bool reGet)
226 {
227  if(reGet || savedCommand == NULL)
228  {
229  G4String parameterValues = GetCurrentValues( aCommand );
230  }
231  for(G4int i=0;i<savedCommand->GetParameterEntries();i++)
232  {
233  if( aParameterName ==
235  return GetCurrentStringValue(aCommand,i+1,false);
236  }
237  return G4String();
238 }
239 
241 const char * aParameterName, G4bool reGet)
242 {
243  G4String targetParameter =
244  GetCurrentStringValue( aCommand, aParameterName, reGet );
245  G4int value;
246  const char* t = targetParameter;
247  std::istringstream is(t);
248  is >> value;
249  return value;
250 }
251 
253 G4int parameterNumber, G4bool reGet)
254 {
255  G4String targetParameter =
256  GetCurrentStringValue( aCommand, parameterNumber, reGet );
257  G4int value;
258  const char* t = targetParameter;
259  std::istringstream is(t);
260  is >> value;
261  return value;
262 }
263 
265 const char * aParameterName, G4bool reGet)
266 {
267  G4String targetParameter =
268  GetCurrentStringValue( aCommand, aParameterName, reGet );
269  G4double value;
270  const char* t = targetParameter;
271  std::istringstream is(t);
272  is >> value;
273  return value;
274 }
275 
277 G4int parameterNumber, G4bool reGet)
278 {
279  G4String targetParameter =
280  GetCurrentStringValue( aCommand, parameterNumber, reGet );
281  G4double value;
282  const char* t = targetParameter;
283  std::istringstream is(t);
284  is >> value;
285  return value;
286 }
287 
289 {
290  treeTop->AddNewCommand( newCommand );
292  { fMasterUImanager()->AddWorkerCommand(newCommand); }
293 }
294 
296 {
297  treeTop->AddNewCommand( newCommand, true );
298 }
299 
301 {
302  treeTop->RemoveCommand( aCommand );
304  { fMasterUImanager()->RemoveWorkerCommand(aCommand); }
305 }
306 
308 {
309  treeTop->RemoveCommand( aCommand, true );
310 }
311 
312 void G4UImanager::ExecuteMacroFile(const char * fileName)
313 {
314  G4UIsession* batchSession = new G4UIbatch(fileName,session);
315  session = batchSession;
316  G4UIsession* previousSession = session->SessionStart();
317  delete session;
318  session = previousSession;
319 }
320 
321 void G4UImanager::LoopS(const char* valueList)
322 {
323  G4String vl = valueList;
324  G4Tokenizer parameterToken(vl);
325  G4String mf = parameterToken();
326  G4String vn = parameterToken();
327  G4String c1 = parameterToken();
328  c1 += " ";
329  c1 += parameterToken();
330  c1 += " ";
331  c1 += parameterToken();
332  const char* t1 = c1;
333  std::istringstream is(t1);
334  G4double d1;
335  G4double d2;
336  G4double d3;
337  is >> d1 >> d2 >> d3;
338  Loop(mf,vn,d1,d2,d3);
339 }
340 
341 void G4UImanager::Loop(const char * macroFile,const char * variableName,
342  G4double initialValue,G4double finalValue,G4double stepSize)
343 {
344  G4String cd;
345  if (stepSize > 0) {
346  for(G4double d=initialValue;d<=finalValue;d+=stepSize)
347  {
348  std::ostringstream os;
349  os << d;
350  cd += os.str();
351  cd += " ";
352  }
353  } else {
354  for(G4double d=initialValue;d>=finalValue;d+=stepSize)
355  {
356  std::ostringstream os;
357  os << d;
358  cd += os.str();
359  cd += " ";
360  }
361  }
362  Foreach(macroFile,variableName,cd);
363 }
364 
365 void G4UImanager::ForeachS(const char* valueList)
366 {
367  G4String vl = valueList;
368  G4Tokenizer parameterToken(vl);
369  G4String mf = parameterToken();
370  G4String vn = parameterToken();
371  G4String c1 = parameterToken();
372  G4String ca;
373  while(!((ca=parameterToken()).isNull()))
374  {
375  c1 += " ";
376  c1 += ca;
377  }
378 
379  G4String aliasValue = c1;
380  if(aliasValue(0)=='"')
381  {
382  G4String strippedValue;
383  if(aliasValue(aliasValue.length()-1)=='"')
384  { strippedValue = aliasValue(1,aliasValue.length()-2); }
385  else
386  { strippedValue = aliasValue(1,aliasValue.length()-1); }
387  aliasValue = strippedValue;
388  }
389 
390 // Foreach(mf,vn,c1);
391  Foreach(mf,vn,aliasValue);
392 }
393 
394 void G4UImanager::Foreach(const char * macroFile,const char * variableName,
395  const char * candidates)
396 {
397  G4String candidatesString = candidates;
398  G4Tokenizer parameterToken( candidatesString );
399  G4String cd;
400  while(!((cd=parameterToken()).isNull()))
401  {
402  G4String vl = variableName;
403  vl += " ";
404  vl += cd;
405  SetAlias(vl);
406  ExecuteMacroFile(FindMacroPath(macroFile));
407  }
408 }
409 
410 
412 {
413  G4String aCommand = aCmd;
414  G4int ia = aCommand.index("{");
415  G4int iz = aCommand.index("#");
416  while((ia != G4int(std::string::npos))&&((iz==G4int(std::string::npos))||(ia<iz)))
417  {
418  G4int ibx = -1;
419  while(ibx<0)
420  {
421  G4int ib = aCommand.index("}");
422  if( ib == G4int(std::string::npos) )
423  {
424  G4cerr << aCommand << G4endl;
425  for(G4int i=0;i<ia;i++) G4cerr << " ";
426  G4cerr << "^" << G4endl;
427  G4cerr << "Unmatched alias parenthis -- command ignored" << G4endl;
428  G4String nullStr;
429  return nullStr;
430  }
431  G4String ps = aCommand(ia+1,aCommand.length()-(ia+1));
432  G4int ic = ps.index("{");
433  G4int id = ps.index("}");
434  if(ic!=G4int(std::string::npos) && ic < id)
435  { ia+=ic+1; }
436  else
437  { ibx = ib; }
438  }
439  //--- Here ia represents the position of innermost "{"
440  //--- and ibx represents corresponding "}"
441  G4String subs;
442  if(ia>0) subs = aCommand(0,ia);
443  G4String alis = aCommand(ia+1,ibx-ia-1);
444  G4String rems = aCommand(ibx+1,aCommand.length()-ibx);
445  // G4cout << "<" << subs << "> <" << alis << "> <" << rems << ">" << G4endl;
446  G4String* alVal = aliasList->FindAlias(alis);
447  if(!alVal)
448  {
449  G4cerr << "Alias <" << alis << "> not found -- command ignored" << G4endl;
450  G4String nullStr;
451  return nullStr;
452  }
453  aCommand = subs+(*alVal)+rems;
454  ia = aCommand.index("{");
455  }
456  return aCommand;
457 }
458 
460 {
461  return ApplyCommand(aCmd.data());
462 }
463 
464 #include "G4Threading.hh"
465 
467 {
468  G4String aCommand = SolveAlias(aCmd);
469  if(aCommand.isNull()) return fAliasNotFound;
470  if(verboseLevel) G4cout << aCommand << G4endl;
471  G4String commandString;
472  G4String commandParameter;
473 
474  G4int i = aCommand.index(" ");
475  if( i != G4int(std::string::npos) )
476  {
477  commandString = aCommand(0,i);
478  commandParameter = aCommand(i+1,aCommand.length()-(i+1));
479  }
480  else
481  {
482  commandString = aCommand;
483  }
484 
485  // remove doubled slash
486  G4int len = commandString.length();
487  G4int ll = 0;
488  G4String a1;
489  G4String a2;
490  while(ll<len-1)
491  {
492  if(commandString(ll,2)=="//")
493  {
494  if(ll==0)
495  { commandString.remove(ll,1); }
496  else
497  {
498  a1 = commandString(0,ll);
499  a2 = commandString(ll+1,len-ll-1);
500  commandString = a1+a2;
501  }
502  len--;
503  }
504  else
505  { ll++; }
506  }
507 
508  if(isMaster&&bridges)
509  {
510  std::vector<G4UIbridge*>::iterator itr = bridges->begin();
511  for(;itr!=bridges->end();itr++)
512  {
513  G4int leng = (*itr)->DirLength();
514  if(commandString(0,leng)==(*itr)->DirName())
515  { return (*itr)->LocalUI()->ApplyCommand(commandString+" "+commandParameter); }
516  }
517  }
518 
519  G4UIcommand * targetCommand = treeTop->FindPath( commandString );
520  if( targetCommand == NULL )
521  {
523  {
525  { commandStack->push_back(commandString+" "+commandParameter); }
526  return fCommandSucceeded;
527  }
528  else
529  { return fCommandNotFound; }
530  }
531 
532  if(stackCommandsForBroadcast && targetCommand->ToBeBroadcasted())
533  { commandStack->push_back(commandString+" "+commandParameter); }
534 
535  if(!(targetCommand->IsAvailable()))
536  { return fIllegalApplicationState; }
537 
538  if(saveHistory) historyFile << aCommand << G4endl;
539  if( G4int(histVec.size()) >= maxHistSize )
540  { histVec.erase(histVec.begin()); }
541  histVec.push_back(aCommand);
542 
543  targetCommand->ResetFailure();
544  G4int commandFailureCode = targetCommand->DoIt( commandParameter );
545  if(commandFailureCode==0)
546  {
547  G4int additionalFailureCode = targetCommand->IfCommandFailed();
548  if(additionalFailureCode > 0)
549  {
551  msg << targetCommand->GetFailureDescription() << "\n"
552  << "Error code : " << additionalFailureCode;
553  G4Exception("G4UImanager::ApplyCommand","UIMAN0123",
554  JustWarning,msg);
555  commandFailureCode += additionalFailureCode;
556  }
557  }
558  return commandFailureCode;
559 }
560 
561 void G4UImanager::StoreHistory(const char* fileName)
562 { StoreHistory(true,fileName); }
563 
564 void G4UImanager::StoreHistory(G4bool historySwitch,const char* fileName)
565 {
566  if(historySwitch)
567  {
568  if(saveHistory)
569  { historyFile.close(); }
570  historyFile.open((char*)fileName);
571  saveHistory = true;
572  }
573  else
574  {
575  historyFile.close();
576  saveHistory = false;
577  }
578  saveHistory = historySwitch;
579 }
580 
581 void G4UImanager::PauseSession(const char* msg)
582 {
584 }
585 
586 void G4UImanager::ListCommands(const char* direct)
587 {
588  G4UIcommandTree* comTree = FindDirectory(direct);
589  if(comTree)
590  { comTree->List(); }
591  else
592  { G4cout << direct << " is not found." << G4endl; }
593 }
594 
596 {
597  G4String aDirName = dirName;
598  G4String targetDir = aDirName.strip(G4String::both);
599  if( targetDir( targetDir.length()-1 ) != '/' )
600  { targetDir += "/"; }
601  G4UIcommandTree* comTree = treeTop;
602  if( targetDir == "/" )
603  { return comTree; }
604  G4int idx = 1;
605  while( idx < G4int(targetDir.length())-1 )
606  {
607  G4int i = targetDir.index("/",idx);
608  G4String targetDirString = targetDir(0,i+1);
609  comTree = comTree->GetTree(targetDirString);
610  if( comTree == NULL )
611  { return NULL; }
612  idx = i+1;
613  }
614  return comTree;
615 }
616 
618 {
619  //G4cout << G4StateManager::GetStateManager()->GetStateString(requestedState) << " <--- " << G4StateManager::GetStateManager()->GetStateString(G4StateManager::GetStateManager()->GetPreviousState()) << G4endl;
621  {
622  if(requestedState==G4State_EventProc &&
624  { PauseSession("BeginOfEvent"); }
625  }
627  {
628  if(requestedState==G4State_GeomClosed &&
629  G4StateManager::GetStateManager()->GetPreviousState()==G4State_EventProc)
630  { PauseSession("EndOfEvent"); }
631  }
632  return true;
633 }
634 
635 //void G4UImanager::Interact()
636 //{
637 // Interact(G4String("G4> "));
638 //}
639 
640 //void G4UImanager::Interact(const char * pC)
641 //{
642 // G4cerr << "G4UImanager::Interact() is out of date and is not used anymore." << G4endl;
643 // G4cerr << "This method will be removed shortly!!!" << G4endl;
644 // G4cerr << "In case of main() use" << G4endl;
645 // G4cerr << " G4UIsession * session = new G4UIterminal;" << G4endl;
646 // G4cerr << " session->SessionStart();" << G4endl;
647 // G4cerr << "In other cases use" << G4endl;
648 // G4cerr << " G4StateManager::GetStateManager()->Pause();" << G4endl;
649 //}
650 
651 
652 
654 {
655  G4coutbuf.SetDestination(value);
656  G4cerrbuf.SetDestination(value);
657 }
658 
659 void G4UImanager::SetAlias(const char * aliasLine)
660 {
661  G4String aLine = aliasLine;
662  G4int i = aLine.index(" ");
663  G4String aliasName = aLine(0,i);
664  G4String aliasValue = aLine(i+1,aLine.length()-(i+1));
665  if(aliasValue(0)=='"')
666  {
667  G4String strippedValue;
668  if(aliasValue(aliasValue.length()-1)=='"')
669  { strippedValue = aliasValue(1,aliasValue.length()-2); }
670  else
671  { strippedValue = aliasValue(1,aliasValue.length()-1); }
672  aliasValue = strippedValue;
673  }
674 
675  aliasList->ChangeAlias(aliasName,aliasValue);
676 }
677 
678 void G4UImanager::RemoveAlias(const char * aliasName)
679 {
680  G4String aL = aliasName;
681  G4String targetAlias = aL.strip(G4String::both);
682  aliasList->RemoveAlias(targetAlias);
683 }
684 
686 {
687  aliasList->List();
688 }
689 
690 void G4UImanager::CreateHTML(const char* dir)
691 {
692  G4UIcommandTree* tr = FindDirectory(dir);
693  if(tr!=0)
694  { tr->CreateHTML(); }
695  else
696  { G4cerr << "Directory <" << dir << "> is not found." << G4endl; }
697 }
698 
700 {
701  searchDirs.clear();
702 
703  size_t idxfirst = 0;
704  size_t idxend = 0;
705  G4String pathstring = "";
706  while( (idxend = searchPath.index(':', idxfirst)) != G4String::npos) {
707  pathstring = searchPath.substr(idxfirst, idxend-idxfirst);
708  if(pathstring.size() != 0) searchDirs.push_back(pathstring);
709  idxfirst = idxend + 1;
710  }
711 
712  pathstring = searchPath.substr(idxfirst, searchPath.size()-idxfirst);
713  if(pathstring.size() != 0) searchDirs.push_back(pathstring);
714 }
715 
716 
717 static G4bool FileFound(const G4String& fname)
718 {
719  G4bool qopen = false;
720  std::ifstream fs;
721  fs.open(fname.c_str(), std::ios::in);
722  if(fs.good()) {
723  fs.close();
724  qopen = true;
725  }
726  return qopen;
727 }
728 
730 {
731  G4String macrofile = fname;
732 
733  for (size_t i = 0; i < searchDirs.size(); i++) {
734  G4String fullpath = searchDirs[i] + "/" + fname;
735  if ( FileFound(fullpath) ) {
736  macrofile = fullpath;
737  break;
738  }
739  }
740 
741  return macrofile;
742 }
743 
744 std::vector<G4String>* G4UImanager::GetCommandStack()
745 {
746  std::vector<G4String>* returnValue = commandStack;
747  commandStack = new std::vector<G4String>;
748  return returnValue;
749 }
750 
752 {
753  if(brg->LocalUI()==this)
754  {
755  G4Exception("G4UImanager::RegisterBridge()","UI7002",FatalException,
756  "G4UIBridge cannot bridge between same object.");
757  }
758  else
759  { bridges->push_back(brg); }
760 }
761 
763 {
764  threadID = tId;
768 }
769 
771 {
778 }
779 
780 void G4UImanager::SetCoutFileName(const G4String& fileN, G4bool ifAppend)
781 {
782  // for sequential mode, ignore this method.
783  if(threadID<0) return;
784 
785  if(fileN == "**Screen**")
786  { threadCout->SetCoutFileName(fileN,ifAppend); }
787  else
788  {
789  std::stringstream fn;
790  fn<<"G4W_"<<threadID<<"_"<<fileN;
791  threadCout->SetCoutFileName(fn.str(),ifAppend);
792  }
793 }
794 
795 void G4UImanager::SetCerrFileName(const G4String& fileN, G4bool ifAppend)
796 {
797  // for sequential mode, ignore this method.
798  if(threadID<0) return;
799 
800  if(fileN == "**Screen**")
801  { threadCout->SetCerrFileName(fileN,ifAppend); }
802  else
803  {
804  std::stringstream fn;
805  fn<<"G4W_"<<threadID<<"_"<<fileN;
806  threadCout->SetCerrFileName(fn.str(),ifAppend);
807  }
808 }
809 
811 {
812  // for sequential mode, ignore this method.
813  if(threadID<0) return;
815 }
816 
818 {
819  // for sequential mode, ignore this method.
820  if(threadID<0) return;
822 }
823 
825 {
826  // for sequential mode, ignore this method.
827  if(threadID<0)
828  {
829  igThreadID = tid;
830  return;
831  }
833 }
834 
836 {
837  // for sequential mode, ignore this method.
838  if(threadID<0) { return; }
840 }
841 
const XML_Char int len
Definition: expat.h:262
G4bool pauseAtBeginOfEvent
Definition: G4UImanager.hh:167
std::vector< G4UIbridge * > * bridges
Definition: G4UImanager.hh:254
G4String & remove(str_size)
void RemoveAlias(const char *aliasName)
Definition: G4UImanager.cc:678
static G4bool DoublePrecisionStr()
Definition: G4UImanager.cc:187
void CreateHTML(const char *dir="/")
Definition: G4UImanager.cc:690
G4bool isNull() const
std::vector< G4String > * GetCommandStack()
Definition: G4UImanager.cc:744
std::vector< G4String > searchDirs
Definition: G4UImanager.hh:170
void SetPrefixString(const G4String &wd="G4WT")
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:45
TTree * t1
Definition: plottest35.C:26
G4String savedParameters
Definition: G4UImanager.hh:159
G4UIcommandTree * FindDirectory(const char *dirName)
Definition: G4UImanager.cc:595
void AddNewCommand(G4UIcommand *newCommand)
Definition: G4UImanager.cc:288
void StoreHistory(const char *fileName="G4history.macro")
Definition: G4UImanager.cc:561
G4String searchPath
Definition: G4UImanager.hh:169
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:466
#define G4endl
Definition: G4ios.hh:61
void G4iosInitialization()
Definition: G4ios.cc:107
G4int operator==(const G4UImanager &right) const
Definition: G4UImanager.cc:180
virtual G4int DoIt(G4String parameterList)
Definition: G4UIcommand.cc:125
G4String FindMacroPath(const G4String &fname) const
Definition: G4UImanager.cc:729
G4UIsession * g4UIWindow
Definition: G4UImanager.hh:155
void AddWorkerCommand(G4UIcommand *newCommand)
Definition: G4UImanager.cc:295
G4UIparameter * GetParameter(G4int i) const
Definition: G4UIcommand.hh:145
std::ofstream historyFile
Definition: G4UImanager.hh:162
G4int IfCommandFailed()
Definition: G4UIcommand.hh:206
void RemoveCommand(G4UIcommand *aCommand)
Definition: G4UImanager.cc:300
str_size index(const char *, G4int pos=0) const
void SetIgnoreInit(G4bool val=true)
G4bool pauseAtEndOfEvent
Definition: G4UImanager.hh:168
G4int operator!=(const G4UImanager &right) const
Definition: G4UImanager.cc:182
#define G4ThreadLocalStatic
Definition: tls.hh:68
G4int maxHistSize
Definition: G4UImanager.hh:166
const G4UImanager & operator=(const G4UImanager &right)
Definition: G4UImanager.cc:178
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:73
static G4ICOMS_DLL G4UImanager *& fMasterUImanager()
Definition: G4UImanager.cc:64
virtual G4UIsession * SessionStart()
Definition: G4UIsession.cc:46
static G4UImanager * GetMasterUIpointer()
Definition: G4UImanager.cc:86
G4String SolveAlias(const char *aCmd)
Definition: G4UImanager.cc:411
void List() const
const XML_Char * s
Definition: expat.h:262
void SetThreadIgnoreInit(G4bool flg=true)
Definition: G4UImanager.cc:835
void G4iosFinalization()
Definition: G4ios.cc:108
static constexpr double ps
Definition: G4SIunits.hh:172
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
G4String GetCurrentValues(const char *aCommand)
Definition: G4UImanager.cc:190
virtual void PauseSessionStart(const G4String &Prompt)
Definition: G4UIsession.cc:48
static G4ICOMS_DLL G4int igThreadID
Definition: G4UImanager.hh:287
static const G4double d2
void SetCerrFileName(const G4String &fileN="G4cerr.txt", G4bool ifAppend=true)
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4UImanager * LocalUI() const
Definition: G4UIbridge.hh:72
G4strstreambuf G4coutbuf
Definition: G4ios.cc:104
static const G4double d1
void RemoveAlias(const char *aliasName)
const char * data() const
void RegisterBridge(G4UIbridge *brg)
Definition: G4UImanager.cc:751
G4String strip(G4int strip_Type=trailing, char c=' ')
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:286
void EnableBuffering(G4bool flag=true)
Float_t d
static const G4double cd
void RemoveWorkerCommand(G4UIcommand *aCommand)
Definition: G4UImanager.cc:307
virtual G4bool Notify(G4ApplicationState requestedState)
Definition: G4UImanager.cc:617
void SetAlias(const char *aliasLine)
Definition: G4UImanager.cc:659
G4UIcontrolMessenger * UImessenger
Definition: G4UImanager.hh:156
G4UIaliasList * aliasList
Definition: G4UImanager.hh:165
void SetCerrFileName(const G4String &fileN="G4cerr.txt", G4bool ifAppend=true)
Definition: G4UImanager.cc:795
void SetDestination(G4coutDestination *dest)
void SetUpForSpecialThread(G4String aPrefix)
Definition: G4UImanager.cc:770
G4GLOB_DLL std::ostream G4cerr
void PauseSession(const char *msg)
Definition: G4UImanager.cc:581
void ChangeAlias(const char *aliasName, const char *aliasValue)
G4bool ToBeBroadcasted() const
Definition: G4UIcommand.hh:186
void ListAlias()
Definition: G4UImanager.cc:685
G4int threadID
Definition: G4UImanager.hh:285
void Loop(const char *macroFile, const char *variableName, G4double initialValue, G4double finalValue, G4double stepSize=1.0)
Definition: G4UImanager.cc:341
void SetCoutFileName(const G4String &fileN="G4cout.txt", G4bool ifAppend=true)
Definition: G4UImanager.cc:780
void AddNewCommand(G4UIcommand *newCommand, G4bool workerThreadOnly=false)
void SetThreadPrefixString(const G4String &s="W")
Definition: G4UImanager.cc:810
static G4ICOMS_DLL G4bool & fUImanagerHasBeenKilled()
Definition: G4UImanager.cc:58
void G4SetThreadId(G4int aNewValue)
Definition: G4Threading.cc:131
void SetThreadIgnore(G4int tid=0)
Definition: G4UImanager.cc:824
void SetIgnoreCout(G4int tid=0)
void SetCoutDestination(G4UIsession *const value)
Definition: G4UImanager.cc:653
G4double GetCurrentDoubleValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
Definition: G4UImanager.cc:276
static G4ICOMS_DLL G4UImanager *& fUImanager()
Definition: G4UImanager.cc:52
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.hh:65
void ListCommands(const char *direc)
Definition: G4UImanager.cc:586
std::vector< G4String > * commandStack
Definition: G4UImanager.hh:257
G4UIcommandTree * treeTop
Definition: G4UImanager.hh:153
int G4int
Definition: G4Types.hh:78
void RemoveCommand(G4UIcommand *aCommand, G4bool workerThreadOnly=false)
ifstream in
Definition: comparison.C:7
G4bool isMaster
Definition: G4UImanager.hh:253
static G4bool FileFound(const G4String &fname)
Definition: G4UImanager.cc:717
G4bool ignoreCmdNotFound
Definition: G4UImanager.hh:255
G4int GetCurrentIntValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
Definition: G4UImanager.cc:252
TDirectory * dir
G4UIcommand * savedCommand
Definition: G4UImanager.hh:160
void ParseMacroSearchPath()
Definition: G4UImanager.cc:699
static G4ICOMS_DLL G4bool doublePrecisionStr
Definition: G4UImanager.hh:296
void ForeachS(const char *valueList)
Definition: G4UImanager.cc:365
G4int GetParameterEntries() const
Definition: G4UIcommand.hh:143
G4GLOB_DLL std::ostream G4cout
std::vector< G4String > histVec
Definition: G4UImanager.hh:164
G4ApplicationState
G4LocalThreadCoutMessenger * CoutMessenger
Definition: G4UImanager.hh:158
void SetUpForAThread(G4int tId)
Definition: G4UImanager.cc:762
void SetThreadUseBuffer(G4bool flg=true)
Definition: G4UImanager.cc:817
G4bool saveHistory
Definition: G4UImanager.hh:163
void CreateMessenger()
Definition: G4UImanager.cc:113
G4String GetCurrentValue()
Definition: G4UIcommand.cc:237
G4String & GetFailureDescription()
Definition: G4UIcommand.hh:208
G4strstreambuf G4cerrbuf
Definition: G4ios.cc:105
G4bool IsAvailable()
Definition: G4UIcommand.cc:292
G4String & append(const G4String &)
G4UIcommand * FindPath(const char *commandPath) const
G4String * FindAlias(const char *aliasName)
G4UIsession * session
Definition: G4UImanager.hh:154
static void UseDoublePrecisionStr(G4bool val)
Definition: G4UImanager.cc:185
G4bool stackCommandsForBroadcast
Definition: G4UImanager.hh:256
void ExecuteMacroFile(const char *fileName)
Definition: G4UImanager.cc:312
void SetCoutFileName(const G4String &fileN="G4cout.txt", G4bool ifAppend=true)
G4UnitsMessenger * UnitsMessenger
Definition: G4UImanager.hh:157
G4String GetParameterName() const
void LoopS(const char *valueList)
Definition: G4UImanager.cc:321
void Foreach(const char *macroFile, const char *variableName, const char *candidates)
Definition: G4UImanager.cc:394
G4String GetCurrentStringValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
Definition: G4UImanager.cc:202
G4int verboseLevel
Definition: G4UImanager.hh:161
static G4StateManager * GetStateManager()
G4UIcommandTree * GetTree(G4int i)
void ResetFailure()
Definition: G4UIcommand.hh:210
G4int G4GetThreadId()
Definition: G4Threading.cc:128