def combineWithSampleWeight(self, weightString): if weightString is None: return self.weightString if not type(weightString)==type(""): raise ValueError( "Need 'None' or string for weightString, got %s" % weightString ) if self.__weightStrings: logger.debug("For Sample %s: Combining weightString %s with sample weightString %s", \ self.name, weightString, self.weightString ) return helpers.combineStrings( [weightString]+self.__weightStrings, stringOperator = "*") else: logger.debug("For Sample %s: Return weightString %s because sample has no weightString", \ self.name, weightString ) return weightString
def combineWithSampleSelection(self, selectionString): if selectionString is None: return self.selectionString if not type(selectionString)==type(""): raise ValueError( "Need 'None' or string for selectionString, got %s" % selectionString ) if self.__selectionStrings: logger.debug("For Sample %s: Combining selectionString %s with sample selectionString %s", \ self.name, selectionString, self.selectionString ) return helpers.combineStrings( [selectionString]+self.__selectionStrings, stringOperator = "&&") else: logger.debug("For Sample %s: Return selectionString %s because sample has no selectionString", \ self.name, selectionString ) return selectionString
def weightString(self): return self.__weightStrings if type(self.__weightStrings)==type("") else helpers.combineStrings(self.__weightStrings, stringOperator = "*")
def selectionString(self): return self.__selectionStrings if type(self.__selectionStrings)==type("") else helpers.combineStrings(self.__selectionStrings, stringOperator = "&&")