CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
cmsswRelease Namespace Reference

Classes

class  CMSSWReleaseTest
 

Functions

def cmsswIs44X
 
def cmsswIs52X
 
def cmsswRelease
 
def isNewerThan
 
def releaseNumber
 

Function Documentation

def cmsswRelease.cmsswIs44X ( )

Definition at line 7 of file cmsswRelease.py.

References spr.find().

7 
8 def cmsswIs44X():
9  return cmsswRelease().find('CMSSW_4_4_') != -1
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
def cmsswRelease.cmsswIs52X ( )

Definition at line 10 of file cmsswRelease.py.

References spr.find().

10 
11 def cmsswIs52X():
12  if cmsswRelease().find('CMSSW_5_2_') != -1 or \
13  cmsswRelease().find('CMSSW_5_3_') != -1:
14  return True
15  else:
16  return False
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
def cmsswRelease.cmsswRelease ( )

Definition at line 4 of file cmsswRelease.py.

References split.

4 
5 def cmsswRelease():
6  return os.environ['CMSSW_BASE'].split('/')[-1]
double split
Definition: MVATrainer.cc:139
def cmsswRelease
Definition: cmsswRelease.py:4
def cmsswRelease.isNewerThan (   release1,
  release2 = None 
)
Checks the orders of two releases. If release2 is not set, it is taken as the current release

Definition at line 51 of file cmsswRelease.py.

References releaseNumber().

Referenced by cmsswRelease.CMSSWReleaseTest.test_isNewerThan().

51 
52 def isNewerThan(release1, release2=None):
53  """Checks the orders of two releases. If release2 is not set, it is taken as the current release"""
54  return releaseNumber(release2) >= releaseNumber(release1)
55 
def cmsswRelease.releaseNumber (   release = None)

Definition at line 17 of file cmsswRelease.py.

Referenced by isNewerThan(), miniAodFiles.miniAodFiles(), and cmsswRelease.CMSSWReleaseTest.test_releaseNumber().

17 
18 def releaseNumber(release = None):
19  # first check if this is an integration build
20  if release is None:
21  release = cmsswRelease()
22  ibrel = re.compile('^CMSSW_(\d+)_(\d+)_X.*$')
23  m = ibrel.match(release)
24  if m:
25  big = int(m.group(1))
26  medium = int(m.group(2))
27  return big, medium
28  rerel = re.compile('^CMSSW_(\d+)_(\d+)_(\d+)(_\S+)*$')
29  m = rerel.match(release)
30  if m is None:
31  raise ValueError('malformed release string '+release)
32  big = int(m.group(1))
33  medium = int(m.group(2))
34  small = int(m.group(3))
35  if m.group(4): # that's either a patch or prerelease
36  prel = re.compile('_pre(\d+)')
37  patch = re.compile('_patch(\d+)')
38  pm = prel.match(m.group(4))
39  if pm: # prerelease
40  pre = int(pm.group(1))
41  return big, medium, small, pre
42  else: # patch
43  pm2 = patch.match(m.group(4))
44  if pm2:
45  pat = int(pm2.group(1))
46  return big, medium, small, pat
47  else:
48  raise ValueError('patch or prerelease string malformed '+m.group(4))
49  else:
50  return big, medium, small