Package models :: Module build_restriction_lib
[hide private]
[frames] | no frames]

Source Code for Module models.build_restriction_lib

 1  ################################################################################ 
 2  # 
 3  # Copyright (c) 2012 The MadGraph5_aMC@NLO Development team and Contributors 
 4  # 
 5  # This file is a part of the MadGraph5_aMC@NLO 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 MadGraph5_aMC@NLO license which should accompany this  
10  # distribution. 
11  # 
12  # For more information, visit madgraph.phys.ucl.ac.be and amcatnlo.web.cern.ch 
13  # 
14  ################################################################################ 
15   
16   
17 -class Rule(object):
18 """ """ 19
20 - def __init__(self, name, default, data,first=True, inverted_display=False):
21 """ """ 22 self.name = name 23 self.default=default 24 self.status=default 25 self.lhablock = data[0].lower() 26 self.lhaid = data[1] 27 self.value = data[2] 28 self.first = first 29 if inverted_display: 30 self.display = lambda x: not x 31 else: 32 self.display = lambda x: x
33
34 -class Category(list):
35 """A container for the different rules""" 36
37 - def __init__(self, name, *args, **opt):
38 """store a title for those restriction category""" 39 40 self.name = name 41 list.__init__(self, *args, **opt)
42
43 - def add_options(self, name='', default='', inverted_display=False, rules=[]):
44 first=True 45 for arg in rules: 46 current_rule = Rule(name, default, arg, first, inverted_display) 47 self.append(current_rule) 48 first=False
49