def create_set_card(self,name):
        """ create all the card from schedular in file name """

        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:
            self.file_ParamInfo=open('./Cards/info_card.dat','w')	
        self.define_mapping_file()
            
        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_for0gen()
            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)

        print 'we have created ',num-1,' param_card\'s'

        if self.MWparam['mw_parameter']['2']:
            self.update_event_dir()
Beispiel #2
0
    def create_set_card(self, name):
        """ create all the card from schedular in file name """

        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:
            self.file_ParamInfo = open('./Cards/info_card.dat', 'w')
        self.define_mapping_file()

        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_for0gen()
            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)

        print 'we have created ', num - 1, ' param_card\'s'

        if self.MWparam['mw_parameter']['2']:
            self.update_event_dir()
Beispiel #3
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()
Beispiel #4
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()
 def charge_card(self,name):
     """ charge the card """
     self.source=name
     self.info=MW_param.read_card(name)
Beispiel #6
0
 def charge_card(self, name):
     """ charge the card """
     self.source = name
     self.info = MW_param.read_card(name)