CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
zMuMuValidation.py
Go to the documentation of this file.
1 import os
2 import configTemplates
3 import globalDictionaries
4 from genericValidation import GenericValidationData
5 from helperFunctions import replaceByMap
6 from TkAlExceptions import AllInOneError
7 
8 
10  def __init__(self, valName, alignment, config,
11  configBaseName = "TkAlZMuMuValidation", scriptBaseName = "TkAlZMuMuValidation", crabCfgBaseName = "TkAlZMuMuValidation",
12  resultBaseName = "ZMuMuValidation", outputBaseName = "ZMuMuValidation"):
13  defaults = {
14  "zmumureference": ("/store/caf/user/emiglior/Alignment/TkAlDiMuonValidation/Reference/BiasCheck_DYToMuMu_Summer12_TkAlZMuMu_IDEAL.root"),
15  "resonance": "Z"
16  }
17  mandatories = ["etamaxneg", "etaminneg", "etamaxpos", "etaminpos"]
18  self.configBaseName = configBaseName
19  self.scriptBaseName = scriptBaseName
20  self.crabCfgBaseName = crabCfgBaseName
21  self.resultBaseName = resultBaseName
22  self.outputBaseName = outputBaseName
23  self.needParentFiles = False
24  GenericValidationData.__init__(self, valName, alignment, config,
25  "zmumu", addDefaults=defaults,
26  addMandatories=mandatories)
27  if self.NJobs > 1:
28  raise AllInOneError("Parallel jobs not implemented for the Z->mumu validation!\n"
29  "Please set parallelJobs = 1.")
30 
31  def createConfiguration(self, path):
32  cfgName = "%s.%s.%s_cfg.py"%( self.configBaseName, self.name,
33  self.alignmentToValidate.name )
34  repMap = self.getRepMap()
35  cfgs = {cfgName: configTemplates.ZMuMuValidationTemplate}
36  GenericValidationData.createConfiguration(self, cfgs, path, repMap = repMap)
37 
38  def createScript(self, path):
39  return GenericValidationData.createScript(self, path, template = configTemplates.zMuMuScriptTemplate)
40 
41  def createCrabCfg(self, path):
42  return GenericValidationData.createCrabCfg(self, path, self.crabCfgBaseName)
43 
44  def getRepMap(self, alignment = None):
45  repMap = GenericValidationData.getRepMap(self, alignment)
46  repMap.update({
47  "nEvents": self.general["maxevents"],
48 # "outputFile": "zmumuHisto.root"
49  "outputFile": ("0_zmumuHisto.root"
50  ",genSimRecoPlots.root"
51  ",FitParameters.txt")
52  })
53  return repMap