pocket_coffea.parameters package#

Subpackages#

Submodules#

pocket_coffea.parameters.cuts module#

pocket_coffea.parameters.dask_env module#

pocket_coffea.parameters.dask_env.setup_dask(dask_config)#

pocket_coffea.parameters.defaults module#

pocket_coffea.parameters.defaults.compose_parameters_from_files(*files: List[str], update=True)#

Helper functions which loads separately the parameters in all the files and then merge then in order.

pocket_coffea.parameters.defaults.dump_parameters(conf: OmegaConf, outfile: str, overwrite=False)#
pocket_coffea.parameters.defaults.get_default_parameters()#

This function loads the default parameters from the PocketCoffea package for - pileup files - event flags - lumi - jet_scale_factors: btagSF, jetPuID - btagging - lepton_scale_factors.

The use can use this function to get a basic set of parameters to customize in each analysis.

pocket_coffea.parameters.defaults.get_default_run_options()#
pocket_coffea.parameters.defaults.get_defaults_and_compose(*files: List[str])#
pocket_coffea.parameters.defaults.merge_parameters(main_config: OmegaConf, *configs: List[OmegaConf], update=True)#

Utility function to update a config with a list of other configs. update=True means that if the key is already present elements are added to dictionaries and keys, and they are not just replaced.

This is needed because OmegaConf.merge does not allow just updating the content, but it always replaces the keys

pocket_coffea.parameters.defaults.merge_parameters_from_files(conf: OmegaConf, *kargs: List[str], update=True)#

Helper function to merge a list yaml files with parameters to an existing OmegaConf object.

The parameters files are loaded and merged in order. If update=True the configurations are added on top of each other merging existing dictionaries and lists. If update=False pre-existing keys are re-assigned to the new dictionary or list present in the merged configurations.

  • If you want to overwrite values without redefining completely a dictionary use update=True,

  • If you want to completely redefine a subkey use update=False

pocket_coffea.parameters.defaults.merge_parameters_from_string(conf: OmegaConf, *kargs: List, update=True)#

Helper function to merge a list of parameters to an existing OmegaConf object. Each element in the list is converted to a OmegaConf object before the merging. In this way one can use a list of dot-string to define a config.

N.B: if you want to merge yaml files use merge_parameters_from_files.

The parameters are loaded and merged in order.

If update=True the configurations are added on top of each other merging

existing dictionaries and lists. If update=False pre-existing keys are re-assigned to the new dictionary or list present in the merged configurations.

  • If you want to overwrite values without redefining completely a dictionary use update=True,

  • If you want to completely redefine a subkey use update=False

pocket_coffea.parameters.defaults.register_configuration_dir(key: str, directory: str)#

This function registers a new resolved in the OmegaConf library to prepend the correct path in a configuration.

E.g. ``` register_configuration_dir(“config_dir”,”/test/analysis/config”) # now this is possible in the configuration yaml ${config_dir:}/params/btagsf_calibration/test.yaml

pocket_coffea.parameters.histograms module#

pocket_coffea.parameters.histograms.count_hist(coll, bins=10, start=0, stop=9, label=None, name=None, **kwargs)#
pocket_coffea.parameters.histograms.ele_hists(coll='ElectronGood', pos=None, fields=None, name=None, axis_settings=None, **kwargs)#
pocket_coffea.parameters.histograms.fatjet_hists(coll='FatJetGood', pos=None, fields=None, name=None, axis_settings=None, **kwargs)#
pocket_coffea.parameters.histograms.jet_hists(coll='JetGood', pos=None, fields=None, name=None, axis_settings=None, **kwargs)#
pocket_coffea.parameters.histograms.lepton_hists(coll='LeptonGood', pos=None, fields=None, name=None, axis_settings=None, **kwargs)#
pocket_coffea.parameters.histograms.met_hists(coll='MET', pos=None, fields=None, name=None, axis_settings=None, **kwargs)#
pocket_coffea.parameters.histograms.muon_hists(coll='MuonGood', pos=None, fields=None, name=None, axis_settings=None, **kwargs)#
pocket_coffea.parameters.histograms.parton_hists(coll='PartonMatched', pos=None, fields=None, name=None, axis_settings=None, **kwargs)#
pocket_coffea.parameters.histograms.sv_hists(coll='SV', pos=None, fields=None, name=None, axis_settings=None, **kwargs)#

pocket_coffea.parameters.jec_config module#

pocket_coffea.parameters.lumi module#

pocket_coffea.parameters.lumi.femtobarn(picobarn, digits=None)#

Module contents#