Warning, /AID2E-framework/examples/epic/drich/workflow.yml is written in an unsupported language. File is not indexed.
0001 # This example shows:
0002 # 1. Optimization with Ax (Sobol warmup + BO)
0003 # 2. Multi-objective dRICH optimization:
0004 # maximize pi/K separation and acceptance
0005 # 3. ePIC workflow chain: geo -> sim_rec -> ana
0006 # ============================================================================
0007
0008 # Problem definition
0009 problem:
0010 name: "dRICH Optimization"
0011 problem_type: "EPIC_dRICH"
0012 description: "Optimization of dRICH"
0013
0014 output_location: "./output"
0015 work_location: "./work"
0016
0017 design_parameters_file: "./design.params"
0018
0019 objectives:
0020 - name: "piKsep_etalow"
0021 direction: "maximize"
0022 - name: "piKsep_etahigh"
0023 direction: "maximize"
0024 - name: "acceptance"
0025 direction: "maximize"
0026
0027 epic_environment:
0028 epic_install: "./work/eic-software"
0029 epic_config: "epic_craterlake"
0030 geometry_mode: "no_build"
0031 eic_shell: "./work/eic-shell"
0032 eic_recon_install: "./work/eic-software/share/epic/local"
0033
0034 evaluation_config:
0035 npart: 500
0036 bootstrap_samples: 50
0037 nbootstraps: 50
0038 particles: ["pi+", "kaon+"]
0039 analysis_executable: "script/dRICHAna_bootstrap"
0040 output_name: "drich_optimization_toy"
0041 scan_points:
0042 - {p: 15, eta_min: 1.5, eta_max: 2.0, radiator: 0}
0043 - {p: 15, eta_min: 2.0, eta_max: 2.5, radiator: 0}
0044 - {p: 45, eta_min: 2.5, eta_max: 3.0, radiator: 1}
0045 - {p: 45, eta_min: 3.0, eta_max: 3.5, radiator: 1}
0046
0047 trial_failure_policy: "penalty" # penalty/fail
0048 max_failed_trials: 5
0049 penalty_objectives:
0050 piKsep_etalow: 0.0
0051 piKsep_etahigh: 0.0
0052 acceptance: 0.0
0053
0054 # Optimizer configuration
0055 optimizer:
0056 name: "ax"
0057 type: "bayesian"
0058 parameters:
0059 initialization_strategy: "sobol"
0060 seed: 999
0061
0062 generator: "BOTORCH_MODULAR"
0063 objective_thresholds:
0064 piKsep_etalow: 3.62
0065 piKsep_etahigh: 4.04
0066 acceptance: 0.80
0067
0068 n_initial_samples: 10 # n_sobol
0069 n_iterations: 50
0070 batch_size: 5 # n_batch_sobol = n_batch_mobo
0071
0072 # Global scheduler configuration
0073 scheduler:
0074 runner_type: "JobLibRunner" # JobLibRunner, SlurmRunner, PanDAiDDSRunner
0075 parameters:
0076 n_jobs: 2
0077 backend: "loky"
0078
0079 # Workflow execution
0080 workflows:
0081 workflows:
0082 - name: "drich_workflow"
0083 description: "dRICH evaluation workflow"
0084 stack_type: "epic"
0085
0086 branches:
0087 - name: "main"
0088 scheduler:
0089 runner_type: "SlurmRunner"
0090 parameters: &drich_stage_slurm
0091 job_name_prefix: "drich"
0092 account: "<account>"
0093 partition: "<partition>"
0094 nodes: 1
0095 ntasks: 1
0096 cpus_per_task: 1
0097 mem: "4G"
0098 time: "04:00:00"
0099 poll_interval: 10
0100 capture_stdout: true
0101 capture_stderr: true
0102 stages:
0103 - name: "geo"
0104 # Edit trial XML and run checkOverlaps.
0105 scheduler:
0106 runner_type: "JobLibRunner"
0107 parameters:
0108 n_jobs: 1
0109 backend: "threading"
0110 jobs:
0111 - name: "drich_geo"
0112 payload:
0113 evaluator_type: "stack"
0114 layers:
0115 - layer: "geo"
0116 inputs:
0117 - "{{geometry_dir}}/${DETECTOR_CONFIG}.xml"
0118 outputs:
0119 - "{{output_dir}}/overlap_log_{{workflow[trial_index]}}.txt"
0120
0121 - name: "sim_rec"
0122 # Run npsim and then eicrecon in the same job
0123 jobs:
0124 - name: "drich_sim_rec"
0125 payload:
0126 evaluator_type: "stack"
0127 layers:
0128 - layer: "sim"
0129 inputs: []
0130 outputs:
0131 - "{{payload[sim_file]}}"
0132 arguments:
0133 - "--compactFile"
0134 - "{{geometry_dir}}/${DETECTOR_CONFIG}.xml"
0135 - "-G"
0136 - "-N {{payload[npart]}}"
0137 - "--gun.etaMax {{payload[eta_max]}}"
0138 - "--gun.etaMin {{payload[eta_min]}}"
0139 - "--gun.phiMin 0"
0140 - "--gun.phiMax 6.2831853"
0141 - "--gun.momentumMax '{{payload[p]}}*GeV'"
0142 - "--gun.momentumMin '{{payload[p]}}*GeV'"
0143 - "--gun.particle {{payload[particle]}}"
0144 - "--gun.distribution eta"
0145 rule: "{{command}} {{arguments}} {{inputs}} {{outputs}}"
0146 - layer: "rec"
0147 inputs:
0148 - "{{payload[sim_file]}}"
0149 outputs:
0150 - "{{payload[reco_file]}}"
0151 arguments:
0152 - "-Pdd4hep:xml_files={{geometry_dir}}/${DETECTOR_CONFIG}.xml"
0153 - "-Ppodio:output_include_collections=DRICHHits,MCParticles,DRICHRawHits,DRICHRawHitsAssociations,DRICHAerogelTracks,DRICHGasTracks,DRICHAerogelIrtCherenkovParticleID,DRICHGasIrtCherenkovParticleID,DRICHMergedIrtCherenkovParticleID"
0154 job_factory:
0155 type: "payloads"
0156 params:
0157 from: "drich_utils:sim_rec_payloads"
0158
0159 - name: "ana"
0160 # Run analysis once per scan point using pi+/kaon+ reco files.
0161 jobs:
0162 - name: "drich_ana"
0163 payload:
0164 evaluator_type: "stack"
0165 layers:
0166 - layer: "ana"
0167 inputs:
0168 - "{{payload[ana_inputs]}}"
0169 outputs:
0170 - "{{payload[analysis_output]}}"
0171 arguments:
0172 - "{{payload[radiator]}}"
0173 - "{{payload[bootstrap_samples]}}"
0174 - "{{payload[nbootstraps]}}"
0175 command: "{{workflow[config_dir]}}/script/dRICHAna_bootstrap"
0176 rule: "{{command}} {{inputs}} {{outputs}} {{arguments}}"
0177 job_factory:
0178 type: "payloads"
0179 params:
0180 from: "drich_utils:ana_payloads"
0181
0182 - name: "collect_objectives"
0183 objective_plan:
0184 steps:
0185 stages:
0186 - name: "merge"
0187 inline:
0188 entrypoint: "drich_utils:aggregate_objectives"
0189 produces_objective: true