Package models
[hide private]
[frames] | no frames]

Source Code for Package models

 1  ################################################################################ 
 2  # 
 3  # Copyright (c) 2009 The MadGraph Development team and Contributors 
 4  # 
 5  # This file is a part of the MadGraph 5 project, an application which  
 6  # automatically generates Feynman diagrams and matrix elements for arbitrary 
 7  # high-energy processes in the Standard Model and beyond. 
 8  # 
 9  # It is subject to the MadGraph license which should accompany this  
10  # distribution. 
11  # 
12  # For more information, please visit: http://madgraph.phys.ucl.ac.be 
13  # 
14  ################################################################################ 
15  """All models for MG5, in particular UFO models (by FeynRules)""" 
16   
17  import os 
18  import sys 
19   
20 -def load_model(name):
21 22 # avoid final '/' in the path 23 if name.endswith('/'): 24 name = name[:-1] 25 26 path_split = name.split(os.sep) 27 if len(path_split) == 1: 28 model_pos = 'models.%s' % name 29 __import__(model_pos) 30 return sys.modules[model_pos] 31 else: 32 sys.path.insert(0, os.sep.join(path_split[:-1])) 33 __import__(path_split[-1]) 34 sys.path.pop(0) 35 return sys.modules[path_split[-1]]
36