2 from genericValidation
import GenericValidation, GenericValidationData
3 from offlineValidation
import OfflineValidation
4 from trackSplittingValidation
import TrackSplittingValidation
5 from monteCarloValidation
import MonteCarloValidation
6 from zMuMuValidation
import ZMuMuValidation
7 from geometryComparison
import GeometryComparison
8 from TkAlExceptions
import AllInOneError
12 Object representing a validation that has already been run,
13 but should be included in plots.
15 def __init__(self, valName, config, valType,
16 addDefaults = {}, addMandatories=[]):
22 defaults = {
"title": self.
name}
23 defaults.update(addDefaults)
24 mandatories = [
"file",
"color",
"style"]
25 mandatories += addMandatories
27 theUpdate = config.getResultingSection(
"preexisting"+valType+
":"+self.
name,
28 defaultDict = defaults,
29 demandPars = mandatories)
30 self.general.update(theUpdate)
34 msg =
"The characters '|', '\"', and ',' cannot be used in the alignment title!"
37 self.
filesToCompare[GenericValidationData.defaultReferenceName] = \
40 knownOpts = defaults.keys()+mandatories
42 config.checkInput(
"preexisting"+valType+
":"+self.
name,
43 knownSimpleOptions = knownOpts,
44 ignoreOptions = ignoreOpts)
55 if repMap[
"file"].startswith(
"/castor/" ):
56 repMap[
"file"] =
"rfio:%(file)s"%repMap
57 elif repMap[
"file"].startswith(
"/store/" ):
58 repMap[
"file"] =
"root://eoscms.cern.ch//eos/cms%(file)s"%repMap
60 result[validationId]=repMap[
"file"]
62 result[validationId]=
"%(file)s=%(title)s|%(color)s|%(style)s"%repMap
66 if not "." in requestId:
67 requestId +=
".%s"%GenericValidation.defaultReferenceName
68 if not requestId.split(
".")[-1]
in result:
69 msg = (
"could not find %s in reference Objects!"
70 %requestId.split(
".")[-1])
72 return result[ requestId.split(
".")[-1] ]
85 addDefaults = {}, addMandatories=[]):
87 "DMRMethod":
"median,rmsNorm",
90 "OfflineTreeBaseDir":
"TrackHitFilter",
91 "SurfaceShapes":
"none"
93 defaults.update(addDefaults)
94 PreexistingValidation.__init__(self, valName, config,
"offline",
95 defaults, addMandatories)
98 if no argument or "" is passed a string with an instantiation is
99 returned, else the validation is appended to the list
103 if validationsSoFar ==
"":
104 validationsSoFar = (
'PlotAlignmentValidation p("%(file)s",'
105 '"%(title)s", %(color)s, %(style)s);\n')%repMap
107 validationsSoFar += (
' p.loadFileList("%(file)s", "%(title)s",'
108 '%(color)s, %(style)s);\n')%repMap
109 return validationsSoFar
113 addDefaults = {}, addMandatories=[]):
114 PreexistingValidation.__init__(self, valName, config,
"split",
115 addDefaults, addMandatories)
118 if no argument or "" is passed a string with an instantiation is
119 returned, else the validation is appended to the list
123 if validationsSoFar !=
"":
124 validationsSoFar +=
',"\n "'
125 validationsSoFar += comparestring
126 return validationsSoFar
130 addDefaults = {}, addMandatories=[]):
131 PreexistingValidation.__init__(self, valName, config,
"mcValidate",
132 addDefaults, addMandatories)
136 raise AllInOneError(
"Preexisting Z->mumu validation not implemented")
141 raise AllInOneError(
"Preexisting geometry comparison not implemented")
def appendToExtendedValidation
def appendToExtendedValidation