|
ATLAS Offline Software
|
Go to the documentation of this file.
6 for line
in iter(card):
7 if not line.strip().startswith(
'#'):
8 command = line.split(
'!', 1)[0]
10 setting = command.split(
'=')[-1].strip()
11 value =
'='.
join(command.split(
'=')[:-1]).strip()
14 setting=setting.lower()
20 if setting.replace(
"'",
'').
replace(
'"',
'').
replace(
'.',
'').lower()
in [
't',
'true']:
25 y=
str(x).lower().strip()
27 while len(y)>0
and (y[0]==
'"' or y[0]==
"'"):
29 while len(y)>0
and (y[-1]==
'"' or y[-1]==
"'"):
39 return key
in mydict
and mydict[key]==value
46 return key
in mydict
and mydict[key]
in [
't',
'true']
59 version_file =
open(os.environ[
'MADPATH']+
'/VERSION',
'r')
61 for line
in version_file:
63 version=line.split(
'=')[1].strip()
67 raise RuntimeError(
'Failed to find MadGraph/MadGraph5_aMC@NLO version in '+version_file)
69 vs=[
int(v)
for v
in version.split(
'.')]
72 y=
int(100**
max(len(vs),len(args)))
78 y=
int(100**
max(len(vs),len(args)))
83 return versionnumber>=testnumber
86 f =
open(run_card,
'r')
87 if "parton_shower" in f.read().lower():
96 raise RuntimeError(
'runArgs must be provided!')
97 if hasattr(runArgs,
'ecmEnergy'):
98 beamEnergy = runArgs.ecmEnergy / 2.
100 raise RuntimeError(
"No center of mass energy found in runArgs.")
101 if hasattr(runArgs,
'randomSeed'):
102 random_seed = runArgs.randomSeed
104 raise RuntimeError(
"No random seed found in runArgs.")
105 return beamEnergy,random_seed
109 FIRST_DIR = (os.environ[
'JOBOPTSEARCHPATH']).
split(
":")[0]
110 jofiles = [f
for f
in os.listdir(FIRST_DIR)
if (f.startswith(
'mc')
and f.endswith(
'.py'))]
112 raise RuntimeError(
'No job options found in '+FIRST_DIR)
113 joparts = os.path.basename(jofiles[0]).
split(
'.')
115 raise RuntimeError(
'Malformed job options file name: '+jofiles[0])
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)