~maddevelopers/mg5amcnlo/3.4.0

« back to all changes in this revision

Viewing changes to madgraph/core/base_objects.py

  • Committer: olivier-mattelaer
  • Date: 2022-04-06 19:53:03 UTC
  • mfrom: (962.3.26 3.2.0_eft_running)
  • Revision ID: olivier-mattelaer-20220406195303-ikpe2rvh6olzimyw
merge with eft_running branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1046
1046
        self['version_tag'] = None # position of the directory (for security)
1047
1047
        self['gauge'] = [0, 1]
1048
1048
        self['case_sensitive'] = True
 
1049
        self['running_elements'] = []
1049
1050
        self['allow_pickle'] = True
1050
1051
        self['limitations'] = [] # MLM means that the model can sometimes have issue with MLM/default scale. 
 
1052
                                 # fix_scale means that the model should use fix_scale computation.
1051
1053
        # attribute which might be define if needed
1052
1054
        #self['name2pdg'] = {'name': pdg}
1053
1055
        
1424
1426
        return max([inter.get_WEIGHTED_order(self) for inter in \
1425
1427
                        self.get('interactions')])
1426
1428
            
 
1429
    def get_running(self, used_parameters=None):
 
1430
        """return a list of parameter which needs to be run together.
 
1431
           check also that at least one requested coupling is dependent of 
 
1432
           such running 
 
1433
        """
 
1434
        
 
1435
        correlated = []
 
1436
        
 
1437
        for key in self["running_elements"]:
 
1438
            for param_list in key.run_objects:
 
1439
                names = [k.name for k in param_list]
 
1440
                try:
 
1441
                    names.remove('aS')
 
1442
                except Exception:
 
1443
                    pass
 
1444
                # find all set of parameter where at least one paremeter are present
 
1445
                this_ones = set(names)
 
1446
                for subset in list(correlated):
 
1447
                    if any(n in subset for n in names):
 
1448
                        this_ones.update(subset)
 
1449
                        correlated.remove(subset)
 
1450
                correlated.append(this_ones)
 
1451
        
 
1452
        #filtering
 
1453
        if used_parameters:
 
1454
            for subset in list(correlated): 
 
1455
                if not any(n in subset for n in used_parameters):
 
1456
                    correlated.remove(subset)
 
1457
        
 
1458
        return correlated   
 
1459
 
 
1460
        
1427
1461
 
1428
1462
    def check_majoranas(self):
1429
1463
        """Return True if there is fermion flow violation, False otherwise"""
1944
1978
    depend = ('external',)
1945
1979
    type = 'real'
1946
1980
    
1947
 
    def __init__(self, name, value, lhablock, lhacode):
 
1981
    def __init__(self, name, value, lhablock, lhacode, scale=None):
1948
1982
        """Initialize a new ParamCardVariable
1949
1983
        name: name of the variable
1950
1984
        value: default numerical value
1955
1989
        self.value = value 
1956
1990
        self.lhablock = lhablock
1957
1991
        self.lhacode = lhacode
 
1992
        self.scale = scale
1958
1993
 
1959
1994
 
1960
1995
#===============================================================================