Пример #1
0
    def __init__(self, name, id, configs=None, aux=None, context=None):
        UniqueObject.__init__(self, name, id, context=context)
        AuxDataMixin.__init__(self, aux=aux)

        # set initial configs
        if configs is not None:
            self.configs.extend(configs)
Пример #2
0
    def __init__(self,
                 name,
                 id,
                 campaign=None,
                 info=None,
                 processes=None,
                 label=None,
                 label_short=None,
                 is_data=False,
                 tags=None,
                 aux=None,
                 context=None,
                 **kwargs):
        UniqueObject.__init__(self, name, id, context=context)
        CopyMixin.__init__(self)
        AuxDataMixin.__init__(self, aux=aux)
        TagMixin.__init__(self, tags=tags)
        DataSourceMixin.__init__(self, is_data=is_data)
        LabelMixin.__init__(self, label=label, label_short=label_short)

        # instance members
        self._campaign = None
        self._info = {}

        # set initial values
        if campaign is not None:
            self.campaign = campaign
        if info is not None:
            self.info = info
        if kwargs and Shift.NOMINAL not in self.info:
            self.info = {Shift.NOMINAL: kwargs}

        # set initial processes
        if processes is not None:
            self.processes.extend(processes)
Пример #3
0
    def __init__(self,
                 name,
                 id,
                 xsecs=None,
                 processes=None,
                 color=None,
                 label=None,
                 label_short=None,
                 is_data=False,
                 tags=None,
                 aux=None,
                 context=None):
        UniqueObject.__init__(self, name, id, context=context)
        CopyMixin.__init__(self)
        AuxDataMixin.__init__(self, aux=aux)
        TagMixin.__init__(self, tags=tags)
        DataSourceMixin.__init__(self, is_data=is_data)
        LabelMixin.__init__(self, label=label, label_short=label_short)
        ColorMixin.__init__(self, color=color)

        # instance members
        self._xsecs = {}

        # set initial values
        if xsecs is not None:
            self.xsecs = xsecs

        # set initial child processes
        if processes is not None:
            self.extend_processes(processes)
Пример #4
0
    def __init__(self,
                 name,
                 id=UniqueObject.AUTO_ID,
                 channel=None,
                 categories=None,
                 label=None,
                 label_short=None,
                 selection=None,
                 selection_mode=None,
                 tags=None,
                 aux=None,
                 context=None):
        UniqueObject.__init__(self, name, id, context=context)
        CopyMixin.__init__(self)
        AuxDataMixin.__init__(self, aux=aux)
        TagMixin.__init__(self, tags=tags)
        SelectionMixin.__init__(self,
                                selection=selection,
                                selection_mode=selection_mode)
        LabelMixin.__init__(self, label=label, label_short=label_short)

        # register empty attributes
        self._channel = None

        # set initial values
        if channel is not None:
            self.channel = channel

        # set initial child categories
        if categories is not None:
            self.extend_categories(categories)
Пример #5
0
    def __init__(self,
                 campaign=None,
                 name=None,
                 id=None,
                 analysis=None,
                 datasets=None,
                 processes=None,
                 channels=None,
                 categories=None,
                 variables=None,
                 shifts=None,
                 aux=None,
                 context=None):
        # instance members
        self._campaign = None
        self._analysis = None

        # if name or id are None, campaign must be set
        # use the campaign setter for type validation first
        self.campaign = campaign
        if name is None:
            if self.campaign is None:
                raise ValueError("a name must be set when campaign is missing")
            name = self.campaign.name
        if id is None:
            if self.campaign is None:
                raise ValueError("an id must be set when campaign is missing")
            id = self.campaign.id

        UniqueObject.__init__(self, name=name, id=id, context=context)
        AuxDataMixin.__init__(self, aux=aux)

        # set initial values
        if analysis is not None:
            self.analysis = analysis

        if datasets is not None:
            self.datasets.extend(datasets)

        if processes is not None:
            self.processes.extend(processes)

        if channels is not None:
            self.channels.extend(channels)

        if categories is not None:
            self.categories.extend(categories)

        if variables is not None:
            self.variables.extend(variables)

        if shifts is not None:
            self.shifts.extend(shifts)
Пример #6
0
    def __init__(self,
                 name,
                 id=UniqueObject.AUTO_ID,
                 expression=None,
                 binning=(1, 0., 1.),
                 x_title="",
                 x_title_short=None,
                 y_title="Entries",
                 y_title_short=None,
                 x_labels=None,
                 log_x=False,
                 log_y=False,
                 unit="1",
                 unit_format="{title} / {unit}",
                 selection=None,
                 selection_mode=None,
                 tags=None,
                 aux=None,
                 context=None):
        UniqueObject.__init__(self, name, id, context=context)
        CopyMixin.__init__(self)
        AuxDataMixin.__init__(self, aux=aux)
        TagMixin.__init__(self, tags=tags)
        SelectionMixin.__init__(self,
                                selection=selection,
                                selection_mode=selection_mode)

        # instance members
        self._expression = None
        self._binning = None
        self._x_title = None
        self._x_title_short = None
        self._y_title = None
        self._y_title_short = None
        self._x_labels = None
        self._log_x = None
        self._log_y = None
        self._unit = None
        self._unit_format = None

        # set initial values
        self.expression = expression
        self.binning = binning
        self.x_title = x_title
        self.x_title_short = x_title_short
        self.y_title = y_title
        self.y_title_short = y_title_short
        self.x_labels = x_labels
        self.log_x = log_x
        self.log_y = log_y
        self.unit = unit
        self.unit_format = unit_format
Пример #7
0
    def __init__(self, keys=None, n_files=-1, n_events=-1, aux=None):
        CopyMixin.__init__(self)
        AuxDataMixin.__init__(self, aux=aux)

        # instance members
        self._keys = []
        self._n_files = -1
        self._n_events = -1

        # set initial values
        if keys is not None:
            self.keys = keys
        if n_files is not None:
            self.n_files = n_files
        if n_events is not None:
            self.n_events = n_events
Пример #8
0
    def __init__(self, name, id, type=None, label=None, label_short=None, tags=None, aux=None,
            context=None):
        UniqueObject.__init__(self, name, id, context=context)
        CopyMixin.__init__(self)
        AuxDataMixin.__init__(self, aux=aux)
        TagMixin.__init__(self, tags=tags)
        LabelMixin.__init__(self, label=label, label_short=label_short)

        # register empty attributes
        self._source = None
        self._direction = None
        self._type = self.RATE_SHAPE

        # set initial values
        self._source, self._direction = self.split_name(self.name)
        if type is not None:
            self.type = type
Пример #9
0
    def __init__(self,
                 name,
                 id,
                 categories=None,
                 label=None,
                 label_short=None,
                 tags=None,
                 aux=None,
                 context=None):
        UniqueObject.__init__(self, name, id, context=context)
        CopyMixin.__init__(self)
        AuxDataMixin.__init__(self, aux=aux)
        TagMixin.__init__(self, tags=tags)
        LabelMixin.__init__(self, label=label, label_short=label_short)

        # set initial categories
        if categories is not None:
            self.extend_categories(categories)
Пример #10
0
    def __init__(self, name, id, ecm=None, bx=None, datasets=None, tags=None, aux=None,
            context=None):
        UniqueObject.__init__(self, name, id, context=context)
        AuxDataMixin.__init__(self, aux=aux)
        TagMixin.__init__(self, tags=tags)

        # instance members
        self._ecm = None
        self._bx = None

        # set initial values
        if ecm is not None:
            self.ecm = ecm
        if bx is not None:
            self.bx = bx

        if datasets is not None:
            self.extend_datasets(datasets)