CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RecoTLR.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 """
4 _recoTLR_
5 
6 Util to retrieve the appropriate set of reco top-level patches
7 from the Configuration/GlobalRuns package based on the release name
8 
9 """
10 
11 
12 # two helper functions
13 def getRelease():
14  import os
15 
16  try:
17  release=os.environ['CMSSW_VERSION']
18  except:
19  msg='No CMSSW_VERSION envvar defined'
20  raise RuntimeError,msg
21 
22  sp=release.split('_')
23  if len(sp)<2:
24  raise RuntimeError,'Unexpected release name'+release
25 
26  return ''.join(sp[1:3])+'X'
27 
28  #__import__(moduleName,globals(),locals(),[scenarioName])
29  #except ImportError, ex:
30 
31 
32 def getCustomProcess(process,myname):
33  rel=getRelease()
34  try:
35  _temp=__import__('Configuration.GlobalRuns.reco_TLR_'+rel,globals(),locals(),[myname])
36  except ImportError,ex:
37  msg= 'Unable to import reco TLR configuration ' + str(ex)
38  raise RuntimeError,msg
39 
40  return getattr(_temp,myname)(process)
41 
42 
43 ##############################################################################
44 import sys
45 def customisePPData(process):
46  myname=sys._getframe().f_code.co_name
47  return getCustomProcess(process,myname)
48 
49 def customiseVALSKIM(process):
50  myname=sys._getframe().f_code.co_name
51  return getCustomProcess(process,myname)
52 
53 ##############################################################################
54 def customisePPMC(process):
55  myname=sys._getframe().f_code.co_name
56  return getCustomProcess(process,myname)
57 
58 ##############################################################################
59 def customiseCosmicData(process):
60  myname=sys._getframe().f_code.co_name
61  return getCustomProcess(process,myname)
62 
63 ##############################################################################
64 def customiseCosmicMC(process):
65  myname=sys._getframe().f_code.co_name
66  return getCustomProcess(process,myname)
67 
68 ##############################################################################
69 def customiseExpress(process):
70  myname=sys._getframe().f_code.co_name
71  return getCustomProcess(process,myname)
72 
73 ##############################################################################
74 def customisePrompt(process):
75  myname=sys._getframe().f_code.co_name
76  return getCustomProcess(process,myname)
77 
78 ##############################################################################
79 def customiseExpressHI(process):
80  myname=sys._getframe().f_code.co_name
81  return getCustomProcess(process,myname)
82 
83 ##############################################################################
84 def customisePromptHI(process):
85  myname=sys._getframe().f_code.co_name
86  return getCustomProcess(process,myname)
def customisePromptHI
Definition: RecoTLR.py:84
def customisePPMC
Definition: RecoTLR.py:54
def customiseCosmicMC
Definition: RecoTLR.py:64
def customiseVALSKIM
Definition: RecoTLR.py:49
def customiseExpressHI
Definition: RecoTLR.py:79
def customiseCosmicData
Definition: RecoTLR.py:59
def getRelease
Definition: RecoTLR.py:13
def customisePPData
Definition: RecoTLR.py:45
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def customisePrompt
Definition: RecoTLR.py:74
def getCustomProcess
Definition: RecoTLR.py:32
def customiseExpress
Definition: RecoTLR.py:69