2 from .
import configTemplates
3 from .
import globalDictionaries
4 from .genericValidation
import GenericValidationData, ValidationWithPlots, pythonboolstring
5 from .helperFunctions
import replaceByMap
6 from .TkAlExceptions
import AllInOneError
9 configBaseName =
"TkAlPrimaryVertexResolution"
10 scriptBaseName =
"TkAlPrimaryVertexResolution"
11 crabCfgBaseName =
"TkAlPrimaryVertexResolution"
12 resultBaseName =
"PrimaryVertexResolution"
13 outputBaseName =
"PrimaryVertexResolution"
16 "pvresolutionreference": (
"/store/group/alca_trackeralign/validation/PVResolution/Reference/PrimaryVertexResolution_phaseIMC92X_upgrade2017_Ideal.root"),
20 mandatories = {
"runControl",
"runboundary",
"doTriggerSelection",
"triggerBits",
"trackcollection"}
21 valType =
"pvresolution"
22 def __init__(self, valName, alignment, config):
23 super(PrimaryVertexResolution, self).
__init__(valName, alignment, config)
25 if self.
general[
"pvresolutionreference"].startswith(
"/store"):
26 self.
general[
"pvresolutionreference"] =
"root://eoscms//eos/cms" + self.
general[
"pvresolutionreference"]
28 raise AllInOneError(
"Parallel jobs not implemented for the SplotVertexResolution validation!\n"
29 "Please set parallelJobs = 1.")
32 return configTemplates.PrimaryVertexResolutionTemplate
36 return configTemplates.SingleTrackRefitter
40 return configTemplates.PVResolutionPath
49 return "PrimaryVertexResolution"
52 return super(PrimaryVertexResolution, self).
createScript(path, template = configTemplates.PVResolutionScriptTemplate)
60 repMap = super(PrimaryVertexResolution, self).
getRepMap(alignment)
62 "nEvents": self.
general[
"maxevents"],
63 "TrackCollection": self.
general[
"trackcollection"],
64 "eosdir": os.path.join(self.
general[
"eosdir"]),
66 "workingdir":
".oO[datadir]Oo./%s/%s/%s" % (self.
outputBaseName, self.
name, alignment.name),
67 "plotsdir":
".oO[datadir]Oo./%s/%s/%s/plots" % (self.
outputBaseName, self.
name, alignment.name),
74 if no argument or "" is passed a string with an instantiation is returned,
75 else the validation is appended to the list
79 parameters =
" ".
join(os.path.join(
"root://eoscms//eos/cms", file.lstrip(
"/"))
for file
in repMap[
"resultFiles"])
81 mergedoutputfile = os.path.join(
"root://eoscms//eos/cms", repMap[
"finalResultFile"].lstrip(
"/"))
82 return "hadd -f %s %s\n" % (mergedoutputfile, parameters)
86 return (
' PVResolution::loadFileList("root://eoscms//eos/cms%(finalResultFile)s",'
87 '"PrimaryVertexResolution","%(title)s", %(color)s, %(style)s);\n')%repMap
91 return configTemplates.PVResolutionPlotExecution
95 return "TkAlPrimaryVertexResolutionPlot.C"
99 return configTemplates.PVResolutionPlotTemplate
103 return "PrimaryVertexResolution"