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  defaults = {
12  "zmumureference": ("/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN2"
13  "/TMP_EM/ZMuMu/data/MC/BiasCheck_DYToMuMu_Summer"
14  "11_TkAlZMuMu_IDEAL.root"),
15  "resonance": "Z"
16  }
17  mandatories = ["dataset", "maxevents",
18  "etamaxneg", "etaminneg", "etamaxpos", "etaminpos"]
19  GenericValidationData.__init__(self, valName, alignment, config,
20  "zmumu", addDefaults=defaults,
21  addMandatories=mandatories)
22 
23  def createConfiguration(self, path, configBaseName = "TkAlZMuMuValidation" ):
24  cfgName = "%s.%s.%s_cfg.py"%( configBaseName, self.name,
25  self.alignmentToValidate.name )
26  repMap = self.getRepMap()
27  cfgs = {cfgName:replaceByMap(configTemplates.ZMuMuValidationTemplate,
28  repMap)}
29  GenericValidationData.createConfiguration(self, cfgs, path)
30 
31  def createScript(self, path, scriptBaseName = "TkAlZMuMuValidation"):
32  scriptName = "%s.%s.%s.sh"%(scriptBaseName, self.name,
33  self.alignmentToValidate.name )
34  repMap = self.getRepMap()
35  repMap["CommandLine"]=""
36  for cfg in self.configFiles:
37  repMap["CommandLine"]+= repMap["CommandLineTemplate"]%{"cfgFile":cfg,
38  "postProcess":""
39  }
40  scripts = {scriptName: replaceByMap(configTemplates.zMuMuScriptTemplate,
41  repMap ) }
42  return GenericValidationData.createScript(self, scripts, path)
43 
44 
45  def createCrabCfg(self, path, crabCfgBaseName = "TkAlZMuMuValidation"):
46  return GenericValidationData.createCrabCfg(self, path, crabCfgBaseName)
47 
48  def getRepMap(self, alignment = None):
49  repMap = GenericValidationData.getRepMap(self, alignment)
50  repMap.update({
51  "nEvents": self.general["maxevents"],
52 # "outputFile": "zmumuHisto.root"
53  "outputFile": ("0_zmumuHisto.root"
54  ",genSimRecoPlots.root"
55  ",FitParameters.txt")
56  })
57  return repMap
def replaceByMap
— Helpers —############################