|
ATLAS Offline Software
|
Go to the documentation of this file.
4 from MCJobOptionUtils.JOsupport
import get_physics_short
10 for line
in iter(card):
11 if not line.strip().startswith(
'#'):
12 command = line.split(
'!', 1)[0]
14 setting = command.split(
'=')[-1].strip()
15 value =
'='.
join(command.split(
'=')[:-1]).strip()
18 setting=setting.lower()
24 if setting.replace(
"'",
'').
replace(
'"',
'').
replace(
'.',
'').lower()
in [
't',
'true']:
29 y=
str(x).lower().strip()
31 while len(y)>0
and (y[0]==
'"' or y[0]==
"'"):
33 while len(y)>0
and (y[-1]==
'"' or y[-1]==
"'"):
43 return key
in mydict
and mydict[key]==value
50 return key
in mydict
and mydict[key]
in [
't',
'true']
63 version_file =
open(os.environ[
'MADPATH']+
'/VERSION',
'r')
65 for line
in version_file:
67 version=line.split(
'=')[1].strip()
71 raise RuntimeError(
'Failed to find MadGraph/MadGraph5_aMC@NLO version in '+version_file)
73 vs=[
int(v)
for v
in version.split(
'.')]
76 y=
int(100**
max(len(vs),len(args)))
82 y=
int(100**
max(len(vs),len(args)))
87 return versionnumber>=testnumber
90 f =
open(run_card,
'r')
91 if "parton_shower" in f.read().lower():
100 raise RuntimeError(
'runArgs must be provided!')
101 if hasattr(runArgs,
'ecmEnergy'):
102 beamEnergy = runArgs.ecmEnergy / 2.
104 raise RuntimeError(
"No center of mass energy found in runArgs.")
105 if hasattr(runArgs,
'randomSeed'):
106 random_seed = runArgs.randomSeed
108 raise RuntimeError(
"No random seed found in runArgs.")
109 return beamEnergy,random_seed
std::string replace(std::string s, const std::string &s2, const std::string &s3)
def isNLO_from_run_card(run_card)
def settingIsTrue(setting)
def checkSettingIsTrue(key_, mydict_)
def get_runArgs_info(runArgs)
def checkSetting(key_, value_, mydict_)
std::string join(const std::vector< std::string > &v, const char c=',')
def checkSettingExists(key_, mydict_)
def getDictFromCard(card_loc, lowercase=False)
def is_version_or_newer(args)