3 from genericValidation
import GenericValidationData
4 from helperFunctions
import replaceByMap
5 from TkAlExceptions
import AllInOneError
9 def __init__(self, valName, alignment, config,
10 configBaseName =
"TkAlTrackSplitting", scriptBaseName =
"TkAlTrackSplitting", crabCfgBaseName =
"TkAlTrackSplitting",
11 resultBaseName =
"TrackSplitting", outputBaseName =
"TrackSplitting"):
12 mandatories = [
"trackcollection"]
20 GenericValidationData.__init__(self, valName, alignment, config,
21 "split", addMandatories = mandatories, addDefaults = defaults)
25 self.alignmentToValidate.name)
27 cfgs = {cfgName: configTemplates.TrackSplittingTemplate}
28 self.
filesToCompare[GenericValidationData.defaultReferenceName] = \
29 repMap[
"finalResultFile"]
30 GenericValidationData.createConfiguration(self, cfgs, path, repMap = repMap)
33 return GenericValidationData.createScript(self, path)
36 return GenericValidationData.createCrabCfg(self, path, self.
crabCfgBaseName)
39 repMap = GenericValidationData.getRepMap(self)
40 if repMap[
"subdetector"] ==
"none":
43 subdetselection =
"process.AlignmentTrackSelector.minHitsPerSubDet.in.oO[subdetector]Oo. = 2" 45 "nEvents": self.
general[
"maxevents"],
46 "TrackCollection": self.
general[
"trackcollection"],
47 "subdetselection": subdetselection,
57 if no argument or "" is passed a string with an instantiation is 58 returned, else the validation is appended to the list 62 if validationsSoFar !=
"":
63 validationsSoFar +=
',"\n "' 64 validationsSoFar += comparestring
65 return validationsSoFar
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
81 filename = os.path.join(self.
cmssw,
"src/Alignment/CommonAlignmentProducer/python/AlignmentTrackSelector_cfi.py")
82 if not os.path.isfile(filename):
83 filename = os.path.join(self.
cmsswreleasebase,
"src/Alignment/CommonAlignmentProducer/python/AlignmentTrackSelector_cfi.py")
84 with open(filename)
as f:
85 trackselector = f.read()
87 minhitspersubdet = trackselector.split(
"minHitsPerSubDet")[1].
split(
"(",1)[1]
91 for character
in minhitspersubdet:
96 if parenthesesdepth < 0:
99 minhitspersubdet = minhitspersubdet[0:i]
101 results = minhitspersubdet.split(
",")
103 for i
in range(len(results)):
106 results.append(
"none")
108 return [a
for a
in results
if a]
def __init__(self, valName, alignment, config, configBaseName="TkAlTrackSplitting", scriptBaseName="TkAlTrackSplitting", crabCfgBaseName="TkAlTrackSplitting", resultBaseName="TrackSplitting", outputBaseName="TrackSplitting")
def createConfiguration(self, path)
def replace(string, replacements)
def createScript(self, path)
def createCrabCfg(self, path)
def appendToExtendedValidation(self, validationsSoFar="")
def appendToMerge(self, validationsSoFar="")
static std::string join(char **cmd)
def getRepMap(self, alignment=None)
def getRepMap(self, alignment=None)
def getCompareStrings(self, requestId=None, plain=False)