Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:26:57

0001 #import FWCore.ParameterSet.Config as cms
0002 import os
0003 
0004 '''
0005 
0006 Helper functions for modifying the tau sequences.
0007 
0008 
0009 Author: Evan K. Friis, UC Davis
0010 
0011 '''
0012 
0013 def represents_int(value):
0014     try:
0015         int(value)
0016         return True
0017     except ValueError:
0018         return False
0019 
0020 def cmssw_version():
0021     version_str = os.environ['CMSSW_VERSION'].replace('CMSSW_', '').split('_')
0022     major_version = int(version_str[0])
0023     minor_version = int(version_str[1])
0024     subminor_version = None
0025     # Correctly deal with IB releases, where the subminor version is X. Return it 
0026     # as a string, which is always larger than integers.
0027     if represents_int(version_str[2]):
0028         subminor_version = int(version_str[2])
0029     else:
0030         subminor_version = version_str[2]
0031     return (version_str[0], version_str[1], version_str[2])