Import Geant4 9.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:58:43 +02:00
parent 96c8bcd0af
commit b79225fb37
7544 changed files with 245407 additions and 91099 deletions
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIaliasList.cc,v 1.6 2006/06/29 19:08:33 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#include "G4UIaliasList.hh"
+17 -14
View File
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4UIbatch.cc,v 1.16 2007/08/10 09:46:10 kmura Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4UIbatch.cc,v 1.17 2008/11/21 10:54:16 kmura Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// ====================================================================
// G4UIbatch.cc
@@ -44,8 +44,16 @@ static void Tokenize(const G4String& str, std::vector<G4String>& tokens)
str_size pos = str.find_first_of(delimiter, pos0);
while (pos != G4String::npos || pos0 != G4String::npos) {
tokens.push_back(str.substr(pos0, pos-pos0));
if (str[pos0] == '\"') {
pos = str.find_first_of("\"", pos0+1);
if(pos != G4String::npos) pos++;
}
if (str[pos0] == '\'') {
pos = str.find_first_of("\'", pos0+1);
if(pos != G4String::npos) pos++;
}
tokens.push_back(str.substr(pos0, pos-pos0));
pos0 = str.find_first_not_of(delimiter, pos);
pos = str.find_first_of(delimiter, pos0);
}
@@ -109,11 +117,16 @@ G4String G4UIbatch::ReadCommand()
// skip null line if single line
if(!qcontinued && cmdline.size()==0) continue;
// '#' is treated as echoing something
if(cmdline[(size_t)0]=='#') return cmdline;
// tokenize...
std::vector<G4String> tokens;
Tokenize(cmdline, tokens);
qcontinued= false;
for (G4int i=0; i< G4int(tokens.size()); i++) {
// string after '#" is ignored
if(tokens[i][(size_t)0] == '#' ) break;
// '\' or '_' is treated as continued line.
if(tokens[i] == '\\' || tokens[i] == '_' ) {
qcontinued= true;
@@ -128,7 +141,7 @@ G4String G4UIbatch::ReadCommand()
cmdtotal+= " ";
}
if(qcontinued) continue; // read` the next line
if(qcontinued) continue; // read the next line
if(cmdtotal.size() != 0) break;
if(macroStream.eof()) break;
@@ -137,22 +150,12 @@ G4String G4UIbatch::ReadCommand()
// strip again
cmdtotal= cmdtotal.strip(G4String::both);
// '#' is treated as echoing something
if(cmdtotal[(size_t)0]=='#') return cmdtotal;
// normally something after # is treated just as comment and ignored
str_size ic= cmdtotal.find_first_of('#');
if(ic != G4String::npos) {
cmdtotal= cmdtotal(0, ic);
}
// finally,
if(macroStream.eof() && cmdtotal.size()==0) {
return "exit";
}
return cmdtotal;
}
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIcmdWith3Vector.cc,v 1.8 2006/06/29 19:08:38 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIcmdWith3VectorAndUnit.cc,v 1.9 2006/06/29 19:08:41 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIcmdWithABool.cc,v 1.8 2006/06/29 19:08:43 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIcmdWithADouble.cc,v 1.8 2006/06/29 19:08:45 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIcmdWithADoubleAndUnit.cc,v 1.9 2006/06/29 19:08:48 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIcmdWithAString.cc,v 1.6 2006/06/29 19:08:50 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIcmdWithAnInteger.cc,v 1.8 2006/06/29 19:08:52 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIcmdWithoutParameter.cc,v 1.4 2006/06/29 19:08:54 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIcommand.cc,v 1.25 2006/06/29 19:08:56 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
+37 -2
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4UIcommandTree.cc,v 1.13 2006/06/29 19:08:58 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4UIcommandTree.cc,v 1.14 2008/01/30 11:20:03 lgarnier Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
#include "G4UIcommandTree.hh"
@@ -155,6 +155,9 @@ void G4UIcommandTree::RemoveCommand(G4UIcommand *aCommand)
}
}
// L. Garnier 01.28.08 This function has not a good name. In fact, it try
// to match a command name, not a path. It should be rename as FindCommandName
G4UIcommand * G4UIcommandTree::FindPath(const char* commandPath)
{
G4String remainingPath = commandPath;
@@ -187,6 +190,38 @@ G4UIcommand * G4UIcommandTree::FindPath(const char* commandPath)
return NULL;
}
/**
* Try to match a command or a path with the one given.
* @commandPath : command or path to match
* @return the commandTree found or NULL if not
*/
G4UIcommandTree * G4UIcommandTree::FindCommandTree(const char* commandPath)
{
G4String remainingPath = commandPath;
if( remainingPath.index( pathName ) == std::string::npos )
{ return NULL; }
remainingPath.remove(0,pathName.length());
G4int i = remainingPath.first('/');
if( i != G4int(std::string::npos) )
{
// Find path
G4String nextPath = pathName;
nextPath.append(remainingPath(0,i+1));
G4int n_treeEntry = tree.size();
for( G4int i_thTree = 0; i_thTree < n_treeEntry; i_thTree++ )
{
if (tree[i_thTree]->GetPathName() == commandPath) {
return tree[i_thTree];
}
else if( nextPath == tree[i_thTree]->GetPathName() ) {
return tree[i_thTree]->FindCommandTree( commandPath );
}
}
}
return NULL;
}
void G4UIcommandTree::ListCurrent()
{
G4cout << "Command directory path : " << pathName << G4endl;
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIcontrolMessenger.cc,v 1.11 2007/06/06 15:14:51 asaim Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#include <stdlib.h>
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIdirectory.cc,v 1.4 2006/06/29 19:09:02 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UImanager.cc,v 1.33 2007/07/16 10:14:36 kmura Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ---------------------------------------------------------------------
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UImessenger.cc,v 1.7 2006/06/29 19:09:06 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#include "G4UImessenger.hh"
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIparameter.cc,v 1.14 2006/06/29 19:09:09 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#include "G4UIparameter.hh"
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UIsession.cc,v 1.7 2006/06/29 19:09:11 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// ---------------------------------------------------------------------
+1 -1
View File
@@ -25,7 +25,7 @@
//
//
// $Id: G4UnitsMessenger.cc,v 1.7 2006/06/29 19:09:13 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
@@ -25,7 +25,7 @@
//
//
// $Id: G4VGlobalFastSimulationManager.cc,v 1.5 2006/06/29 19:09:15 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//
// Abstract interface for GEANT4 Global Fast Simulation Manager.