Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-25 02:29:44

0001 #! /usr/bin/env python
0002 import os
0003 import re
0004 import sys
0005 import subprocess
0006 
0007 #******************   template file  **********************************
0008 templateFile = open('templateForDropbox.txt', 'r')
0009 fileContents = templateFile.read(-1)
0010 print('--------------- TEMPLATE :  -----------------')
0011 print(fileContents)
0012 p1 = re.compile(r'TAGNAME')
0013 p2 = re.compile(r'PRODNAME')
0014 
0015 #******************   definitions  **********************************
0016 jec_type    = 'JetCorrectorParametersCollection'
0017 ERA         = 'Jec11_V10'
0018 ALGO_LIST   = [#'IC5Calo','IC5PF',
0019                'AK5Calo','AK5PF','AK5PFchs','AK5JPT'#,#'AK5TRK',
0020                'AK7Calo','AK7PF',
0021                'KT4Calo','KT4PF',
0022                #'KT6Calo','KT6PF'
0023                ]
0024 #*********************************************************************
0025 
0026 files = []
0027 
0028 
0029 ### L2+L3 Corrections
0030 for aa in ALGO_LIST: #loop for jet algorithms
0031 
0032     s1 = jec_type + '_' + ERA + '_' + aa
0033     s2 = jec_type + '_' + ERA + '_' + aa
0034     k1 = p1.sub( s1, fileContents )
0035     k2 = p2.sub( s2, k1 )
0036     k2outfile = s2 + '.txt'
0037     print('--------------------------------------')
0038     print('ORCOFF File for jet correction : ' + s2)
0039     print('Written to ' + k2outfile)
0040     FILE = open(k2outfile,"w")
0041     FILE.write(k2)       
0042     files.append( k2outfile )
0043     
0044 
0045 
0046 for ifile in files :
0047     s = "./dropBoxOffline_test.sh "+ERA+".db " + ifile
0048     print(s)
0049     subprocess.call( ["./dropBoxOffline_test.sh", ERA+".db", ifile])
0050