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.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 /Par04/detector/setDetectorInnerRadius 80 cm
  2 /Par04/detector/setDetectorLength 4 m
  3 /Par04/detector/setNbOfLayers 90
  4 /Par04/detector/setAbsorber 0 G4_W 1.4 mm true
  5 /Par04/detector/setAbsorber 1 G4_Si 0.3 mm true
  6 /Par04/mesh/setSizeOfRhoCells 2.325 mm
  7 /Par04/mesh/setSizeOfZCells 3.4 mm
  8 /Par04/mesh/setNbOfRhoCells 18
  9 /Par04/mesh/setNbOfPhiCells 50
 10 /Par04/mesh/setNbOfZCells 45
 11 /Par04/detector/print
 12 
 13 # Use default detector dimensions and initialize
 14 /run/initialize
 15 
 16 # If inference model is active, de-activate it because it needs configuration
 17 /param/InActivateModel inferenceModel
 18 
 19 # Open a viewer
 20 /vis/open
 21 # This opens the default viewer - see examples/basic/B1/vis.mac for a
 22 # more comprehensive overview of options. Also the documentation.
 23 #
 24 # Disable auto refresh and quieten vis messages whilst scene and
 25 # trajectories are established:
 26 /vis/viewer/set/autoRefresh false
 27 /vis/verbose errors
 28 #
 29 # Draw geometry:
 30 /vis/drawVolume worlds
 31 #
 32 # Specify view angle:
 33 /vis/viewer/set/viewpointThetaPhi 0 90 deg
 34 /vis/viewer/set/targetPoint 0 800 0 mm
 35 #
 36 # Specify zoom value:
 37 /vis/viewer/zoom 10
 38 #
 39 # Specify style (surface or wireframe):
 40 #/vis/viewer/set/style wireframe
 41 #
 42 # Draw coordinate axes:
 43 #/vis/scene/add/axes 0 0 0 1 m
 44 #
 45 # Draw smooth trajectories at end of event, showing trajectory points
 46 # as markers 2 pixels wide:
 47 #/vis/scene/add/trajectories smooth
 48 /vis/scene/add/trajectories
 49 /vis/modeling/trajectories/create/drawByCharge
 50 /vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true
 51 /vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2
 52 # (if too many tracks cause core dump => /tracking/storeTrajectory 0)
 53 #
 54 # Draw hits at end of event:
 55 /vis/scene/add/hits
 56 #
 57 # To draw only gammas:
 58 #/vis/filtering/trajectories/create/particleFilter
 59 #/vis/filtering/trajectories/particleFilter-0/add gamma
 60 #
 61 # To invert the above, drawing all particles except gammas,
 62 # keep the above two lines but also add:
 63 #/vis/filtering/trajectories/particleFilter-0/invert true
 64 #
 65 # Many other options are available with /vis/modeling and /vis/filtering.
 66 # For example, to select colour by particle ID:
 67 #/vis/modeling/trajectories/create/drawByParticleID
 68 #/vis/modeling/trajectories/drawByParticleID-0/set e- blue
 69 #
 70 # Create an attribute filter to draw only particles with certain (high) momentum
 71 /vis/filtering/trajectories/create/attributeFilter
 72 # Select attribute "IMag"
 73 /vis/filtering/trajectories/attributeFilter-0/setAttribute IMag
 74 # Select trajectories with 25 MeV <= IMag < 1000 GeV
 75 /vis/filtering/trajectories/attributeFilter-0/addInterval 25 MeV 1000 GeV
 76 #
 77 # To superimpose all of the events from a given run:
 78 /vis/scene/endOfEventAction accumulate
 79 #
 80 # Re-establish auto refreshing and verbosity:
 81 /vis/viewer/set/autoRefresh true
 82 /vis/verbose warnings
 83 #
 84 # For file-based drivers, use this to create an empty detector view:
 85 #/vis/viewer/flush
 86 /vis/viewer/set/background 1 1 1
 87 
 88 # Fast Simulation
 89 # Inference Setup
 90 ## dimension of the latent vector (encoded vector in a Variational Autoencoder model)
 91 /Par04/inference/setSizeLatentVector 10
 92 ## size of the condition vector (energy, angle and geometry)
 93 /Par04/inference/setSizeConditionVector 4
 94 ## path to the model which is set to download by cmake
 95 /Par04/inference/setModelPathName MLModels/Generator.onnx
 96 /Par04/inference/setProfileFlag 1
 97 /Par04/inference/setOptimizationFlag 0
 98 /Par04/inference/setInferenceLibrary ONNX
 99 ## set mesh size for inference == mesh size of a full sim that
100 ## was used for training; it coincides with readout mesh size
101 /Par04/inference/setSizeOfRhoCells 2.325 mm
102 /Par04/inference/setSizeOfZCells 3.4 mm
103 /Par04/inference/setNbOfRhoCells 18
104 /Par04/inference/setNbOfPhiCells 50
105 /Par04/inference/setNbOfZCells 45
106 ## Dynamic readout mesh from particle direction needs to be the first fast sim model!
107 /param/ActivateModel defineMesh
108 ## ML fast sim, configured with the inference setup /Par04/inference
109 /param/ActivateModel inferenceModel