Commit d19fe91d authored by Peter Fackeldey's avatar Peter Fackeldey
Browse files

[docs] add real examples to datacard_manipulation scripts using termynal.js

parent dae9aefb
......@@ -57,6 +57,16 @@ optional arguments:
remove_parameters
```
Example:
<div class="termy">
```console
$ remove_parameters.py datacard.txt lumi_13TeV_XY
<span style="color: green;">INFO</span>: remove_parameters - remove parameter lumi_13TeV_XY
```
</div>
### Rename
......@@ -101,6 +111,18 @@ optional arguments:
rename_parameters
```
Example:
<div class="termy">
```console
$ rename_parameters.py datacard.txt BR_H_WW_ggHH=BR_H_WW
<span style="color: green;">INFO</span>: rename_parameters - rename parameter BR_H_WW_ggHH to BR_H_WW
<span style="color: green;">INFO</span>: rename_parameters - rename parameter BR_H_WW_ggHH to BR_H_WW
<span style="color: green;">INFO</span>: rename_parameters - rename parameter BR_H_WW_ggHH to BR_H_WW
```
</div>
### Add
......@@ -158,6 +180,16 @@ optional arguments:
add_parameter
```
Example:
<div class="termy">
```console
$ add_parameter.py datacard.txt lumi_13TeV_XY lnN '*,*,1.02'
<span style="color: green;">INFO</span>: add_parameter - adding new parameter line 'lumi_13TeV_XY lnN 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02 1.02'
```
</div>
### Merge
......@@ -239,6 +271,23 @@ optional arguments:
merge_parameters
```
Example:
<div class="termy">
```console
$ merge_parameters.py datacard.txt lumi_13TeV "lumi_13TeV*"
<span style="color: green;">INFO</span>: merge_parameters - determined type of new parameter lumi_13TeV to be lnN
<span style="color: green;">INFO</span>: merge_parameters - found parameter lumi_13TeV_2018 to be merged
<span style="color: green;">INFO</span>: merge_parameters - found parameter lumi_13TeV_LS to be merged
<span style="color: green;">INFO</span>: merge_parameters - found parameter lumi_13TeV_BBD to be merged
<span style="color: green;">INFO</span>: merge_parameters - found parameter lumi_13TeV_DB to be merged
<span style="color: green;">INFO</span>: merge_parameters - found parameter lumi_13TeV_BCC to be merged
<span style="color: green;">INFO</span>: merge_parameters - found parameter lumi_13TeV_GS to be merged
<span style="color: green;">INFO</span>: merge_parameters - found parameter lumi_13TeV_XY to be merged
```
</div>
### Split
......@@ -294,6 +343,16 @@ optional arguments:
split_parameter
```
Example:
<div class="termy">
```console
$ split_parameter.py datacard.txt pdf_VH "pdf_WH,*,WH" "pdf_ZH,*,ZH"
<span style="color: green;">INFO</span>: split_parameter - found parameter pdf_VH to split with type lnN
```
</div>
### Flip
......@@ -348,6 +407,16 @@ optional arguments:
flip_parameters
```
Example:
<div class="termy">
```console
$ flip_parameters.py datacard.txt "alpha_s_ttH"
<span style="color: green;">INFO</span>: flip_parameters - adding new parameter line 'alpha_s_ttH lnN - - - - - - - - - - - - - - - 1.03/0.97 - - - - - -'
```
</div>
## Adjusting pairs of datacard bins and processes
......@@ -403,6 +472,17 @@ optional arguments:
remove_bin_process_pairs
```
Example:
<div class="termy">
```console
$ remove_bin_process_pairs.py datacard.txt "*,ttH"
<span style="color: green;">INFO</span>: remove_bin_process_pairs - removed 1 entries from process rates
<span style="color: green;">INFO</span>: remove_bin_process_pairs - removed all occurrences of processes(s) ttH
<span style="color: green;">INFO</span>: remove_bin_process_pairs - set jmax from 21 to 20
```
</div>
## Adjusting processes
......@@ -451,6 +531,18 @@ optional arguments:
remove_processes
```
Example:
<div class="termy">
```console
$ remove_processes.py datacard.txt "qqHH_CV_1_C2V_*_kl_*"
<span style="color: green;">INFO</span>: remove_processes - removed 5 entries from process rates
<span style="color: green;">INFO</span>: remove_processes - removed all occurrences of processes(s) qqHH_CV_1_C2V_2_kl_1_2B2VTo2L2Nu, qqHH_CV_1_C2V_1_kl_0_2B2VTo2L2Nu, qqHH_CV_1_C2V_1_kl_2_2B2VTo2L2Nu, qqHH_CV_1_C2V_0_kl_1_2B2VTo2L2Nu, qqHH_CV_1_C2V_1_kl_1_2B2VTo2L2Nu
<span style="color: green;">INFO</span>: remove_processes - set jmax from 20 to 15
```
</div>
### Remove depending on rate
......@@ -510,6 +602,15 @@ optional arguments:
remove_empty_processes
```
Example:
<div class="termy">
```console
$ remove_empty_processes.py datacard.txt '*,ttH,0.1'
<span style="color: green;">INFO</span>: remove_empty_processes - found 0 bin-process pair(s) to remove
```
</div>
### Rename
......@@ -554,6 +655,16 @@ optional arguments:
rename_processes
```
Example:
<div class="termy">
```console
$ rename_processes.py datacard.txt DY=DrellYan --no-shapes
<span style="color: green;">INFO</span>: rename_processes - rename process DY to DrellYan
```
</div>
## Adjusting datacard bins
......@@ -602,6 +713,19 @@ optional arguments:
remove_bins
```
Example:
<div class="termy">
```console
$ remove_bins.py datacard.txt ch1
<span style="color: green;">INFO</span>: remove_bins - removed 22 entries from process rates
<span style="color: green;">INFO</span>: remove_bins - removed all occurrences of bin(s) ch1
<span style="color: green;">INFO</span>: remove_bins - set imax from 6 to 5
<span style="color: green;">INFO</span>: remove_bins - remove bin ch1 from observations
<span style="color: green;">INFO</span>: remove_bins - remove autoMCStats for bin ch1
```
</div>
## Adjusting shape bins
......@@ -682,6 +806,21 @@ optional arguments:
remove_shape_bins
```
Example:
<div class="termy">
```console
$ remove_shape_bins.py datacard.txt '*,S<0.00001'
<span style="color: green;">INFO</span>: remove_shape_bins - going to process 1 matched datacard bin(s)
<span style="color: green;">INFO</span>: remove_shape_bins - loaded shapes of 23 process(es) in datacard bin ee_HH_ggF
<span style="color: green;">INFO</span>: remove_shape_bins - dropping 1 shape bin(s) in datacard bin ee_HH_ggF
<span style="color: green;">INFO</span>: remove_shape_bins - shape bin indices to remove in bin ee_HH_ggF: 1
<span style="color: green;">INFO</span>: remove_shape_bins - added new observation line with updated integrals in 1 bin(s)
<span style="color: green;">INFO</span>: remove_shape_bins - added new rates line with updated integrals in 1 bin(s)
```
</div>
## Miscellaneous
......@@ -723,6 +862,16 @@ optional arguments:
extract_datacard_content
```
Example:
<div class="termy">
```console
$ extract_datacard_content.py datacard.txt -o data.json
<span style="color: green;">INFO</span>: extract_datacard_content - saved structured datacard content in data.json
```
</div>
### Split a datacard by bins
......@@ -767,6 +916,27 @@ optional arguments:
split_datacard_by_bins
```
Example:
<div class="termy">
```console
$ split_datacard_by_bins.py datacard.txt
<span style="color: green;">INFO</span>: split_datacard_by_bins - removing all bins but ch1 in datacard /afs/cern.ch/user/m/mfackeld/repos/inference/datacard_ch1.txt
<span style="color: green;">INFO</span>: split_datacard_by_bins (bin ch1) - removed 22 entries from process rates
<span style="color: green;">INFO</span>: split_datacard_by_bins (bin ch1) - removed all occurrences of bin(s) ch2
<span style="color: green;">INFO</span>: split_datacard_by_bins (bin ch1) - set imax from 2 to 1
<span style="color: green;">INFO</span>: split_datacard_by_bins (bin ch1) - remove bin ch2 from observations
<span style="color: green;">INFO</span>: split_datacard_by_bins (bin ch1) - remove autoMCStats for bin ch2
<span style="color: green;">INFO</span>: split_datacard_by_bins - removing all bins but ch2 in datacard /afs/cern.ch/user/m/mfackeld/repos/inference/datacard_ch2.txt
<span style="color: green;">INFO</span>: split_datacard_by_bins (bin ch2) - removed 22 entries from process rates
<span style="color: green;">INFO</span>: split_datacard_by_bins (bin ch2) - removed all occurrences of bin(s) ch1
<span style="color: green;">INFO</span>: split_datacard_by_bins (bin ch2) - set imax from 2 to 1
<span style="color: green;">INFO</span>: split_datacard_by_bins (bin ch2) - remove bin ch1 from observations
<span style="color: green;">INFO</span>: split_datacard_by_bins (bin ch2) - remove autoMCStats for bin ch1
```
</div>
### Bundle a datacard
......@@ -805,6 +975,21 @@ optional arguments:
bundle_datacard
```
Example:
<div class="termy">
```console
$ bundle_datacard.py "datacard_ch*.txt" out
<span style="color: green;">INFO</span>: bundle_datacard - bundled datacard datacard_ch1.txt to /afs/cern.ch/user/m/mfackeld/repos/inference/out/datacard_ch1.txt
<span style="color: green;">INFO</span>: bundle_datacard - bundled datacard datacard_ch2.txt to /afs/cern.ch/user/m/mfackeld/repos/inference/out/datacard_ch2.txt
<span style="color: green;">INFO</span>: bundle_datacard - bundled datacard datacard_ch3.txt to /afs/cern.ch/user/m/mfackeld/repos/inference/out/datacard_ch3.txt
<span style="color: green;">INFO</span>: bundle_datacard - bundled datacard datacard_ch4.txt to /afs/cern.ch/user/m/mfackeld/repos/inference/out/datacard_ch4.txt
<span style="color: green;">INFO</span>: bundle_datacard - bundled datacard datacard_ch5.txt to /afs/cern.ch/user/m/mfackeld/repos/inference/out/datacard_ch5.txt
<span style="color: green;">INFO</span>: bundle_datacard - bundled datacard datacard_ch6.txt to /afs/cern.ch/user/m/mfackeld/repos/inference/out/datacard_ch6.txt
```
</div>
### Prettify a datacard
......@@ -842,3 +1027,13 @@ optional arguments:
--log-name LOG_NAME name of the logger on the command line; default:
prettify_datacard
```
Example:
<div class="termy">
```console
$ prettify_datacard.py datacard.txt
<span style="color: green;">INFO</span>: prettify_datacard - write prettified datacard /afs/cern.ch/user/m/mfackeld/repos/inference/datacard.txt
```
</div>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment