Skip to content

Commit 46d7709

Browse files
committed
added maxStep to readout specs, setting it in detector construction. fix random number seed. setting maxStep in the dynamic digitizations. fix gparticle log
1 parent 9dea1f0 commit 46d7709

109 files changed

Lines changed: 1494 additions & 1374 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

actions/event/gEventAction.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ void GEventAction::EndOfEventAction([[maybe_unused]] const G4Event* event) {
9797
// Process all hits in the collection. Event-mode digitizers append to the
9898
// event container, while run-mode digitizers append to the run container.
9999
for (size_t hitIndex = 0; hitIndex < this_ghc->GetSize(); ++hitIndex) {
100+
100101
auto* const this_hit = static_cast<GHit*>(this_ghc->GetHit(hitIndex));
101102
if (this_hit == nullptr) {
102103
continue;

actions/event/gEventAction.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@
88
#include "../run/gRunAction.h"
99

1010
/**
11-
* @file gEventAction.h
12-
* @brief Declares GEventAction, the per-event processing action for the GEMC actions module.
11+
* \file gEventAction.h
12+
* \brief Declares GEventAction, the per-event processing action for the GEMC actions module.
1313
*
1414
* @ingroup gactions_module
1515
*/
1616

1717
constexpr const char* EVENTACTION_LOGGER = "geventaction";
1818

1919
/**
20-
* @brief Namespace containing helpers related to event-action configuration.
20+
* \brief Namespace containing helpers related to event-action configuration.
2121
*
2222
* @ingroup gactions_module
2323
*/
2424
namespace geventaction {
2525
/**
26-
* @brief Returns the options associated with the event-action logger scope.
26+
* \brief Returns the options associated with the event-action logger scope.
2727
*
28-
* @return A GOptions object scoped to the event-action logger name.
28+
* \return A GOptions object scoped to the event-action logger name.
2929
*/
3030
inline GOptions defineOptions() { return GOptions(EVENTACTION_LOGGER); }
3131
} // namespace geventaction
3232

3333

3434
/**
3535
* @class GEventAction
36-
* @brief Handles event begin/end callbacks, hit digitization, and event-level publication.
36+
* \brief Handles event begin/end callbacks, hit digitization, and event-level publication.
3737
*
3838
* This class is the worker-side event action used by GEMC. It participates in the
3939
* per-event lifecycle driven by Geant4 and is responsible for transforming hit
@@ -59,10 +59,10 @@ class GEventAction : public GBase<GEventAction>, public G4UserEventAction
5959
{
6060
public:
6161
/**
62-
* @brief Constructs the event action.
62+
* \brief Constructs the event action.
6363
*
64-
* @param gopt Shared configuration object used for event-product construction and logging.
65-
* @param run_a Non-owning pointer to the thread-local GRunAction instance that provides
64+
* \param gopt Shared configuration object used for event-product construction and logging.
65+
* \param run_a Non-owning pointer to the thread-local GRunAction instance that provides
6666
* access to digitization routines, run-level accumulation, and streamers.
6767
*/
6868
explicit GEventAction(const std::shared_ptr<GOptions>& gopt, GRunAction* run_a);
@@ -75,17 +75,17 @@ class GEventAction : public GBase<GEventAction>, public G4UserEventAction
7575
GEventAction& operator=(GEventAction&&) = delete;
7676

7777
/**
78-
* @brief Called by Geant4 at the beginning of an event.
78+
* \brief Called by Geant4 at the beginning of an event.
7979
*
8080
* In this implementation, the method is mainly used for event/thread tracing and
8181
* lightweight diagnostics.
8282
*
83-
* @param event Geant4 event descriptor for the event being started.
83+
* \param event Geant4 event descriptor for the event being started.
8484
*/
8585
void BeginOfEventAction(const G4Event* event) override;
8686

8787
/**
88-
* @brief Called by Geant4 at the end of an event.
88+
* \brief Called by Geant4 at the end of an event.
8989
*
9090
* This method performs the main event-processing logic of the module:
9191
* - count the event in the run-level bookkeeping;
@@ -96,25 +96,25 @@ class GEventAction : public GBase<GEventAction>, public G4UserEventAction
9696
* the digitizer collection mode;
9797
* - publish the event data once all event-mode collections have been processed.
9898
*
99-
* @param event Geant4 event descriptor for the event being completed.
99+
* \param event Geant4 event descriptor for the event being completed.
100100
*/
101101
void EndOfEventAction(const G4Event* event) override;
102102

103103
private:
104104
/**
105-
* @brief Publishes a completed event data collection to all worker-thread streamers.
105+
* \brief Publishes a completed event data collection to all worker-thread streamers.
106106
*
107-
* @param event_data Shared event-data object containing the completed event payload.
107+
* \param event_data Shared event-data object containing the completed event payload.
108108
*/
109109
void publish_event_data(const std::shared_ptr<GEventDataCollection>& event_data) const;
110110

111111
/**
112-
* @brief Shared configuration used to build event products and control logging.
112+
* \brief Shared configuration used to build event products and control logging.
113113
*/
114114
std::shared_ptr<GOptions> goptions;
115115

116116
/**
117-
* @brief Non-owning pointer to the thread-local run action associated with this event action.
117+
* \brief Non-owning pointer to the thread-local run action associated with this event action.
118118
*
119119
* The run action provides:
120120
* - access to the shared digitization-routine map;

actions/gaction.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66

77
// Construct the action initializer and keep shared services available for later
88
// action registration on worker and master execution contexts.
9-
GAction::GAction(std::shared_ptr<GOptions> gopts,
9+
GAction::GAction(std::shared_ptr<GOptions> gopts,
1010
std::shared_ptr<gdynamicdigitization::dRoutinesMap> digi_map) :
1111
GBase(gopts, GACTION_LOGGER),
1212
goptions(std::move(gopts)),
13-
digitization_routines_map(std::move(digi_map)) { }
13+
digitization_routines_map(std::move(digi_map)) {
14+
15+
log->debug(CONSTRUCTOR, FUNCTION_NAME);
16+
17+
}
1418

1519

1620
// Register the master-thread actions.
@@ -40,4 +44,4 @@ void GAction::Build() const {
4044

4145
// The event action consumes the run action as a non-owning dependency.
4246
SetUserAction(new GEventAction(goptions, run_action));
43-
}
47+
}

actions/gaction.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#include "generator/gPrimaryGeneratorAction.h"
1616

1717
/**
18-
* @file gaction.h
19-
* @brief Declares GAction, the Geant4 action-initialization entry point for the GEMC actions module.
18+
* \file gaction.h
19+
* \brief Declares GAction, the Geant4 action-initialization entry point for the GEMC actions module.
2020
*
2121
* GAction is the module-level class responsible for registering the Geant4 user
2222
* actions used by GEMC. It derives from \c G4VUserActionInitialization and is
@@ -29,7 +29,7 @@
2929
constexpr const char* GACTION_LOGGER = "gaction";
3030

3131
/**
32-
* @brief Namespace containing helpers related to action-subsystem configuration.
32+
* \brief Namespace containing helpers related to action-subsystem configuration.
3333
*
3434
* The functions in this namespace are intended to support module setup by providing
3535
* a single place where all action-related option definitions can be collected.
@@ -39,7 +39,7 @@ constexpr const char* GACTION_LOGGER = "gaction";
3939
namespace gaction {
4040

4141
/**
42-
* @brief Builds the aggregate option set required by the actions subsystem.
42+
* \brief Builds the aggregate option set required by the actions subsystem.
4343
*
4444
* This helper creates a logger-scoped GOptions object for the action module and
4545
* then merges into it the option definitions contributed by the event action,
@@ -48,7 +48,7 @@ namespace gaction {
4848
* The returned object is meant to be merged into the wider application configuration
4949
* before constructing GAction.
5050
*
51-
* @return A GOptions object containing the union of all action-related option definitions.
51+
* \return A GOptions object containing the union of all action-related option definitions.
5252
*/
5353
inline GOptions defineOptions() {
5454
auto goptions = GOptions(GACTION_LOGGER);
@@ -64,7 +64,7 @@ inline GOptions defineOptions() {
6464

6565
/**
6666
* @class GAction
67-
* @brief Registers GEMC user actions for worker threads, sequential execution, and the master thread.
67+
* \brief Registers GEMC user actions for worker threads, sequential execution, and the master thread.
6868
*
6969
* Geant4 uses an action-initialization object derived from \c G4VUserActionInitialization
7070
* to obtain the user actions that will participate in a simulation.
@@ -93,10 +93,10 @@ inline GOptions defineOptions() {
9393
class GAction : public GBase<GAction>, public G4VUserActionInitialization {
9494
public:
9595
/**
96-
* @brief Constructs the action initializer used by the Geant4 run manager.
96+
* \brief Constructs the action initializer used by the Geant4 run manager.
9797
*
98-
* @param gopts Shared configuration object used by all actions constructed by this initializer.
99-
* @param digi_map Shared map associating collection names with digitization routines.
98+
* \param gopts Shared configuration object used by all actions constructed by this initializer.
99+
* \param digi_map Shared map associating collection names with digitization routines.
100100
*/
101101
explicit GAction(std::shared_ptr<GOptions> gopts,
102102
std::shared_ptr<gdynamicdigitization::dRoutinesMap> digi_map);
@@ -109,7 +109,7 @@ class GAction : public GBase<GAction>, public G4VUserActionInitialization {
109109
GAction& operator=(GAction&&) = delete;
110110

111111
/**
112-
* @brief Registers the user actions required by worker threads and sequential execution.
112+
* \brief Registers the user actions required by worker threads and sequential execution.
113113
*
114114
* This method is called by Geant4 when action objects must be created for an
115115
* execution context that processes events.
@@ -126,7 +126,7 @@ class GAction : public GBase<GAction>, public G4VUserActionInitialization {
126126
void Build() const override;
127127

128128
/**
129-
* @brief Registers the user actions required by the master thread.
129+
* \brief Registers the user actions required by the master thread.
130130
*
131131
* In multithreaded execution, the master thread does not process individual events.
132132
* For that reason, only GRunAction is registered here. That action handles the
@@ -136,7 +136,7 @@ class GAction : public GBase<GAction>, public G4VUserActionInitialization {
136136

137137
private:
138138
/**
139-
* @brief Shared configuration used when constructing all action objects.
139+
* \brief Shared configuration used when constructing all action objects.
140140
*
141141
* This pointer is stored so both \ref GAction::Build "Build()" and
142142
* \ref GAction::BuildForMaster "BuildForMaster()" create actions using the same
@@ -145,7 +145,7 @@ class GAction : public GBase<GAction>, public G4VUserActionInitialization {
145145
std::shared_ptr<GOptions> goptions;
146146

147147
/**
148-
* @brief Shared digitization-routine map passed to run and event processing actions.
148+
* \brief Shared digitization-routine map passed to run and event processing actions.
149149
*
150150
* The map associates collection names with the routines that know how to transform
151151
* raw hit information into GEMC digitized and truth-level payload.

actions/gactionConventions.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
2-
* @file gactionConventions.h
3-
* @brief Defines error codes used by the GEMC actions module.
2+
* \file gactionConventions.h
3+
* \brief Defines error codes used by the GEMC actions module.
44
*
55
* This header centralizes stable error identifiers used by the action-related
66
* classes when reporting failures through the logging system.
77
*
88
* @defgroup gactions_module_errors GEMC actions module error codes
9-
* @brief Error/status codes used by the GEMC actions module.
9+
* \brief Error/status codes used by the GEMC actions module.
1010
*
1111
* These numeric codes make it easier to identify recurring failure modes in logs,
1212
* tests, and operational diagnostics.
@@ -17,7 +17,7 @@
1717
/**
1818
* @ingroup gactions_module_errors
1919
* @name Error codes
20-
* @brief Module-level error/status codes emitted by action-related classes.
20+
* \brief Module-level error/status codes emitted by action-related classes.
2121
*
2222
* The values are in the 1200 range and are intended to remain stable so log-based
2323
* diagnostics can reliably identify the same category of problem across builds.

actions/gactionsDoxy.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
2-
* @file gactionsDoxy.h
3-
* @brief Doxygen entry point for the GEMC actions module.
2+
* \file gactionsDoxy.h
3+
* \brief Doxygen entry point for the GEMC actions module.
44
*
55
* This file defines the module-level Doxygen group and the main documentation page
66
* for the action subsystem responsible for Geant4 action registration and execution.
77
*/
88

99
/**
1010
* @defgroup gactions_module GEMC actions module
11-
* @brief Geant4 action initialization and per-thread action components for GEMC.
11+
* \brief Geant4 action initialization and per-thread action components for GEMC.
1212
*
1313
* This module contains the classes that register and execute the Geant4 user actions
1414
* used by GEMC during a run. It centralizes the action lifecycle, threading model,

actions/generator/gPrimaryGeneratorAction.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ GPrimaryGeneratorAction::GPrimaryGeneratorAction(std::shared_ptr<GOptions> gopts
2525
// inject the corresponding primary information into the current event.
2626
void GPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) {
2727
for (const auto& gparticle : gparticles) {
28-
log->info(2, gparticle);
2928

3029
if (gparticle != nullptr) {
3130
gparticle->shootParticle(gparticleGun.get(), anEvent);

actions/generator/gPrimaryGeneratorAction.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,30 @@
1313
#include "G4ParticleGun.hh"
1414

1515
/**
16-
* @file gPrimaryGeneratorAction.h
17-
* @brief Declares GPrimaryGeneratorAction, the primary-particle generation action for the GEMC actions module.
16+
* \file gPrimaryGeneratorAction.h
17+
* \brief Declares GPrimaryGeneratorAction, the primary-particle generation action for the GEMC actions module.
1818
*
1919
* @ingroup gactions_module
2020
*/
2121

2222
constexpr const char* GPRIMARYGENERATORACTION_LOGGER = "generator";
2323

2424
/**
25-
* @brief Namespace containing helpers related to primary-generator configuration.
25+
* \brief Namespace containing helpers related to primary-generator configuration.
2626
*
2727
* @ingroup gactions_module
2828
*/
2929
namespace gprimaryaction {
3030

3131
/**
32-
* @brief Returns the options associated with the primary-generator action scope.
32+
* \brief Returns the options associated with the primary-generator action scope.
3333
*
3434
* In the current implementation this helper returns a logger-scoped GOptions object
3535
* without adding dedicated primary-generator switches directly in this file.
3636
* Generator behavior is instead mainly driven by the particle definitions loaded
3737
* through the generator support code.
3838
*
39-
* @return A GOptions object scoped to the primary-generator logger name.
39+
* \return A GOptions object scoped to the primary-generator logger name.
4040
*/
4141
inline GOptions defineOptions() {
4242
return GOptions(GPRIMARYGENERATORACTION_LOGGER);
@@ -47,7 +47,7 @@ inline GOptions defineOptions() {
4747

4848
/**
4949
* @class GPrimaryGeneratorAction
50-
* @brief Generates the primary vertices for each Geant4 event.
50+
* \brief Generates the primary vertices for each Geant4 event.
5151
*
5252
* This class is the GEMC implementation of the Geant4 primary-generator action.
5353
* It owns a \c G4ParticleGun and a list of configured Gparticle objects.
@@ -65,14 +65,14 @@ inline GOptions defineOptions() {
6565
class GPrimaryGeneratorAction : public GBase<GPrimaryGeneratorAction>, public G4VUserPrimaryGeneratorAction {
6666
public:
6767
/**
68-
* @brief Constructs the primary-generator action.
68+
* \brief Constructs the primary-generator action.
6969
*
7070
* Construction performs the following steps:
7171
* - allocate the \c G4ParticleGun instance used for emission;
7272
* - read the configured particle definitions through gparticle support helpers;
7373
* - create a default particle if no explicit particle definition is available.
7474
*
75-
* @param gopts Shared configuration object used to retrieve generator settings and logging controls.
75+
* \param gopts Shared configuration object used to retrieve generator settings and logging controls.
7676
*/
7777
explicit GPrimaryGeneratorAction(std::shared_ptr<GOptions> gopts);
7878

@@ -84,7 +84,7 @@ class GPrimaryGeneratorAction : public GBase<GPrimaryGeneratorAction>, public G4
8484
GPrimaryGeneratorAction& operator=(GPrimaryGeneratorAction&&) = delete;
8585

8686
/**
87-
* @brief Generates the primary content for one event.
87+
* \brief Generates the primary content for one event.
8888
*
8989
* The method loops over all configured Gparticle objects. For each non-null entry,
9090
* it asks the particle object to configure the internal \c G4ParticleGun and to
@@ -93,21 +93,21 @@ class GPrimaryGeneratorAction : public GBase<GPrimaryGeneratorAction>, public G4
9393
* This design allows multiple configured particle definitions to contribute to a
9494
* single Geant4 event.
9595
*
96-
* @param event The event that will receive the generated primary vertices and particles.
96+
* \param event The event that will receive the generated primary vertices and particles.
9797
*/
9898
void GeneratePrimaries(G4Event* event) override;
9999

100100
private:
101101
/**
102-
* @brief Particle-gun instance used to materialize configured primaries into the event.
102+
* \brief Particle-gun instance used to materialize configured primaries into the event.
103103
*
104104
* The gun is owned exclusively by this class and reused across events. Individual
105105
* Gparticle objects configure it before shooting their contribution to the event.
106106
*/
107107
std::unique_ptr<G4ParticleGun> gparticleGun;
108108

109109
/**
110-
* @brief List of configured particle definitions used during event generation.
110+
* \brief List of configured particle definitions used during event generation.
111111
*
112112
* Each entry represents one generator-side particle description. During event
113113
* generation the list is traversed in order, and each non-null entry is given

0 commit comments

Comments
 (0)