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":
""}
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 deprecateddefaults = {
105 "OfflineTreeBaseDir":
"",
108 defaults.update(deprecateddefaults)
109 defaults.update(addDefaults)
110 PreexistingValidation.__init__(self, valName, config,
"offline",
111 defaults, addMandatories)
112 for option
in deprecateddefaults:
114 raise AllInOneError(
"The '%s' option has been moved to the [plots:offline] section. Please specify it there."%option)
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 = (
'PlotAlignmentValidation p("%(file)s",'
125 '"%(title)s", %(color)s, %(style)s, .oO[bigtext]Oo.);\n')%repMap
127 validationsSoFar += (
' p.loadFileList("%(file)s", "%(title)s",'
128 '%(color)s, %(style)s);\n')%repMap
129 return validationsSoFar
133 addDefaults = {}, addMandatories=[]):
134 defaults = {
"subdetector":
"BPIX"}
135 defaults.update(addDefaults)
136 PreexistingValidation.__init__(self, valName, config,
"split",
137 defaults, addMandatories)
140 if no argument or "" is passed a string with an instantiation is
141 returned, else the validation is appended to the list
145 if validationsSoFar !=
"":
146 validationsSoFar +=
',"\n "'
147 validationsSoFar += comparestring
148 return validationsSoFar
152 addDefaults = {}, addMandatories=[]):
153 PreexistingValidation.__init__(self, valName, config,
"mcValidate",
154 addDefaults, addMandatories)
158 raise AllInOneError(
"Preexisting Z->mumu validation not implemented")
163 raise AllInOneError(
"Preexisting geometry comparison not implemented")
def appendToExtendedValidation
def appendToExtendedValidation