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[
"alignment"][
"name"] = alignment
41 local[
"validation"] = copy.deepcopy(config[
"validations"][
"MTS"][mtsType][singleName])
42 local[
"validation"].pop(
"alignments")
43 local[
"validation"][
"IOV"] = IOV
44 if "dataset" in local[
"validation"]:
45 local[
"validation"][
"dataset"] = local[
"validation"][
"dataset"].
format(IOV)
46 if "goodlumi" in local[
"validation"]:
47 local[
"validation"][
"goodlumi"] = local[
"validation"][
"goodlumi"].
format(IOV)
51 "name":
"MTS_{}_{}_{}_{}".
format(mtsType, alignment, singleName, IOV),
54 "cms-config":
"{}/src/Alignment/OfflineValidation/python/TkAlAllInOneTool/MTS_cfg.py".
format(os.environ[
"CMSSW_BASE"]),
63 if "merge" in config[
"validations"][
"MTS"]:
69 for mergeName
in config[
"validations"][
"MTS"][pvType]:
71 for iname,singleName
in enumerate(config[
"validations"][
"MTS"][pvType][mergeName][
'singles']):
72 for IOV
in IOVs[singleName]:
75 workDir =
"{}/MTS/{}/{}/{}".
format(validationDir, pvType, mergeName, IOV)
81 "name":
"MTS_{}_{}_{}".
format(pvType, mergeName, IOV),
90 for alignment
in config[
"alignments"]:
91 local.setdefault(
"alignments", {})
92 if alignment
in config[
"validations"][
"MTS"][
"single"][singleName][
"alignments"]:
93 local[
"alignments"][alignment] = copy.deepcopy(config[
"alignments"][alignment])
94 local[
"alignments"][alignment][
'index'] = config[
"validations"][
"MTS"][
"single"][singleName][
"alignments"].
index(alignment)
95 local[
"alignments"][alignment][
'isMC'] =
False 96 local[
"validation"] = copy.deepcopy(config[
"validations"][
"MTS"][pvType][mergeName])
97 local[
"validation"][
"IOV"] = IOV
98 if "customrighttitle" in local[
"validation"].
keys():
99 if "IOV" in local[
"validation"][
"customrighttitle"]:
100 local[
"validation"][
"customrighttitle"] = local[
"validation"][
"customrighttitle"].
replace(
"IOV",
str(IOV))
101 local[
"output"] =
"{}/{}/MTS/{}/{}/{}".
format(config[
"LFS"], config[
"name"], pvType, mergeName, IOV)
104 if "style" in config.keys():
105 if "MTS" in config[
'style'].
keys():
106 if pvType
in config[
'style'][
'MTS'].
keys():
107 local[
"style"] = copy.deepcopy(config[
"style"][
"MTS"][pvType])
108 if "Rlabel" in local[
"style"]
and "customrighttitle" in local[
"validation"].
keys():
109 print(
"WARNING: custom right label is overwritten by global settings")
112 for singleJob
in jobs:
114 _alignment, _singleName, _singleIOV = singleJob[
"name"].
split(
"_")[2:]
115 if _singleName
in config[
"validations"][
"MTS"][pvType][mergeName][
"singles"]:
116 if (
int(_singleIOV) == IOV):
117 local[
"alignments"][_alignment][
"file"] = singleJob[
"config"][
"output"]
118 job[
"dependencies"].
append(singleJob[
"name"])
120 mergeJobs.append(job)
122 jobs.extend(mergeJobs)
125 def replace(string, replacements)
def MTS(config, validationDir)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def split(sequence, size)