Import Geant4 11.3.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2024-06-28 13:08:51 +02:00
parent f7b23877ed
commit e58e650b32
5232 changed files with 239416 additions and 244360 deletions
-37
View File
@@ -41,7 +41,6 @@
#include "G4ApplicationState.hh"
#include "G4ThreeVector.hh"
#include "G4UIparameter.hh"
#include "G4UItokenNum.hh"
#include "globals.hh"
#include <vector>
@@ -137,7 +136,6 @@ class G4UIcommand
inline void SetParameter(G4UIparameter* const newParameter)
{
parameter.push_back(newParameter);
newVal.resize(parameter.size());
}
// Adds a guidance line. Unlimited times of invokation of this method is
@@ -198,10 +196,6 @@ class G4UIcommand
inline void SetDefaultSortFlag(G4bool val) { ifSort = val; }
protected:
// --- the following is used by CheckNewValue() --------
using yystype = G4UItokenNum::yystype;
using tokenNum = G4UItokenNum::tokenNum;
G4int CheckNewValue(const char* newValue);
G4bool toBeBroadcasted = false;
@@ -216,31 +210,6 @@ class G4UIcommand
private:
void G4UIcommandCommonConstructorCode(const char* theCommandPath);
G4bool RangeCheck(const char* t);
// syntax nodes
yystype Expression();
yystype LogicalORExpression();
yystype LogicalANDExpression();
yystype EqualityExpression();
yystype RelationalExpression();
yystype AdditiveExpression();
yystype MultiplicativeExpression();
yystype UnaryExpression();
yystype PrimaryExpression();
// semantics routines
G4int Eval2(const yystype& arg1, G4int op, const yystype& arg2);
// utility
tokenNum Yylex(); // returns next token
unsigned IndexOf(const char*); // returns the index of the var name
unsigned IsParameter(const char*); // returns 1 or 0
G4int G4UIpGetc(); // read one char from rangeBuf
G4int G4UIpUngetc(G4int c); // put back
G4int Backslash(G4int c);
G4int Follow(G4int expect, G4int ifyes, G4int ifno);
// Data -----------------------------------------------------------
private:
CommandType commandType = BaseClassCmd;
G4UImessenger* messenger = nullptr;
@@ -250,12 +219,6 @@ class G4UIcommand
std::vector<G4UIparameter*> parameter;
std::vector<G4String> commandGuidance;
std::vector<G4ApplicationState> availabelStateList;
G4int bp = 0; // current index into rangeExpression
tokenNum token = G4UItokenNum::IDENTIFIER;
yystype yylval;
std::vector<yystype> newVal;
G4int paramERR = 0;
};
#endif
-2
View File
@@ -53,7 +53,6 @@ class G4LocalThreadCoutMessenger;
class G4UIaliasList;
class G4MTcoutDestination;
class G4UIbridge;
class G4ProfilerMessenger;
class G4UImanager : public G4VStateDependent
{
@@ -266,7 +265,6 @@ class G4UImanager : public G4VStateDependent
G4UIcontrolMessenger* UImessenger = nullptr;
G4UnitsMessenger* UnitsMessenger = nullptr;
G4LocalThreadCoutMessenger* CoutMessenger = nullptr;
G4ProfilerMessenger* ProfileMessenger = nullptr;
G4String savedParameters;
G4UIcommand* savedCommand = nullptr;
G4int verboseLevel = 0;
+3 -36
View File
@@ -39,7 +39,6 @@
#ifndef G4UIparameter_hh
#define G4UIparameter_hh 1
#include "G4UItokenNum.hh"
#include "globals.hh"
class G4UIparameter
@@ -108,36 +107,11 @@ class G4UIparameter
inline const G4String& GetParameterGuidance() const { return parameterGuidance; }
inline void SetGuidance(const char* theGuidance) { parameterGuidance = theGuidance; }
protected:
using yystype = G4UItokenNum::yystype;
using tokenNum = G4UItokenNum::tokenNum;
private:
G4bool TypeCheck(const char* newValue);
G4bool CandidateCheck(const char* newValue);
private:
// --- the following is used by CheckNewValue() -------
G4bool TypeCheck(const char* newValue);
G4bool RangeCheck(const char* newValue);
G4bool CandidateCheck(const char* newValue);
// syntax nodes
yystype Expression();
yystype LogicalORExpression();
yystype LogicalANDExpression();
yystype EqualityExpression();
yystype RelationalExpression();
yystype AdditiveExpression();
yystype MultiplicativeExpression();
yystype UnaryExpression();
yystype PrimaryExpression();
// semantics routines
G4int Eval2(const yystype& arg1, G4int op, const yystype& arg2);
// utility
tokenNum Yylex(); // returns next token
G4int G4UIpGetc(); // read one char from rangeBuf
G4int G4UIpUngetc(G4int c); // put back
G4int Backslash(G4int c);
G4int Follow(G4int expect, G4int ifyes, G4int ifno);
// data -----------------------------------------------------------
G4String parameterName;
G4String parameterGuidance;
G4String defaultValue;
@@ -146,13 +120,6 @@ class G4UIparameter
char parameterType = '\0';
G4bool omittable = false;
G4bool currentAsDefaultFlag = false;
//------------ CheckNewValue() related data members ---------------
G4int bp = 0; // current index in rangeExpression
tokenNum token = G4UItokenNum::NONE;
yystype yylval;
yystype newVal;
G4int paramERR = 0;
};
#endif
@@ -1,76 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4ProfilerMessenger
//
// Class description
//
// This class is the messenger of the class which maintain the profiling
// controls (located in global/management/include/G4Profiler.hh).
// In general, it forwards to the argument parser provided by timemory.
// Author: J.Madsen, 12 November 2020
// --------------------------------------------------------------------
#ifndef G4ProfilerMessenger_hh
#define G4ProfilerMessenger_hh 1
#include "G4Profiler.hh"
#include "G4UImessenger.hh"
#include "globals.hh"
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithABool;
class G4ProfilerMessenger : public G4UImessenger
{
public:
G4ProfilerMessenger();
~G4ProfilerMessenger() override;
G4ProfilerMessenger(const G4ProfilerMessenger&) = delete;
G4ProfilerMessenger& operator=(const G4ProfilerMessenger&) = delete;
G4ProfilerMessenger(G4ProfilerMessenger&&) = default;
G4ProfilerMessenger& operator=(G4ProfilerMessenger&&) = default;
void SetNewValue(G4UIcommand*, G4String) override;
private:
using stringcmd_pair = std::pair<G4UIcmdWithAString*, std::string>;
using boolcmd_pair = std::pair<G4UIcmdWithABool*, std::string>;
using directory_array = std::array<G4UIdirectory*, G4ProfileType::TypeEnd>;
using stringcmd_array = std::array<stringcmd_pair, G4ProfileType::TypeEnd>;
using boolcmd_array = std::array<boolcmd_pair, G4ProfileType::TypeEnd>;
using boolcmd_vector = std::vector<boolcmd_pair>;
G4UIdirectory* profileDirectory;
G4UIdirectory* profileOutputDirectory;
directory_array profileTypeDirs;
boolcmd_array profileEnableCmds;
boolcmd_vector profileGeneralCmds;
stringcmd_array profileCompCmds;
};
#endif
@@ -35,6 +35,9 @@
#include <cctype>
class G4UIparameter;
class G4UIcommand;
namespace G4UIparsing
{
// Convert G4String to value of type T
@@ -308,6 +311,13 @@ inline G4int CompareDouble(G4double arg1, G4int op, G4double arg2, G4int& errCod
return result;
}
// --------------------------------------------------------------------
// Return true if parameter is within range expression value
G4bool RangeCheck(const G4UIparameter& p, const char* value);
// Return true if command's parameters are within range expression value
G4bool RangeCheck(const G4UIcommand& p, const char* value);
} // namespace G4UIparsing
#endif