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)
56 if repMap[
"file"].startswith(
"/castor/" ):
57 repMap[
"file"] =
"rfio:%(file)s"%repMap
58 elif repMap[
"file"].startswith(
"/store/" ):
59 repMap[
"file"] =
"root://eoscms.cern.ch//eos/cms%(file)s"%repMap
61 result[validationId]=repMap[
"file"]
63 result[validationId]=
"%(file)s=%(title)s|%(color)s|%(style)s"%repMap
67 if not "." in requestId:
68 requestId +=
".%s"%GenericValidation.defaultReferenceName
69 if not requestId.split(
".")[-1]
in result:
70 msg = (
"could not find %s in reference Objects!"
71 %requestId.split(
".")[-1])
73 return result[ requestId.split(
".")[-1] ]
80 raise AllInOneError(
"Shouldn't be here...")
86 addDefaults = {}, addMandatories=[]):
88 "DMRMethod":
"median,rmsNorm",
91 "OfflineTreeBaseDir":
"TrackHitFilter",
92 "SurfaceShapes":
"coarse",
94 defaults.update(addDefaults)
95 PreexistingValidation.__init__(self, valName, config,
"offline",
96 defaults, addMandatories)
99 if no argument or "" is passed a string with an instantiation is
100 returned, else the validation is appended to the list
104 if validationsSoFar ==
"":
105 validationsSoFar = (
'PlotAlignmentValidation p("%(file)s",'
106 '"%(title)s", %(color)s, %(style)s);\n')%repMap
108 validationsSoFar += (
' p.loadFileList("%(file)s", "%(title)s",'
109 '%(color)s, %(style)s);\n')%repMap
110 return validationsSoFar
114 addDefaults = {}, addMandatories=[]):
115 PreexistingValidation.__init__(self, valName, config,
"split",
116 addDefaults, addMandatories)
119 if no argument or "" is passed a string with an instantiation is
120 returned, else the validation is appended to the list
124 if validationsSoFar !=
"":
125 validationsSoFar +=
',"\n "'
126 validationsSoFar += comparestring
127 return validationsSoFar
131 addDefaults = {}, addMandatories=[]):
132 PreexistingValidation.__init__(self, valName, config,
"mcValidate",
133 addDefaults, addMandatories)
137 raise AllInOneError(
"Preexisting Z->mumu validation not implemented")
142 raise AllInOneError(
"Preexisting geometry comparison not implemented")
def appendToExtendedValidation
def appendToExtendedValidation