Import Geant4 11.1.0.beta source tree
This commit is contained in:
@@ -70,6 +70,8 @@ class Par04EventAction : public G4UserEventAction
|
||||
G4double fCellSizeZ = 0;
|
||||
/// Size of cell along radius of cylinder
|
||||
G4double fCellSizeRho = 0;
|
||||
/// Size of cell in azimuthal angle
|
||||
G4double fCellSizePhi = 0;
|
||||
/// Number of readout cells along radius
|
||||
G4int fCellNbRho = 0;
|
||||
/// Number of readout cells in azimuthal angle
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#define PAR04INFERENCEINTERFACE_HH
|
||||
|
||||
#include "globals.hh"
|
||||
using namespace std;
|
||||
#include <vector>
|
||||
|
||||
/**
|
||||
* @brief Inference interface
|
||||
@@ -46,7 +46,7 @@ class Par04InferenceInterface
|
||||
/// @param[in] aGenVector Input latent space and conditions
|
||||
/// @param[out] aEnergies Model output = generated shower energies
|
||||
/// @param[in] aSize Size of the output
|
||||
virtual void RunInference(vector<float> aGenVector, std::vector<G4double>& aEnergies,
|
||||
virtual void RunInference(std::vector<float> aGenVector, std::vector<G4double>& aEnergies,
|
||||
int aSize) = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -26,14 +26,15 @@
|
||||
#ifdef USE_INFERENCE
|
||||
#ifndef PAR04INFERENCEMESSENGER_H
|
||||
#define PAR04INFERENCEMESSENGER_H
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class Par04InferenceSetup;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithoutParameter;
|
||||
class G4UIcmdWithAnInteger;
|
||||
#include <G4String.hh> // for G4String
|
||||
#include "G4UImessenger.hh" // for G4UImessenger
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcommand;
|
||||
class G4UIdirectory;
|
||||
class Par04InferenceSetup;
|
||||
|
||||
/**
|
||||
* @brief Inference messenger.
|
||||
|
||||
@@ -27,18 +27,15 @@
|
||||
#ifndef PAR04INFEERENCESETUP_HH
|
||||
#define PAR04INFEERENCESETUP_HH
|
||||
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "globals.hh"
|
||||
#include "CLHEP/Units/SystemOfUnits.h"
|
||||
|
||||
#include "Par04DetectorConstruction.hh"
|
||||
#include "Par04InferenceMessenger.hh"
|
||||
#include "Par04InferenceInterface.hh"
|
||||
|
||||
namespace CLHEP
|
||||
{
|
||||
class HepRandomEngine;
|
||||
}
|
||||
#include <G4String.hh> // for G4String
|
||||
#include <G4SystemOfUnits.hh> // for mm
|
||||
#include <G4Types.hh> // for G4int, G4double, G4bool, G4f...
|
||||
#include <memory> // for unique_ptr
|
||||
#include <vector> // for vector
|
||||
#include "CLHEP/Units/SystemOfUnits.h" // for mm
|
||||
#include "G4ThreeVector.hh" // for G4ThreeVector
|
||||
class Par04DetectorConstruction;
|
||||
class Par04InferenceInterface;
|
||||
class Par04InferenceMessenger;
|
||||
|
||||
/**
|
||||
@@ -65,10 +62,6 @@ class Par04InferenceSetup
|
||||
/// Check if inference should be performed for the particle
|
||||
/// @param[in] aEnergy Particle's energy
|
||||
G4bool IfTrigger(G4double aEnergy);
|
||||
/// Specify if cylindrical coordinates are to be used (or Carthesian instead).
|
||||
inline void SetIfCylindrical(const G4bool aIfCylindrical) { fIfCylindrical = aIfCylindrical; };
|
||||
/// Get flag specifying if cylindrical are used (or Carthesian instead).
|
||||
inline G4double GetIfCylindrical() const { return fIfCylindrical; };
|
||||
/// Set mesh size.
|
||||
/// @param aSize (x,y,x) size for Carthesian coordinates, or (R, phi, z) for
|
||||
/// cylindrical coordinates.
|
||||
@@ -145,12 +138,6 @@ class Par04InferenceSetup
|
||||
G4ThreeVector aParticleDirection);
|
||||
|
||||
private:
|
||||
/// Pointer to detector construction to retrieve (once) the detector
|
||||
/// dimensions
|
||||
Par04DetectorConstruction* fDetector;
|
||||
// Alpha parameter of the Sigma distribution
|
||||
/// Can be changed with UI command `/example/mesh/cylindrical <true/false>`
|
||||
bool fIfCylindrical = true;
|
||||
/// Cell's size: (x,y,x) for Carthesian, and (R, phi, z) for cylindrical
|
||||
/// coordinates Can be changed with UI command `/example/mesh/size <x y z>/<r
|
||||
/// phi z> <unit>`. For cylindrical coordinates phi is ignored and calculated
|
||||
|
||||
@@ -28,10 +28,14 @@
|
||||
#ifndef PAR04LWTNNINFERENCE_HH
|
||||
#define PAR04LWTNNINFERENCE_HH
|
||||
|
||||
#include "Par04InferenceInterface.hh"
|
||||
#include "lwtnn/LightweightGraph.hh"
|
||||
#include "lwtnn/parse_json.hh"
|
||||
#include <fstream>
|
||||
#include <G4String.hh> // for G4String
|
||||
#include <G4Types.hh> // for G4double
|
||||
#include <map> // for map, map<>::value_compare
|
||||
#include <memory> // for unique_ptr
|
||||
#include <string> // for string, basic_string, operator<
|
||||
#include <vector> // for vector
|
||||
#include "Par04InferenceInterface.hh" // for Par04InferenceInterface
|
||||
#include "lwtnn/LightweightGraph.hh" // for LightweightGraph
|
||||
|
||||
/**
|
||||
* @brief Inference using the LWTNN library.
|
||||
@@ -42,8 +46,6 @@
|
||||
*
|
||||
**/
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Par04LwtnnInference : public Par04InferenceInterface
|
||||
{
|
||||
public:
|
||||
@@ -54,7 +56,7 @@ class Par04LwtnnInference : public Par04InferenceInterface
|
||||
/// @param[in] aGenVector Input latent space and conditions
|
||||
/// @param[out] aEnergies Model output = generated shower energies
|
||||
/// @param[in] aSize Size of the output
|
||||
void RunInference(vector<float> aGenVector, std::vector<G4double>& aEnergies, int aSize);
|
||||
void RunInference(std::vector<float> aGenVector, std::vector<G4double>& aEnergies, int aSize);
|
||||
|
||||
private:
|
||||
/// LWTNN graph , Network input and output vectors
|
||||
|
||||
@@ -27,12 +27,18 @@
|
||||
#ifndef PAR04MLFASTSIMMODEL_HH
|
||||
#define PAR04MLFASTSIMMODEL_HH
|
||||
|
||||
#include "G4VFastSimulationModel.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "Par04InferenceSetup.hh"
|
||||
|
||||
#include <G4String.hh> // for G4String
|
||||
#include <G4ThreeVector.hh> // for G4ThreeVector
|
||||
#include <G4Types.hh> // for G4bool, G4double
|
||||
#include <memory> // for unique_ptr
|
||||
#include <vector> // for vector
|
||||
#include "G4VFastSimulationModel.hh" // for G4VFastSimulationModel
|
||||
class G4FastSimHitMaker;
|
||||
class G4FastStep;
|
||||
class G4FastTrack;
|
||||
class G4ParticleDefinition;
|
||||
class G4Region;
|
||||
class Par04InferenceSetup;
|
||||
|
||||
/**
|
||||
* @brief Inference for the fast simulation model.
|
||||
|
||||
@@ -27,12 +27,13 @@
|
||||
#ifdef USE_INFERENCE_ONNX
|
||||
#ifndef PAR04ONNXINFERENCE_HH
|
||||
#define PAR04ONNXINFERENCE_HH
|
||||
|
||||
#include "Par04InferenceInterface.hh"
|
||||
#include "CLHEP/Units/SystemOfUnits.h"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "globals.hh"
|
||||
#include "core/session/onnxruntime_cxx_api.h"
|
||||
#include <core/session/onnxruntime_c_api.h> // for OrtMemoryInfo
|
||||
#include <G4String.hh> // for G4String
|
||||
#include <G4Types.hh> // for G4int, G4double
|
||||
#include <memory> // for unique_ptr
|
||||
#include <vector> // for vector
|
||||
#include "Par04InferenceInterface.hh" // for Par04InferenceInterface
|
||||
#include "core/session/onnxruntime_cxx_api.h" // for Env, Session, SessionO...
|
||||
|
||||
/**
|
||||
* @brief Inference using the ONNX runtime.
|
||||
@@ -53,7 +54,7 @@ class Par04OnnxInference : public Par04InferenceInterface
|
||||
/// @param[in] aGenVector Input latent space and conditions
|
||||
/// @param[out] aEnergies Model output = generated shower energies
|
||||
/// @param[in] aSize Size of the output
|
||||
void RunInference(vector<float> aGenVector, std::vector<G4double>& aEnergies, int aSize);
|
||||
void RunInference(std::vector<float> aGenVector, std::vector<G4double>& aEnergies, int aSize);
|
||||
|
||||
private:
|
||||
/// Pointer to the ONNX enviroment
|
||||
|
||||
Reference in New Issue
Block a user