4 def MTS(config, validationDir):
16 if not mtsType
in config[
"validations"][
"MTS"]:
17 raise Exception(
"No 'single' key word in config for MTS")
19 for singleName
in config[
"validations"][
"MTS"][mtsType]:
20 aux_IOV = config[
"validations"][
"MTS"][mtsType][singleName][
"IOV"]
21 if not isinstance(aux_IOV, list)
and aux_IOV.endswith(
".txt"):
22 config[
"validations"][
"MTS"][mtsType][singleName][
"IOV"] = []
23 with open(aux_IOV,
'r') as IOVfile: for line
in IOVfile.readlines():
24 if len(line) != 0: config[
"validations"][
"MTS"][mtsType][singleName][
"IOV"].
append(
int(line))
25 for IOV
in config[
"validations"][
"MTS"][mtsType][singleName][
"IOV"]:
27 if singleName
not in IOVs.keys():
29 if IOV
not in IOVs[singleName]:
30 IOVs[singleName].
append(IOV)
32 for alignment
in config[
"validations"][
"MTS"][mtsType][singleName][
"alignments"]:
34 workDir =
"{}/MTS/{}/{}/{}/{}".
format(validationDir, mtsType, singleName, alignment, IOV)
38 local[
"output"] =
"{}/{}/MTS/{}/{}/{}/{}".
format(config[
"LFS"], config[
"name"], mtsType, alignment, singleName, IOV)
39 local[
"alignment"] = copy.deepcopy(config[
"alignments"][alignment])
40 local[
"validation"] = copy.deepcopy(config[
"validations"][
"MTS"][mtsType][singleName])
41 local[
"validation"].pop(
"alignments")
42 local[
"validation"][
"IOV"] = IOV
43 if "dataset" in local[
"validation"]:
44 local[
"validation"][
"dataset"] = local[
"validation"][
"dataset"].
format(IOV)
45 if "goodlumi" in local[
"validation"]:
46 local[
"validation"][
"goodlumi"] = local[
"validation"][
"goodlumi"].
format(IOV)
50 "name":
"MTS_{}_{}_{}_{}".
format(mtsType, alignment, singleName, IOV),
53 "cms-config":
"{}/src/Alignment/OfflineValidation/python/TkAlAllInOneTool/MTS_cfg.py".
format(os.environ[
"CMSSW_BASE"]),
62 if "merge" in config[
"validations"][
"MTS"]:
68 for mergeName
in config[
"validations"][
"MTS"][pvType]:
70 for iname,singleName
in enumerate(config[
"validations"][
"MTS"][pvType][mergeName][
'singles']):
71 for IOV
in IOVs[singleName]:
74 workDir =
"{}/MTS/{}/{}/{}".
format(validationDir, pvType, mergeName, IOV)
80 "name":
"MTS_{}_{}_{}".
format(pvType, mergeName, IOV),
89 for alignment
in config[
"alignments"]:
90 local.setdefault(
"alignments", {})
91 if alignment
in config[
"validations"][
"MTS"][
"single"][singleName][
"alignments"]:
92 local[
"alignments"][alignment] = copy.deepcopy(config[
"alignments"][alignment])
93 local[
"alignments"][alignment][
'index'] = config[
"validations"][
"MTS"][
"single"][singleName][
"alignments"].
index(alignment)
94 local[
"alignments"][alignment][
'isMC'] =
False 95 local[
"validation"] = copy.deepcopy(config[
"validations"][
"MTS"][pvType][mergeName])
96 local[
"validation"][
"IOV"] = IOV
97 if "customrighttitle" in local[
"validation"].
keys():
98 if "IOV" in local[
"validation"][
"customrighttitle"]:
99 local[
"validation"][
"customrighttitle"] = local[
"validation"][
"customrighttitle"].
replace(
"IOV",
str(IOV))
100 local[
"output"] =
"{}/{}/MTS/{}/{}/{}".
format(config[
"LFS"], config[
"name"], pvType, mergeName, IOV)
103 if "style" in config.keys():
104 if "MTS" in config[
'style'].
keys():
105 if pvType
in config[
'style'][
'MTS'].
keys():
106 local[
"style"] = copy.deepcopy(config[
"style"][
"MTS"][pvType])
107 if "Rlabel" in local[
"style"]
and "customrighttitle" in local[
"validation"].
keys():
108 print(
"WARNING: custom right label is overwritten by global settings")
111 for singleJob
in jobs:
113 _alignment, _singleName, _singleIOV = singleJob[
"name"].
split(
"_")[2:]
114 if _singleName
in config[
"validations"][
"MTS"][pvType][mergeName][
"singles"]:
115 if (
int(_singleIOV) == IOV):
116 local[
"alignments"][_alignment][
"file"] = singleJob[
"config"][
"output"]
117 job[
"dependencies"].
append(singleJob[
"name"])
119 mergeJobs.append(job)
121 jobs.extend(mergeJobs)
124 def replace(string, replacements)
def MTS(config, validationDir)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def split(sequence, size)