Skip to content

Commit b50f6f4

Browse files
committed
fixed gfield running
1 parent 9784417 commit b50f6f4

11 files changed

Lines changed: 17 additions & 9 deletions

File tree

gemc_options.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "g4display_options.h"
1515
#include "g4dialog_options.h"
1616
#include "gsd.h"
17+
#include "gfield_options.h"
1718

1819
namespace gemc {
1920

@@ -71,6 +72,7 @@ namespace gemc {
7172
goptions += g4display::defineOptions();
7273
goptions += g4dialog::defineOptions();
7374
goptions += gsensitivedetector::defineOptions();
75+
goptions += gfields::defineOptions();
7476

7577

7678
return goptions;

gfactory/gfactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class GManager {
6868
template <class Derived>
6969
void RegisterObjectFactory(std::string_view name);
7070

71-
/// Create an instance of previously registered factory as @c Base*.
71+
/// Create an instance of the previously registered factory
7272
template <class Base>
7373
[[nodiscard]] Base* CreateObject(std::string_view name) const;
7474

gfields/examples/test_gfield_dipole.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using namespace std;
99

1010
int main(int argc, char* argv[]) {
11+
1112
// Initialize GOptions (parsed from YAML or another source)
1213
auto gopts = std::make_shared<GOptions>(argc, argv, gfields::defineOptions());
1314

gfields/gfield.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// gfield
1717
#include "gfield.h"
1818
#include "gfieldConventions.h"
19+
#include "gfield_options.h"
1920

2021

2122
// notice: we are always using G4Mag_UsualEqRhs here
@@ -66,3 +67,5 @@ G4FieldManager *GField::create_FieldManager() {
6667
return new G4FieldManager(this, fChordFinder);
6768

6869
}
70+
71+
void GField::set_loggers(const std::shared_ptr<GOptions>& g) { log = std::make_shared<GLogger>(g, GFIELD_LOGGER, "gfields"); }

gfields/gfield.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// gemc
88
#include "gfactory.h"
99

10-
// gfield
11-
#include "gfieldConventions.h"
1210

1311
/**
1412
* @brief Utility struct to load GFields from options.
@@ -92,7 +90,7 @@ class GField : public G4MagneticField {
9290
int get_field_parameter_int(const std::string& key) { return stoi(gfield_definitions.field_parameters[key]); }
9391
double get_field_parameter_double(const std::string& key) { return stod(gfield_definitions.field_parameters[key]); }
9492

95-
void set_loggers(const std::shared_ptr<GOptions>& g) { log = std::make_shared<GLogger>(g, GFIELD_LOGGER, "gfield logger"); }
93+
void set_loggers(const std::shared_ptr<GOptions>& g);
9694

9795
private:
9896
// TODO: make this list automatic

gfields/gfieldConventions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
22

3-
constexpr const char* GFIELD_LOGGER = "gfield";
43

54
#define GFIELD_DEFAULT_INTEGRATION_STEPPER "G4DormandPrince745"
65
#define GFIELD_DEFAULT_MINIMUM_STEP "1.0*mm"

gfields/gfieldFactories/multipoles/gfield_multipoles.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
// gfields
88
#include "gfield_multipoles.h"
9+
#include "gfieldConventions.h"
910

1011
// gemv
1112
#include "gutilities.h"

gfields/gfield_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// gfields
77
#include "gfield.h"
88

9+
constexpr const char* GFIELD_LOGGER = "gfield";
910

1011
namespace gfields {
1112

gfields/gmagneto.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// gemc
44
#include "gfield.h"
5+
#include "gfield_options.h"
56
#include "gfieldConventions.h"
67

78
/**

glogging/glogger.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <utility>
1313

1414

15-
// cross platform function to return the function name
15+
// cross-platform function to return the function name
1616
#if defined(__clang__) || defined(__GNUC__)
1717
#define FUNCTION_NAME __PRETTY_FUNCTION__
1818
#elif defined(_MSC_VER)
@@ -45,7 +45,7 @@ class GLogger {
4545
* @brief Constructs a GLogger instance.
4646
* @param gopts Shared Pointer to GOptions instance used for verbosity/debug lookup.
4747
* @param vname The verbosity or debug name is a string used to identify the logger and as header for all messages
48-
* @param cc The calling class name, used to identify the source of the log messages.
48+
* @param desc The calling class name, used to identify the source of the log messages.
4949
*/
5050
explicit GLogger(const std::shared_ptr<GOptions>& gopts, const std::string& vname, const std::string& desc = "")
5151
: verbosity_name(vname), description(desc), log_counter{0} {
@@ -106,7 +106,7 @@ class GLogger {
106106
*/
107107
template <typename... Args>
108108
void info(int level, Args&&... args) const {
109-
// error if level is not 0, 1 or 2
109+
// error if the level is not 0, 1 or 2
110110
if (level != 0 && level != 1 && level != 2) {
111111
G4cerr << FATALERRORL << header_string() << GWARNING << " Invalid verbosity level requested: " << level <<
112112
RST << G4endl;
@@ -121,7 +121,7 @@ class GLogger {
121121
}
122122

123123
/**
124-
* @brief Overloaded version of info() with default level = 0.
124+
* @brief Overloaded version of info() with the default level = 0.
125125
*
126126
* @tparam Args Variadic template parameters for any streamable types.
127127
* @param args Streamable message components.

0 commit comments

Comments
 (0)