Namespace: Embedding

namespace embedding
namespace electron

Functions

ROOT::RDF::RNode PtCorrection_byValue(ROOT::RDF::RNode df, const std::string &outputname, const std::string &pt, const std::string &eta, const float &sf_barrel, const float &sf_endcap)

This function scales the \(p_T\) values of electrons depending on whether they fall within the barrel or endcap region of the detector. The correction factors are provided as input parameters.

Parameters:
  • df – input dataframe

  • outputname – name of the output column storing the corrected \(p_T\) values

  • pt – name of the input column containing \(p_T\) values

  • eta – name of the column containing eta values

  • sf_barrel – scale factor applied in the barrel region (|eta| <= 1.479)

  • sf_endcap – scale factor applied in the endcap region (|eta| > 1.479)

Returns:

a dataframe with the corrected \(p_T\) values

ROOT::RDF::RNode PtCorrection(ROOT::RDF::RNode df, correctionManager::CorrectionManager &correction_manager, const std::string &outputname, const std::string &pt, const std::string &eta, const std::string &es_file, const std::string &correction_name, const std::string &variation_barrel, const std::string &variation_endcap)

This function scales the \(p_T\) values of electrons based on their pseudorapidity (eta), applying different correction factors for the barrel and endcap regions of the detector.

Parameters:
  • df – input dataframe

  • correction_manager – correction manager responsible for loading the correction file

  • outputname – name of the output column storing the corrected electron \(p_T\)pT values

  • pt – name of the input column containing electron \(p_T\) values

  • eta – name of the column containing electron eta values

  • es_file – path to the correction file for the energy scale correction

  • correction_name – name of the correction in es_file

  • variation_barrel – variation for the barrel region, options are “nom”, “up”, “down”

  • variation_endcap – variation for the endcap region, options are “nom”, “up”, “down”

Returns:

a dataframe with the corrected \(p_T\) values

ROOT::RDF::RNode Scalefactor(ROOT::RDF::RNode df, correctionManager::CorrectionManager &correction_manager, const std::string &outputname, const std::string &pt, const std::string &eta, const std::string &sf_file, const std::string &sf_name, const std::string correction_type, const float &extrapolation_factor = 1.0)

This function calculates electron scale factors (SFs) that were measured by the tau embedding group for embedding samples. The scale factors are loaded from a correctionlib file using a specified scale factor name which defines the correction (e.g. ID, Iso, Trigger).

The tau embedding group also measured electron scale factors for simulated samples with the same T&P method as for embedding. Which scale factor is used can be specified by the correction_type parameter.

The variation is introduced via an extrapolation factor. This factor is applied on top of the scale factor, thereby varying the scale factor by a fixed percentage.

Note

If possible, the scale factors from the CMS POGs should be used for simulated samples because they have a more sofisticated treatment of systematic uncertainties.

Parameters:
  • df – input dataframe

  • correction_manager – correction manager responsible for loading the electron scale factor file

  • outputname – name of the output column containing the electron scale factor

  • pt – name of the column containing the transverse momentum of an electron

  • eta – name of the column containing the pseudorapidity of an electron

  • sf_file – path to the file containing the electron scale factors

  • sf_name – name of the electron scale factor correction, this parameter defines what is corrected ID, Iso or Trigger, e.g. “ID90_pt_bins_inc_eta”

  • correction_type – type of the correction, there are two options: emb for embedding and mc for simulation

  • extrapolation_factor – factor that is used to introduce percent type variations of the scale factor, default value is 1.0

Returns:

a new dataframe containing the new column

namespace muon

Functions

ROOT::RDF::RNode Scalefactor(ROOT::RDF::RNode df, correctionManager::CorrectionManager &correction_manager, const std::string &outputname, const std::string &pt, const std::string &eta, const std::string &sf_file, const std::string &sf_name, const std::string correction_type, const float &extrapolation_factor = 1.0)

This function calculates muon scale factors (SFs) that were measured by the tau embedding group for embedding samples. The scale factors are loaded from a correctionlib file using a specified scale factor name which defines the correction (e.g. ID, Iso, Trigger).

The tau embedding group also measured muon scale factors for simulated samples with the same T&P method as for embedding. Which scale factor is used can be specified by the correction_type parameter.

The variation is introduced via an extrapolation factor. This factor is applied on top of the scale factor, thereby varying the scale factor by a fixed percentage.

Note

If possible, the scale factors from the CMS POGs should be used for simulated samples because they have a more sofisticated treatment of systematic uncertainties.

Parameters:
  • df – input dataframe

  • correction_manager – correction manager responsible for loading the muon scale factor file

  • outputname – name of the output column containing the muon scale factor

  • pt – name of the column containing the transverse momentum of a muon

  • eta – name of the column containing the pseudorapidity of a muon

  • sf_file – path to the file containing the muon scale factors

  • sf_name – name of the muon scale factor correction, this parameter defines what is corrected ID, Iso or Trigger, e.g. “Trg_IsoMu27_pt_eta_bins”

  • correction_type – type of the correction, there are two options: emb for embedding and mc for simulation

  • extrapolation_factor – factor that is used to introduce percent type variations of the scale factor, default value is 1.0

Returns:

a new dataframe containing the new column

namespace scalefactor

Functions

ROOT::RDF::RNode SelectionTrigger(ROOT::RDF::RNode df, correctionManager::CorrectionManager &correction_manager, const std::string &outputname, const std::string &pt_1, const std::string &eta_1, const std::string &pt_2, const std::string &eta_2, const std::string &sf_file, const std::string &sf_name)

This function calculates a scale factor (SF) that corrects the bias in the trigger selection of events for the embedding method. The scale factors are measured by the tau embedding group and are loaded from a correctionlib file using a specified scale factor name.

For the calculation the two initially selected muons in data need to be provided.

Parameters:
  • df – input dataframe

  • correction_manager – correction manager responsible for loading the correction file

  • outputname – name of the output column containing the embedding selection trigger scale factor

  • pt_1\(p_T\) of the leading generator particle which corresponds to the leading muon selected by the embedding selection

  • eta_1\(\eta\) of the leading generator particle which corresponds to the leading muon selected by the embedding selection

  • pt_2\(p_T\) of the subleading generator particle which corresponds to the subleading muon selected by the embedding selection

  • eta_2\(\eta\) of the subleading generator particle which corresponds to the subleading muon selected by the embedding selection

  • sf_file – path to the file with the embedding selection trigger scale factors

  • sf_name – name of the embedding selection trigger scale factor correction e.g. “m_sel_trg_kit_ratio”

Returns:

a new dataframe containing the new column

ROOT::RDF::RNode SelectionId(ROOT::RDF::RNode df, correctionManager::CorrectionManager &correction_manager, const std::string &outputname, const std::string &pt, const std::string &eta, const std::string &sf_file, const std::string &sf_name)

This function calculates a scale factor (SF) that corrects the bias in the ID selection of muons in events for the embedding method. The scale factors are measured by the tau embedding group and are loaded from a correctionlib file using a specified scale factor name.

For the calculation the one of the two initially selected muons in data need to be provided.

Parameters:
  • df – input dataframe

  • correction_manager – correction manager responsible for loading the correction file

  • outputname – name of the output column containing the embedding selection ID scale factor

  • pt\(p_T\) of a generator particle which corresponds to one of the muons selected by the embedding selection

  • eta\(\eta\) of a generator particle which corresponds to one of the muons selected by the embedding selection

  • sf_file – tpath to the file with the embedding selection ID scale factors

  • sf_name – name of the embedding selection trigger scale factor correction e.g. “EmbID_pt_eta_bins”

Returns:

a new dataframe containing the new column

namespace tau

Functions

ROOT::RDF::RNode PtCorrection_byValue(ROOT::RDF::RNode df, const std::string &outputname, const std::string &pt, const std::string &decay_mode, const float &sf_dm0, const float &sf_dm1, const float &sf_dm10, const float &sf_dm11)

This function scales the \(p_T\) values of hadronic taus based on their decay mode. The correction factors are provided as input parameters.

Parameters:
  • df – input dataframe

  • outputname – name of the output column storing the corrected \(p_T\) values

  • pt – name of the input column containing \(p_T\) values

  • decay_mode – name of the column containing the tau decay modes

  • sf_dm0 – scale factor applied for decay mode 0

  • sf_dm1 – scale factor applied for decay mode 1

  • sf_dm10 – scale factor applied for decay mode 10

  • sf_dm11 – scale factor applied for decay mode 11

Returns:

a dataframe with the corrected \(p_T\) values

namespace scalefactor

Functions

ROOT::RDF::RNode Id_vsJet_lt(ROOT::RDF::RNode df, correctionManager::CorrectionManager &correction_manager, const std::string &outputname, const std::string &pt, const std::string &decay_mode, const std::string &gen_match, const std::string &sf_file, const std::string &sf_name, const std::vector<int> &selected_dms, const std::string &wp, const std::string &vsele_wp, const std::string &sf_dependence, const std::string &variation_pt20to25, const std::string &variation_pt25to30, const std::string &variation_pt30to35, const std::string &variation_pt35to40, const std::string &variation_pt40toInf)

This function calculates scale factors (SFs) for tau identification (ID) against jets (vsJet) for embedding samples. The scale factors are loaded from a correctionlib file using a specified scale factor name and variation. The variation and the scale factor itself is binned in transverse momenta ( \(p_T\)) of hadronic taus for this function. This dependence is usually used in semi-leptonic channels ( \(e\tau_h\), \(\mu\tau_h\)).

Description of the bit map used to define the tau ID against jets working points of the DeepTau v2.1 tagger. vsJets | Value | Bit (value used in the config) ———————————&#8212;|—-&#8212;|—-&#8212; no ID selection (takes every tau) | 0 | - VVVLoose | 1 | 1 VVLoose | 2 | 2 VLoose | 4 | 3 Loose | 8 | 4 Medium | 16 | 5 Tight | 32 | 6 VTight | 64 | 7 VVTight | 128 | 8

Warning

This function is depricated (used for legacy H(tt) analysis). It is recommended to use physicsobject::tau::scalefactor::Id_vsJet instead.

Parameters:
  • df – input dataframe

  • correction_manager – correction manager responsible for loading the tau scale factor file

  • outputname – name of the output column containing the vsJets ID scale factor

  • pt – name of the column containing the transverse momentum of a tau

  • decay_mode – name of the column containing the decay mode of the tau

  • gen_match – name of the column with the matching information of the hadronic tau to generator-level particles (matches are: 1=prompt e, 2=prompt mu, 3=tau->e, 4=tau->mu, 5=had. tau, 0=unmatched)

  • sf_file – path to the file with the tau scale factors

  • sf_name – name of the tau scale factor for the vsJet ID correction

  • selected_dms – list of allowed decay modes for which a scale factor should be calculated

  • wp – working point of the vsJet ID

  • vsele_wp – working point of the vsEle ID

  • sf_dependence – variable dependence of the scale factor, options are “pt” or “dm”

  • variation_pt20to25 – name of the scale factor variation for \(20 \leq p_T <25\) GeV, “nom” for nominal and “up”/”down” the up/down variation

  • variation_pt25to30 – name of the scale factor variation for \(25 \leq p_T <30\) GeV, “nom” for nominal and “up”/”down” the up/down variation

  • variation_pt30to35 – name of the scale factor variation for \(30 \leq p_T <35\) GeV, “nom” for nominal and “up”/”down” the up/down variation

  • variation_pt35to40 – name of the scale factor variation for \(35 \leq p_T <40\) GeV, “nom” for nominal and “up”/”down” the up/down variation

  • variation_pt40toInf – name of the scale factor variation for \(40 \leq p_T < \infty \) GeV, “nom” for nominal and “up”/”down” the up/down variation

Returns:

a new dataframe containing the new column