Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/8x8SiPM_crystal.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},

"event": {
"mode": "Minimal",
"event_mode": "Minimal",
"maxslot": 1000000,
"max_bounce": 31,
"propagate_epsilon": 0.05,
Expand Down
2 changes: 1 addition & 1 deletion config/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
},

"event": {
"event_mode": "DebugLite",
"max_bounce": 31,
"max_genstep": 10000000,
"maxslot": 1000000,
"mode": "DebugLite",
"mode_lite": "Unspecified",
"mode_merge": "Unspecified",
"output_dir": "./",
Expand Down
2 changes: 1 addition & 1 deletion config/sphere_leak.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},

"event": {
"mode": "DebugLite",
"event_mode": "DebugLite",
"maxslot": 1000000,
"max_bounce": 31,
"propagate_epsilon": 0.05,
Expand Down
2 changes: 1 addition & 1 deletion config/trap_iso.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},

"event": {
"mode": "DebugLite",
"event_mode": "DebugLite",
"maxslot": 1000000,
"max_bounce": 10000,
"propagate_epsilon": 0.001,
Expand Down
2 changes: 1 addition & 1 deletion config/wls_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},

"event": {
"mode": "DebugLite",
"event_mode": "DebugLite",
"maxslot": 1000000,
"max_bounce": 31,
"propagate_epsilon": 0.05,
Expand Down
4 changes: 2 additions & 2 deletions sysrap/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void Config::ReadConfig(std::string filepath)
Assign(event_, "max_bounce", max_bounce);
Assign(event_, "max_genstep", max_genstep);
Assign(event_, "maxslot", maxslot);
AssignNamedEnum(event_, "event", "mode", event_mode, EventModeInfos);
AssignNamedEnum(event_, "event", "event_mode", event_mode, EventModeInfos);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve or reject the legacy mode key

When a user points GPHOX_CONFIG_DIR at an existing config that still uses the pre-rename event.mode key, this parser now ignores that key and leaves event_mode at its default Minimal. Because unknown JSON keys are otherwise accepted, configs that requested modes such as DebugLite or HitPhoton silently stop gathering/saving the configured event arrays instead of failing or migrating; consider accepting the legacy key or explicitly rejecting it during the rename.

Useful? React with 👍 / 👎.

AssignNamedEnum(event_, "event", "mode_lite", mode_lite, ModeLiteInfos);
AssignNamedEnum(event_, "event", "mode_merge", mode_merge, ModeMergeInfos);
AssignOutputDir(event_, output_dir);
Expand All @@ -344,10 +344,10 @@ void Config::Apply() const
const std::string event_mode_name{EventModeName(event_mode)};
const std::string output_dir_str = output_dir.string();

SEventConfig::SetEventMode(event_mode_name.c_str());
SEventConfig::SetMaxBounce(max_bounce);
SEventConfig::SetMaxGenstep(max_genstep);
SEventConfig::SetMaxSlot(maxslot);
SEventConfig::SetEventMode(event_mode_name.c_str());
if (mode_lite != ModeLite::Unspecified)
SEventConfig::SetModeLite(static_cast<int>(mode_lite));
if (mode_merge != ModeMerge::Unspecified)
Expand Down
6 changes: 3 additions & 3 deletions sysrap/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class Config
/// A unique name associated with this Config
std::string name{"dev"};

/// Event persistence mode applied to SEventConfig.
EventMode event_mode{EventMode::Minimal};

/// Maximum photon bounce count.
int max_bounce{31};

Expand All @@ -74,9 +77,6 @@ class Config
/// Maximum event slots applied to SEventConfig.
int maxslot{0};

/// Event persistence mode applied to SEventConfig.
EventMode event_mode{EventMode::Minimal};

/// Optional compact photon/hit storage mode.
ModeLite mode_lite{ModeLite::Unspecified};

Expand Down
Loading