File indexing completed on 2025-01-30 09:18:35
0001 require 'numpy'
0002
0003
0004 class VariatorBase
0005
0006
0007
0008
0009
0010
0011
0012 @@center_delta = Proc.new do |center, delta, count|
0013 Numpy.linspace(center-delta, center+delta, count).to_a
0014 end
0015
0016
0017 @@min_max = Proc.new do |min, max, count|
0018 Numpy.linspace(min, max, count).to_a
0019 end
0020
0021
0022
0023
0024
0025
0026
0027
0028 @@test_optics = Proc.new do |settings|
0029 [
0030
0031 [[
0032 'scripts/edit_xml.rb',
0033 settings[:compact_drich],
0034 '//constant[@name="DRICH_debug_optics"]',
0035 'value',
0036 '0'
0037 ]],
0038
0039 [[
0040 './geometry.sh',
0041 "-c #{settings[:compact_detector]}",
0042 "-o #{settings[:output].sub(/root$/,'geometry.root')}",
0043 ]],
0044
0045 [[
0046 './simulate.py',
0047 '-t 4',
0048 '-n 100',
0049 "-c #{settings[:compact_detector]}",
0050 "-o #{settings[:output]}",
0051 ]],
0052
0053 [[
0054 'bin/draw_hits',
0055 "d",
0056 settings[:output]
0057 ]],
0058
0059 [[
0060 'scripts/edit_xml.rb',
0061 settings[:compact_drich],
0062 '//constant[@name="DRICH_debug_optics"]',
0063 'value',
0064 '1'
0065 ]],
0066
0067
0068
0069 [
0070 ["exit"],
0071 [
0072 "./simulate.py",
0073 "-t 102",
0074 "-v",
0075 "-n 15",
0076 "-e svg",
0077 "-c #{settings[:compact_detector]}",
0078 "-o #{settings[:output]}",
0079 ],
0080 ],
0081 ]
0082 end
0083
0084
0085
0086
0087
0088 def initialize
0089 @varied_settings = Array.new
0090 @fixed_settings = Array.new
0091 @derived_settings = Array.new
0092 end
0093
0094
0095 attr_accessor :varied_settings, :fixed_settings, :derived_settings, :simulation_pipelines
0096
0097 end