seeds#

Methods related to creating event and object seeds.

Functions:

create_seed(val[, n_hex])

Create a seed from an integer value by hashing it and returning the trailing 64 bit integer.

Classes:

deterministic_event_seeds(*args[, ...])

deterministic_object_seeds(*args[, ...])

deterministic_jet_seeds(*args[, ...])

deterministic_electron_seeds(*args[, ...])

deterministic_photon_seeds(*args[, ...])

deterministic_seeds(*args[, requires_func, ...])

create_seed(val, n_hex=16)[source]#

Create a seed from an integer value by hashing it and returning the trailing 64 bit integer.

Return type:

int

class deterministic_event_seeds(*args, requires_func=law.util.no_value, setup_func=law.util.no_value, sandbox=law.util.no_value, call_force=law.util.no_value, max_chunk_size=law.util.no_value, pick_cached_result=law.util.no_value, inst_dict=None, **kwargs)[source]#

Bases: Producer

Methods:

call_func(events, **kwargs)

Produces deterministic event seeds and stores them in events which is also returned.

init_func()

Producer initialization that adds columns to the set of used columns based on the event_columns, object_count_columns, and object_columns lists.

setup_func(reqs, inputs, reader_targets)

Setup function that defines conventions methods needed during the producer function.

skip_func()

update_cls_dict(cls_name, cls_dict, get_attr)

Attributes:

call_func(events, **kwargs)#

Produces deterministic event seeds and stores them in events which is also returned.

Strategy: :rtype: Array

  1. gather a selection of unambiguous integer features

  2. multiply them with a vector of primes

  3. use the resulting integer as an input to sha256 and hex-digest the result

  4. reverse it and int-cast the leading 16 characters, leading to a 64 bit int

Note

When using object_columns, the event seeds depend on the position of the particular objects per event. It is up to the user to bring them into the desired order before invoking this producer.

data_only = False#
event_columns = [<Route 'Pileup.nPU' (tags=optional)>]#
init_func()#

Producer initialization that adds columns to the set of used columns based on the event_columns, object_count_columns, and object_columns lists.

Return type:

None

mc_only = False#
nominal_only = False#
object_columns = [<Route 'Electron.jetIdx' (tags=optional)>, <Route 'Electron.seediPhiOriY' (tags=optional)>, <Route 'Muon.jetIdx' (tags=optional)>, <Route 'Muon.nStations' (tags=optional)>, <Route 'Tau.jetIdx' (tags=optional)>, <Route 'Tau.decayMode' (tags=optional)>, <Route 'Jet.nConstituents' (tags=optional)>, <Route 'Jet.nElectrons' (tags=optional)>, <Route 'Jet.nMuons' (tags=optional)>]#
object_count_columns = [<Route 'Jet.nConstituents' (tags=optional)>, <Route 'FatJet.pt' (tags=optional)>, <Route 'SubJet.pt' (tags=optional)>, <Route 'Photon.pt' (tags=optional)>, <Route 'Muon.jetIdx' (tags=optional)>, <Route 'Electron.jetIdx' (tags=optional)>, <Route 'Tau.jetIdx' (tags=optional)>, <Route 'SV.pt' (tags=optional)>, <Route 'GenJet.pt' (tags=optional)>, <Route 'GenPart.pt' (tags=optional)>]#
produces = {'deterministic_seed'}#
setup_func(reqs, inputs, reader_targets)#

Setup function that defines conventions methods needed during the producer function.

Return type:

None

shifts_only = None#
skip_func()#
static update_cls_dict(cls_name, cls_dict, get_attr)#
uses = {'event', 'luminosityBlock', 'run'}#
class deterministic_object_seeds(*args, requires_func=law.util.no_value, setup_func=law.util.no_value, sandbox=law.util.no_value, call_force=law.util.no_value, max_chunk_size=law.util.no_value, pick_cached_result=law.util.no_value, inst_dict=None, **kwargs)[source]#

Bases: Producer

Attributes:

Methods:

call_func(events, **kwargs)

Base class to produce object-specific random seeds.

init_func()

rtype:

None

setup_func(reqs, inputs, reader_targets)

Setup before entering the event chunk loop.

abstract property object_field: str#
abstract property prime_offset: int#
call_func(events, **kwargs)[source]#

Base class to produce object-specific random seeds.

Produces deterministic seeds for each object in object_field and stores them in events which is also returned. The object-specific seeds are based on the event seeds like the ones produced by deterministic_event_seeds() which is not called by this producer for the purpose of of modularity. The strategy for producing seeds is identical.

Parameters:

events (Array) – The events array.

Return type:

Array

Returns:

The events array with the object seeds stored in object_field.deterministic_seed.

Note

The object seeds depend on the position of the particular object in the event. It is up to the user to bring them into the desired order before invoking this producer.

init_func()[source]#
Return type:

None

setup_func(reqs, inputs, reader_targets)[source]#

Setup before entering the event chunk loop.

Saves the primes in an numpy array for later use.

Parameters:
  • reqs (dict) – Resolved requirements (not used).

  • inputs (dict) – Dictionary for inputs (not used).

  • reader_targets (InsertableDict) – Dictionary for additional column to retrieve (not used).

Return type:

None

class deterministic_jet_seeds(*args, requires_func=law.util.no_value, setup_func=law.util.no_value, sandbox=law.util.no_value, call_force=law.util.no_value, max_chunk_size=law.util.no_value, pick_cached_result=law.util.no_value, inst_dict=None, **kwargs)#

Bases: deterministic_object_seeds

Attributes:

object_field = 'Jet'#
prime_offset = 50#
class deterministic_electron_seeds(*args, requires_func=law.util.no_value, setup_func=law.util.no_value, sandbox=law.util.no_value, call_force=law.util.no_value, max_chunk_size=law.util.no_value, pick_cached_result=law.util.no_value, inst_dict=None, **kwargs)#

Bases: deterministic_object_seeds

Attributes:

object_field = 'Electron'#
prime_offset = 60#
class deterministic_photon_seeds(*args, requires_func=law.util.no_value, setup_func=law.util.no_value, sandbox=law.util.no_value, call_force=law.util.no_value, max_chunk_size=law.util.no_value, pick_cached_result=law.util.no_value, inst_dict=None, **kwargs)#

Bases: deterministic_object_seeds

Attributes:

object_field = 'Photon'#
prime_offset = 70#
class deterministic_seeds(*args, requires_func=law.util.no_value, setup_func=law.util.no_value, sandbox=law.util.no_value, call_force=law.util.no_value, max_chunk_size=law.util.no_value, pick_cached_result=law.util.no_value, inst_dict=None, **kwargs)[source]#

Bases: Producer

Methods:

call_func(events, **kwargs)

Wrapper producer that invokes deterministic_event_seeds() and deterministic_jet_seeds().

skip_func()

update_cls_dict(cls_name, cls_dict, get_attr)

Attributes:

call_func(events, **kwargs)#

Wrapper producer that invokes deterministic_event_seeds() and deterministic_jet_seeds().

Return type:

Array

data_only = False#
mc_only = False#
nominal_only = False#
produces = {<class 'columnflow.production.cms.seeds.deterministic_event_seeds'>, <class 'columnflow.production.cms.seeds.deterministic_jet_seeds'>}#
shifts_only = None#
skip_func()#
static update_cls_dict(cls_name, cls_dict, get_attr)#
uses = {<class 'columnflow.production.cms.seeds.deterministic_event_seeds'>, <class 'columnflow.production.cms.seeds.deterministic_jet_seeds'>}#