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"),
19 mandatories = [
"isda",
"ismc",
"runboundary",
"trackcollection",
"vertexcollection",
"lumilist",
"ptCut",
"runControl",
"numberOfBins"]
26 GenericValidationData.__init__(self, valName, alignment, config,
27 "primaryvertex", addDefaults=defaults,
28 addMandatories=mandatories)
30 if self.
general[
"pvvalidationreference"].startswith(
"/store"):
31 self.
general[
"pvvalidationreference"] =
"root://eoscms//eos/cms" + self.
general[
"pvvalidationreference"]
33 raise AllInOneError(
"Parallel jobs not implemented for the PrimaryVertex validation!\n"
34 "Please set parallelJobs = 1.")
38 self.alignmentToValidate.name )
40 cfgs = {cfgName: configTemplates.PrimaryVertexValidationTemplate}
41 self.
filesToCompare[GenericValidationData.defaultReferenceName] = \
42 repMap[
"finalResultFile"]
43 GenericValidationData.createConfiguration(self, cfgs, path, repMap = repMap)
46 return GenericValidationData.createScript(self, path, template = configTemplates.PVValidationScriptTemplate)
49 return GenericValidationData.createCrabCfg(self, path, self.
crabCfgBaseName)
54 repMap = GenericValidationData.getRepMap(self, alignment)
56 "nEvents": self.
general[
"maxevents"],
57 "TrackCollection": self.
general[
"trackcollection"],
58 "VertexCollection": self.
general[
"vertexcollection"],
59 "eosdir": os.path.join(self.
general[
"eosdir"]),
61 "workingdir":
".oO[datadir]Oo./%s/%s/%s" % (self.
outputBaseName, self.
name, alignment.name),
62 "plotsdir":
".oO[datadir]Oo./%s/%s/%s/plots" % (self.
outputBaseName, self.
name, alignment.name),
69 if no argument or "" is passed a string with an instantiation is returned,
70 else the validation is appended to the list
74 parameters =
" ".
join(os.path.join(
"root://eoscms//eos/cms", file.lstrip(
"/"))
for file
in repMap[
"resultFiles"])
76 mergedoutputfile = os.path.join(
"root://eoscms//eos/cms", repMap[
"finalResultFile"].lstrip(
"/"))
77 validationsSoFar +=
"hadd -f %s %s\n" % (mergedoutputfile, parameters)
78 return validationsSoFar
82 if no argument or "" is passed a string with an instantiation is
83 returned, else the validation is appended to the list
87 if validationsSoFar !=
"":
88 validationsSoFar +=
','
89 validationsSoFar +=
"root://eoscms//eos/cms%(finalResultFile)s=%(title)s"%repMap
91 validationsSoFar +=
"root://eoscms//eos/cms%(finalResultFile)s=%(title)s"%repMap
92 return validationsSoFar
def appendToExtendedValidation
static std::string join(char **cmd)