Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-13 01:32:32

0001 #! /usr/bin/env python3
0002 # -*-coding: utf-8 -*-
0003 
0004 from __future__ import print_function
0005 import os, sys
0006 
0007 
0008 class env:
0009     def checkSample(self):
0010         if ('DD_SAMPLE' not in os.environ) or (os.environ['DD_SAMPLE'] == ''):
0011             if (len(sys.argv) > 2):  # no else part since if sample does not exist, we had quit previously
0012                 sampleName = str(sys.argv[2])
0013                 os.environ['DD_SAMPLE'] = 'RelVal' + sampleName
0014                 print('Sample name:', sampleName, ' - ', os.environ['DD_SAMPLE'])
0015             else:
0016                 print('====================')
0017                 print('no sample name, quit')
0018                 print('====================')
0019                 quit()
0020 
0021     def beginTag(self):
0022         #beginTag = 'Phase2'
0023         beginTag = 'Run3'
0024         return beginTag
0025 
0026     def dd_tier(self):
0027         dd_tier = 'GEN-SIM-RECO'
0028         #dd_tier = 'MINIAODSIM'
0029         return dd_tier
0030 
0031     def tag_startup(self):
0032         tag_startup = '123X_mcRun3_2021_realistic_v14'
0033         # tag_startup = '113X_mcRun3_2021_realistic_v7'
0034         # tag_startup = '93X_upgrade2023_realistic_v2_2023D17PU140'
0035         # tag_startup = '93X_upgrade2023_realistic_v0_D17PU200'
0036         # tag_startup = '92X_upgrade2023_realistic_v2_2023D17noPU'
0037         # tag_startup = '93X_upgrade2023_realistic_v0_D17PU200'
0038         return tag_startup
0039 
0040     def data_version(self):
0041         data_version = 'v1'
0042         return data_version
0043 
0044     def test_global_tag(self):
0045         test_global_tag = self.tag_startup()
0046         return test_global_tag
0047 
0048     def dd_cond(self):
0049         # dd_cond = 'PU25ns_' + self.test_global_tag() + '-' + self.data_version() # PU
0050         dd_cond = self.test_global_tag() + '-' + self.data_version()  # noPU
0051         return dd_cond
0052 
0053     def checkValues(self):
0054         print('-----')
0055         print(self.dd_tier())
0056         print(self.tag_startup())
0057         print(self.data_version())
0058         print(self.test_global_tag())
0059         print(self.dd_cond())
0060         print('-----')
0061 
0062         os.environ['beginTag'] = self.beginTag()
0063 
0064         if ('DD_TIER' not in os.environ) or (os.environ['DD_TIER'] == ''):
0065             os.environ['DD_TIER'] = self.dd_tier()  # 'GEN-SIM-RECO'
0066         if 'TAG_STARTUP' not in os.environ:  # TAG_STARTUP from OvalFile
0067             os.environ['TAG_STARTUP'] = self.tag_startup()  # '93X_upgrade2023_realistic_v0_D17PU200'
0068         if 'DATA_VERSION' not in os.environ:  # DATA_VERSION from OvalFile
0069             os.environ['DATA_VERSION'] = self.data_version()  # 'v1'
0070         if 'TEST_GLOBAL_TAG' not in os.environ:  # TEST_GLOBAL_TAG from OvalFile
0071             os.environ['TEST_GLOBAL_TAG'] = self.test_global_tag()  # os.environ['TAG_STARTUP']
0072         if ('DD_COND' not in os.environ) or (os.environ['DD_COND'] == ''):
0073             os.environ[
0074                 'DD_COND'] = self.dd_cond()  # 'PU25ns_' + os.environ['TEST_GLOBAL_TAG'] + '-' + os.environ['DATA_VERSION']
0075 
0076         os.environ['DD_RELEASE'] = os.environ['CMSSW_VERSION']
0077         # os.environ['DD_RELEASE'] = "CMSSW_11_3_0_pre3"
0078 
0079         print('=====')
0080         if ('DD_SAMPLE_OUT' not in os.environ) or (os.environ['DD_SAMPLE_OUT'] == ''):
0081             os.environ['DD_SAMPLE_OUT'] = os.environ['DD_SAMPLE'].replace("RelVal", "ValFull")
0082         print('=====')
0083 
0084         os.environ['DD_SOURCE'] = '/eos/cms/store/relval/' + os.environ['DD_RELEASE'] + '/' + os.environ[
0085             'DD_SAMPLE'] + '/' + os.environ['DD_TIER'] + '/' + os.environ['DD_COND']
0086         os.environ['data'] = '/' + os.environ['DD_SAMPLE'] + '/' + os.environ['DD_RELEASE'] + '-' + os.environ[
0087             'DD_COND'] + '/' + os.environ['DD_TIER']
0088         os.environ['outputFile'] = 'electronHistos.' + os.environ['DD_SAMPLE_OUT'] + '_gedGsfE.root'
0089         if ('inputPostFile' not in os.environ) or (os.environ['inputPostFile'] == ''):
0090             print('inputPostFile : %s' % os.environ['outputFile'])
0091             os.environ['inputPostFile'] = os.environ['outputFile']
0092 
0093         print('DD_RELEASE', os.environ['DD_RELEASE'])
0094         print('DD_SAMPLE', os.environ['DD_SAMPLE'])
0095         print('DD_SAMPLE_OUT', os.environ['DD_SAMPLE_OUT'])
0096         print('DD_COND', os.environ['DD_COND'])
0097         print('DD_TIER', os.environ['DD_TIER'])
0098         print('DD_SOURCE', os.environ['DD_SOURCE'])
0099         print('data', os.environ['data'])
0100         print('outputFile    :', os.environ['outputFile'])
0101         print('inputPostFile :', os.environ['inputPostFile'])
0102         print('beginTag : ', self.beginTag())