5 AddVariable.cpp
Renata Kopecná edited this page 2022-01-27 14:58:17 +01:00

Functions used to add various branches to the preselected or MVAed trees. KshortDecayInVelo option is more-or-less obsolete as the Kshort analysis didn't need to dig into the TRUE MC variables.

Table of Contents

Global variables:

  • bool bkgSample = false
    • If set to true, it meas one of the B0, K1 or Inclusive samples are used. This is needed as some information is missing in these tuples.

Functions:

std::string tmpAdress()

Used to define what background sample should be used. The adress is hardcoded! This was easier to modify than setting a whole new function with booleans desiding which of the B0, K1 or Inclusive samples are used.

  • Parameters
    • string year
    • string magnet
  • Return
    • The path to the desired background tuple for given year and polarity.

Adding TRUE pi0 variables

int addPi0TRUEVariables()

Ading TRUE pi0 four-momentum variables (PX, PY, PZ, PE, PT, ETA, PHI and M) for the sample defined by the input parameters. Moreover, adds TRUE PX, PY, PZ, PT and PE to B+, K*+, K+, mu+ and mu-. The BDTed option decides whether the branches will be added to the tuple with or without the MVA cut (the tuples with/out the MVA cut are saved separately). Saves the new tuple in a new tree and then rewrites the old tree file with the new file.

  • Parameters
    • string year
    • int Run
    • string magnet
    • bool BDTed
    • bool ReferenceChannel
    • bool PHSP
    • bool KshortDecayInVelo
  • Return
    • If something fails 0, otherwise 1.

int addPi0TRUEVariablesAllYearMC()

Calls addPi0TRUEVariables() for both polarities before the MVA selection.

  • Parameters
    • string year
    • bool ReferenceChannel
    • bool PHSP
  • Return
    • If something fails 0, otherwise 1.

int addPi0TRUEVariablesAllMC()

Calls addPi0TRUEVariablesAllYearMC() for all years.

  • Parameters
    • int Run
    • bool ReferenceChannel
    • bool PHSP
  • Return
    • If something fails 0, otherwise 1.

int addPi0TRUEVariablesAllMC()

Calls addPi0TRUEVariablesAllMC() for all MC samples (signal, reference, PHSP).

  • Parameters
    • int Run
  • Return
    • If something fails 0, otherwise 1.

Adding missing variables

int addVariable()

Adds PX, PY, PZ, PE, PT to the particle specified as input.

  • Parameters
    • string year
    • int Run
    • string magnet
    • bool Preselected
    • bool BDTed
    • bool TM
    • bool ReferenceChannel
    • bool PHSP
    • bool KshortDecayInVelo
    • string particle
  • Return
    • If something fails 0, otherwise 1.

int addAllVariables()

Calls addVariable() for B_plus, K_star_plus, pi_zero_resolved, K_plus, gamma1, gamma2, mu_minus and mu_plus.

  • Parameters
    • string year
    • int Run
    • string magnet
    • bool Preselected
    • bool BDTed
    • bool TM
    • bool ReferenceChannel
    • bool PHSP
    • bool KshortDecayInVelo
  • Return
    • If something fails 0, otherwise 1.

int addAllVariablesAllYearMC()

Calls addAllVariables() for all possible polarities.

  • Parameters
    • string year
    • bool ReferenceChannel
    • bool PHSP
  • Return
    • If something fails 0, otherwise 1.

int addAllVariablesAllMC()

Calls addAllVariablesAllYearMC() for all years for a given Run.

  • Parameters
    • int Run
    • bool ReferenceChannel
    • bool PHSP
  • Return
    • If something fails 0, otherwise 1.

int addAllVariablesAllMCSamples()

Calls addAllVariablesAllMC() for signal, reference and PHSP.

  • Parameters
    • int Run
  • Return
    • If something fails 0, otherwise 1.

Adding KplusMuMu and pi0MuMu mass

int addXMuMuMass()

Calculates KplusMuMu (Kplus=True) or pi0MuMu mass (Kplus=False) and adds the branch to the tree. Moreover, takes the existing K+, pi0, mu+ and mu- branches, add PX, PY, PZ and PE to them.

  • Parameters
    • bool Kplus
    • bool DTF
    • string year
    • string magnet
    • int Run
    • bool MC
    • bool ReferenceChannel
    • bool PHSP
    • bool KshortDecayInVelo
  • Return
    • If something fails 0, otherwise 1.

int addAllXMuMuMass()

Calls addXMuMuMass() for all years for the given Run.

  • Parameters
    • bool Kplus
    • bool DTF
    • int Run
    • bool MC
    • bool ReferenceChannel
    • bool PHSP
  • Return
    • If something fails 0, otherwise 1.

int addAllXMuMuMass()

Calls addAllXMuMuMass() for data, signal MC, reference MC and PHSP MC.

  • Parameters
    • bool Kplus
    • bool DTF
    • int Run
  • Return
    • If something fails 0, otherwise 1.

Applying KplusMuMu and pi0MuMu vetos

int applyVetoKplusMuMuMass()

Removes all events with 5179 MeV < M_KplusMuMu < 5379 MeV.

  • Parameters
    • string year
    • string magnet
    • int Run
    • bool MC
    • bool ReferenceChannel
    • bool PHSP
    • bool KshortDecayInVelo
  • Return
    • If something fails 0, otherwise 1.

int applyAllVetoKplusMuMuMass()

Calls applyVetoKplusMuMuMass() for all years for the given Run.

  • Parameters
    • int Run
    • bool MC
    • bool ReferenceChannel
    • bool PHSP
  • Return
    • If something fails 0, otherwise 1.

int applyAllVetoKplusMuMuMass()

Calls applyAllVetoKplusMuMuMass() for data, signal MC, reference MC and PHSP MC.

  • Parameters
    • int Run
  • Return
    • If something fails 0, otherwise 1.

int applyVetoPizMuMuMass()

Removes all events with M_PizMuMu < 3700 MeV in the Jpsi Q2 region.

  • Parameters
    • string year
    • string magnet
    • int Run
    • bool MC
  • Return
    • If something fails 0, otherwise 1.

int applyVetoPizMuMuMass()

Calls applyVetoPizMuMuMass() for all years and polarities for given Run.

  • Parameters

    • int Run
  • Return

    • If something fails 0, otherwise 1. VetoKplusMuMuMass() Calls applyAllVetoKplusMuMuMass() for data, signal MC, reference MC and PHSP MC.
  • Parameters

    • int Run
  • Return

    • If something fails 0, otherwise 1.

int applyVetoPizMuMuMass()

Removes all events with M_PizMuMu < 3700 MeV in the Jpsi Q2 region.

  • Parameters
    • string year
    • string magnet
    • int Run
    • bool MC
  • Return
    • If something fails 0, otherwise 1.

int applyVetoPizMuMuMass()

Calls applyVetoPizMuMuMass() for all years and polarities for given Run.

  • Parameters
    • int Run
  • Return
    • If something fails 0, otherwise 1.