3 import globalDictionaries
4 from genericValidation
import GenericValidationData
5 from helperFunctions
import replaceByMap
6 from TkAlExceptions
import AllInOneError
10 def __init__(self, valName, alignment, config,
11 configBaseName =
"TkAlZMuMuValidation", scriptBaseName =
"TkAlZMuMuValidation", crabCfgBaseName =
"TkAlZMuMuValidation",
12 resultBaseName =
"ZMuMuValidation", outputBaseName =
"ZMuMuValidation"):
14 "zmumureference": (
"/store/caf/user/emiglior/Alignment/TkAlDiMuonValidation/Reference/BiasCheck_DYToMuMu_Summer12_TkAlZMuMu_IDEAL.root"),
16 deprecateddefaults = {
24 defaults.update(deprecateddefaults)
25 mandatories = [
"etamaxneg",
"etaminneg",
"etamaxpos",
"etaminpos"]
32 GenericValidationData.__init__(self, valName, alignment, config,
33 "zmumu", addDefaults=defaults,
34 addMandatories=mandatories,
35 addneedpackages=[
'MuonAnalysis/MomentumScaleCalibration'])
36 if self.
general[
"zmumureference"].startswith(
"/store"):
37 self.
general[
"zmumureference"] =
"root://eoscms//eos/cms" + self.
general[
"zmumureference"]
39 raise AllInOneError(
"Parallel jobs not implemented for the Z->mumu validation!\n"
40 "Please set parallelJobs = 1.")
41 for option
in deprecateddefaults:
43 raise AllInOneError(
"The '%s' option has been moved to the [plots:zmumu] section. Please specify it there."%option)
48 self.alignmentToValidate.name )
50 self.
filesToCompare[GenericValidationData.defaultReferenceName] = \
52 cfgs = {cfgName: configTemplates.ZMuMuValidationTemplate}
53 GenericValidationData.createConfiguration(self, cfgs, path, repMap = repMap)
56 return GenericValidationData.createScript(self, path, template = configTemplates.zMuMuScriptTemplate)
59 return GenericValidationData.createCrabCfg(self, path, self.
crabCfgBaseName)
64 repMap = GenericValidationData.getRepMap(self, alignment)
66 "nEvents": self.
general[
"maxevents"],
67 "outputFile": (
"0_zmumuHisto.root"
68 ",genSimRecoPlots.root"
69 ",FitParameters.txt"),
71 "workingdir":
".oO[datadir]Oo./%s/%s/%s" % (self.
outputBaseName, self.
name, alignment.name),
72 "plotsdir":
".oO[datadir]Oo./%s/%s/%s/plots" % (self.
outputBaseName, self.
name, alignment.name),
78 if no argument or "" is passed a string with an instantiation is
79 returned, else the validation is appended to the list
82 if validationsSoFar !=
"":
83 validationsSoFar +=
' '
84 validationsSoFar +=
replaceByMap(
'filenames.push_back("root://eoscms//eos/cms/store/caf/user/$USER/.oO[eosdir]Oo./BiasCheck.root"); titles.push_back(".oO[title]Oo."); colors.push_back(.oO[color]Oo.); linestyles.push_back(.oO[style]Oo.);\n', repMap)
85 return validationsSoFar
def appendToExtendedValidation
def replaceByMap
— Helpers —############################