Source code for vibe.analysis_validation_modes.tracking.mergedKs_efficiency

import basf2
import modularAnalysis as ma
from variables import variables as v
import stdV0s as stdv
import variables.utils as vu

from vibe.core.utils.misc import fancy_validation_mode_header
from vibe.core.validation_mode import ValidationModeBaseClass

[docs] @fancy_validation_mode_header class MergedKsEfficiency(ValidationModeBaseClass): name = "MergedKsEfficiency"
[docs] def create_basf2_path(self): v.addAlias("daughtersChargeProduct", "formula((daughter(0, charge))*(daughter(1, charge)))") v.addAlias("mcProdVertexX", "mcProductionVertexX") v.addAlias("mcProdVertexY", "mcProductionVertexY") v.addAlias("mcProdVertexZ", "mcProductionVertexZ") v.addAlias("mcX", "mcDecayVertexX") v.addAlias("mcY", "mcDecayVertexY") v.addAlias("mcZ", "mcDecayVertexZ") v.addAlias("seen", "formula(seenInSVD+seenInCDC)") v.addAlias("d0seen", "formula(daughter(0, seenInSVD)+daughter(0, seenInCDC))") v.addAlias("d1seen", "formula(daughter(1, seenInSVD)+daughter(1, seenInCDC))") main_path = basf2.Path() v0_cut = "nDaughters > 1 and daughtersChargeProduct == -1" pi_cut = "genMotherPDG == 310" ks_MC = ("K_S0:gen", v0_cut) pions_MC = ("pi+:gen", pi_cut) ma.fillParticleListsFromMC([ks_MC], path=main_path, addDaughters=True) ma.fillParticleListsFromMC([pions_MC], path=main_path) pions = ("pi+:reco", "genMotherPDG == 310") ma.fillParticleLists([pions], path=main_path) ma.applyCuts("pi+:reco", "isSignal == 1 and isCloneTrack == 0", path=main_path) stdv.stdKshorts(prioritiseV0=True, path=main_path) ma.matchMCTruth("K_S0:merged", path=main_path) # ntuples v_FOMs_MC = ["nDaughters"] v_FOMS_4daughters = ["genMotherPDG", "isCloneTrack"] v_FOMS_daughters = vu.create_daughter_aliases(v_FOMS_4daughters, 0) + vu.create_daughter_aliases( v_FOMS_4daughters, 1 ) v_FOMs_v0 = ["isSignal"] v_kin_MC_4daughters = ["mcPX", "mcPY", "mcPZ", "charge"] v_kin_MC_daughters = vu.create_daughter_aliases(v_kin_MC_4daughters, 0) + vu.create_daughter_aliases( v_kin_MC_4daughters, 1 ) v_kin_MC = ["mcPX", "mcPY", "mcPZ", "mcX", "mcY", "mcZ", "mcFlightDistance"] + v_kin_MC_daughters v_kin_4daughters = ["px", "py", "pz"] v_kin_daughters = vu.create_daughter_aliases(v_kin_4daughters, 0) + vu.create_daughter_aliases( v_kin_4daughters, 1 ) v_kin = v_kin_MC + ["px", "py", "pz", "x", "y", "z", "flightDistance"] + v_kin_daughters v_v0 = v_FOMs_v0 + v_FOMS_daughters + v_kin v_v0_MC = v_FOMs_MC + v_kin_MC + ["d0seen", "d1seen"] v_tracks_MC = ["genMotherPDG"] + v_kin_MC_4daughters + ["mcProdVertexX", "mcProdVertexY", "mcProdVertexZ"] v_tracks = v_tracks_MC + v_kin_4daughters + ["prodVertexX", "prodVertexY", "prodVertexZ"] self.variables_to_validation_ntuple(decay_str="K_S0:merged", variables=list(v_v0), path=main_path) self.variables_to_validation_ntuple(decay_str="K_S0:gen", variables=list(v_v0_MC), path=main_path) self.variables_to_validation_ntuple(decay_str="pi+:reco", variables=list(v_tracks), path=main_path) self.variables_to_validation_ntuple(decay_str="pi+:gen", variables=list(v_tracks_MC + ["seen"]), path=main_path) return main_path