Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recast cli examples added #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions recastcli_examples/madgraph_pythia-rivet-contur/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Madgraph_Pythia Rivet Contur Workflow
This is a directory made for testing the madgraph-pythia-rivet-contur workflow.

## Dependencies
A working installation of python3 and yadage, which can be installed using pip:

pip3 install yadage

## Included Workflows
1. [./workflows/workflow.yml](https://github.com/vladov3000/yadage-tests/blob/master/madgraph_pythia-rivet-contur/workflows/workflow.yml) contains a full analysis using madgraph for generation, pythia for showering, rivet for selection, and contur for statistics. The workflow takes the number of events to generate, a proc_card as input for madgraph, and a rivet analysis id and returns the ANALYSIS folder contur produces.

2. [./workflows/simple_contur.yml](https://github.com/vladov3000/yadage-tests/blob/master/madgraph_pythia-rivet-contur/workflows/simple_contur.yml) just contains the contur step. It takes a .hepmc file as input and returns the ANALYSIS folder contur produces.

## Setting Inputs
First, move all files used as inputs to [./inputs](https://github.com/vladov3000/yadage-tests/tree/master/madgraph_pythia-rivet-contur/inputs). This is a necessary step for yadage to run properly. Then, map the filenames to input names in [./inputs/inputs.yml](https://github.com/vladov3000/yadage-tests/blob/master/madgraph_pythia-rivet-contur/inputs/input.yml). You can also set other non-file parameters in inputs.yml.

## Running the Workflow
Enter ```./run.sh``` to run the default workflow [./workflows/workflow.yml](https://github.com/vladov3000/yadage-tests/blob/master/madgraph_pythia-rivet-contur/workflows/workflow.yml).

To run [./workflows/simple_contur.yml](https://github.com/vladov3000/yadage-tests/blob/master/madgraph_pythia-rivet-contur/workflows/simple_contur.yml):

./run.sh ./workflows/simple_contur.yml

In general, to run any workflow using the run script:

./run.sh /path/to/workflow.yml

## Using Outputs
After running yadage, a directory called workdir will be generated. In workdir, you will find the ouput from each step organized into seperate folders named after the step.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
proc_card: 'proc_card_dm.dat'
n_events: 1000
analysis: ATLAS_2016_I1458270
yoda: 'rivet_analysis.yoda'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import model DMsimp_s_spin1 --modelname
generate p p > xd xd~ j
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
BEGIN YODA_COUNTER_V2 /ATLAS_2016_I1458270/2jl
Path: /
ScaledBy: 3.27680000000005194e+01
Title:
Type: Counter
---
# sumW sumW2 numEntries
3.022021e+03 3.044204e+06 3.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /ATLAS_2016_I1458270/2jm
Path: /ATLAS_2016_I1458270/2jm
Title:
Type: Counter
---
# sumW sumW2 numEntries
1.844495e+02 5.670272e+03 6.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /ATLAS_2016_I1458270/2jt
Path: /ATLAS_2016_I1458270/2jt
Title:
Type: Counter
---
# sumW sumW2 numEntries
3.074159e+01 9.450454e+02 1.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /ATLAS_2016_I1458270/4jt
Path: /ATLAS_2016_I1458270/4jt
ScaledBy: 3.20000000000001705e+00
Title:
Type: Counter
---
# sumW sumW2 numEntries
0.000000e+00 0.000000e+00 0.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /ATLAS_2016_I1458270/5j
Path: /ATLAS_2016_I1458270/5j
ScaledBy: 3.20000000000001705e+00
Title:
Type: Counter
---
# sumW sumW2 numEntries
0.000000e+00 0.000000e+00 0.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /ATLAS_2016_I1458270/6jm
Path: /ATLAS_2016_I1458270/6jm
ScaledBy: 3.20000000000001705e+00
Title:
Type: Counter
---
# sumW sumW2 numEntries
0.000000e+00 0.000000e+00 0.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /ATLAS_2016_I1458270/6jt
Path: /ATLAS_2016_I1458270/6jt
ScaledBy: 3.20000000000001705e+00
Title:
Type: Counter
---
# sumW sumW2 numEntries
0.000000e+00 0.000000e+00 0.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /_EVTCOUNT
Path: /_EVTCOUNT
Title:
Type: Counter
---
# sumW sumW2 numEntries
3.074159e+04 9.450454e+05 1.000000e+03
END YODA_COUNTER_V2

BEGIN YODA_SCATTER1D_V2 /_XSEC
Variations: [""]
Path: /_XSEC
Title:
Type: Scatter1D
---
# xval xerr- xerr+
3.074159e+01 0.000000e+00 0.000000e+00
END YODA_SCATTER1D_V2

BEGIN YODA_COUNTER_V2 /RAW/ATLAS_2016_I1458270/2jl
Path: /RAW/ATLAS_2016_I1458270/2jl
ScaledBy: 3.27680000000005194e+01
Title:
Type: Counter
---
# sumW sumW2 numEntries
9.222477e+01 2.835136e+03 3.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /RAW/ATLAS_2016_I1458270/2jm
Path: /RAW/ATLAS_2016_I1458270/2jm
Title:
Type: Counter
---
# sumW sumW2 numEntries
1.844495e+02 5.670272e+03 6.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /RAW/ATLAS_2016_I1458270/2jt
Path: /RAW/ATLAS_2016_I1458270/2jt
Title:
Type: Counter
---
# sumW sumW2 numEntries
3.074159e+01 9.450454e+02 1.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /RAW/ATLAS_2016_I1458270/4jt
Path: /RAW/ATLAS_2016_I1458270/4jt
ScaledBy: 3.20000000000001705e+00
Title:
Type: Counter
---
# sumW sumW2 numEntries
0.000000e+00 0.000000e+00 0.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /RAW/ATLAS_2016_I1458270/5j
Path: /RAW/ATLAS_2016_I1458270/5j
ScaledBy: 3.20000000000001705e+00
Title:
Type: Counter
---
# sumW sumW2 numEntries
0.000000e+00 0.000000e+00 0.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /RAW/ATLAS_2016_I1458270/6jm
Path: /RAW/ATLAS_2016_I1458270/6jm
ScaledBy: 3.20000000000001705e+00
Title:
Type: Counter
---
# sumW sumW2 numEntries
0.000000e+00 0.000000e+00 0.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /RAW/ATLAS_2016_I1458270/6jt
Path: /RAW/ATLAS_2016_I1458270/6jt
ScaledBy: 3.20000000000001705e+00
Title:
Type: Counter
---
# sumW sumW2 numEntries
0.000000e+00 0.000000e+00 0.000000e+00
END YODA_COUNTER_V2

BEGIN YODA_COUNTER_V2 /RAW/_EVTCOUNT
Path: /RAW/_EVTCOUNT
Title:
Type: Counter
---
# sumW sumW2 numEntries
3.074159e+04 9.450454e+05 1.000000e+03
END YODA_COUNTER_V2

BEGIN YODA_SCATTER1D_V2 /RAW/_XSEC
Variations: [""]
Path: /RAW/_XSEC
Title:
Type: Scatter1D
---
# xval xerr- xerr+
3.074159e+01 0.000000e+00 0.000000e+00
END YODA_SCATTER1D_V2
3 changes: 3 additions & 0 deletions recastcli_examples/madgraph_pythia-rivet-contur/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rm -r workdir
WORKFLOW=${1:-workflows/workflow.yml}
yadage-run workdir $WORKFLOW inputs/input.yml -d initdir=$PWD/inputs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
stages:
- dependencies:
- init
name: contur
scheduler:
parameters:
inputyoda: {output: yoda, step: init}
output_analysis: "{workdir}/ANALYSIS"
output_plots: "{workdir}/plots"
scheduler_type: singlestep-stage
step:
environment:
environment_type: 'docker-encapsulated'
image: huangjoanna/contur
imagetag: 'latest'
process:
process_type: interpolated-script-cmd
script: |
source ./setupContur.sh
contur {inputyoda}
cp -r ./ANALYSIS {output_analysis}
cp -r ./plots {output_plots}
publisher:
publish:
analysis: output_analysis
plots: output_plots
publisher_type: 'interpolated-pub'
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
stages:
- dependencies: ["init"]
name: madgraph
scheduler:
parameters:
proc_card: {output: proc_card, step: init}
n_events: {output: n_events, step: init}
outputlhe: '{workdir}/events.lhe'
scheduler_type: singlestep-stage
step:
environment:
environment_type: docker-encapsulated
image: recast/madgraph
imagetag: '2.6.7_v2'
process:
process_type: string-interpolated-cmd
cmd: python steer_madgraph.py {proc_card} {outputlhe} -n {n_events}
publisher:
outputmap:
lhefile: outputlhe
publisher_type: frompar-pub
- dependencies: ["madgraph"]
name: pythia
scheduler:
parameters:
inputlhe:
output: lhefile
step: madgraph
n_events:
output: n_events
step: init
outputhepmc: '{workdir}/output.hepmc'
scheduler_type: singlestep-stage
step:
environment:
environment_type: docker-encapsulated
image: recast/madgraph-pythia
imagetag: '2.6.6'
process:
process_type: string-interpolated-cmd
cmd: 'python steer_pythia.py {inputlhe} {outputhepmc} {n_events}'
publisher:
outputmap:
hepmc: outputhepmc
publisher_type: frompar-pub
- dependencies:
- pythia
name: rivet
scheduler:
parameters:
analysis:
output: analysis
step: init
hepmc:
output: hepmc
step: pythia
outputyoda: "{workdir}/rivet_analysis.yoda"
scheduler_type: singlestep-stage
step:
environment:
environment_type: docker-encapsulated
image: recast/rivet
imagetag: 'latest'
process:
process_type: string-interpolated-cmd
cmd: 'rivet -a {analysis} -H {outputyoda} {hepmc}'
publisher:
publish:
yoda: outputyoda
publisher_type: interpolated-pub
- dependencies:
- init
name: contur
scheduler:
parameters:
inputyoda: {output: yoda, step: init}
output_analysis: "{workdir}/ANALYSIS"
output_plots: "{workdir}/plots"
scheduler_type: singlestep-stage
step:
environment:
environment_type: 'docker-encapsulated'
image: huangjoanna/contur
imagetag: 'latest'
process:
process_type: interpolated-script-cmd
script: |
source ./setupContur.sh
contur {inputyoda}
cp -r ./ANALYSIS {output_analysis}
cp -r ./plots {output_plots}
publisher:
publish:
analysis: output_analysis
plots: output_plots
publisher_type: 'interpolated-pub'



4 changes: 4 additions & 0 deletions recastcli_examples/madgraph_pythia-rivet/inputs/input.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
proc_card: 'proc_card_dm.dat'
n_events: 1000
analysis: ATLAS_2016_I1458270
hepmc: 'output.hepmc'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import model DMsimp_s_spin1 --modelname
generate p p > xd xd~ j
3 changes: 3 additions & 0 deletions recastcli_examples/madgraph_pythia-rivet/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rm -r workdir
WORKFLOW=${1:-workflows/workflow.yml}
yadage-run workdir $WORKFLOW inputs/input.yml -d initdir=$PWD/inputs
Loading