pocket_coffea.lib.calibrators.common package

Contents

pocket_coffea.lib.calibrators.common package#

Submodules#

pocket_coffea.lib.calibrators.common.common module#

class pocket_coffea.lib.calibrators.common.common.ElectronsScaleCalibrator(params, metadata, do_variations=True, **kwargs)#

Bases: Calibrator

calibrate(events, orig_colls, variation, already_applied_calibrators=None)#

The events objects is passed to the calibrator alongside a dictionary with the original collection. the calibrated_collections are computed and returned to the manager. The method is called also for variations not defined by the correct calibrator. In this was the calibrator can react and customize its output depending on the requested variation.

The calibrator MUST NOT replace in place the events collection. The CalibratorsManager will take care of replacing the collection and of possible coordination between calibrators.

If the variation is not handled by the calibrator, it should return the nominal collection, or the collection that is supposed to be returned in case of no variation.

A list of the calibrators already applied to the events is passed to the calibrator. This is useful for the calibrators that need to know which calibrators have been already applied to the events.

calibrated_collections: List[str] = ['Electron.pt', 'Electron.pt_original', 'Electron.energyErr']#
has_variations: ClassVar[bool] = True#
initialize(events)#

Method called once for chunk for the calibrator to prepare all the necessary data. The list of the variations is set here depending on the chunk metadata. N.B: the events object is passed to the calibrator before any calibrator is applied. If the calibrator prepares the variation values here, it is not incorporating the changes that may be applied by other calibrators. If the user want to prepare the variations based on the events calibrated in the chain, it should be done in the calibrate method.

isMC_only: ClassVar[bool] = False#
name: ClassVar[str] = 'electron_scale_and_smearing'#
class pocket_coffea.lib.calibrators.common.common.JetsCalibrator(params, metadata, do_variations, **kwargs)#

Bases: Calibrator

This calibator applies the JEC to the jets and their uncertainties. The set of calibrations to be applied is defined in the parameters file under the jets_calibration.collection section. All the jet types that have apply_jec_MC or apply_jec_Data set to True will be calibrated. If the pT regression is requested for a jet type, it should be done by the JetsPtRegressionCalibrator, this calibrator will raise an exception if configured to apply pT regression.

apply_regression(jets, jet_type, regression_params=None)#

Apply pT regression to jets.

Parameters:
  • jets – Jets collection to apply regression on

  • jet_type – Type of jet regression to apply

  • regression_params – Parameters for regression selection cuts

Returns:

Dictionary with calibrated jet collection Mask of jets where regression was applied

apply_variation(out, jet_type, variation_type, direction)#
calibrate(events, orig_colls, variation, already_applied_calibrators=None)#

The events objects is passed to the calibrator alongside a dictionary with the original collection. the calibrated_collections are computed and returned to the manager. The method is called also for variations not defined by the correct calibrator. In this was the calibrator can react and customize its output depending on the requested variation.

The calibrator MUST NOT replace in place the events collection. The CalibratorsManager will take care of replacing the collection and of possible coordination between calibrators.

If the variation is not handled by the calibrator, it should return the nominal collection, or the collection that is supposed to be returned in case of no variation.

A list of the calibrators already applied to the events is passed to the calibrator. This is useful for the calibrators that need to know which calibrators have been already applied to the events.

has_variations: ClassVar[bool] = True#
initialize(events)#

Method called once for chunk for the calibrator to prepare all the necessary data. The list of the variations is set here depending on the chunk metadata. N.B: the events object is passed to the calibrator before any calibrator is applied. If the calibrator prepares the variation values here, it is not incorporating the changes that may be applied by other calibrators. If the user want to prepare the variations based on the events calibrated in the chain, it should be done in the calibrate method.

isMC_only: ClassVar[bool] = False#
name: ClassVar[str] = 'jet_calibration'#
class pocket_coffea.lib.calibrators.common.common.JetsSoftdropMassCalibrator(params, metadata, do_variations, **kwargs)#

Bases: Calibrator

This calibator applies the JEC to the softdrop mass of AK8 jets. The set of calibrations to be applied is defined in the parameters file under the jets_calibration.collection section. All the jet types that have apply_jec_MC or apply_jec_Data set to True will be calibrated. If the pT regression is requested for a jet type, it should be done by the JetsPtRegressionCalibrator, this calibrator will raise an exception if configured to apply pT regression.

calibrate(events, orig_colls, variation, already_applied_calibrators=None)#

The events objects is passed to the calibrator alongside a dictionary with the original collection. the calibrated_collections are computed and returned to the manager. The method is called also for variations not defined by the correct calibrator. In this was the calibrator can react and customize its output depending on the requested variation.

The calibrator MUST NOT replace in place the events collection. The CalibratorsManager will take care of replacing the collection and of possible coordination between calibrators.

If the variation is not handled by the calibrator, it should return the nominal collection, or the collection that is supposed to be returned in case of no variation.

A list of the calibrators already applied to the events is passed to the calibrator. This is useful for the calibrators that need to know which calibrators have been already applied to the events.

has_variations: ClassVar[bool] = True#
initialize(events)#

Method called once for chunk for the calibrator to prepare all the necessary data. The list of the variations is set here depending on the chunk metadata. N.B: the events object is passed to the calibrator before any calibrator is applied. If the calibrator prepares the variation values here, it is not incorporating the changes that may be applied by other calibrators. If the user want to prepare the variations based on the events calibrated in the chain, it should be done in the calibrate method.

isMC_only: ClassVar[bool] = False#
name: ClassVar[str] = 'msoftdrop_calibration'#
class pocket_coffea.lib.calibrators.common.common.METCalibrator(params, metadata, do_variations=True, **kwargs)#

Bases: Calibrator

calibrate(events, orig_colls, variation, already_applied_calibrators=None)#

From `https://indico.cern.ch/event/1644923/contributions/6916115/attachments/3211593/5720863/260202_JMEGeneral_Type1METWithNano_Nurfikri.pdf

has_variations: ClassVar[bool] = True#
initialize(events)#

Method called once for chunk for the calibrator to prepare all the necessary data. The list of the variations is set here depending on the chunk metadata. N.B: the events object is passed to the calibrator before any calibrator is applied. If the calibrator prepares the variation values here, it is not incorporating the changes that may be applied by other calibrators. If the user want to prepare the variations based on the events calibrated in the chain, it should be done in the calibrate method.

isMC_only: ClassVar[bool] = False#
name: ClassVar[str] = 'met_type1_calibration'#
class pocket_coffea.lib.calibrators.common.common.MuonsCalibrator(params, metadata, do_variations=True, **kwargs)#

Bases: Calibrator

calibrate(events, orig_colls, variation, already_applied_calibrators=None)#

The events objects is passed to the calibrator alongside a dictionary with the original collection. the calibrated_collections are computed and returned to the manager. The method is called also for variations not defined by the correct calibrator. In this was the calibrator can react and customize its output depending on the requested variation.

The calibrator MUST NOT replace in place the events collection. The CalibratorsManager will take care of replacing the collection and of possible coordination between calibrators.

If the variation is not handled by the calibrator, it should return the nominal collection, or the collection that is supposed to be returned in case of no variation.

A list of the calibrators already applied to the events is passed to the calibrator. This is useful for the calibrators that need to know which calibrators have been already applied to the events.

calibrated_collections: List[str] = ['Muon.pt', 'Muon.pt_original', 'Muon.energyErr']#
has_variations: ClassVar[bool] = True#
initialize(events)#

Method called once for chunk for the calibrator to prepare all the necessary data. The list of the variations is set here depending on the chunk metadata. N.B: the events object is passed to the calibrator before any calibrator is applied. If the calibrator prepares the variation values here, it is not incorporating the changes that may be applied by other calibrators. If the user want to prepare the variations based on the events calibrated in the chain, it should be done in the calibrate method.

isMC_only: ClassVar[bool] = False#
name: ClassVar[str] = 'muons_scale_and_resolution'#

Module contents#

class pocket_coffea.lib.calibrators.common.ElectronsScaleCalibrator(params, metadata, do_variations=True, **kwargs)#

Bases: Calibrator

calibrate(events, orig_colls, variation, already_applied_calibrators=None)#

The events objects is passed to the calibrator alongside a dictionary with the original collection. the calibrated_collections are computed and returned to the manager. The method is called also for variations not defined by the correct calibrator. In this was the calibrator can react and customize its output depending on the requested variation.

The calibrator MUST NOT replace in place the events collection. The CalibratorsManager will take care of replacing the collection and of possible coordination between calibrators.

If the variation is not handled by the calibrator, it should return the nominal collection, or the collection that is supposed to be returned in case of no variation.

A list of the calibrators already applied to the events is passed to the calibrator. This is useful for the calibrators that need to know which calibrators have been already applied to the events.

calibrated_collections: List[str] = ['Electron.pt', 'Electron.pt_original', 'Electron.energyErr']#
has_variations: ClassVar[bool] = True#
initialize(events)#

Method called once for chunk for the calibrator to prepare all the necessary data. The list of the variations is set here depending on the chunk metadata. N.B: the events object is passed to the calibrator before any calibrator is applied. If the calibrator prepares the variation values here, it is not incorporating the changes that may be applied by other calibrators. If the user want to prepare the variations based on the events calibrated in the chain, it should be done in the calibrate method.

isMC_only: ClassVar[bool] = False#
name: ClassVar[str] = 'electron_scale_and_smearing'#
class pocket_coffea.lib.calibrators.common.JetsCalibrator(params, metadata, do_variations, **kwargs)#

Bases: Calibrator

This calibator applies the JEC to the jets and their uncertainties. The set of calibrations to be applied is defined in the parameters file under the jets_calibration.collection section. All the jet types that have apply_jec_MC or apply_jec_Data set to True will be calibrated. If the pT regression is requested for a jet type, it should be done by the JetsPtRegressionCalibrator, this calibrator will raise an exception if configured to apply pT regression.

apply_regression(jets, jet_type, regression_params=None)#

Apply pT regression to jets.

Parameters:
  • jets – Jets collection to apply regression on

  • jet_type – Type of jet regression to apply

  • regression_params – Parameters for regression selection cuts

Returns:

Dictionary with calibrated jet collection Mask of jets where regression was applied

apply_variation(out, jet_type, variation_type, direction)#
calibrate(events, orig_colls, variation, already_applied_calibrators=None)#

The events objects is passed to the calibrator alongside a dictionary with the original collection. the calibrated_collections are computed and returned to the manager. The method is called also for variations not defined by the correct calibrator. In this was the calibrator can react and customize its output depending on the requested variation.

The calibrator MUST NOT replace in place the events collection. The CalibratorsManager will take care of replacing the collection and of possible coordination between calibrators.

If the variation is not handled by the calibrator, it should return the nominal collection, or the collection that is supposed to be returned in case of no variation.

A list of the calibrators already applied to the events is passed to the calibrator. This is useful for the calibrators that need to know which calibrators have been already applied to the events.

has_variations: ClassVar[bool] = True#
initialize(events)#

Method called once for chunk for the calibrator to prepare all the necessary data. The list of the variations is set here depending on the chunk metadata. N.B: the events object is passed to the calibrator before any calibrator is applied. If the calibrator prepares the variation values here, it is not incorporating the changes that may be applied by other calibrators. If the user want to prepare the variations based on the events calibrated in the chain, it should be done in the calibrate method.

isMC_only: ClassVar[bool] = False#
name: ClassVar[str] = 'jet_calibration'#
class pocket_coffea.lib.calibrators.common.METCalibrator(params, metadata, do_variations=True, **kwargs)#

Bases: Calibrator

calibrate(events, orig_colls, variation, already_applied_calibrators=None)#

From `https://indico.cern.ch/event/1644923/contributions/6916115/attachments/3211593/5720863/260202_JMEGeneral_Type1METWithNano_Nurfikri.pdf

has_variations: ClassVar[bool] = True#
initialize(events)#

Method called once for chunk for the calibrator to prepare all the necessary data. The list of the variations is set here depending on the chunk metadata. N.B: the events object is passed to the calibrator before any calibrator is applied. If the calibrator prepares the variation values here, it is not incorporating the changes that may be applied by other calibrators. If the user want to prepare the variations based on the events calibrated in the chain, it should be done in the calibrate method.

isMC_only: ClassVar[bool] = False#
name: ClassVar[str] = 'met_type1_calibration'#