seeds#
Methods related to creating event and object seeds.
Functions:
|
Create a seed from an integer value by hashing it and returning the trailing 64 bit integer. |
Classes:
|
|
|
|
|
|
|
|
|
|
|
- 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:
- class deterministic_event_seeds(*args, **kwargs)[source]#
Bases:
ProducerAttributes:
Methods:
call_func(events, **kwargs)Produces deterministic event seeds and stores them in events which is also returned.
init_func(**kwargs)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(task, reqs, inputs, ...)Setup function that defines conventions methods needed during the producer function.
skip_func(**kwargs)update_cls_dict(cls_name, cls_dict, get_attr)- cache_instances = True#
- call_func(events, **kwargs)#
Produces deterministic event seeds and stores them in events which is also returned.
Strategy: :rtype:
Arraygather a selection of unambiguous integer features
multiply them with a vector of primes
use the resulting integer as an input to sha256 and hex-digest the result
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(**kwargs)#
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:
- mc_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(task, reqs, inputs, reader_targets, **kwargs)#
Setup function that defines conventions methods needed during the producer function.
- Return type:
- static update_cls_dict(cls_name, cls_dict, get_attr)#
- uses = {'event', 'luminosityBlock', 'run'}#
- class deterministic_object_seeds(*args, **kwargs)[source]#
Bases:
ProducerAttributes:
Methods:
call_func(events, **kwargs)Base class to produce object-specific random seeds.
init_func(**kwargs)setup_func(task, reqs, inputs, ...)Setup before entering the event chunk loop.
- call_func(events, **kwargs)[source]#
Base class to produce object-specific random seeds.
Produces deterministic seeds for each object in
object_fieldand stores them in events which is also returned. The object-specific seeds are based on the event seeds like the ones produced bydeterministic_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:
- 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.
- setup_func(task, reqs, inputs, reader_targets, **kwargs)[source]#
Setup before entering the event chunk loop.
Saves the
primesin an numpy array for later use.
- cache_instances = True#
- class deterministic_jet_seeds(*args, **kwargs)#
Bases:
deterministic_object_seedsAttributes:
- cache_instances = True#
- object_field = 'Jet'#
- prime_offset = 50#
- class deterministic_electron_seeds(*args, **kwargs)#
Bases:
deterministic_object_seedsAttributes:
- cache_instances = True#
- object_field = 'Electron'#
- prime_offset = 60#
- class deterministic_photon_seeds(*args, **kwargs)#
Bases:
deterministic_object_seedsAttributes:
- cache_instances = True#
- object_field = 'Photon'#
- prime_offset = 70#
- class deterministic_seeds(*args, **kwargs)[source]#
Bases:
ProducerAttributes:
Methods:
call_func(events, **kwargs)Wrapper producer that invokes
deterministic_event_seeds()anddeterministic_jet_seeds().skip_func(**kwargs)update_cls_dict(cls_name, cls_dict, get_attr)- cache_instances = True#
- call_func(events, **kwargs)#
Wrapper producer that invokes
deterministic_event_seeds()anddeterministic_jet_seeds().- Return type:
- data_only = False#
- mc_only = False#
- produces = {<class 'columnflow.production.cms.seeds.deterministic_event_seeds'>, <class 'columnflow.production.cms.seeds.deterministic_jet_seeds'>}#
- 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'>}#