def __init__(self, input_type): InputType.__init__(self, input_type) TemplateLoader.__init__(self) self.templates = {} self.use_folders = [] self.ban_folders = [] self.use_plots = [] self.ban_plots = []
def __init__(self, input_type, template): ''' Initialize object with input type and histogram. Histogram will be cloned and automatically scaled to x-section, luminosity and number of Monte-Carlo processed events ''' InputType.__init__(self, input_type) # cache scale factor for future fast access self.__scale = (self.xsection * self.luminosity() / self.events) if self.events else 1 # histogram will be scaled upon set and scale factor need to be set Template.__init__(self, template = template)
def __str__(self): ''' Add lumi and scale numbers to InputType pretty print ''' return ("<{Class} lumi {lumi:.1f} fb-1 scale {scale:.2f} at 0x{ID:x}>\n" " + {InputTypeStr}\n" " + {TemplateStr}").format( Class = self.__class__.__name__, lumi = self.luminosity() / 1000, scale = self.scale, InputTypeStr = InputType.__str__(self), TemplateStr = Template.__str__(self), ID = id(self))