Esempio n. 1
0
    def convertSelector(self, eventSelector=None):
        '''Input:  Modify an EventSelector to switch to the new input connection strings
        Go from a list of connection strings or file names to a new list of connection strings

        convertSelector(self, eventSelector=None)

        If eventSelector is None, the default EventSelector will be found.
        If an event selector is passed, that one will be modified

        '''
        #don't do anything if _my_ type is MDF to avoid overwiting everything forever
        if self._inputPersistency == "MDF":
            return eventSelector

        if eventSelector is None:
            from Gaudi.Configuration import EventSelector
            eventSelector = EventSelector()

        if type(eventSelector.Input) is not list:
            return eventSelector

        eventSelector.Input = self.convertConnectionStrings(
            eventSelector.Input, "I")

        return eventSelector
Esempio n. 2
0
    def inputFiles(self, files, clear=False, eventSelector=None):
        '''Input: wrapper for IOHelper.inputFiles, where the persistency
        type is guessed from the file extension

        inputFiles(<list_of_files>, clear=False, eventSelector=None)

        if clear is True, empty the existing EventSelector list
        '''
        #print eventSelector
        #print eventSelector.__slots__

        if type(files) is not list:
            raise TypeError, "You need to pass a list of input files, but you passed a " + str(
                type(files)) + " instead"

        if eventSelector is None:
            from Gaudi.Configuration import EventSelector
            eventSelector = EventSelector()

        if clear:
            eventSelector.Input = []

        for file in files:
            eventSelector = self.getIOHelper(file).inputFiles(
                [file], clear=False, eventSelector=eventSelector)

        return eventSelector
Esempio n. 3
0
    def inputFiles(self, files, clear=False, eventSelector=None):
        '''Input:  Edit the content of EventSelector and fill the Inputs with
        Go from a list of connection strings or file names to a new list of connection strings

        inputFiles(self,files,clear=True, eventSelector=None)

        If eventSelector is None, the default EventSelector will be found.
        If an event selector is passed, that one will be modified

        If clear is True the original Inputs are overwritten.
        If clear is False the original Inputs are also kept.
        '''

        if type(files) is not list:
            raise TypeError, "You need to pass a list of files to InputFiles, you have passed a " + str(
                type(files)) + " instead"

        if eventSelector is None:
            from Gaudi.Configuration import EventSelector
            eventSelector = EventSelector()

        if clear:
            eventSelector.Input = []

        if not clear:
            self.convertSelector(eventSelector)

        for file in files:
            #never convert a dressed MDF file, it's not needed
            if self.detectFileType(file) == "MDF":
                eventSelector.Input.append(file)
                continue
            eventSelector.Input += [
                self.dressFile(self.undressFile(file), 'I')
            ]
        return eventSelector