diff --git a/AddVariable.cpp.md b/AddVariable.cpp.md index abe10d3..5dd1d9b 100644 --- a/AddVariable.cpp.md +++ b/AddVariable.cpp.md @@ -1,6 +1,219 @@ 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:](#global-variables) +* [Functions and their parameters:](#functions-and-their-parameters) + * [std::string tmpAdress()](#stdstring-tmpadress) + * [Adding TRUE pi0 variables](#adding-true-pi0-variables) + * [int addPi0TRUEVariables()](#int-addpi0truevariables) + * [int addPi0TRUEVariablesAllYearMC()](#int-addpi0truevariablesallyearmc) + * [int addPi0TRUEVariablesAllMC()](#int-addpi0truevariablesallmc) + * [int addPi0TRUEVariablesAllMC()](#int-addpi0truevariablesallmc-1) + * [Adding missing variables](#adding-missing-variables) + * [int addVariable()](#int-addvariable) + * [int addAllVariables()](#int-addallvariables) + * [int addAllVariablesAllYearMC()](#int-addallvariablesallyearmc) + * [int addAllVariablesAllMC()](#int-addallvariablesallmc) + * [int addAllVariablesAllMCSamples()](#int-addallvariablesallmcsamples) + * [Adding KplusMuMu and pi0MuMu mass](#adding-kplusmumu-and-pi0mumu-mass) + * [int addXMuMuMass()](#int-addxmumumass) + * [int addAllXMuMuMass()](#int-addallxmumumass) + * [int addAllXMuMuMass()](#int-addallxmumumass-1) + * [Applying KplusMuMu and pi0MuMu vetos](#applying-kplusmumu-and-pi0mumu-vetos) + * [int applyVetoKplusMuMuMass()](#int-applyvetokplusmumumass) + * [int applyAllVetoKplusMuMuMass()](#int-applyallvetokplusmumumass) + * [int applyAllFunctions used to add various branches to the preselected or MVAed trees.](#int-applyallfunctions-used-to-add-various-branches-to-the-preselected-or-mvaed-trees) + + +## 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 and their parameters: +### 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()](#int-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()](#int-addpi0truevariablesallyearmc) for all years. +* **Parameters** + * int Run + * bool ReferenceChannel + * bool PHSP +* **Return** + * If something fails 0, otherwise 1. + +### int addPi0TRUEVariablesAllMC() +Calls [addPi0TRUEVariablesAllMC()](#int-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()](#int-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()](#int-addallvariables) for all possible polarities. +* **Parameters** + * string year + * bool ReferenceChannel + * bool PHSP +* **Return** + * If something fails 0, otherwise 1. + + +### int addAllVariablesAllMC() +Calls [addAllVariablesAllYearMC()](#int-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()](#int-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()](#int-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()](#int-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()](#int-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 applyAllFunctions 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. + ## Global variables: * bool bkgSample = false @@ -181,6 +394,30 @@ Calls [applyVetoKplusMuMuMass()](#int-applyvetokplusmumumass) for all years for ### int applyAllVetoKplusMuMuMass() Calls [applyAllVetoKplusMuMuMass()](#int-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()](#int-applyvetopizmumumass()) for all years and polarities for given `Run`. +* **Parameters** + * int Run +* **Return** + * If something fails 0, otherwise 1. +VetoKplusMuMuMass() +Calls [applyAllVetoKplusMuMuMass()](#int-applyallvetokplusmumumass) for data, signal MC, reference MC and PHSP MC. + * **Parameters** * int Run * **Return**