#####################################################################################################
# This yaml file can be used to postprocess the Scalar Singlet Z2 samples for both low_mass and full
# parameter regions. The postprocessing scan adds AMS02 antiproton likelihood (2021), LZ 
# likelihood (2022), PandaX_4T likelihood (2021) and the LHC Higgs invisible width likelihood (2022). 
#####################################################################################################

Parameters:

  StandardModel_SLHA2: !import StandardModel_SLHA2_postprocessing.yaml

  nuclear_params_sigmas_sigmal:
    sigmas:
      prior_type: none
    sigmal: 
      prior_type: none
    deltau:  
      prior_type: none
    deltad:  
      prior_type: none
    deltas:  
      prior_type: none

  StandardModel_Higgs:
    mH:
      prior_type: none

  ScalarSingletDM_Z2:
    mS:
      prior_type: none
    lambda_hS:
      prior_type: none

  Halo_gNFW_rho0:
    rho0:
      prior_type: none
    v0:
      prior_type: none
    vesc:
      prior_type: none
    vrot:
      prior_type: none
    rs:
      prior_type: none
    r_sun:
      prior_type: none
    alpha:
      prior_type: none
    beta:
      prior_type: none
    gamma:
      prior_type: none


Priors:

  # All the priors are simple for this scan, so they are specified directly in the Parameters section.

Printer:

  printer: hdf5

  options:
    output_file: <output_file>.hdf5
    group: "ScalarSingletDM_Z2"
    delete_file_on_restart: True
    buffer_length: 1000


Scanner:

  use_scanner: postprocessor

  scanners:
    postprocessor:
      plugin: postprocessor
      like: LogLike
      reweighted_like: LogLike
      add_to_like: [LogLike]
      permit_discard_old_likes: true
      update_interval: 1000
      batch_size: 1000
      reader:
        type: hdf5
        file: <path/to/input_file>.hdf5
        group: "/ScalarSingletDM_Z2"

ObsLikes:

  - capability: lnL_Higgs_invWidth
    purpose: LogLike

  - capability: pbar_logLike_uncorr
    purpose: Observable

  - capability: pbar_logLike_corr
    purpose: LogLike

  - capability: LZ_2022_LogLikelihood
    purpose:    LogLike

  - capability: PandaX_4T_LogLikelihood
    purpose: LogLike

Rules:

  - capability: DD_couplings
    function: DD_couplings_ScalarSingletDM_Z2

  - capability: DDCalc_Couplings
    function: DDCalc_Couplings_WIMP_nucleon

  - capability: RD_oh2
    function: RD_from_postprocessor
    module: DarkBit

  - capability: RD_fraction
    function: RD_fraction_rescaled

  - capability: decay_rates
    function: all_decays

  - capability: TH_ProcessCatalog
    function: TH_ProcessCatalog_ScalarSingletDM_Z2

  - capability: lnL_Higgs_invWidth
    function: lnL_Higgs_invWidth_SMlike

  - capability: pbar_logLikes
    function: lnL_pbarAMS02

  - capability: pbar_logLike_uncorr
    function: lnL_pbarAMS02_uncorr

  - capability: pbar_logLike_corr
    function: lnL_pbarAMS02_corr
 
  - capability: pbarlike_1_0_init 
    options:
      PreventExtrapolation: False    # Choose whether or not to prevent neural network from extrapolating into 
      # untrained parameter regions
      PropagationModel: "DIFF.BRK"   # Choose one of two propagation models: "DIFF.BRK" or "INJ.BRK"
      PropagationParameters: [[0.0]] # Dummy propagation parameters to force pbarlike to perform marginalization
      # instead of profiling. 

Logger:

  redirection:
    [Default] : "default.log"
    [DarkBit] : "DarkBit.log"
    [DecayBit] : "DecayBit.log"
    [Dependency Resolver] : "dep_resolver.log"

KeyValues:

  dependency_resolution:
    prefer_model_specific_functions: true

  default_output_path: <path/to/output_directory>

  debug: false