7.8.11. ksSelector#

The ksSelector is a module for MVA-based \(K^0_S\) selection. This KsSelector consists of two selection through MVA, V0Selector and LambdaVeto. The first is a MVA to discriminate \(K^0_S\) from mis-reconstructed \(K^0_S\) coming from IP. The second is a MVA to discriminate \(K^0_S\) and \(\Lambda\). Parameters for MVA training are selected not to raise bias in mass of \(K^0_S\) for true \(K^0_S\).

V0Selector#

For V0Selector, mainly kinematics of \(K^0_S\) and its daughter pions, flight length of \(K^0_S\) and number of hits in VXD are used for MVA training. The most dominant parameter for V0 selection is cosVertexMomentum, which represents the angle between vertex position and momentum of \(K^0_S\).

LambdaVeto#

For LambdaVeto, daughters’ protonID, Lambda_mass which is calculated assuming proton mass hypothesis for one of daughter pions, and kinematics of pions are used for MVA training. Two Lambda_mass parameters are dominant for LambdaVeto selection.

Tutorials#

An example tutorial for applying ksSelector to the existing \(K^0_S\) particleList is :

analysis/examples/tutorials/B2A910-ApplyKsSelector.py

An example tutorial for creating dataset for MVA training, which include true \(K^0_S\), \(\Lambda\), and mis-reconstructed \(K^0_S\) is :

analysis/examples/tutorials/B2A911-CreateTrainData.py

An example tutorial for training dataset is :

analysis/examples/tutorials/B2A912-TrainKsSelector.py

ksSelector Functions#

ksSelector.LambdaVeto_Training(train_data, tree_name='tree', mva_identifier='MVAFastBDT_LambdaVeto.root', target_variable='isSignal')[source]#

Defines the configuration of LambdaVeto Training. The training data should contain only K_S0 and Lambda0.

Parameters:
  • train_data – Root file containing Ks information to be trained.

  • tree_name – Tree name for variables.

  • mva_identifier – Name for output MVA weight file.

  • target_variable – Target variable for MVA training.

ksSelector.V0Selector_Training(train_data, tree_name='tree', mva_identifier='MVAFastBDT_V0Selector.root', target_variable='isSignal')[source]#

Defines the configuration of V0Selector Training. The training data should contain K_S0 and misreconstructed K_S0 without Lambda0.

Parameters:
  • train_data – Root file containing Ks information to be trained.

  • tree_name – Tree name for variables.

  • mva_identifier – Name for output MVA weight file.

  • target_variable – Target variable for MVA training.

ksSelector.add_default_ks_Selector_aliases()[source]#

This function is used to set up variables aliases for ks Selector variables.

ksSelector.add_variable_collection()[source]#

Call this function to add variable collection for ksSelector.

ksSelector.ksSelector(particleListName, identifier_Ks, identifier_vLambda, output_label_name='', extraInfoName_V0Selector='KsSelector_V0Selector', extraInfoName_LambdaVeto='KsSelector_LambdaVeto', useCustomThreshold=False, threshold_V0Selector=0.9, threshold_LambdaVeto=0.11, path=None)[source]#

This function will apply K_S0 selection MVA on the given particleList. By default this function appends MVA output as a extraInfo for the given particleList. You can apply preset cut or custom cut by giving parameters. In this case, a new particleList is created from the original particleList applying cuts on the MVA output.

Parameters:
  • particleLists – Reconstructed Ks -> pi+ pi- list.

  • output_label_name – Label of the returned Ks particleList. When empty ‘’, no cut is applied and new particleList is not created. When custom name, the custom threshold is used, and useCustomThreshold must be True. When ‘standard’, ‘tight’, or ‘loose’, a cut with Ks efficiency 90%, 95%, and 85% is applied.

  • extraInfoName_V0Selector – Variable name for V0Selector MVA output.

  • extraInfoName_LambdaVeto – Variable name for LambdaVeto MVA output.

  • identifier_Ks – Identifier name for V0Selector weight file.

  • identifier_vLambda – Identifier name for LambdaVeto weight file.

  • useCustomThreshold – Flag whether threshold_V0Selector and threshold_LambdaVeto are used.

  • threshold_V0Selector – Threshold for V0Selector.

  • threshold_LambdaVeto – Threshold for LambdaVeto.

  • path – Basf2 path to execute.