def __init__(self,name='acceptance'): """read the card""" MW_param.go_to_main_dir() self.MWparam=MW_param.MW_info('MadWeight_card.dat') self.name=name self.dir=os.getcwd().split('/')[-1] os.system('mkdir Events/'+self.MWparam.name) os.system('mkdir Events/'+self.MWparam.name+'/Acceptance') create_param.Param_card(run_name=self.MWparam) self.MWparam.update_nb_card() os.chdir('..')
def define_new_phase_space_point(self, new_point): """ define the new card """ self.MWparam['mw_parameter']['1'] = 2 self.MWparam['mw_parameter']['2'] = 1 for i in range(1, len(new_point[-1]) + 1): self.MWparam['mw_parameter'][str(10 * i + 3)] = [] for j in range(0, len(new_point)): self.MWparam['mw_parameter'][str(10 * i + 3)].append( str(new_point[j][i - 1])) import create_param print 'before update', MWparam.nb_card, create_param.Param_card(run_name=MWparam) MWparam.update_nb_card() print 'after update', MWparam.nb_card
listdir = os.listdir('./Source/MadWeight/transfer_function/data') print('Available transfer functions:\n ', end=' ') print('\n '.join([ content[3:-4] for content in listdir if (content.startswith('TF') and content.endswith('dat')) ])) name = input('Choose your transfer Function\n') P_dir, MW_dir = detect_SubProcess(P_mode=1) os.chdir('./Source/MadWeight/transfer_function') change_tf.create_TF_main(name, 0, MW_dir) print(os.getcwd()) os.chdir('../../..') break if MWparam.run_opt['param']: create_param.Param_card(run_name=MWparam) MWparam.update_nb_card() Cards.create_include_file(MWparam) update_cuts_status(MWparam) if MWparam.run_opt['analyzer']: write_MadWeight.create_all_fortran_code(MWparam) if MWparam.run_opt['madweight_main']: Launch_all_SubProcess(MWparam) if MWparam.run_opt['plot']: import plot plot.Likelihood(mw_param=MWparam, auto=1) if MWparam['mw_run']['histo']: plot.Differential_Graph(MWparam, auto=1)