Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:34

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 #ifdef USE_INFERENCE
0027 #  ifndef PAR04INFERENCEMESSENGER_H
0028 #    define PAR04INFERENCEMESSENGER_H
0029 
0030 #    include "G4UImessenger.hh"  // for G4UImessenger
0031 
0032 #    include <G4String.hh>  // for G4String
0033 class G4UIcmdWithADoubleAndUnit;
0034 class G4UIcmdWithAString;
0035 class G4UIcmdWithAnInteger;
0036 class G4UIcommand;
0037 class G4UIdirectory;
0038 class Par04InferenceSetup;
0039 
0040 /**
0041  * @brief Inference messenger.
0042  *
0043  * Provides UI commands to setup the inference: name of the inference library,
0044  * path to the ML model, size of the latent space, the size of the condition
0045  * vector and flags for optimization and profiling. It allows to specify the
0046  * mesh size (in cylindrical coordinates) that was used in training dataset
0047  * (full simulation).
0048  *
0049  */
0050 
0051 class Par04InferenceMessenger : public G4UImessenger
0052 {
0053   public:
0054     Par04InferenceMessenger(Par04InferenceSetup*);
0055     ~Par04InferenceMessenger();
0056     /// Invokes appropriate methods based on the typed command
0057     virtual void SetNewValue(G4UIcommand*, G4String) final;
0058     /// Retrieves the current settings
0059     virtual G4String GetCurrentValue(G4UIcommand*) final;
0060 
0061   private:
0062     /// Inference to setup
0063     Par04InferenceSetup* fInference = nullptr;
0064     /// Command to set the directory common to all inference messengers in this
0065     /// example /Par04
0066     G4UIdirectory* fExampleDir = nullptr;
0067     /// Command to set the directory for inference settings /Par04/inference
0068     G4UIdirectory* fInferenceDir = nullptr;
0069     /// Command to set the inference library
0070     G4UIcmdWithAString* fInferenceLibraryCmd = nullptr;
0071     /// Command to set fModelPathNameCmd
0072     G4UIcmdWithAString* fModelPathNameCmd = nullptr;
0073     /// Command to set the fSizeLatentVectorCmd
0074     G4UIcmdWithAnInteger* fSizeLatentVectorCmd = nullptr;
0075     /// Command to set the fSizeConditionVectorCmd
0076     G4UIcmdWithAnInteger* fSizeConditionVectorCmd = nullptr;
0077     /// Command to set the fProfileFlagCmd
0078     G4UIcmdWithAnInteger* fProfileFlagCmd = nullptr;
0079     /// Command to set the fOptimizationFlagCmd
0080     G4UIcmdWithAnInteger* fOptimizationFlagCmd = nullptr;
0081     /// Command to set the number of cells in the cylindrical readout mesh (along
0082     /// rho axis)
0083     G4UIcmdWithAnInteger* fMeshNbRhoCellsCmd = nullptr;
0084     /// Command to set the number of cells in the cylindrical readout mesh (along
0085     /// phi axis)
0086     G4UIcmdWithAnInteger* fMeshNbPhiCellsCmd = nullptr;
0087     /// Command to set the number of cells in the cylindrical readout mesh (along
0088     /// z axis)
0089     G4UIcmdWithAnInteger* fMeshNbZCellsCmd = nullptr;
0090     /// Command to the size of cells in the cylindrical readout mesh (along rho
0091     /// axis)
0092     G4UIcmdWithADoubleAndUnit* fMeshSizeRhoCellsCmd = nullptr;
0093     /// Command to the size of cells in the cylindrical readout mesh (along z
0094     /// axis)
0095     G4UIcmdWithADoubleAndUnit* fMeshSizeZCellsCmd = nullptr;
0096     /// Commands to set execution provider flags
0097     /// GPU
0098     G4UIcmdWithAnInteger* fCudaFlagCmd = nullptr;
0099     /// Cuda Commands
0100     G4UIdirectory* fCudaOptionsDir = nullptr;
0101     G4UIcmdWithAString* fCudaDeviceIdCmd = nullptr;
0102     G4UIcmdWithAString* fCudaGpuMemLimitCmd = nullptr;
0103     G4UIcmdWithAString* fCudaArenaExtendedStrategyCmd = nullptr;
0104     G4UIcmdWithAString* fCudaCudnnConvAlgoSearchCmd = nullptr;
0105     G4UIcmdWithAString* fCudaDoCopyInDefaultStreamCmd = nullptr;
0106     G4UIcmdWithAString* fCudaCudnnConvUseMaxWorkspaceCmd = nullptr;
0107 };
0108 
0109 #  endif
0110 #endif