Add 'AddVariable.cpp'

Renata Kopecná 2022-01-27 12:16:51 +01:00
parent be96b6b468
commit c34a58edab

204
AddVariable.cpp.md Normal file

@ -0,0 +1,204 @@
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.
## 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.
### 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.
### int addVariable()
Adds PX, PY, PZ, PE, PT, M, P, ETA, PHI
* **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()
* **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()
* **Parameters**
* string year
* bool ReferenceChannel
* bool PHSP
* **Return**
* If something fails 0, otherwise 1.
### int addAllVariablesAllMC()
* **Parameters**
* int Run
* bool ReferenceChannel
* bool PHSP
* **Return**
* If something fails 0, otherwise 1.
### int addAllVariablesAllMCSamples()
* **Parameters**
* int Run
* **Return**
* If something fails 0, otherwise 1.
### int testFunction()
* **Parameters**
*
* **Return**
### int addXMuMuMass()
* **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()
* **Parameters**
* bool Kplus
* bool DTF
* int Run
* bool MC
* bool ReferenceChannel
* bool PHSP
* **Return**
* If something fails 0, otherwise 1.
### int addAllXMuMuMass()
* **Parameters**
* bool Kplus
* bool DTF
* int Run
* **Return**
* If something fails 0, otherwise 1.
### int applyVetoKplusMuMuMass()
* **Parameters**
* string year
* string magnet
* int Run
* bool MC
* bool ReferenceChannel
* bool PHSP
* bool KshortDecayInVelo
* **Return**
* If something fails 0, otherwise 1.
### int applyAllVetoKplusMuMuMass()
* **Parameters**
* int Run
* bool MC
* bool ReferenceChannel
* bool PHSP
* **Return**
### int applyAllVetoKplusMuMuMass()
* **Parameters**
* int Run
* **Return**
### int applyVetoPizMuMuMass()
* **Parameters**
* string year
* string magnet
* int Run
* bool MC
* **Return**
### int applyVetoPizMuMuMass()
* **Parameters**
* int Run
* **Return**