3 import globalDictionaries
4 from genericValidation
import GenericValidationData
5 from helperFunctions
import replaceByMap
6 from TkAlExceptions
import AllInOneError
9 def __init__(self, valName, alignment, config,
10 configBaseName =
"TkAlPrimaryVertexValidation",
11 scriptBaseName =
"TkAlPrimaryVertexValidation",
12 crabCfgBaseName =
"TkAlPrimaryVertexValidation",
13 resultBaseName =
"PrimaryVertexValidation",
14 outputBaseName =
"PrimaryVertexValidation"):
16 "pvvalidationreference": (
"/store/caf/user/musich/Alignment/TkAlPrimaryVertexValidation/Reference/PrimaryVertexValidation_test_pvvalidation_mc_design_mc_48bins.root"),
17 "ttrhbuilder":
"WithAngleAndTemplate",
22 mandatories = [
"isda",
"ismc",
"runboundary",
"trackcollection",
"vertexcollection",
"lumilist",
"ptCut",
"etaCut",
"runControl",
"numberOfBins"]
29 GenericValidationData.__init__(self, valName, alignment, config,
30 "primaryvertex", addDefaults=defaults,
31 addMandatories=mandatories)
33 if self.
general[
"pvvalidationreference"].startswith(
"/store"):
34 self.
general[
"pvvalidationreference"] =
"root://eoscms//eos/cms" + self.
general[
"pvvalidationreference"]
36 raise AllInOneError(
"Parallel jobs not implemented for the PrimaryVertex validation!\n" 37 "Please set parallelJobs = 1.")
41 self.alignmentToValidate.name )
43 cfgs = {cfgName: configTemplates.PrimaryVertexValidationTemplate}
44 self.
filesToCompare[GenericValidationData.defaultReferenceName] = \
45 repMap[
"finalResultFile"]
46 GenericValidationData.createConfiguration(self, cfgs, path, repMap = repMap)
49 return GenericValidationData.createScript(self, path, template = configTemplates.PVValidationScriptTemplate)
52 return GenericValidationData.createCrabCfg(self, path, self.
crabCfgBaseName)
57 repMap = GenericValidationData.getRepMap(self, alignment)
60 "nEvents": self.
general[
"maxevents"],
61 "TrackCollection": self.
general[
"trackcollection"],
62 "VertexCollection": self.
general[
"vertexcollection"],
63 "eosdir": os.path.join(self.
general[
"eosdir"]),
65 "workingdir":
".oO[datadir]Oo./%s/%s/%s" % (self.
outputBaseName, self.
name, alignment.name),
66 "plotsdir":
".oO[datadir]Oo./%s/%s/%s/plots" % (self.
outputBaseName, self.
name, alignment.name),
73 if no argument or "" is passed a string with an instantiation is returned, 74 else the validation is appended to the list 78 parameters =
" ".
join(os.path.join(
"root://eoscms//eos/cms", file.lstrip(
"/"))
for file
in repMap[
"resultFiles"])
80 mergedoutputfile = os.path.join(
"root://eoscms//eos/cms", repMap[
"finalResultFile"].lstrip(
"/"))
81 validationsSoFar +=
"hadd -f %s %s\n" % (mergedoutputfile, parameters)
82 return validationsSoFar
86 if no argument or "" is passed a string with an instantiation is 87 returned, else the validation is appended to the list 91 if validationsSoFar ==
"":
92 validationsSoFar = (
' loadFileList("root://eoscms//eos/cms%(finalResultFile)s",' 93 '"PVValidation","%(title)s", %(color)s, %(style)s);\n')%repMap
95 validationsSoFar += (
' loadFileList("root://eoscms//eos/cms%(finalResultFile)s",' 96 '"PVValidation","%(title)s", %(color)s, %(style)s);\n')%repMap
98 return validationsSoFar
def appendToExtendedValidation(self, validationsSoFar="")
def appendToMerge(self, validationsSoFar="")
def __init__(self, valName, alignment, config, configBaseName="TkAlPrimaryVertexValidation", scriptBaseName="TkAlPrimaryVertexValidation", crabCfgBaseName="TkAlPrimaryVertexValidation", resultBaseName="PrimaryVertexValidation", outputBaseName="PrimaryVertexValidation")
def createCrabCfg(self, path)
def getRepMap(self, alignment=None)
def createScript(self, path)
static std::string join(char **cmd)
def getRepMap(self, alignment=None)
def createConfiguration(self, path)