3 import globalDictionaries
4 from genericValidation
import GenericValidationData_CTSR, ParallelValidation, ValidationWithComparison, ValidationForPresentation, ValidationWithPlots, ValidationWithPlotsSummary
5 from helperFunctions
import replaceByMap, addIndex, pythonboolstring
6 from presentation
import SubsectionFromList, SubsectionOnePage
7 from TkAlExceptions
import AllInOneError
10 configBaseName =
"TkAlOfflineValidation" 11 scriptBaseName =
"TkAlOfflineValidation" 12 crabCfgBaseName =
"TkAlOfflineValidation" 13 resultBaseName =
"AlignmentValidation" 14 outputBaseName =
"AlignmentValidation" 16 "offlineModuleLevelHistsTransient":
"False",
17 "offlineModuleLevelProfiles":
"True",
18 "stripYResiduals":
"False",
20 deprecateddefaults = {
24 "OfflineTreeBaseDir":
"",
27 defaults.update(deprecateddefaults)
28 mandatories = {
"trackcollection"}
31 def __init__(self, valName, alignment, config):
32 super(OfflineValidation, self).
__init__(valName, alignment, config)
34 for name
in "offlineModuleLevelHistsTransient",
"offlineModuleLevelProfiles",
"stripYResiduals":
39 raise AllInOneError(
"The '%s' option has been moved to the [plots:offline] section. Please specify it there."%option)
42 if self.
NJobs > 1
and self.
general[
"offlineModuleLevelHistsTransient"] ==
"True":
43 msg = (
"To be able to merge results when running parallel jobs," 44 " set offlineModuleLevelHistsTransient to false.")
49 return "OfflineValidator" 53 return configTemplates.offlineTemplate
57 return configTemplates.OfflineValidationSequence
61 return configTemplates.offlineFileOutputTemplate
70 repMap = super(OfflineValidation, self).
getRepMap()
72 "nEvents": self.
general[
"maxevents"],
73 "offlineValidationMode":
"Standalone",
74 "TrackCollection": self.
general[
"trackcollection"],
75 "filetoplot":
"root://eoscms//eos/cms.oO[finalResultFile]Oo.",
81 return ' p.loadFileList(".oO[filetoplot]Oo.", ".oO[title]Oo.", .oO[color]Oo., .oO[style]Oo.);\n' 85 from plottingOptions
import PlottingOptions
87 with open(outFilePath,
"w")
as theFile:
88 theFile.write(
replaceByMap(configTemplates.mergeOfflineParJobsTemplate, {}))
89 result = super(OfflineValidation, cls).
initMerge()
90 result += (
"cp .oO[Alignment/OfflineValidation]Oo./scripts/merge_TrackerOfflineValidation.C .\n" 91 "rfcp .oO[mergeOfflineParJobsScriptPath]Oo. .\n")
97 parameters =
"root://eoscms//eos/cms" +
",root://eoscms//eos/cms".
join(repMap[
"resultFiles"])
99 mergedoutputfile =
"root://eoscms//eos/cms%(finalResultFile)s"%repMap
100 return (
'root -x -b -q -l "TkAlOfflineJobsMerge.C(\\\"' 101 +parameters+
'\\\",\\\"'+mergedoutputfile+
'\\\")"')
105 return "TkAlExtendedOfflineValidation.C" 109 return configTemplates.extendedValidationTemplate
113 return "ExtendedOfflineValidation_Images" 117 return "compareAlignments.cc" 142 configBaseName =
"TkAlOfflineValidationDQM" 144 super(OfflineValidationDQM, self).
__init__(valName, alignment, config)
145 if not config.has_section(
"DQM"):
146 msg =
"You need to have a DQM section in your configfile!" 154 repMap = super(OfflineValidationDQM, self).
getRepMap(alignment)
156 "workdir": os.path.expandvars(repMap[
"workdir"]),
157 "offlineValidationMode":
"Dqm",
158 "workflow": (
"/%s/TkAl%s-.oO[alignmentName]Oo._R%09i_R%09i_" 159 "ValSkim-v1/ALCARECO" 161 datetime.datetime.now().strftime(
"%y"),
165 if "__" in repMap[
"workflow"]:
166 msg = (
"the DQM workflow specefication must not contain '__'. " 167 "it is: %s"%repMap[
"workflow"])
173 return configTemplates.offlineDqmFileOutputTemplate
def getRepMap(self, alignment=None)
def FileOutputTemplate(self)
def pythonboolstring(string, name)
def presentationsubsections(cls)
def ValidationSequence(self)
def FileOutputTemplate(self)
def createScript(self, path)
def comparealignmentsname(cls)
def __init__(self, valName, alignment, config)
def getRepMap(self, alignment=None)
def plottingscripttemplate(cls)
def ValidationTemplate(self)
def plottingscriptname(cls)
def PlottingOptions(config, valType)
def replaceByMap(target, the_map)
— Helpers —############################
dictionary deprecateddefaults
static std::string join(char **cmd)
def createCrabCfg(self, path)
def __init__(self, valName, alignment, config)
def getRepMap(self, alignment=None)