diff --git a/Lb2LcPi_Run3_respruce_test/README_copy.md b/Lb2LcPi_Run3_respruce_test/README_copy.md deleted file mode 100644 index 188843ed21255a58686b94531d23b36d391c7e5e..0000000000000000000000000000000000000000 --- a/Lb2LcPi_Run3_respruce_test/README_copy.md +++ /dev/null @@ -1,10 +0,0 @@ -Analysis Production for the Run 3 2024 MC Lb2LcPi (and backgrounds) polarity Up - -# B2OC Run3 2024 Analysis Production - -## Hlt2 stripping line: -Hlt2B2OC_LbToLcpPi_LcpToPKPi -targetting the decay: Lb -> Lc(->pKpi) pi - -## decay of interest: -Lb -> Lc(->pKpi) pi \ No newline at end of file diff --git a/Lb2LcPi_Run3_respruce_test/dv_Alessandro.py b/Lb2LcPi_Run3_respruce_test/dv_Alessandro.py deleted file mode 100644 index c784a53bbe10ff1e5bfdc1db2b18f057f08fadb5..0000000000000000000000000000000000000000 --- a/Lb2LcPi_Run3_respruce_test/dv_Alessandro.py +++ /dev/null @@ -1,257 +0,0 @@ -# Based on: -# https://gitlab.cern.ch/lhcb/DaVinci/-/blob/v63r2/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2.py - -import Functors as F -import FunTuple.functorcollections as FC -from FunTuple import FunctorCollection, FunTuple_Particles as Funtuple -from PyConf.reading import get_particles, get_pvs, get_rec_summary, get_odin -from GaudiKernel.SystemOfUnits import GeV -from DaVinci.algorithms import create_lines_filter -from DaVinci import Options, make_config -from DaVinciMCTools import MCTruthAndBkgCat -from DecayTreeFitter import DecayTreeFitter -from Hlt2Conf.flavourTagging import run2_all_taggers -# specific for the B2OC SigmaNet -import Functors.math as fmath -import os - - -def alg_config(options: Options): - - line = "Hlt2B2OC_BdToDmPi_DmToPimPimKp" - line_data = get_particles(f"/Event/Turbo/{line}/Particles") - my_filter = create_lines_filter("Hlt2Line_Filter", - lines=[f"{line}"]) - Hlt1_decisions = [ - "Hlt1TrackMVADecision", - "Hlt1TwoTrackMVADecision", - ] - Hlt2_decisions = ['Hlt2B2OC_BdToDmPi_DmToPimPimKpDecision', - 'Hlt2Topo2BodyDecision', - 'Hlt2Topo3BodyDecision'] - - fields = { - "lab0": "[[B0]CC -> (D- -> K+ pi- pi-) pi+]CC", - "lab1": "[[B0]CC -> (D- -> K+ pi- pi-) ^pi+]CC", - "lab2": "[[B0]CC -> ^(D- -> K+ pi- pi-) pi+]CC", - "lab3": "[[B0]CC -> (D- -> ^K+ pi- pi-) pi+]CC", - "lab4": "[[B0]CC -> (D- -> K+ ^pi- pi-) pi+]CC", - "lab5": "[[B0]CC -> (D- -> K+ pi- ^pi-) pi+]CC", - } - - pvs = get_pvs() - - DTF_MassFitConsD = DecayTreeFitter(name="DTF_MassFitConsD", - input_particles=line_data, - mass_constraints=["D-"]) - DTF_LifetimeFit = DecayTreeFitter(name="DTF_LifetimeFit", - input_particles=line_data, - input_pvs=pvs) - - all_tagging = run2_all_taggers(line_data) - - # define helper functors - get_child = F.CHILD(1, F.FORWARDARG0) # change here the index of the child - get_SV = F.ENDVERTEX @ F.FORWARDARG0 - get_SV_pos = F.TOLINALG @ F.POSITION @ get_SV # only if composite (i.e. has vertex) - get_child_endvtx_pos = F.ENDVERTEX_POS @ get_child - get_fdvec_child = get_child_endvtx_pos - get_SV_pos - - # define observables - IP_wrt_SV = F.IP.bind(get_SV_pos , get_child) - IPCHI2_wrt_SV = F.IPCHI2.bind(get_SV , get_child) # only if child is composite (i.e. has vertex) - FD_wrt_SV = F.MAGNITUDE @ get_fdvec_child - FDCHI2_wrt_SV = F.VTX_FDCHI2.bind(get_SV, get_child) - - B_variables = FunctorCollection( - { - "ID": F.PARTICLE_ID, - "PT": F.PT, - "ETA": F.ETA, - "P": F.P, - "SUMPT": F.SUM(F.PT), - "MASS": F.MASS, - "BPVDIRA": F.BPVDIRA(pvs), - "CHI2DOF": F.CHI2DOF, - "BPVIPCHI2": F.BPVIPCHI2(pvs), - "BPVIP": F.BPVIP(pvs), - "BPVFDCHI2": F.BPVFDCHI2(pvs), - "BPVLTIME": F.BPVLTIME(pvs), - "BPVFD": F.BPVFD(pvs), - "CHILD1_IPwrtSV": IP_wrt_SV, - "CHILD1_IPCHI2wrtSV": IPCHI2_wrt_SV, - "CHILD1_FDwrtSV": FD_wrt_SV, - "CHILD1_FDCHI2wrtSV": FDCHI2_wrt_SV, - "DTF_MassFitConsD_MASS": DTF_MassFitConsD(F.MASS), - "DTF_MassFitConsD_CHI2DOF": DTF_MassFitConsD(F.CHI2DOF), # track or vertex chi2/ndf - "DTF_MassFitConsD_P": DTF_MassFitConsD(F.P), - "DTF_LifetimeFit_MASS": DTF_LifetimeFit(F.MASS), - "DTF_LifetimeFit_CHI2DOF": DTF_LifetimeFit(F.CHI2DOF), # track or vertex chi2/ndf - "DTF_LifetimeFit_CTAU": DTF_LifetimeFit.CTAU, - "DTF_LifetimeFit_CTAUERR": DTF_LifetimeFit.CTAUERR, - "PX": F.PX, - "PY": F.PY, - "PZ": F.PZ, - "BPVX": F.BPVX(pvs), - "BPVY": F.BPVY(pvs), - "BPVZ": F.BPVZ(pvs), - "END_VX": F.END_VX, - "END_VY": F.END_VY, - "END_VZ": F.END_VZ, - "END_VCHI2DOF": F.CHI2DOF @ F.ENDVERTEX, - "BPVCHI2DOF": F.CHI2DOF @ F.BPV(pvs), - # B2OC generic B hadron NN Hlt2 algorithm, - # not planning to use it directly for B2OC EM - "MVA": F.MVA( - MVAType="SigmaNet", - Config={ - "File": - "paramfile://data/Hlt2B2OC_B_SigmaNet_Run3-v2.json", - "Name": - "B2OC_SigmaNet_Generic", - "Lambda": - "2.0", - "NLayers": - "3", - "InputSize": - "6", - "Monotone_Constraints": - "[1,-1,-1,-1,-1,-1]", - "Variables": - "log_B_PT,B_ETA,log_B_DIRA,log_B_ENDVERTEX_CHI2,log_B_IPCHI2_OWNPV,log_B_IP_OWNPV", - }, - Inputs={ - "log_B_PT": fmath.log(F.PT), - "B_ETA": F.ETA, - "log_B_DIRA": fmath.log(1. +1.e-6 - F.BPVDIRA(pvs)), - "log_B_ENDVERTEX_CHI2": fmath.log(F.CHI2DOF), - "log_B_IPCHI2_OWNPV": fmath.log(F.BPVIPCHI2(pvs)), - "log_B_IP_OWNPV": fmath.log(F.BPVIP(pvs)), - }), - } - ) - B_variables+=FC.HltTisTos(selection_type="Hlt1", trigger_lines=Hlt1_decisions, data=line_data) - B_variables+=FC.FlavourTaggingResults(all_tagging) - - C_variables = FunctorCollection( - { - "ID": F.PARTICLE_ID, - "PT": F.PT, - "ETA": F.ETA, - "P": F.P, - "SUMPT": F.SUM(F.PT), - "MASS": F.MASS, - "DOCA12": F.DOCA(1, 2), - "DOCA13": F.DOCA(1, 3), - "DOCA23": F.DOCA(2, 3), - "BPVDIRA": F.BPVDIRA(pvs), - "CHI2DOF": F.CHI2DOF, - "BPVIP": F.BPVIP(pvs), - "BPVIPCHI2": F.BPVIPCHI2(pvs), - "BPVFD": F.BPVFD(pvs), - "BPVFDCHI2": F.BPVFDCHI2(pvs), - "MINIPCHI2": F.MINIPCHI2(pvs), - "PX": F.PX, - "PY": F.PY, - "PZ": F.PZ, - "BPVX": F.BPVX(pvs), - "BPVY": F.BPVY(pvs), - "BPVZ": F.BPVZ(pvs), - "END_VX": F.END_VX, - "END_VY": F.END_VY, - "END_VZ": F.END_VZ, - "END_VCHI2DOF": F.CHI2DOF @ F.ENDVERTEX, - } - ) - - fs_variables = FunctorCollection( - { - "ID": F.PARTICLE_ID, - "PT": F.PT, - "ETA": F.ETA, - "PHI": F.PHI, - "P": F.P, - "MASS": F.MASS, - "CHI2DOF": F.CHI2DOF, - "MINIPCHI2": F.MINIPCHI2(pvs), - "BPVIPCHI2": F.BPVIPCHI2(pvs), - "PX": F.PX, - "PY": F.PY, - "PZ": F.PZ, - "hasRICH": F.PPHASRICH() @ F.PROTOPARTICLE(), - "PIDK": F.PID_K, - "PIDp": F.PID_P, - "PIDe": F.PID_E, - "PIDmu": F.PID_MU, - "isMuon": F.ISMUON, - "TRACK_GhostProb": F.GHOSTPROB, - "ProbNNp": F.PROBNN_P, - "NHITS": F.VALUE_OR(-1) @ F.NHITS @ F.TRACK, - "NVPHITS": F.VALUE_OR(-1) @ F.NVPHITS @ F.TRACK, # VeloPixel hits - "NUTHITS": F.VALUE_OR(-1) @ F.NUTHITS @ F.TRACK, # UpstreamTracker hits - "NFTHITS": F.VALUE_OR(-1) @ F.NFTHITS @ F.TRACK, # ForwardTracker hits - "TRACKHASVELO": F.VALUE_OR(-1) @ F.TRACKHASVELO @ F.TRACK, - } - ) - - variables = { - "lab0": B_variables, - "lab1": fs_variables, - "lab2": C_variables, - "lab3": fs_variables, - "lab4": fs_variables, - "lab5": fs_variables, - } - - if options.simulation: - # get configured "MCTruthAndBkgCatAlg" algorithm for HLT2 output - mctruth = MCTruthAndBkgCat(line_data) - # add helper lambda that configures a functor to get truth information - MCTRUTH = lambda func: F.MAP_INPUT(Functor=func, Relations=mctruth.MCAssocTable) - trueid_bkgcat_info = { - # Important note: specify an invalid value for integer functors if there exists no truth info. - # The invalid value for floating point functors is set to nan. - "TRUEID": F.VALUE_OR(0) @ MCTRUTH(F.PARTICLE_ID), - "TRUEKEY": F.VALUE_OR(-1) @ MCTRUTH(F.OBJECT_KEY), - # - "TRUEPT": MCTRUTH(F.PT), - "TRUEPX": MCTRUTH(F.PX), - "TRUEPY": MCTRUTH(F.PY), - "TRUEPZ": MCTRUTH(F.PZ), - "TRUEENERGY": MCTRUTH(F.ENERGY), - "TRUEP": MCTRUTH(F.P), - "TRUEFOURMOMENTUM": MCTRUTH(F.FOURMOMENTUM), - "BKGCAT": F.BKGCAT(Relations=mctruth.BkgCatTable), - } - for field in variables.keys(): - variables[field] += FunctorCollection(trueid_bkgcat_info) - - - odin = get_odin() - rec_summary = get_rec_summary() - # define event level variables - evt_variables = FunctorCollection({ - "RUNNUMBER": F.RUNNUMBER(odin), - "EVENTNUMBER": F.EVENTNUMBER(odin), - "nVPClusters" : F.VALUE_OR(-1) @ F.RECSUMMARY_INFO( rec_summary, "nVPClusters"), - "nFTClusters" : F.VALUE_OR(-1) @ F.RECSUMMARY_INFO( rec_summary, "nFTClusters"), - "nPVs": F.VALUE_OR(-1) @ F.RECSUMMARY_INFO(rec_summary, "nPVs"), - "nLongTracks": F.VALUE_OR(-1) @ F.RECSUMMARY_INFO(rec_summary, "nLongTracks"), - "nVeloTracks": F.VALUE_OR(-1) @F.RECSUMMARY_INFO(rec_summary,"nVeloTracks"), - }) - evt_variables+=FC.SelectionInfo(selection_type="Hlt1", trigger_lines=Hlt1_decisions) - evt_variables+=FC.SelectionInfo(selection_type="Hlt2", trigger_lines=Hlt2_decisions) - - # define FunTuple instance - my_tuple = Funtuple( - name="Tuple", - tuple_name="DecayTree", - fields=fields, - variables=variables, - event_variables=evt_variables, - inputs=line_data, - store_multiple_cand_info=True, - ) - - return make_config(options, [my_filter, my_tuple]) - diff --git a/Lb2LcPi_Run3_respruce_test/dv_simple.py b/Lb2LcPi_Run3_respruce_test/dv_simple.py deleted file mode 100644 index db690d9937b700f47bec88ad21c3a128e044312f..0000000000000000000000000000000000000000 --- a/Lb2LcPi_Run3_respruce_test/dv_simple.py +++ /dev/null @@ -1,259 +0,0 @@ -# Based on: -# https://gitlab.cern.ch/lhcb/DaVinci/-/blob/v63r2/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2.py - -import Functors as F -import FunTuple.functorcollections as FC -from FunTuple import FunctorCollection, FunTuple_Particles as Funtuple -from PyConf.reading import get_particles, get_pvs, get_rec_summary, get_odin -from GaudiKernel.SystemOfUnits import GeV -from Hlt2Conf.algorithms_thor import ParticleFilter -from DaVinci.algorithms import create_lines_filter -from DaVinci import Options, make_config -from DaVinciMCTools import MCTruthAndBkgCat -from DecayTreeFitter import DecayTreeFitter -from Hlt2Conf.flavourTagging import run2_all_taggers -# specific for the B2OC SigmaNet -import Functors.math as fmath -import os - - -def alg_config(options: Options): - - line = "Hlt2B2OC_LbToLcpPi_LcpToPKPi" - line_data = get_particles(f"/Event/Turbo/{line}/Particles") - my_filter = create_lines_filter("Hlt2Line_Filter", - lines=[f"{line}"]) - Hlt1_decisions = [ - "Hlt1TrackMVADecision", - "Hlt1TwoTrackMVADecision", - ] - Hlt2_decisions = ['Hlt2B2OC_LbToLcpPi_LcpToPKPiDecision', - 'Hlt2Topo2BodyDecision', - 'Hlt2Topo3BodyDecision'] - - fields = { - 'lab0': '[Lambda_b0 -> (Lambda_c+ -> p+ K- pi+) pi-]CC', - 'lab1': '[Lambda_b0 -> (Lambda_c+ -> p+ K- pi+) ^pi-]CC', - 'lab2': '[Lambda_b0 -> ^(Lambda_c+ -> p+ K- pi+) pi-]CC', - 'lab3': '[Lambda_b0 -> (Lambda_c+ -> ^p+ K- pi+) pi-]CC', - 'lab4': '[Lambda_b0 -> (Lambda_c+ -> p+ ^K- pi+) pi-]CC', - 'lab5': '[Lambda_b0 -> (Lambda_c+ -> p+ K- ^pi+) pi-]CC' - } - - pvs = get_pvs() - - DTF_MassFitConsLc = DecayTreeFitter( - name="DTF_MassFitConsLc", - input_particles=line_data, - mass_constraints=["Lambda_c+"]) - - DTF_LifetimeFit = DecayTreeFitter( - name="DTF_LifetimeFit", input_particles=line_data, input_pvs=pvs) - - # all_tagging = run2_all_taggers(line_data) - - # define helper functors - get_child = F.CHILD(1, F.FORWARDARG0) # change here the index of the child - get_SV = F.ENDVERTEX @ F.FORWARDARG0 - get_SV_pos = F.TOLINALG @ F.POSITION @ get_SV # only if composite (i.e. has vertex) - get_child_endvtx_pos = F.ENDVERTEX_POS @ get_child - get_fdvec_child = get_child_endvtx_pos - get_SV_pos - - # define observables - IP_wrt_SV = F.IP.bind(get_SV_pos , get_child) - IPCHI2_wrt_SV = F.IPCHI2.bind(get_SV , get_child) # only if child is composite (i.e. has vertex) - FD_wrt_SV = F.MAGNITUDE @ get_fdvec_child - FDCHI2_wrt_SV = F.VTX_FDCHI2.bind(get_SV, get_child) - - B_variables = FunctorCollection( - { - "ID": F.PARTICLE_ID, - "PT": F.PT, - "ETA": F.ETA, - "P": F.P, - "SUMPT": F.SUM(F.PT), - "MASS": F.MASS, - "BPVDIRA": F.BPVDIRA(pvs), - "CHI2DOF": F.CHI2DOF, - "BPVIPCHI2": F.BPVIPCHI2(pvs), - "BPVIP": F.BPVIP(pvs), - "BPVFDCHI2": F.BPVFDCHI2(pvs), - "BPVLTIME": F.BPVLTIME(pvs), - "BPVFD": F.BPVFD(pvs), - "CHILD1_IPwrtSV": IP_wrt_SV, - "CHILD1_IPCHI2wrtSV": IPCHI2_wrt_SV, - "CHILD1_FDwrtSV": FD_wrt_SV, - "CHILD1_FDCHI2wrtSV": FDCHI2_wrt_SV, - "DTF_MassFitConsLc_MASS": DTF_MassFitConsLc(F.MASS), - "DTF_MassFitConsLc_CHI2DOF": DTF_MassFitConsLc(F.CHI2DOF), # track or vertex chi2/ndf - "DTF_MassFitConsLc_P": DTF_MassFitConsLc(F.P), - "DTF_LifetimeFit_MASS": DTF_LifetimeFit(F.MASS), - "DTF_LifetimeFit_CHI2DOF": DTF_LifetimeFit(F.CHI2DOF), # track or vertex chi2/ndf - "DTF_LifetimeFit_CTAU": DTF_LifetimeFit.CTAU, - "DTF_LifetimeFit_CTAUERR": DTF_LifetimeFit.CTAUERR, - "PX": F.PX, - "PY": F.PY, - "PZ": F.PZ, - "BPVX": F.BPVX(pvs), - "BPVY": F.BPVY(pvs), - "BPVZ": F.BPVZ(pvs), - "END_VX": F.END_VX, - "END_VY": F.END_VY, - "END_VZ": F.END_VZ, - "END_VCHI2DOF": F.CHI2DOF @ F.ENDVERTEX, - "BPVCHI2DOF": F.CHI2DOF @ F.BPV(pvs), - # B2OC generic B hadron NN Hlt2 algorithm, - # not planning to use it directly for B2OC EM - "MVA": F.MVA( - MVAType="SigmaNet", - Config={ - "File": - "paramfile://data/Hlt2B2OC_B_SigmaNet_Run3-v2.json", - "Name": - "B2OC_SigmaNet_Generic", - "Lambda": - "2.0", - "NLayers": - "3", - "InputSize": - "6", - "Monotone_Constraints": - "[1,-1,-1,-1,-1,-1]", - "Variables": - "log_B_PT,B_ETA,log_B_DIRA,log_B_ENDVERTEX_CHI2,log_B_IPCHI2_OWNPV,log_B_IP_OWNPV", - }, - Inputs={ - "log_B_PT": fmath.log(F.PT), - "B_ETA": F.ETA, - "log_B_DIRA": fmath.log(1. +1.e-6 - F.BPVDIRA(pvs)), - "log_B_ENDVERTEX_CHI2": fmath.log(F.CHI2DOF), - "log_B_IPCHI2_OWNPV": fmath.log(F.BPVIPCHI2(pvs)), - "log_B_IP_OWNPV": fmath.log(F.BPVIP(pvs)), - }), - } - ) - B_variables+=FC.HltTisTos(selection_type="Hlt1", trigger_lines=Hlt1_decisions, data=line_data) - # B_variables+=FC.FlavourTaggingResults(all_tagging) - - C_variables = FunctorCollection( - { - "ID": F.PARTICLE_ID, - "PT": F.PT, - "ETA": F.ETA, - "P": F.P, - "SUMPT": F.SUM(F.PT), - "MASS": F.MASS, - "DOCA12": F.DOCA(1, 2), - "DOCA13": F.DOCA(1, 3), - "DOCA23": F.DOCA(2, 3), - "BPVDIRA": F.BPVDIRA(pvs), - "CHI2DOF": F.CHI2DOF, - "BPVIP": F.BPVIP(pvs), - "BPVIPCHI2": F.BPVIPCHI2(pvs), - "BPVFD": F.BPVFD(pvs), - "BPVFDCHI2": F.BPVFDCHI2(pvs), - "MINIPCHI2": F.MINIPCHI2(pvs), - "PX": F.PX, - "PY": F.PY, - "PZ": F.PZ, - "BPVX": F.BPVX(pvs), - "BPVY": F.BPVY(pvs), - "BPVZ": F.BPVZ(pvs), - "END_VX": F.END_VX, - "END_VY": F.END_VY, - "END_VZ": F.END_VZ, - "END_VCHI2DOF": F.CHI2DOF @ F.ENDVERTEX, - } - ) - - fs_variables = FunctorCollection( - { - "ID": F.PARTICLE_ID, - "PT": F.PT, - "ETA": F.ETA, - "PHI": F.PHI, - "P": F.P, - "MASS": F.MASS, - "CHI2DOF": F.CHI2DOF, - "MINIPCHI2": F.MINIPCHI2(pvs), - "BPVIPCHI2": F.BPVIPCHI2(pvs), - "PX": F.PX, - "PY": F.PY, - "PZ": F.PZ, - "hasRICH": F.PPHASRICH() @ F.PROTOPARTICLE(), - "PIDK": F.PID_K, - "PIDp": F.PID_P, - "PIDe": F.PID_E, - "PIDmu": F.PID_MU, - "isMuon": F.ISMUON, - "TRACK_GhostProb": F.GHOSTPROB, - "ProbNNp": F.PROBNN_P, - "NHITS": F.VALUE_OR(-1) @ F.NHITS @ F.TRACK, - "NVPHITS": F.VALUE_OR(-1) @ F.NVPHITS @ F.TRACK, # VeloPixel hits - "NUTHITS": F.VALUE_OR(-1) @ F.NUTHITS @ F.TRACK, # UpstreamTracker hits - "NFTHITS": F.VALUE_OR(-1) @ F.NFTHITS @ F.TRACK, # ForwardTracker hits - "TRACKHASVELO": F.VALUE_OR(-1) @ F.TRACKHASVELO @ F.TRACK, - } - ) - - variables = { - "lab0": B_variables, - "lab1": fs_variables, - "lab2": C_variables, - "lab3": fs_variables, - "lab4": fs_variables, - "lab5": fs_variables, - } - - if options.simulation: - # get configured "MCTruthAndBkgCatAlg" algorithm for HLT2 output - mctruth = MCTruthAndBkgCat(line_data) - # add helper lambda that configures a functor to get truth information - MCTRUTH = lambda func: F.MAP_INPUT(Functor=func, Relations=mctruth.MCAssocTable) - trueid_bkgcat_info = { - # Important note: specify an invalid value for integer functors if there exists no truth info. - # The invalid value for floating point functors is set to nan. - "TRUEID": F.VALUE_OR(0) @ MCTRUTH(F.PARTICLE_ID), - "TRUEKEY": F.VALUE_OR(-1) @ MCTRUTH(F.OBJECT_KEY), - # - "TRUEPT": MCTRUTH(F.PT), - "TRUEPX": MCTRUTH(F.PX), - "TRUEPY": MCTRUTH(F.PY), - "TRUEPZ": MCTRUTH(F.PZ), - "TRUEENERGY": MCTRUTH(F.ENERGY), - "TRUEP": MCTRUTH(F.P), - "TRUEFOURMOMENTUM": MCTRUTH(F.FOURMOMENTUM), - "BKGCAT": F.BKGCAT(Relations=mctruth.BkgCatTable), - } - for field in variables.keys(): - variables[field] += FunctorCollection(trueid_bkgcat_info) - - - odin = get_odin() - rec_summary = get_rec_summary() - # define event level variables - evt_variables = FunctorCollection({ - "RUNNUMBER": F.RUNNUMBER(odin), - "EVENTNUMBER": F.EVENTNUMBER(odin), - "nVPClusters" : F.VALUE_OR(-1) @ F.RECSUMMARY_INFO( rec_summary, "nVPClusters"), - "nFTClusters" : F.VALUE_OR(-1) @ F.RECSUMMARY_INFO( rec_summary, "nFTClusters"), - "nPVs": F.VALUE_OR(-1) @ F.RECSUMMARY_INFO(rec_summary, "nPVs"), - "nLongTracks": F.VALUE_OR(-1) @ F.RECSUMMARY_INFO(rec_summary, "nLongTracks"), - "nVeloTracks": F.VALUE_OR(-1) @F.RECSUMMARY_INFO(rec_summary,"nVeloTracks"), - }) - evt_variables+=FC.SelectionInfo(selection_type="Hlt1", trigger_lines=Hlt1_decisions) - evt_variables+=FC.SelectionInfo(selection_type="Hlt2", trigger_lines=Hlt2_decisions) - - # define FunTuple instance - my_tuple = Funtuple( - name="Tuple", - tuple_name="DecayTree", - fields=fields, - variables=variables, - event_variables=evt_variables, - inputs=line_data, - store_multiple_cand_info=True, - ) - - return make_config(options, [my_filter, my_tuple]) - diff --git a/Lb2LcPi_Run3_respruce_test/hlt1.py b/Lb2LcPi_Run3_respruce_test/hlt1.py deleted file mode 100644 index 10e9800a78d52aa43d1d07ff1f4508a2514fd316..0000000000000000000000000000000000000000 --- a/Lb2LcPi_Run3_respruce_test/hlt1.py +++ /dev/null @@ -1,31 +0,0 @@ -############################################################################### -# (c) Copyright 2023 CERN for the benefit of the LHCb Collaboration # -# # -# This software is distributed under the terms of the GNU General Public # -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # -# # -# In applying this licence, CERN does not waive the privileges and immunities # -# granted to it by virtue of its status as an Intergovernmental Organization # -# or submit itself to any jurisdiction. # -############################################################################### -""" -Configures running HLT1 via Moore. -""" - -from Moore import Options -from Moore.config import allen_control_flow -from RecoConf.hlt1_allen import allen_gaudi_config, get_allen_line_names -from PyConf.application import configure_input, configure - -def alg_config(options: Options): - """ - Configures algorithm running of HLT1 via Moore to be passed to Analysis Productions. - """ - - config = configure_input(options) - with allen_gaudi_config.bind(sequence="hlt1_pp_matching_1000KHz"): - line_names = get_allen_line_names() - allen_node = allen_control_flow(options) - config.update(configure(options, allen_node)) - - return config diff --git a/Lb2LcPi_Run3_respruce_test/hlt2.py b/Lb2LcPi_Run3_respruce_test/hlt2.py deleted file mode 100644 index 28784249e074fcb73a530fe75d9520ba75bfdf67..0000000000000000000000000000000000000000 --- a/Lb2LcPi_Run3_respruce_test/hlt2.py +++ /dev/null @@ -1,51 +0,0 @@ -############################################################################### -# (c) Copyright 2023 CERN for the benefit of the LHCb Collaboration # -# # -# This software is distributed under the terms of the GNU General Public # -# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # -# # -# In applying this licence, CERN does not waive the privileges and immunities # -# granted to it by virtue of its status as an Intergovernmental Organization # -# or submit itself to any jurisdiction. # -############################################################################### -""" -Configures running HLT2 via Moore. -""" - -from Moore import options, Options, run_moore -from Hlt2Conf.lines.b_to_open_charm import all_lines -# -from RecoConf.global_tools import stateProvider_with_simplified_geom, trackMasterExtrapolator_with_simplified_geom -from RecoConf.reconstruction_objects import reconstruction - -all_lines = {} -from Hlt2Conf.lines.b_to_open_charm.hlt2_b2oc import make_hlt2_lines -default_lines = [ -'LbToLcpPi_LcpToPKPi', -] -extra_config = {} -make_hlt2_lines( - line_dict=all_lines, - all_lines=default_lines, - extra_config=extra_config) - -def make_lines(): - lines = [builder() for builder in all_lines.values()] - return lines - -def alg_config(options: Options): - - make_tight_pions.global_bind(pi_pidk_max=None) - make_lc_to_pkpi.global_bind(pi_pidk_max=None,k_pidk_min=None,p_pidkmp_max=None) - - public_tools = [ - trackMasterExtrapolator_with_simplified_geom(), - stateProvider_with_simplified_geom() - ] - - # config_pp_2024_without_UT or config_pp_2024 - from Hlt2Conf.settings.hlt2_binds import config_pp_2024 - with reconstruction.bind(from_file=False), config_pp_2024(): - config = run_moore(options, make_lines, public_tools) - - return config diff --git a/Lb2LcPi_Run3_respruce_test/info.yaml b/Lb2LcPi_Run3_respruce_test/info.yaml deleted file mode 100644 index b42295b4958345ac88186f7855344eda57e1b29c..0000000000000000000000000000000000000000 --- a/Lb2LcPi_Run3_respruce_test/info.yaml +++ /dev/null @@ -1,47 +0,0 @@ - -checks: - hist_lab0_MASS: - type: range - expression: lab0_MASS - limits: - min: 5_000 - max: 7_000 - n_bins: 100 - -defaults: - application: DaVinci/v65r1@x86_64_v2-el9-clang16-opt - output: DATA.ROOT - options: - entrypoint: Lb2LcPi_Run3_respruce_test.dv_simple:alg_config - extra_options: - input_raw_format: 0.5 - input_type: ROOT # ROOT for SprucingPass, RAW for RAW data (Hlt2 output) - simulation: False - data_type: "Upgrade" - geometry_version: run3/trunk - conditions_version: master - input_process: "TurboSpruce" # for SprucingPass, "Hlt2" for RAW data (Hlt2 output) - input_stream: "b2oc" # for streamed data - inform: - - maciej.artur.giza@cern.ch - wg: B2OC - -{%- set datasets = [ - ('2024Data', 'MagDown-Excl-UT', '24x'), - ('2024Data', 'MagUp-Excl-UT', '24x'), - ('2024Data', 'MagDown', '24x'), - ('2024Data', 'MagUp', '24x'), -]%} -{%- for evttype, polarity, campain in datasets %} -Lb2LcPi_{{ evttype }}_{{ polarity }}_{{ campain }}: - input: - bk_query: "/validation/Collision24/Beam6800GeV-VeloClosed-{{ polarity }}/Real Data/Sprucing{{ campain }}/94000000/B2OC.DST" - dq_flags: - - UNCHECKED - - OK - keep_running: false - n_test_lfns: 2 - checks: - - hist_lab0_MASS -{%- endfor %} - diff --git a/Lb2LcPi_Run3_respruce_test/info_copy.yaml b/Lb2LcPi_Run3_respruce_test/info_copy.yaml deleted file mode 100644 index 05bc75fcb2b4a8b545f0f5b86f4e478e72fd37cc..0000000000000000000000000000000000000000 --- a/Lb2LcPi_Run3_respruce_test/info_copy.yaml +++ /dev/null @@ -1,46 +0,0 @@ - -checks: - hist_lab0_MASS: - type: range - expression: lab0_MASS - limits: - min: 5_000 - max: 7_000 - n_bins: 100 - -defaults: - application: DaVinci/v64r10@x86_64_v2-el9-clang16-opt - output: DATA.ROOT - options: - entrypoint: Lb2LcPi_Run3.dv_simple:alg_config - extra_options: - input_raw_format: 0.5 - input_type: ROOT # ROOT for SprucingPass, RAW for RAW data (Hlt2 output) - simulation: True - data_type: "Upgrade" - geometry_version: run3/trunk - conditions_version: master - input_process: "Hlt2" # for SprucingPass, "Hlt2" for RAW data (Hlt2 output) - inform: - - maciej.artur.giza@cern.ch - wg: B2OC - -{%- set datasets = [ - ('15364010', 'MagUp'), # Lb2LcPi - ('11264001', 'MagUp'), # Bd2DPi - ('13264021', 'MagUp'), # Bs2DsPi - ('15364011', 'MagUp'), # Lb2LcK -]%} -{%- for evttype, polarity in datasets %} -Lb2LcPi_{{ evttype }}_{{ polarity }}: - input: - bk_query: "/MC/2024/Beam6800GeV-2024.W31.34-{{ polarity }}-Nu6.3-25ns-Pythia8/Sim10d/HLT2-2024.W31.34/{{ evttype }}/DST" - dq_flags: - - UNCHECKED - - OK - keep_running: false - n_test_lfns: 1 - checks: - - hist_lab0_MASS -{%- endfor %} -