def expand_all(): go_to_main_dir() print "copying files" copy_file() del_file() print "modifying files" mod_file.mod_file('./Source/MadWeight_File/mod_file/MW_pos', opt={'nowarning': """['DESACTIVATE_CUT']"""})
def expand_all(echap=[]): go_to_main_dir() print("copying files") copy_file(echap) del_file() print("modifying files") opt = {} opt['nowarning'] = """['DESACTIVATE_CUT','DESACTIVATE_BW_CUT','get_user_params','main_make','obj_for_MW']""" mod_file.mod_file('./Source/MadWeight/mod_file/MW_pos', opt=opt)
def expand_all(echap=[]): go_to_main_dir() print "copying files" copy_file(echap) del_file() print "modifying files" opt = {} opt["nowarning"] = """['DESACTIVATE_CUT','DESACTIVATE_BW_CUT','get_user_params','main_make','obj_for_MW']""" mod_file.mod_file("./Source/MadWeight/mod_file/MW_pos", opt=opt)
def verif_event(MWparam): # 0 ############## #### go to main directory and copy file go_to_main_dir() try: os.mkdir('./Events/'+MWparam.name) except: pass os.system('cp ./Events/input.lhco ./Events/'+MWparam.name+'/') # 1 ############## #### take run information for MW_dir in MWparam.MW_listdir: select=Lhco_filter(MW_dir,'input.lhco',MWparam)
def verif_event(MWparam): # 0 ############## #### go to main directory and copy file go_to_main_dir() try: os.mkdir('./Events/' + MWparam.name) except: pass os.system('cp ./Events/input.lhco ./Events/' + MWparam.name + '/') # 1 ############## #### take run information for MW_dir in MWparam.MW_listdir: select = Lhco_filter(MW_dir, 'input.lhco', MWparam)
def restrict_event_passing_cut(MWparam): """ return the number of events in a (previous) run which pass the 'new' cut """ # 0 ############## #### go to main directory and copy file go_to_main_dir() try: os.mkdir('./Events/'+MWparam.name) except: pass os.system('cp ./SubProcesses/'+MWparam.MW_listdir[0]+'/'+MWparam.old_name+'/verif.lhco ./Events/'+MWparam.name+'/') # 1 ############## #### take run information MW_dir=MWparam.MW_listdir[0] filter=Lhco_filter(MW_dir,MWparam=MWparam,auto=0) return filter.verif_event(MWparam.name+'/verif.lhco',output=1) #output 1:return which event pass the cut
def collect_schedular(MW_param): go_to_main_dir() run_name=MW_param.name if MW_param.norm_with_cross: #check if we use normalisation by CS print 'collecting cross section results' for dir in MW_param.P_listdir: os.chdir('./SubProcesses/'+dir+'/schedular') Collect_P_dir(dir,MW_param) os.chdir('../../../') # suppress lhe file and vegas-grid Clean_event(run_name) print 'collecting output weight results' for dir in MW_param.MW_listdir: os.chdir('./SubProcesses/'+dir+'/schedular') Collect_MW_dir(dir,MW_param) os.chdir('../../../') All_Col=Collect_All_dir(MW_param)
def collect_schedular(MW_param): go_to_main_dir() run_name = MW_param.name if MW_param.norm_with_cross: #check if we use normalisation by CS print 'collecting cross section results' for dir in MW_param.P_listdir: os.chdir('./SubProcesses/' + dir + '/schedular') Collect_P_dir(dir, MW_param) os.chdir('../../../') # suppress lhe file and vegas-grid Clean_event(run_name) print 'collecting output weight results' for dir in MW_param.MW_listdir: os.chdir('./SubProcesses/' + dir + '/schedular') Collect_MW_dir(dir, MW_param) os.chdir('../../../') All_Col = Collect_All_dir(MW_param)
elif os.path.isdir(os.path.join(pos,element)): value,mess=self.suppress_dir(os.path.join(pos,element),opt) else: value=0 mess="unknow data type "+str(element)+str(os.path.isdir(element)) supress*=value if mess: message+=mess+'\n' if supress: if 'n' not in opt: os.rmdir(pos) if 's' not in opt: print 'delete dir',pos else: print 'schedulle removing directory',pos return 1,'' else: return 0,message #2 ######################################################################### if (__name__=='__main__'): from MW_param import go_to_main_dir go_to_main_dir() #Clean_event('fermi') #Clean_run('fermi') print 'no cleaning by default'
else: value = 0 mess = "unknow data type " + str(element) + str( os.path.isdir(element)) supress *= value if mess: message += mess + '\n' if supress: if 'n' not in opt: os.rmdir(pos) if 's' not in opt: print 'delete dir', pos else: print 'schedulle removing directory', pos return 1, '' else: return 0, message #2 ######################################################################### if (__name__ == '__main__'): from MW_param import go_to_main_dir go_to_main_dir() #Clean_event('fermi') #Clean_run('fermi') print 'no cleaning by default'
def collect_schedular(MW_param): go_to_main_dir() Collect_All(MW_param)