def define_parameter(self,param_card):
        """define mass+width of all particle"""

        #load the information from the param card
        info=MW_param.read_card(param_card)

        for obj in self.content.values():
            obj.def_mass(info) #this routines defines also width if the particle is a propagator
Exemple #2
0
    def define_parameter(self, param_card):
        """define mass+width of all particle"""

        #load the information from the param card
        info = MW_param.read_card(param_card)

        for obj in self.content.values():
            obj.def_mass(
                info
            )  #this routines defines also width if the particle is a propagator
Exemple #3
0
    def __init__(self, info='default'):
        "initialize option"
        if isinstance(info, six.string_types) and info != 'default':
            info = MW_param.read_card(info)
        # DEFAULT VALUE:
        self.ecs_fuse = 1
        self.blob_fuse = 1
        self.use_sol_type_1 = 1
        self.use_sol_type_2 = 1
        self.use_sol_type_3 = 1
        self.max_sol = 10
        self.use_ecs_a = 1
        self.use_ecs_b = 1
        self.use_ecs_c = 1
        self.use_ecs_d = 1
        self.use_ecs_e = 1
        self.use_ecs_f = 1
        self.foce_nwa = 1e-9

        if info == 'default':
            return

        tag_to_genvar = {
            '1': 'self.ecs_fuse',
            '2': 'self.blob_fuse',
            '3': 'self.max_sol',
            '4': 'self.use_sol_type_1',
            '5': 'self.use_sol_type_2',
            '6': 'self.use_sol_type_3',
            '10': 'self.use_ecs_a',
            '11': 'self.use_ecs_b',
            '12': 'self.use_ecs_c',
            '13': 'self.use_ecs_d',
            '14': 'self.use_ecs_e',
            '15': 'self.use_ecs_f',
            'force_nwa': 'self.force_nwa'
        }

        #replace defined value:
        for key, value in info['mw_gen'].items():
            if key in tag_to_genvar:
                exec('%s = %s' % (tag_to_genvar[key], value))

        self.ecs_on = []
        for letter in 'abcdef':
            cond = 'self.use_ecs_' + letter
            if eval(cond):
                self.ecs_on.append(letter)

        #
        self.force_nwa = max(self.force_nwa, float(info['mw_run']['nwa']))
    def __init__(self,info='default'):
       "initialize option"
       if isinstance(info, basestring) and info!='default':
            info=MW_param.read_card(info)
       # DEFAULT VALUE:
       self.ecs_fuse=1
       self.blob_fuse=1
       self.use_sol_type_1=1
       self.use_sol_type_2=1
       self.use_sol_type_3=1
       self.max_sol=10
       self.use_ecs_a=1
       self.use_ecs_b=1
       self.use_ecs_c=1
       self.use_ecs_d=1
       self.use_ecs_e=1
       self.use_ecs_f=1
       self.foce_nwa = 1e-9

       if info=='default':
           return
       
       tag_to_genvar={'1':'self.ecs_fuse',
                      '2':'self.blob_fuse',
                      '3':'self.max_sol',
                      '4':'self.use_sol_type_1',
                      '5':'self.use_sol_type_2',
                      '6':'self.use_sol_type_3',
                      '10':'self.use_ecs_a',
                      '11':'self.use_ecs_b',
                      '12':'self.use_ecs_c',
                      '13':'self.use_ecs_d',
                      '14':'self.use_ecs_e',
                      '15':'self.use_ecs_f',
                      'force_nwa':'self.force_nwa'}

       #replace defined value:
       for key, value in info['mw_gen'].items():
           if key in tag_to_genvar:
               exec('%s = %s' % (tag_to_genvar[key],value))

       self.ecs_on=[]
       for letter in 'abcdef':
           cond='self.use_ecs_'+letter
           if eval(cond):
               self.ecs_on.append(letter)
               
       #
       self.force_nwa = max(self.force_nwa, float(info['mw_run']['nwa']))
Exemple #5
0
    def create_set_card(self, name):
        """ create all the card from schedular in file name """
        self.creating_card = 1  #tag to know card under creation
        self.wrong_generation = [
        ]  #can happen if fct is wrongly defined -> automatic desactivation

        if type(name) == str:
            self.MWparam = MW_param.read_card(name)
        else:
            self.MWparam = name

        if self.MWparam['mw_parameter']['2']:
            self.file_ParamInfo = open('./Cards/info_card.dat', 'a')
        else:
            print('define new mapping file')
            self.file_ParamInfo = open('./Cards/info_card.dat', 'w')

        param_list = self.create_change_tag(self.MWparam)

        if not self.source:
            self.charge_card('param_card.dat')
        if self.MWparam['mw_parameter']['1'] == 0:
            self.check_exist()
            self.define_mapping_file()
            return
        elif self.MWparam['mw_parameter']['1'] == 1:
            self.del_old_param()
            num = self.generated_uncorolated_card(param_list)
        elif self.MWparam['mw_parameter']['1'] == 2:
            self.del_old_param()
            num = self.generated_corolated_card(param_list)

        self.define_mapping_file()
        print('we have created ', num - 1, ' param_card\'s')
        if self.wrong_generation:
            print('but ', len(self.wrong_generation), ' are desactivated')

        if self.MWparam['mw_parameter']['2']:
            self.update_event_dir()
Exemple #6
0
    def create_set_card(self,name):
        """ create all the card from schedular in file name """
        self.creating_card=1 #tag to know card under creation
        self.wrong_generation=[] #can happen if fct is wrongly defined -> automatic desactivation
        
        if type(name)==str:
            self.MWparam=MW_param.read_card(name)
        else:
            self.MWparam=name
        
        if self.MWparam['mw_parameter']['2']:
            self.file_ParamInfo=open('./Cards/info_card.dat','a')	            
        else:
            print 'define new mapping file'
            self.file_ParamInfo=open('./Cards/info_card.dat','w')	            

        param_list=self.create_change_tag(self.MWparam)

        if not self.source:
            self.charge_card('param_card.dat')            
        if self.MWparam['mw_parameter']['1'] == 0:
            self.check_exist()
            self.define_mapping_file()
            return
        elif self.MWparam['mw_parameter']['1'] == 1:
            self.del_old_param()
            num=self.generated_uncorolated_card(param_list)
        elif self.MWparam['mw_parameter']['1'] == 2:
            self.del_old_param()
            num=self.generated_corolated_card(param_list)

        self.define_mapping_file()
        print 'we have created ',num-1,' param_card\'s'
        if self.wrong_generation:
            print 'but ',len(self.wrong_generation),' are desactivated'
                        
        if self.MWparam['mw_parameter']['2']:
            self.update_event_dir()
Exemple #7
0
 def charge_card(self, name):
     """ charge the card """
     self.source = name
     self.info = MW_param.read_card(name)
Exemple #8
0
 def charge_card(self,name):
     """ charge the card """
     self.source=name
     self.info=MW_param.read_card(name)