Definition at line 24 of file AfterBurner_tf.py.
◆ __init__()
def AfterBurner_tf.EvgenExecutor.__init__ |
( |
|
self, |
|
|
|
skeleton |
|
) |
| |
Definition at line 27 of file AfterBurner_tf.py.
28 athenaExecutor.__init__(self, name=
"generate", skeletonFile=skeleton, substep=
"gen2evnt", tryDropAndReload=
False, inData=[
"EVNT_Pre"], outData=[
"EVNT"])
◆ preExecute()
def AfterBurner_tf.EvgenExecutor.preExecute |
( |
|
self, |
|
|
|
input = set() , |
|
|
|
output = set() |
|
) |
| |
Definition at line 30 of file AfterBurner_tf.py.
30 def preExecute(self, input=set(), output=
set()):
31 "Get input tarball, unpack and set up env if an evgenJobOpts arg was provided."
34 super(EvgenExecutor, self).preExecute(input, output)
36 def expand_if_archive(filename):
37 "Function to expand a file if it is a zip archive or tarball"
38 if ".tar" in filename:
40 tf = tarfile.open(filename)
43 elif filename.endswith(
".zip"):
45 zf = zipfile.ZipFile(filename)
50 return [name
for name
in os.listdir(a_dir)
51 if os.path.isdir(os.path.join(a_dir, name))]
53 def mk_jo_proxy(targetbasepath, pkgname, proxypath, addtosearch=True):
54 "Make a JO proxy dir such that the MCxxJobOptions/dddd dirs contents are found via include(MCxxJobOptions/yyyy)"
56 if os.path.exists(proxypath):
57 shutil.rmtree(proxypath)
59 os.environ[
'LOCAL_INSTALL_DIR'] = (os.environ[
'JOBOPTSEARCHPATH']).
split(
":")[0]
60 comdir = os.path.join(targetbasepath,
"common")
62 subdirlist1 = [
'common/%s' % item
for item
in subdirlist]
63 dirlist = [
'common',
'share',
'gencontrol',
'susycontrol']
64 for d
in (dirlist+subdirlist1):
66 if (d !=
'common/.svn'):
67 dpath = os.path.join(proxypath, d)
71 os.symlink(os.path.join(targetbasepath, d), os.path.join(dpath, pkgname))
73 os.environ[
"JOBOPTSEARCHPATH"] = dpath+
":"+os.environ[
"JOBOPTSEARCHPATH"]
74 os.environ[
"DATAPATH"] =os.path.join(targetbasepath, d)+
":"+os.environ[
"DATAPATH"]
76 os.environ[
"JOBOPTSEARCHPATH"] = os.environ[
'LOCAL_INSTALL_DIR']+
":"+os.environ[
"JOBOPTSEARCHPATH"]
80 if "evgenJobOpts" in self._trf.argdict:
81 tarball = self._trf.argdict[
"evgenJobOpts"].value
84 if tarball.startswith(
"http"):
86 tarball = os.basename(tarball)
88 url =
"http://cern.ch/atlas-computing/links/kitsDirectory/EvgenJobOpts/" + tarball
90 if not os.path.exists(tarball):
91 from EvgenJobTransforms.download
import downloadUsingProxy
94 raise EnvironmentError(
'Error downloading tarball %s. Downloader reports: %s' % (tarball, output))
95 msg.info(
'Evgen tarball download success: %s' % output)
97 expand_if_archive(tarball)
98 mk_jo_proxy(os.getcwd(),
"MC14JobOptions",
"_joproxy14")
99 mk_jo_proxy(os.getcwd(),
"MC15JobOptions",
"_joproxy15")
108 if os.path.exists(
"/cvmfs/atlas.cern.ch"):
110 mk_jo_proxy(
"/cvmfs/atlas.cern.ch/repo/sw/Generators/MC14JobOptions/latest/",
"MC14JobOptions",
"_joproxy14")
111 mk_jo_proxy(
"/cvmfs/atlas.cern.ch/repo/sw/Generators/MC15JobOptions/latest/",
"MC15JobOptions",
"_joproxy15")
112 msg.info(
"No evgenJobOpts tarball specified, using JOBOPTSEARCHPATH = '%s'" % os.environ[
"JOBOPTSEARCHPATH"])
113 elif os.path.exists(
"/afs/cern.ch/atlas/groups/Generators"):
114 mk_jo_proxy(
"/afs/cern.ch/atlas/groups/Generators/MC14JobOptions/latest/",
"MC14JobOptions",
"_joproxy14")
115 mk_jo_proxy(
"/afs/cern.ch/atlas/groups/Generators/MC15JobOptions/latest/",
"MC15JobOptions",
"_joproxy15")
116 msg.info(
"No evgenJobOpts tarball specified, no cvmfs, using JOBOPTSEARCHPATH = '%s'" % os.environ[
"JOBOPTSEARCHPATH"])
119 if "inputGeneratorFile" in self._trf.argdict:
120 expand_if_archive(self._trf.argdict[
"inputGeneratorFile"].value)
121 if "inputGenConfFile" in self._trf.argdict:
122 expand_if_archive(self._trf.argdict[
"inputGenConfFile"].value)
The documentation for this class was generated from the following file:
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.