CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/RecoTauTag/Configuration/python/tools/recoTauConfTools.py

Go to the documentation of this file.
00001 #import FWCore.ParameterSet.Config as cms
00002 import os
00003 
00004 '''
00005 
00006 Helper functions for modifying the tau sequences.
00007 
00008 
00009 Author: Evan K. Friis, UC Davis
00010 
00011 '''
00012 
00013 def represents_int(value):
00014     try:
00015         int(value)
00016         return True
00017     except ValueError:
00018         return False
00019 
00020 def cmssw_version():
00021     version_str = os.environ['CMSSW_VERSION'].replace('CMSSW_', '').split('_')
00022     major_version = int(version_str[0])
00023     minor_version = int(version_str[1])
00024     subminor_version = None
00025     # Correctly deal with IB releases, where the subminor version is X. Return it 
00026     # as a string, which is always larger than integers.
00027     if represents_int(version_str[2]):
00028         subminor_version = int(version_str[2])
00029     else:
00030         subminor_version = version_str[2]
00031     return (version_str[0], version_str[1], version_str[2])