Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:28:29

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 = '125X_mcRun3_2022_realistic_v3'
0033         tag_startup = '125X_mcRun4_realistic_v2_2026D88noPU'
0034         # tag_startup = '113X_mcRun3_2021_realistic_v7'
0035         # tag_startup = '93X_upgrade2023_realistic_v2_2023D17PU140'
0036         # tag_startup = '93X_upgrade2023_realistic_v0_D17PU200'
0037         # tag_startup = '92X_upgrade2023_realistic_v2_2023D17noPU'
0038         # tag_startup = '93X_upgrade2023_realistic_v0_D17PU200'
0039         return tag_startup
0040 
0041     def data_version(self):
0042         data_version = 'v1'
0043         return data_version
0044 
0045     def test_global_tag(self):
0046         test_global_tag = self.tag_startup()
0047         return test_global_tag
0048 
0049     def dd_cond(self):
0050         # dd_cond = 'PU25ns_' + self.test_global_tag() + '-' + self.data_version() # PU
0051         dd_cond = self.test_global_tag() + '-' + self.data_version()  # noPU
0052         return dd_cond
0053 
0054     def checkValues(self):
0055         print('-----')
0056         print(self.dd_tier())
0057         print(self.tag_startup())
0058         print(self.data_version())
0059         print(self.test_global_tag())
0060         print(self.dd_cond())
0061         print('-----')
0062 
0063         os.environ['beginTag'] = self.beginTag()
0064 
0065         if ('DD_TIER' not in os.environ) or (os.environ['DD_TIER'] == ''):
0066             os.environ['DD_TIER'] = self.dd_tier()  # 'GEN-SIM-RECO'
0067         if 'TAG_STARTUP' not in os.environ:  # TAG_STARTUP from OvalFile
0068             os.environ['TAG_STARTUP'] = self.tag_startup()  # '93X_upgrade2023_realistic_v0_D17PU200'
0069         if 'DATA_VERSION' not in os.environ:  # DATA_VERSION from OvalFile
0070             os.environ['DATA_VERSION'] = self.data_version()  # 'v1'
0071         if 'TEST_GLOBAL_TAG' not in os.environ:  # TEST_GLOBAL_TAG from OvalFile
0072             os.environ['TEST_GLOBAL_TAG'] = self.test_global_tag()  # os.environ['TAG_STARTUP']
0073         if ('DD_COND' not in os.environ) or (os.environ['DD_COND'] == ''):
0074             os.environ[
0075                 'DD_COND'] = self.dd_cond()  # 'PU25ns_' + os.environ['TEST_GLOBAL_TAG'] + '-' + os.environ['DATA_VERSION']
0076 
0077         os.environ['DD_RELEASE'] = os.environ['CMSSW_VERSION']
0078         # os.environ['DD_RELEASE'] = "CMSSW_11_3_0_pre3"
0079 
0080         print('=====')
0081         if ('DD_SAMPLE_OUT' not in os.environ) or (os.environ['DD_SAMPLE_OUT'] == ''):
0082             os.environ['DD_SAMPLE_OUT'] = os.environ['DD_SAMPLE'].replace("RelVal", "ValFull")
0083         print('=====')
0084 
0085         os.environ['DD_SOURCE'] = '/eos/cms/store/relval/' + os.environ['DD_RELEASE'] + '/' + os.environ[
0086             'DD_SAMPLE'] + '/' + os.environ['DD_TIER'] + '/' + os.environ['DD_COND']
0087         os.environ['data'] = '/' + os.environ['DD_SAMPLE'] + '/' + os.environ['DD_RELEASE'] + '-' + os.environ[
0088             'DD_COND'] + '/' + os.environ['DD_TIER']
0089         os.environ['outputFile'] = 'electronHistos.' + os.environ['DD_SAMPLE_OUT'] + '_gedGsfE.root'
0090         if ('inputPostFile' not in os.environ) or (os.environ['inputPostFile'] == ''):
0091             print('inputPostFile : %s' % os.environ['outputFile'])
0092             os.environ['inputPostFile'] = os.environ['outputFile']
0093 
0094         print('DD_RELEASE', os.environ['DD_RELEASE'])
0095         print('DD_SAMPLE', os.environ['DD_SAMPLE'])
0096         print('DD_SAMPLE_OUT', os.environ['DD_SAMPLE_OUT'])
0097         print('DD_COND', os.environ['DD_COND'])
0098         print('DD_TIER', os.environ['DD_TIER'])
0099         print('DD_SOURCE', os.environ['DD_SOURCE'])
0100         print('data', os.environ['data'])
0101         print('outputFile    :', os.environ['outputFile'])
0102         print('inputPostFile :', os.environ['inputPostFile'])
0103         print('beginTag : ', self.beginTag())