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}
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!"
38 self.
filesToCompare[GenericValidationData.defaultReferenceName] = \
41 knownOpts = defaults.keys()+mandatories
43 config.checkInput(
"preexisting"+valType+
":"+self.
name,
44 knownSimpleOptions = knownOpts,
45 ignoreOptions = ignoreOpts)
61 if repMap[
"file"].startswith(
"/castor/" ):
62 repMap[
"file"] =
"rfio:%(file)s"%repMap
63 elif repMap[
"file"].startswith(
"/store/" ):
64 repMap[
"file"] =
"root://eoscms.cern.ch//eos/cms%(file)s"%repMap
66 result[validationId]=repMap[
"file"]
68 result[validationId]=
"%(file)s=%(title)s|%(color)s|%(style)s"%repMap
72 if not "." in requestId:
73 requestId +=
".%s"%GenericValidation.defaultReferenceName
74 if not requestId.split(
".")[-1]
in result:
75 msg = (
"could not find %s in reference Objects!"
76 %requestId.split(
".")[-1])
78 return result[ requestId.split(
".")[-1] ]
85 raise AllInOneError(
"Shouldn't be here...")
91 addDefaults = {}, addMandatories=[]):
93 deprecateddefaults = {
97 "OfflineTreeBaseDir":
"",
100 defaults.update(deprecateddefaults)
101 defaults.update(addDefaults)
102 PreexistingValidation.__init__(self, valName, config,
"offline",
103 defaults, addMandatories)
104 for option
in deprecateddefaults:
106 raise AllInOneError(
"The '%s' option has been moved to the [plots:offline] section. Please specify it there."%option)
110 if no argument or "" is passed a string with an instantiation is
111 returned, else the validation is appended to the list
115 if validationsSoFar ==
"":
116 validationsSoFar = (
'PlotAlignmentValidation p("%(file)s",'
117 '"%(title)s", %(color)s, %(style)s, .oO[bigtext]Oo.);\n')%repMap
119 validationsSoFar += (
' p.loadFileList("%(file)s", "%(title)s",'
120 '%(color)s, %(style)s);\n')%repMap
121 return validationsSoFar
125 addDefaults = {}, addMandatories=[]):
126 defaults = {
"subdetector":
"BPIX"}
127 defaults.update(addDefaults)
128 PreexistingValidation.__init__(self, valName, config,
"split",
129 defaults, 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