Skip to content

Commit

Permalink
sherpa: add option for hepmc2
Browse files Browse the repository at this point in the history
Also test that hepmc2 and hepmc3 output works

Closes #337.

Signed-off-by: David C Hall <[email protected]>
  • Loading branch information
davidchall committed Oct 12, 2023
1 parent 613769b commit b841e89
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Formula/sherpa.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Sherpa < Formula
depends_on "hepmc3" => :recommended
depends_on "lhapdf" => :recommended
depends_on "rivet" => :recommended
depends_on "hepmc2" => :optional
depends_on "root" => :optional

def install
Expand All @@ -36,6 +37,7 @@ def install
]

args << "--enable-fastjet=#{Formula["fastjet"].opt_prefix}" if build.with? "fastjet"
args << "--enable-hepmc2=#{Formula["hepmc2"].opt_prefix}" if build.with? "hepmc2"
args << "--enable-hepmc3=#{Formula["hepmc3"].opt_prefix}" if build.with? "hepmc3"
args << "--enable-lhapdf=#{Formula["lhapdf"].opt_prefix}" if build.with? "lhapdf"
args << "--enable-rivet=#{Formula["rivet"].opt_prefix}" if build.with? "rivet"
Expand Down Expand Up @@ -72,6 +74,14 @@ def install
}(mi)
EOS

system bin/"Sherpa", "-p", testpath, "-L", testpath, "-e", "100"
system bin/"Sherpa", "-e", "100"
if build.with? "hepmc2"
system bin/"Sherpa", "-e", "100", "EVENT_OUTPUT=HepMC_GenEvent[events]"
assert_predicate testpath/"events.hepmc2g", :exist?
end
if build.with? "hepmc3"
system bin/"Sherpa", "-e", "100", "EVENT_OUTPUT=HepMC3_GenEvent[events]"
assert_predicate testpath/"events", :exist?
end
end
end

0 comments on commit b841e89

Please sign in to comment.