Beispiel #1
0
    def plasma_search_flag(self,value):
        """
        :param value, a string, the plasma search method
        """
        # Check the type
        self.__plasma_search_flag = checkAndSetInstance(str,value,None)

        # Check the value
        con = lpdi.Constants()
        not_valid_option = True
        try:
            for i in list(range(con.size("PlasmaSearch"))):
                if value == con.varValue("PlasmaSearch",i):
                    not_valid_option = not_valid_option and False
        except:
            err = sys.exc_info()
            print("Error type: " + str(err[0]))
            print("Error value: " + str(err[1]))
            print("Error traceback: " + str(err[2]))
            not_valid_option = True
        if not_valid_option:
           raise ValueError("Unknown plasma_search_flag: " + str(value))
Beispiel #2
0
    def point_simulation_method(self,value):
        """
        :param value, a string, the charge simulation method
        """
        # Check the type
        self.__point_simulation_method = checkAndSetInstance(str,value,None)

        # Check the value
        con = lpdi.Constants()
        not_valid_option = True
        try:
            for i in list(range(con.size("ChargeProp"))):
                if value == con.varValue("ChargeProp",i):
                    not_valid_option = not_valid_option and False
        except:
            err = sys.exc_info()
            print("Error type: " + str(err[0]))
            print("Error value: " + str(err[1]))
            print("Error traceback: " + str(err[2]))
            not_valid_option = True
        if not_valid_option:
            raise ValueError("Unknown point_simulation_method: " + str(value))
Beispiel #3
0
    def detector_type(self,value):
        """
        :param value, a string with the detector name
        """
        # Check the type
        self.__detector_type = checkAndSetInstance(str,value,None)

        # Check the value
        con = lpdi.Constants()
        not_valid_option = True
        try:
            for i in list(range(con.size("DetectorType"))):
                if value == con.varValue("DetectorType",i):
                    not_valid_option = not_valid_option and False
        except:
            err = sys.exc_info()
            print("Error type: " + str(err[0]))
            print("Error value: " + str(err[1]))
            print("Error traceback: " + str(err[2]))
            not_valid_option = True
        if not_valid_option:
            raise ValueError("Unknown detector type: " + str(value))