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