Changeset 12901 for fact/tools/pyscripts


Ignore:
Timestamp:
02/17/12 14:34:56 (13 years ago)
Author:
lusterma
Message:
added myhisto.py
Location:
fact/tools/pyscripts/tools
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/pyscripts/tools/fbsl.py

    r12820 r12901  
    66import numpy as np
    77
    8 import pyfact
     8import pyfact_rename
    99from myhisto import *
    1010from hist import *
     
    3434# rd.ReadBaseline( 'histo.root', 'bls_sum/hplt_mean' )
    3535
    36 rd.NEvents = 725
     36rd.NEvents = 70
    3737print 'processing N events ', rd.NEvents
    3838step     = 500
  • fact/tools/pyscripts/tools/submit.py

    r12898 r12901  
    3939
    4040if len( options.fname ) == 0:
    41         para_list = [ [ 'f12_1', 'f12_2', 'f12_3' ],
    42                                   [ 'f13_1', 'f13_2', 'f13_3' ],
    43                                   [ 'f14_1', 'f14_2', 'f14_3' ]
    44                                 ]
     41    para_list = [ [ 'f12_1', 'f12_2', 'f12_3' ],
     42                  [ 'f13_1', 'f13_2', 'f13_3' ],
     43                  [ 'f14_1', 'f14_2', 'f14_3' ]
     44                  ]
    4545else:
    46         print 'read para list from file: ', options.fname
    47         para_list = []
     46    print 'read para list from file: ', options.fname
     47    para_list = []
    4848
    4949job_fname = options.script + '_' + options.job + '.py'
    5050       
     51for run in para_list:
     52    """ loop over all runs
     53   
     54    - create the program text
     55    - save it to disk
     56    - submit the job
    5157
    52 for run in para_list:
    53         """ loop over all runs
    54         - create the program text
    55         - save it to disk
    56         - submit the job
    57         """
    58         pl = ''
    59         for opt in run:
    60                 pl += '\'' + opt + '\','
     58    """
     59
     60    pl = ''
     61    for opt in run:
     62        pl += '\'' + opt + '\','
    6163        #pl = pl[:-1] # remove the last comma
    6264       
    6365        cmd = 'ana = ' + options.job + '( ' + pl + ')'
    64 
     66       
    6567        # compose the text of the program script
    6668        prg_text = """
     
    7577# end of script"""
    7678       
    77         # print 'program:'
    78         # print prg_text
    79         # print
     79# print 'program:'
     80# print prg_text
     81# print
     82
     83# save the program to disk
     84file = open( job_fname, 'w' )
     85file.write( prg_text )
     86file.close()
     87
     88# submit the program script
     89shell_cmd = 'qsub -S/usr/bin/python -V -q ' + options.queue + ' ', options.job
     90print 'shell_cmd: ', shell_cmd
     91os.system( 'python ' + job_fname )     
    8092       
    81         # save the program to disk
    82         file = open( job_fname, 'w' )
    83         file.write( prg_text )
    84         file.close()
    85        
    86         # submit the program script
    87         shell_cmd = 'qsub -S/usr/bin/python -V -q ' + options.queue + ' ', options.job
    88         print 'shell_cmd: ', shell_cmd
    89         os.system( 'python ' + job_fname )     
    90        
Note: See TracChangeset for help on using the changeset viewer.