Skip to content

Commit

Permalink
docs: update options in config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyi15 committed Jun 9, 2024
1 parent e0e2653 commit 3c42d56
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 18 deletions.
56 changes: 39 additions & 17 deletions config.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ data:
## the `finals` in `particle` will be used by default.
## it is necessary when dat files has momentum out of final particles
dat_order: [B, C, D]
## The file path is grouped by `name[_tail]`
## Each tail correspanding to the valriable in a dataset
## basic data files, every line is `E px py pz` as 4-momentum of a particle,
## and every m lines group as m final particls
## support input multi data as [["data.dat"], ["data2.dat"]] to do simultaneous fit using the same model
data: ["data/data4600_new.dat"]
## The additional file is grouped by `name[_tail]`
## Each tail is corresponding to the valriables in a dataset `name`
## data weight file, each line for a weight
# data_weight: ["data/data_weight.dat"]
## phase space data for normalize amplitude
Expand All @@ -28,19 +33,34 @@ data:
bg: ["data/bg4600_new.dat"]
## background weight
bg_weight: 0.731
## inject MC in data
# inmc: ["data/inMC.dat"]
# inject_ratio: 0.01
# float_inmc_ratio_in_pdf: False
## using total monumtum direction as initial axis (or labrary axis)
## set to False if the initial particle is e+e- direcly
# random_z: True
## whether boost data to center mass frame first
# center_mass: True
# cached data file
## cached data file
# cached_data: "data/all_data.npy"
# data_charge: ["data/data4600_cc.dat"] # charge conjugation condition same as weight
## charge conjugation condition same as weight
# data_charge: ["data/data4600_cc.dat"]
# cp_trans: True # when used charge conjugation as above, this do p -> -p for charge conjugation process.

## Currently, addtion configuration for fit can also be put in here, some option might be changed frequrently.
## likehood formula, cfit, some model require other options (bg_frac)
# model: default
# bg_frac: 0.3
## use tf function to complite the amplitude model
# use_tf_function: Ture
## Pre-Proceesor and amplutude model for different way of amplitude calculation. ["default", "cached_amp","cached_shape", "p4_directly"]
# preprocessor: cached_shape
# amp_model: cached_shape
## use TensorFlow Dataset instead of loading all data to GPU directly.
# lazy_call: True
## caching preprocessor results in file_name
# cached_lazy_call: file_name
## use memmap instead of loading data to memory
# lazy_file: True
## using multi gpu (experimental), only support with `model: simple`
# multi_gpu: True


## `decay` describe the decay structure, each node can be a list of particle name
decay:
## each entry is a list of direct decay particle, or a list or the list.
Expand Down Expand Up @@ -112,25 +132,27 @@ particle:

## The following config is used for DecayChain
# decay_chain:
# $all:
# is_cp: True
# $all:
# is_cp: True

## constrains for params [WIP]
constrains:
# particle:
# equal:
# mass: [[D1_2430p, D1_2430]]
# equal:
# mass: [[D1_2430p, D1_2430]]
## fix the first decay chain total to 1.0
decay:
fix_chain_idx: 0
fix_chain_val: 1
# decay_d: 3.0
# decay_d: 3.0 # support number or list of number
# fix_var:
# "A->Zc_4025.DZc_4025->B.C_total_0r": 1.0
# "A->Zc_4025.DZc_4025->B.C_total_0r": 1.0
# free_var:
# - "A->Zc_4025.DZc_4025->B.C_total_0r"
# var_range:
# "A->Zc_4025.DZc_4025->B.C_total_0r": [1.0, null]
# "A->Zc_4025.DZc_4025->B.C_total_0r": [1.0, null]
# var_equal:
# - ["A->D2_2460p.CD2_2460p->B.D_total_0r", "A->D2_2460.BD2_2460->C.D_total_0r"]
# - ["A->D2_2460p.CD2_2460p->B.D_total_0r", "A->D2_2460.BD2_2460->C.D_total_0r"]

## plot describe the configuration of plotting 1-d data distribution
plot:
Expand Down Expand Up @@ -199,4 +221,4 @@ plot:
x: m_R_CD**2
y: m_R_BC**2
display: "$M_{CD}^2$ vs $M_{BC}^2$"
plot_figs: ["data", "sideband", "fitted"]
plot_figs: ["data", "sideband", "fitted", "pull"]
8 changes: 7 additions & 1 deletion fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,13 @@ def main():
parser.add_argument(
"--CPU-plot", action="store_true", default=False, dest="cpu_plot"
)
parser.add_argument("-c", "--config", default="config.yml", dest="config")
parser.add_argument(
"-c",
"--config",
default="config.yml",
dest="config",
help="config.yml files, support input multiply file as `config1.yml,config2.yml` to do simultaneous fit using different model",
)
parser.add_argument(
"-i", "--init_params", default="init_params.json", dest="init"
)
Expand Down

0 comments on commit 3c42d56

Please sign in to comment.