Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:21:12

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file accel/SetupOptionsMessenger.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 #include <memory>
0009 #include <vector>
0010 #include <G4UIcommand.hh>
0011 #include <G4UIdirectory.hh>
0012 #include <G4UImessenger.hh>
0013 
0014 namespace celeritas
0015 {
0016 struct SetupOptions;
0017 
0018 //---------------------------------------------------------------------------//
0019 /*!
0020  * Expose setup options through the Geant4 "macro" UI interface.
0021  *
0022  * The following options are exposed in the \c /celer/ command "directory":
0023  *
0024   Command              | Description
0025   -------------------- | -----------------------------------------------------
0026   geometryFile         | Override detector geometry with a custom GDML
0027   outputFile           | Filename for JSON diagnostic output
0028   physicsOutputFile    | Filename for ROOT dump of physics data
0029   offloadOutputFile    | Filename for HepMC3/ROOT dump of offloaded tracks
0030   geometryOutputFile   | Filename for GDML export
0031   maxNumTracks         | Number of tracks to be transported simultaneously
0032   maxNumEvents         | Maximum number of events in use
0033   maxNumSteps          | Limit on number of step iterations before aborting
0034   maxInitializers      | Maximum number of track initializers
0035   secondaryStackFactor | At least the average number of secondaries per track
0036   autoFlush            | Number of tracks to buffer before offloading
0037   maxFieldSubsteps     | Limit on substeps in field propagator
0038   slotDiagnosticPrefix | Print IDs of particles in all slots (expensive)
0039 
0040  * The following option is exposed in the \c /celer/detector/ command
0041  * "directory":
0042  *
0043   Command | Description
0044   ------- | -----------------------------------------
0045   enabled | Call back to Geant4 sensitive detectors
0046 
0047  * If a CUDA/HIP device is available, additional options are available under \c
0048  * /celer/device/ (or a DEPRECATED /celer/cuda path, to be removed in v0.7):
0049  *
0050   Command        | Description
0051   -------------- | ------------------------------------------------
0052   stackSize      | Set the CUDA per-thread stack size for VecGeom
0053   heapSize       | Set the CUDA per-thread heap size for VecGeom
0054   actionTimes    | Add timers around every action (may reduce performance)
0055   defaultStream  | Launch all kernels on the default stream (DEPRECATED)
0056  *
0057  * \warning The given SetupOptions should be global *or* otherwise must exceed
0058  * the scope of this UI messenger.
0059  */
0060 class SetupOptionsMessenger : public G4UImessenger
0061 {
0062   public:
0063     // Construct with a reference to a setup options instance
0064     explicit SetupOptionsMessenger(SetupOptions* options);
0065 
0066     // Default destructor
0067     ~SetupOptionsMessenger() override;
0068 
0069   protected:
0070     void SetNewValue(G4UIcommand* command, G4String newValue) override;
0071     G4String GetCurrentValue(G4UIcommand* command) override;
0072 
0073   private:
0074     std::vector<std::unique_ptr<G4UIdirectory>> directories_;
0075     std::vector<std::unique_ptr<G4UIcommand>> commands_;
0076 };
0077 
0078 //---------------------------------------------------------------------------//
0079 }  // namespace celeritas