• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python import_ufo.import_model函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中models.import_ufo.import_model函数的典型用法代码示例。如果您正苦于以下问题:Python import_model函数的具体用法?Python import_model怎么用?Python import_model使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了import_model函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_model_name

 def test_model_name(self):
     """ test that the model name is correctly set """
     self.assertEqual(self.base_model["name"], "sm")
     model = import_ufo.import_model('sm-full') 
     self.assertEqual(model["name"], "sm-full")
     model = import_ufo.import_model('sm-no_b_mass') 
     self.assertEqual(model["name"], "sm-no_b_mass")        
开发者ID:cesarotti,项目名称:MMAPS,代码行数:7,代码来源:test_import_ufo.py


示例2: test_simple_import

 def test_simple_import(self):
     """ check that basic quantity are define """
     
     #remove pkl file
     try:
         model_path = os.path.join(MG5DIR, 'models', 'sm')
         os.remove(os.path.join(model_path,'model.pkl'))
     except:
         pass
     
     import_ufo._import_once = []
     sm_path = import_ufo.find_ufo_path('sm')
     model = import_ufo.import_model(sm_path)
 
     self.assertNotEqual(model.get('particles'),None)
     self.assertNotEqual(model.get('particles'),[], "empty particles list")
 
     self.assertNotEqual(model.get('interactions'),None)
     self.assertNotEqual(model.get('interactions'),[])    
     
     
     # try with the pickle:
     sm_path = import_ufo.find_ufo_path('sm')
     model = import_ufo.import_model(sm_path)
 
     self.assertNotEqual(model.get('particles'),None)
     self.assertNotEqual(model.get('particles'),[], "empty particles list")
 
     self.assertNotEqual(model.get('interactions'),None)
     self.assertNotEqual(model.get('interactions'),[])            
开发者ID:harrypuuter,项目名称:tp1,代码行数:30,代码来源:test_link_to_ufo.py


示例3: setUp

 def setUp(self):
     self.base_model_scalar = import_ufo.import_model('uutt_tch_scalar')
     self.full_model_scalar = \
                            model_reader.ModelReader(self.base_model_scalar)
     self.full_model_scalar.set_parameters_and_couplings()
     
     self.base_model_4ferm = import_ufo.import_model('uutt_tch_4fermion')
     self.full_model_4ferm = \
                            model_reader.ModelReader(self.base_model_4ferm)
     self.full_model_4ferm.set_parameters_and_couplings()
开发者ID:harrypuuter,项目名称:tp1,代码行数:10,代码来源:test_4fermion_models.py


示例4: setUp

 def setUp(self):
     self.base_model_scalar = import_ufo.import_model('sextet_diquarks')
     self.full_model_scalar = \
                            model_reader.ModelReader(self.base_model_scalar)
     self.full_model_scalar.set_parameters_and_couplings()
     self.full_model_scalar.get('parameter_dict')['mdl_MSIX'] = 1.e5
     
     self.base_model_4ferm = import_ufo.import_model('uutt_sch_4fermion')
     self.full_model_4ferm = \
                            model_reader.ModelReader(self.base_model_4ferm)
     self.full_model_4ferm.set_parameters_and_couplings()
开发者ID:bendavid,项目名称:MadGraph5_aMC-NLO,代码行数:11,代码来源:test_4fermion_models.py


示例5: test_mssm_equivalence

    def test_mssm_equivalence(self):
        """Test the UFO and MG4 MSSM model correspond to the same model """
        
        # import UFO model
        sm_path = import_ufo.find_ufo_path('mssm')
        ufo_model = import_ufo.import_model(sm_path)
        #converter = import_ufo.UFOMG5Converter(model)
        #ufo_model = converter.load_model()
        ufo_model.pass_particles_name_in_mg_default()
        
        # import MG4 model
        model = base_objects.Model()
        if not MG4DIR:
            raise MadGraph5Error, "Please provide a valid MG/ME path with -d"
        v4_path = os.path.join(MG4DIR, 'models', 'mssm_v4')
        if not os.path.isdir(v4_path):
            v4_path = os.path.join(MG4DIR, 'Models', 'mssm')
            if not os.path.isdir(v4_path):
                raise MadGraph5Error, \
                      "Please provide a valid MG/ME path with -d"

        model.set('particles', files.read_from_file(
               os.path.join(v4_path,'particles.dat'),
               import_v4.read_particles_v4))
        model.set('interactions', files.read_from_file(
            os.path.join(v4_path,'interactions.dat'),
            import_v4.read_interactions_v4,
            model['particles']))
        
        model.pass_particles_name_in_mg_default()
        # Checking the particles
        for particle in model['particles']:
            ufo_particle = ufo_model.get("particle_dict")[particle['pdg_code']]
            self.check_particles(particle, ufo_particle)

        # Skip test below until equivalence has been created by Benj and Claude
        return

        
        # Checking the interactions
        nb_vertex = 0
        ufo_vertices = []
        for ufo_vertex in ufo_model['interactions']:
            pdg_code_ufo = [abs(part['pdg_code']) for part in ufo_vertex['particles']]
            int_name = [part['name'] for part in ufo_vertex['particles']]
            rep = (pdg_code_ufo, int_name)
            pdg_code_ufo.sort()
            ufo_vertices.append(pdg_code_ufo)
        mg4_vertices = []
        for vertex in model['interactions']:
            pdg_code_mg4 = [abs(part['pdg_code']) for part in vertex['particles']]
            pdg_code_mg4.sort()

            try:
                ufo_vertices.remove(pdg_code_mg4)
            except ValueError:
                mg4_vertices.append(pdg_code_mg4)

        self.assertEqual(ufo_vertices, [])  
        self.assertEqual(mg4_vertices, [])  
开发者ID:harrypuuter,项目名称:tp1,代码行数:60,代码来源:test_model_equivalence.py


示例6: load_model

    def load_model(self, name, use_mg_default, complex_mass=False):
        """load the model"""
        
        
        loop = False
        #if (name.startswith('loop_')):
        #    logger.info("The model in the banner is %s" % name)
        #    logger.info("Set the model to %s since only" % name[:5])
        #    logger.info("tree-level amplitudes are used for the decay ")
        #    name = name[5:]
        #    self.banner.proc_card.info['full_model_line'].replace('loop_','')

        logger.info('detected model: %s. Loading...' % name)
        model_path = name
        #base_model = import_ufo.import_model(model_path)

        # Import model
        base_model = import_ufo.import_model(name, decay=True,
                                               complex_mass_scheme=complex_mass)

        if use_mg_default:
            base_model.pass_particles_name_in_mg_default()
        
        self.model = base_model
        self.mg5cmd._curr_model = self.model
        self.mg5cmd.process_model()
开发者ID:liu0604,项目名称:MG5_aMC,代码行数:26,代码来源:interface_madspin.py


示例7: setUp

 def setUp(self):
     m_path = import_ufo.find_ufo_path("triplet_diquarks")
     self.base_model = import_ufo.import_model(m_path)
     self.full_model = model_reader.ModelReader(self.base_model)
     self.full_model.set_parameters_and_couplings()
     # Set top quark mass to 0 to compare with literature expression
     self.full_model.get("parameter_dict")["MT"] = 0.0
     self.full_model.get("parameter_dict")["WT"] = 0.0
开发者ID:harrypuuter,项目名称:tp1,代码行数:8,代码来源:test_diquark_models.py


示例8: setUp

 def setUp(self):
     m_path = import_ufo.find_ufo_path('triplet_diquarks')
     self.base_model = import_ufo.import_model(m_path)
     self.full_model = model_reader.ModelReader(self.base_model)
     self.full_model.set_parameters_and_couplings()
     # Set top quark mass to 0 to compare with literature expression
     self.full_model.get('parameter_dict')['mdl_MT'] = 0.
     self.full_model.get('parameter_dict')['mdl_WT'] = 0.
开发者ID:cesarotti,项目名称:MMAPS,代码行数:8,代码来源:test_diquark_models.py


示例9: load_IOTestsUnit

    def load_IOTestsUnit(self):
        """load the models and exporters if necessary."""
            
        if not hasattr(self, 'models') or \
           not hasattr(self, 'fortran_models') or \
           not hasattr(self, 'loop_exporters'):\
           
            self.models = { \
                'loop_sm' : import_ufo.import_model('loop_sm') 
                          }
            self.fortran_models = {
                'fortran_model' : helas_call_writers.FortranUFOHelasCallWriter(\
                                                         self.models['loop_sm']) 
                                  }
            
            self.loop_exporters = {
                'default' : loop_exporters.LoopProcessExporterFortranSA(\
                                  _mgme_file_path, _proc_file_path,
                                  {'clean':False, 'complex_mass':False, 
                                   'export_format':'madloop','mp':True,
                                   'loop_dir':_loop_file_path,
                                   'cuttools_dir':_cuttools_file_path,
                                   'fortran_compiler':'gfortran',
                                   'output_dependencies':'external'}),
                'optimized' : loop_exporters.\
                                  LoopProcessOptimizedExporterFortranSA(\
                                  _mgme_file_path, _proc_file_path,
                                  {'clean':False, 'complex_mass':False, 
                                   'export_format':'madloop','mp':True,
                                   'loop_dir':_loop_file_path,
                                   'cuttools_dir':_cuttools_file_path,
                                   'fortran_compiler':'gfortran',
                                   'output_dependencies':'external'})
                                  }
            
            # g g > t t~
            self.addIOTestsForProcess( testName = 'gg_ttx',
                                       testFolder = 'short_ML_SMQCD',
                                       particles_ids = [21,21,6,-6],
                                       exporters = self.loop_exporters,
                                       orders = {'QCD':2,'QED':0} )

            # d d > t t~ (only the proc files for this one)
            self.addIOTestsForProcess( testName = 'ddx_ttx',
                                       testFolder = 'short_ML_SMQCD',
                                       particles_ids = [1,-1,6,-6],
                                       exporters = self.loop_exporters,
                                       orders = {'QCD':2,'QED':0},
                                       files_to_check=IOTests.IOTest.proc_files)

            # And the loop induced g g > h h for good measure 
            # Use only one exporter only here
            self.addIOTestsForProcess( testName = 'gg_hh',
                                       testFolder = 'short_ML_SMQCD_LoopInduced',
                                       particles_ids = [21,21,25,25],
                                       exporters = self.loop_exporters['default'],
                                       orders = {'QCD': 2, 'QED': 2} )
开发者ID:cesarotti,项目名称:MMAPS,代码行数:57,代码来源:test_loop_exporters.py


示例10: setUp

    def setUp(self):
        """ prepare a model and the ParamCardWriter"""

        # load the SM
        self.model = import_ufo.import_model('sm')
        # initialize the main object 
        self.writter = writter.ParamCardWriter(self.model)
        self.content = StringIO.StringIO()
        self.writter.define_output_file(self.content)
        self.content.truncate(0) # remove the header
开发者ID:cirslinger,项目名称:Rutgers,代码行数:10,代码来源:test_write_param.py


示例11: __init__

 def __init__(self, model):
     
     self.model = model
     self.cmd = cmd_interface.MasterCmd()
     self.cmd.exec_cmd('set automatic_html_opening False')
     self.cmd.exec_cmd('import model %s --modelname' % model)
     self.cmd._curr_model = import_ufo.import_model(model, decay=True)
     
     self.particles_id = dict([(p.get('name'), p.get('pdg_code'))
                             for p in self.cmd._curr_model.get('particles')])
开发者ID:bendavid,项目名称:MadGraph5_aMC-NLO,代码行数:10,代码来源:decay_comparator.py


示例12: setUp

    def setUp(self):
        if not hasattr(self, 'mymodel') or \
           not hasattr(self, 'myleglist3') or \
           not hasattr(self, 'myproc1') or \
           not hasattr(self, 'myproc3'):

            myleglist1 = MG.LegList()
            # PROCESS: u g > u g 
            mylegs = [{'id': 2, 'number': 1, 'state': False},
                      {'id': 21, 'number': 2, 'state': False},
                      {'id': 2, 'number': 3, 'state': True},
                      {'id': 21, 'number': 4, 'state': True}]
            for i in mylegs:
                myleglist1.append(MG.Leg(i))
                
            myleglist3 = MG.LegList()
            # PROCESS: d d~ > u u~
            mylegs = [{'id': 1, 'number': 1, 'state': False},
                      {'id': -1, 'number': 2, 'state': False},
                      {'id': 2, 'number': 3, 'state': True},
                      {'id': -2, 'number': 4, 'state': True}]
            for i in mylegs:
                myleglist3.append(MG.Leg(i))

            mymodel = import_ufo.import_model('sm')

            dict1 = {'legs' : myleglist1, 'orders':{'QCD':10, 'QED':0},
                               'model': mymodel,
                               'id': 1,
                               'required_s_channels':[],
                               'forbidden_s_channels':[],
                               'forbidden_particles':[],
                               'is_decay_chain': False,
                               'orders': {'QED': 0, 'WEIGHTED':2},
                               'perturbation_couplings' : ['QCD'],
                               'decay_chains': MG.ProcessList(),
                               'overall_orders': {}}

            dict3 = {'legs' : myleglist3, 'orders':{'QCD':10, 'QED':0},
                               'model': mymodel,
                               'id': 1,
                               'required_s_channels':[],
                               'forbidden_s_channels':[],
                               'forbidden_particles':[],
                               'is_decay_chain': False,
                               'orders': {'QED': 0, 'WEIGHTED':2 },
                               'perturbation_couplings' : ['QCD'],
                               'decay_chains': MG.ProcessList(),
                               'overall_orders': {}}
            
            testFKSHelasObjects.mymodel = mymodel
            testFKSHelasObjects.myleglist3 = myleglist3
            testFKSHelasObjects.myproc1 = MG.Process(dict1)
            testFKSHelasObjects.myproc3 = MG.Process(dict3)
开发者ID:cesarotti,项目名称:MMAPS,代码行数:54,代码来源:test_fks_helas_objects.py


示例13: test_fks_ppzz_in_RS

    def test_fks_ppzz_in_RS(self):
        """"""

        p = [21, 1, 2, 3, -1, -2, -3 ]
        z_leg = MG.MultiLeg({'ids':[23], 'state': True})
        p_leg = MG.MultiLeg({'ids': p, 'state': False});
        my_multi_leglist = MG.MultiLegList([copy.copy(leg) for leg in [p_leg] * 2] \
                    + MG.MultiLegList([z_leg, z_leg]))
        mymodel = import_ufo.import_model('RS')
        my_process_definition = MG.ProcessDefinition({ \
                        'orders': {'WEIGHTED': 4},
                        'legs': my_multi_leglist,
                        'perturbation_couplings': ['QCD'],
                        'NLO_mode': 'real',
                        'model': mymodel})
        my_process_definitions = MG.ProcessDefinitionList(\
            [my_process_definition])

        my_multi_process = fks_base.FKSMultiProcess(\
                {'process_definitions': my_process_definitions})
        for born in my_multi_process['born_processes']:
            born_pdg_list = [l['id'] for l in born.born_proc['legs']]
            if born_pdg_list[0] == 21:
            # gg initiated
                self.assertEqual(len(born.born_amp['diagrams']), 1)
                for amp in born.real_amps:
                    if amp.pdgs[0] != 21 or amp.pdgs[1] != 21:
                        self.assertEqual(len(amp.amplitude['diagrams']), 12)
                    else:
                        self.assertEqual(len(amp.amplitude['diagrams']), 4)
            else:
            # qq initiated
                self.assertEqual(len(born.born_amp['diagrams']), 4)
                for amp in born.real_amps:
                    self.assertEqual(len(amp.amplitude['diagrams']), 12)

        my_helas_mp = fks_helas.FKSHelasMultiProcess(my_multi_process, gen_color = False)
        for born in my_helas_mp['matrix_elements']:
            born_pdg_list = [l['id'] for l in born.born_matrix_element['base_amplitude']['process']['legs']]
            if born_pdg_list[0] == 21:
            # gg initiated
                self.assertEqual(len(born.born_matrix_element['diagrams']), 1)
                for real in born.real_processes:
                    pdgs = [l['id'] for l in real.matrix_element['base_amplitude']['process']['legs']]
                    if pdgs[0] != 21 or pdgs[1] != 21:
                        self.assertEqual(len(real.matrix_element['diagrams']), 12)
                    else:
                        self.assertEqual(len(real.matrix_element['diagrams']), 4)
            else:
            # qq initiated
                self.assertEqual(len(born.born_matrix_element['diagrams']), 4)
                for real in born.real_processes:
                    self.assertEqual(len(real.matrix_element['diagrams']), 12)
开发者ID:bendavid,项目名称:MadGraph5_aMC-NLO,代码行数:53,代码来源:test_fks_helas_objects.py


示例14: setUp

 def setUp(self):
     """ creating the full model from scratch """
     CheckFileCreate.clean_files(self)
     
     #picklefile = os.path.join(MG5DIR,'models','sm','model.pkl') 
     #if not files.is_uptodate(picklefile):
     #    sm_path = import_ufo.find_ufo_path('sm')
     model = import_ufo.import_model('sm')
     #else:
     #    model = save_load_object.load_from_file(picklefile)
         
     export_v4.UFO_model_to_mg4(model, self.output_path).build()
开发者ID:harrypuuter,项目名称:tp1,代码行数:12,代码来源:test_model_equivalence.py


示例15: load_IOTestsAcceptance

    def load_IOTestsAcceptance(self):
        """load the models and exporters if necessary."""
        if not hasattr(self, 'models') or \
           not hasattr(self, 'fortran_models') or \
           not hasattr(self, 'loop_exporters'):\
           
            self.models = { \
                'loop_sm' : import_ufo.import_model('loop_sm') 
                          }
            self.fortran_models = {
                'fortran_model' : helas_call_writers.FortranUFOHelasCallWriter(\
                                                         self.models['loop_sm']) 
                                  }
            
            self.loop_exporters = {
                'default' : loop_exporters.LoopProcessExporterFortranSA(\
                                  _mgme_file_path, _proc_file_path,
                                  {'clean':False, 'complex_mass':False, 
                                   'export_format':'madloop','mp':True,
                                   'loop_dir':_loop_file_path,
                                   'cuttools_dir':_cuttools_file_path,
                                   'fortran_compiler':'gfortran',
                                   'output_dependencies':'external',
                                   'SubProc_prefix': '',
                                   'compute_color_flows': False}),
                'optimized' : loop_exporters.\
                                  LoopProcessOptimizedExporterFortranSA(\
                                  _mgme_file_path, _proc_file_path,
                                  {'clean':False, 'complex_mass':False, 
                                   'export_format':'madloop','mp':True,
                                   'loop_dir':_loop_file_path,
                                   'cuttools_dir':_cuttools_file_path,
                                   'fortran_compiler':'gfortran',
                                    'output_dependencies':'external',
                                    'SubProc_prefix': '',
                                   'compute_color_flows': False})
                                  }

            # d u~ > mu- vmx g
            self.addIOTestsForProcess( testName = 'dux_mumvmxg',
                                       testFolder = 'long_ML_SMQCD',
                                       particles_ids = [1,-2,13,-14,21],
                                       exporters = ['default','optimized'],
                                       orders = {'QCD': 1, 'QED': 2} )

            # g g > w- t b~ Single top (long but really includes everything)
            self.addIOTestsForProcess( testName = 'gg_wmtbx',
                                       testFolder = 'long_ML_SMQCD',
                                       particles_ids = [21,21,-24,6,-5],
                                       exporters = ['default','optimized'],
                                       orders = {'QCD': 2, 'QED': 1} )
开发者ID:bendavid,项目名称:MadGraph5_aMC-NLO,代码行数:51,代码来源:test_output_files.py


示例16: setUp

 def setUp(self):
     """ creating the full model from scratch """
     CheckFileCreate.setUp(self)
     os.system('cp %s %s' % (pjoin(MG5DIR,'Template', 'LO','Source',
                                   'make_opts'), '/tmp'))
     
     CheckFileCreate.clean_files(self)
     
     #picklefile = os.path.join(MG5DIR,'models','sm','model.pkl') 
     #if not files.is_uptodate(picklefile):
     #    sm_path = import_ufo.find_ufo_path('sm')
     model = import_ufo.import_model('sm')
     #else:
     #    model = save_load_object.load_from_file(picklefile)
         
     export_v4.UFO_model_to_mg4(model, self.output_path).build()
开发者ID:bendavid,项目名称:MadGraph5_aMC-NLO,代码行数:16,代码来源:test_model_equivalence.py


示例17: setUp

    def setUp(self):
       """Loading the different writers, exporters and model used for these
       IOTests"""

       if not hasattr(self, 'model'):
           self.model=import_ufo.import_model('loop_qcd_qed_sm-full')
           
       if not hasattr(self, 'exporter'):
           self.exporter = loop_exporters.\
                                  LoopProcessOptimizedExporterFortranSA(\
                                  _mgme_file_path, _proc_file_path,
                                  {'clean':False, 'complex_mass':False, 
                                   'export_format':'madloop','mp':True,
                                   'loop_dir':_loop_file_path,
                                   'cuttools_dir':_cuttools_file_path,
                                   'fortran_compiler':'gfortran',
                                   'output_dependencies':'external'})
开发者ID:restrepo,项目名称:DMLR-Toolbox,代码行数:17,代码来源:test_loop_exporters.py


示例18: test_sort_fks_proc

    def test_sort_fks_proc(self):
        """tests that two FKSProcesses with different legs order in the
        input process/amplitude are returned as equal. check also that
        born_proc has 'legs_with_decay' = madgraph.base_objects.LegList()"""
        model = import_ufo.import_model("sm")

        # sorted leglist for e+ e- > u u~ g
        myleglist_s = MG.LegList()
        myleglist_s.append(MG.Leg({"id": -11, "state": False}))
        myleglist_s.append(MG.Leg({"id": 11, "state": False}))
        myleglist_s.append(MG.Leg({"id": 2, "state": True}))
        myleglist_s.append(MG.Leg({"id": -2, "state": True}))
        myleglist_s.append(MG.Leg({"id": 21, "state": True}))

        # unsorted leglist: e+ e- > u g u~
        myleglist_u = MG.LegList()
        myleglist_u.append(MG.Leg({"id": -11, "state": False}))
        myleglist_u.append(MG.Leg({"id": 11, "state": False}))
        myleglist_u.append(MG.Leg({"id": 2, "state": True}))
        myleglist_u.append(MG.Leg({"id": 21, "state": True}))
        myleglist_u.append(MG.Leg({"id": -2, "state": True}))

        # define (un)sorted processes:
        proc_s = MG.Process({"model": model, "legs": myleglist_s, "orders": {"QED": 2, "QCD": 1}})
        proc_u = MG.Process({"model": model, "legs": myleglist_u, "orders": {"QED": 2, "QCD": 1}})
        # define (un)sorted amplitudes:
        amp_s = diagram_generation.Amplitude(proc_s)
        amp_u = diagram_generation.Amplitude(proc_u)

        fks_p_s = fks_base.FKSProcess(proc_s)
        fks_p_u = fks_base.FKSProcess(proc_u)

        self.assertEqual(fks_p_s.born_proc, fks_p_u.born_proc)
        self.assertEqual(fks_p_s.born_amp, fks_p_u.born_amp)

        fks_a_s = fks_base.FKSProcess(amp_s)
        fks_a_u = fks_base.FKSProcess(amp_u)

        self.assertEqual(fks_a_s.born_proc, fks_a_u.born_proc)
        self.assertEqual(fks_a_s.born_amp, fks_a_u.born_amp)

        self.assertEqual(fks_a_s.born_proc["legs_with_decays"], MG.LegList())
        self.assertEqual(fks_a_u.born_proc["legs_with_decays"], MG.LegList())
开发者ID:cesarotti,项目名称:MMAPS,代码行数:43,代码来源:test_fks_base.py


示例19: load_model

    def load_model(self, name, use_mg_default, complex_mass=False):
        """load the model"""

        loop = False

        logger.info("detected model: %s. Loading..." % name)
        model_path = name

        # Import model
        base_model = import_ufo.import_model(name, decay=False)

        if use_mg_default:
            base_model.pass_particles_name_in_mg_default()
        if complex_mass:
            base_model.change_mass_to_complex_scheme()

        self.model = base_model
        self.mg5cmd._curr_model = self.model
        self.mg5cmd.process_model()
开发者ID:cesarotti,项目名称:MMAPS,代码行数:19,代码来源:reweight_interface.py


示例20: do_generate_param_card

def do_generate_param_card(modelname, output):
    """Do the work for generating param_card.dat to <output> given
    the model name. We put this in a separate function so it can be called
    in a different process, because the imports below are sensitive to the
    model changing, so we need a new Python interpreter for each call"""

    # Modify sys.path so we can import the below objects
    # See: http://stackoverflow.com/questions/279237/import-a-module-from-a-relative-path/6098238#6098238
    cmd_folder = os.path.realpath(os.path.abspath(options.mg5_dir))
    if cmd_folder not in sys.path:
        sys.path.insert(0, cmd_folder)

    import madgraph.core.base_objects as base_objects
    import models.import_ufo as import_ufo
    import models.write_param_card as write_param_card

    model = import_ufo.import_model(modelname)
    writer = write_param_card.ParamCardWriter(model)
    writer.define_output_file(output)
    writer.write_card()
开发者ID:drglove,项目名称:scalar-physics,代码行数:20,代码来源:generate_events.py



注:本文中的models.import_ufo.import_model函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python info.getInfo函数代码示例发布时间:2022-05-27
下一篇:
Python favorite.Favorite类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap