2 from genericValidation
import GenericValidation, GenericValidationData
3 from geometryComparison
import GeometryComparison
4 from helperFunctions
import getCommandOutput2, parsecolor, parsestyle
5 from monteCarloValidation
import MonteCarloValidation
6 from offlineValidation
import OfflineValidation
7 from TkAlExceptions
import AllInOneError
8 from trackSplittingValidation
import TrackSplittingValidation
9 from zMuMuValidation
import ZMuMuValidation
13 Object representing a validation that has already been run,
14 but should be included in plots.
16 def __init__(self, valName, config, valType,
17 addDefaults = {}, addMandatories=[]):
23 defaults = {
"title": self.
name,
"jobid":
"",
"subdetector":
"BPIX"}
24 defaults.update(addDefaults)
25 mandatories = [
"file",
"color",
"style"]
26 mandatories += addMandatories
28 theUpdate = config.getResultingSection(
"preexisting"+valType+
":"+self.
name,
29 defaultDict = defaults,
30 demandPars = mandatories)
31 self.general.update(theUpdate)
35 msg =
"The characters '|', '\"', and ',' cannot be used in the alignment title!"
42 if "is not found" in output:
raise RuntimeError
46 self.
filesToCompare[GenericValidationData.defaultReferenceName] = \
49 knownOpts = defaults.keys()+mandatories
51 config.checkInput(
"preexisting"+valType+
":"+self.
name,
52 knownSimpleOptions = knownOpts,
53 ignoreOptions = ignoreOpts)
69 if repMap[
"file"].startswith(
"/castor/" ):
70 repMap[
"file"] =
"rfio:%(file)s"%repMap
71 elif repMap[
"file"].startswith(
"/store/" ):
72 repMap[
"file"] =
"root://eoscms.cern.ch//eos/cms%(file)s"%repMap
74 result[validationId]=repMap[
"file"]
76 result[validationId]=
"%(file)s=%(title)s|%(color)s|%(style)s"%repMap
80 if not "." in requestId:
81 requestId +=
".%s"%GenericValidation.defaultReferenceName
82 if not requestId.split(
".")[-1]
in result:
83 msg = (
"could not find %s in reference Objects!"
84 %requestId.split(
".")[-1])
86 return result[ requestId.split(
".")[-1] ]
93 raise AllInOneError(
"Shouldn't be here...")
99 addDefaults = {}, addMandatories=[]):
101 "DMRMethod":
"median,rmsNorm",
104 "OfflineTreeBaseDir":
"TrackHitFilter",
105 "SurfaceShapes":
"coarse",
107 defaults.update(addDefaults)
108 PreexistingValidation.__init__(self, valName, config,
"offline",
109 defaults, addMandatories)
112 if no argument or "" is passed a string with an instantiation is
113 returned, else the validation is appended to the list
117 if validationsSoFar ==
"":
118 validationsSoFar = (
'PlotAlignmentValidation p("%(file)s",'
119 '"%(title)s", %(color)s, %(style)s);\n')%repMap
121 validationsSoFar += (
' p.loadFileList("%(file)s", "%(title)s",'
122 '%(color)s, %(style)s);\n')%repMap
123 return validationsSoFar
127 addDefaults = {}, addMandatories=[]):
128 PreexistingValidation.__init__(self, valName, config,
"split",
129 addDefaults, addMandatories)
132 if no argument or "" is passed a string with an instantiation is
133 returned, else the validation is appended to the list
137 if validationsSoFar !=
"":
138 validationsSoFar +=
',"\n "'
139 validationsSoFar += comparestring
140 return validationsSoFar
144 addDefaults = {}, addMandatories=[]):
145 PreexistingValidation.__init__(self, valName, config,
"mcValidate",
146 addDefaults, addMandatories)
150 raise AllInOneError(
"Preexisting Z->mumu validation not implemented")
155 raise AllInOneError(
"Preexisting geometry comparison not implemented")
def appendToExtendedValidation
def appendToExtendedValidation