File indexing completed on 2025-05-09 22:40:13
0001 import FWCore.ParameterSet.Config as cms
0002 from PhysicsTools.BPHNano.common_cff import *
0003
0004
0005
0006 BToTrkTrkMuMu = cms.EDProducer(
0007 'BToTrkTrkLLBuilder',
0008 dileptons = cms.InputTag("MuMu:SelectedDiLeptons"),
0009 leptonTransientTracks = cms.InputTag('muonBPH', 'SelectedTransientMuons'),
0010 ditracks = cms.InputTag('DiTrack'),
0011 transientTracks = cms.InputTag('tracksBPH', 'SelectedTransientTracks'),
0012 PUtracks = cms.InputTag('tracksBPH', 'SelectedTracks'),
0013 beamSpot = cms.InputTag("offlineBeamSpot"),
0014 preVtxSelection = cms.string('userFloat("min_dr") > 0.03 && ((4.5<userFloat("unfitted_B_mass_KK") && userFloat("unfitted_B_mass_KK")<6.0 ) || (4.5<userFloat("unfitted_B_mass_Kpi") && userFloat("unfitted_B_mass_Kpi")<6.0 ) || (4.5<userFloat("unfitted_B_mass_piK") && userFloat("unfitted_B_mass_piK")<6.0))'),
0015 postVtxSelection = cms.string('userFloat("sv_prob") > 1.e-3 && userFloat("fitted_cos_theta_2D") >= 0.90 && ( (4.6<userFloat("fitted_mass_KK") && userFloat("fitted_mass_KK")<5.8) || (4.6<userFloat("fitted_mass_Kpi") && userFloat("fitted_mass_Kpi")<5.8 ) || (4.6<userFloat("fitted_mass_piK") && userFloat("fitted_mass_piK")<5.8)) && -0.045<userFloat("trk1_svip2d") && userFloat("trk1_svip2d")<0.045 && -0.045<userFloat("trk2_svip2d") && userFloat("trk2_svip2d")<0.045'),
0016 dileptonMassContraint = cms.bool(True)
0017 )
0018
0019
0020
0021 BToTrkTrkMuMuTable = cms.EDProducer(
0022 'SimpleCompositeCandidateFlatTableProducer',
0023 src = cms.InputTag("BToTrkTrkMuMu:SelectedBToTrkTrkMuMu"),
0024 cut = cms.string(""),
0025 name = cms.string("BToTrkTrkMuMu"),
0026 doc = cms.string("BToTrkTrkMuMu Variables"),
0027 singleton = cms.bool(False),
0028 extension = cms.bool(False),
0029 variables = cms.PSet(
0030
0031 CandVars,
0032 l1_idx = Var("userInt('l1_idx')", int, doc = "leading muon index to the BPH muon collection"),
0033 l2_idx = Var("userInt('l2_idx')", int, doc = "subleading muon index to the BPH muon collection"),
0034 trk1_idx = Var("userInt('trk1_idx')", int, doc = "leading track index to the BPH track collection"),
0035 trk2_idx = Var("userInt('trk2_idx')", int, doc = "subleading track index to the BPH track collection"),
0036 ditrack_idx = Var("userInt('ditrack_idx')", int, doc = "Ditrack pair index to the BPH DiTrack collection"),
0037 fit_mass_KK = Var("userFloat('fitted_mass_KK')", float, doc = "mass of the B candidate for the leading trk->Kaon subleading trk->kaon mass hypothesis", precision=10),
0038 fit_mass_Kpi = Var("userFloat('fitted_mass_Kpi')", float, doc = "mass of the B candidate for the leading trk->Kaon subleading trk->pion mass hypothesis", precision=10),
0039 fit_mass_piK = Var("userFloat('fitted_mass_piK')", float, doc = "mass of the B candidate for the leading trk->pion subleading trk->kaon mass hypothesis", precision=10),
0040 fit_massErr_KK = Var("userFloat('fitted_massErr_KK')", float, doc = "uncertainty of the mass of the B candidate for the leading trk->Kaon subleading trk->pion mass hypothesis", precision=10),
0041 fit_massErr_Kpi = Var("userFloat('fitted_massErr_Kpi')", float, doc = "uncertainty of the mass of the B candidate for the leading trk->Kaon subleading trk->pion mass hypothesis", precision=10),
0042 fit_massErr_piK = Var("userFloat('fitted_massErr_piK')", float, doc = "uncertainty mass of the B candidate for the leading trk->Kaon subleading trk->pion mass hypothesis", precision=10),
0043 fit_ditrack_mass_KK = Var("userFloat('fitted_ditrack_mass_KK')", float, doc = "mass of the two track system for the leading trk->Kaon subleading trk->kaon mass hypothesis", precision=10),
0044 fit_ditrack_mass_Kpi = Var("userFloat('fitted_ditrack_mass_Kpi')", float, doc = "mass of the two track system for the leading trk->Kaon subleading trk->pion mass hypothesis", precision=10),
0045 fit_ditrack_mass_piK = Var("userFloat('fitted_ditrack_mass_piK')", float, doc = "mass of the two track system for the leading trk->pion subleading trk->kaon mass hypothesis", precision=10),
0046 min_dr = Var("userFloat('min_dr')", float, doc = "min DR of the two tracks with the two muons", precision=10),
0047 max_dr = Var("userFloat('max_dr')", float, doc = "max DR of the two tracks with the two muons", precision=10),
0048
0049 chi2 = Var("userFloat('sv_chi2')", float, doc = "vertex chi^2 of the B candidate", precision=10),
0050 svprob = Var("userFloat('sv_prob')", float, doc = "vertex probability of the B candidate", precision=10),
0051 cos2D = Var("userFloat('cos_theta_2D')", float, doc = "cos 2D of pre-fit candidate wrt beamspot", precision=10),
0052 fit_cos2D = Var("userFloat('fitted_cos_theta_2D')", float, doc = "cos 2D of fitted vertex wrt beamspot", precision=10),
0053 l_xy = Var("userFloat('l_xy')", float, doc = "post-fit vertex displacement on transverse plane wrt beamspot", precision=10),
0054 l_xy_unc = Var("userFloat('l_xy_unc')", float, doc = "post-fit uncertainty of the vertex displacement on transverse plane wrt beamspot", precision=10),
0055
0056 mll_fullfit = Var("userFloat('fitted_mll')", float, doc = "post-fit mass of the two muons", precision=10),
0057 fit_pt = Var("userFloat('fitted_pt')", float, doc = "post-fit B pT", precision=10),
0058 fit_eta = Var("userFloat('fitted_eta')", float, doc = "post-fit B eta", precision=10),
0059 fit_phi = Var("userFloat('fitted_phi')", float, doc = "post-fit B phi", precision=10),
0060
0061 vtx_x = Var("userFloat('vtx_x')", float, doc = "position x of fitted vertex", precision=10),
0062 vtx_y = Var("userFloat('vtx_y')", float, doc = "position y of fitted vertex", precision=10),
0063 vtx_z = Var("userFloat('vtx_z')", float, doc = "position z of fitted vertex", precision=10),
0064 vtx_cxx = Var("userFloat('vtx_cxx')", float, doc = "error x of fitted vertex", precision=10),
0065 vtx_cyy = Var("userFloat('vtx_cyy')", float, doc = "error y of fitted vertex", precision=10),
0066 vtx_czz = Var("userFloat('vtx_czz')", float, doc = "error z of fitted vertex", precision=10),
0067 vtx_cyx = Var("userFloat('vtx_cyx')", float, doc = "error yx of fitted vertex", precision=10),
0068 vtx_czx = Var("userFloat('vtx_czx')", float, doc = "error zx of fitted vertex", precision=10),
0069 vtx_czy = Var("userFloat('vtx_czy')", float, doc = "error zy of fitted vertex", precision=10),
0070
0071
0072 fit_l1_pt = Var("userFloat('fitted_l1_pt')", float, doc = "post-fit leading mu pT", precision=10),
0073 fit_l1_eta = Var("userFloat('fitted_l1_eta')", float, doc = "post-fit leading mu eta", precision=10),
0074 fit_l1_phi = Var("userFloat('fitted_l1_phi')", float, doc = "post-fit leading mu phi", precision=10),
0075
0076 fit_l2_pt = Var("userFloat('fitted_l2_pt')", float, doc = "post-fit subleading mu pT", precision=10),
0077 fit_l2_eta = Var("userFloat('fitted_l2_eta')", float, doc = "post-fit subleading mu eta", precision=10),
0078 fit_l2_phi = Var("userFloat('fitted_l2_phi')", float, doc = "post-fit subleading mu phi", precision=10),
0079
0080 fit_trk1_pt = Var("userFloat('fitted_trk1_pt')", float, doc = "post-fit leading track pT", precision=10),
0081 fit_trk1_eta = Var("userFloat('fitted_trk1_eta')", float, doc = "post-fit leading track eta", precision=10),
0082 fit_trk1_phi = Var("userFloat('fitted_trk1_phi')", float, doc = "post-fit leading track phi", precision=10),
0083
0084 fit_trk2_pt = Var("userFloat('fitted_trk2_pt')", float, doc = "post-fit subleading track pT", precision=10),
0085 fit_trk2_eta = Var("userFloat('fitted_trk2_eta')", float, doc = "post-fit subleading track eta", precision=10),
0086 fit_trk2_phi = Var("userFloat('fitted_trk2_phi')", float, doc = "post-fit subleading track phi", precision=10),
0087
0088 l1_iso04 = Var("userFloat('l1_iso04')", float, doc = "leading mu isolation DR<0.4", precision=10),
0089 l2_iso04 = Var("userFloat('l2_iso04')", float, doc = "subleading mu isolation DR<0.4", precision=10),
0090 trk1_iso04 = Var("userFloat('trk1_iso04')", float, doc = "leading track isolation DR<0.4", precision=10),
0091 trk2_iso04 = Var("userFloat('trk2_iso04')", float, doc = "subleading track isolation DR<0.4", precision=10),
0092 trk1_svip2d = Var("userFloat('trk1_svip2d')", float, doc = "2D IP of the leading track wrt the dimuon vertex", precision=10),
0093 trk1_svip2d_err = Var("userFloat('trk1_svip2d_err')", float, doc = "uncertainty of 2D IP of the leading track wrt the dimuon vertex", precision=10),
0094 trk2_svip2d = Var("userFloat('trk2_svip2d')", float, doc = "2D IP of the subleading track wrt the dimuon vertex", precision=10),
0095 trk2_svip2d_err = Var("userFloat('trk2_svip2d_err')", float, doc = "uncertainty of 2D IP of the subleading track wrt the dimuon vertex", precision=10),
0096 constraint_sv_prob = Var("userFloat('constraint_sv_prob')", float, doc = "B vertex probability after the dimuon mass constraint", precision=10),
0097 constraint_pt = Var("userFloat('constraint_pt')", float, doc = "B pt after the dimuon mass constraint", precision=10),
0098 constraint_eta = Var("userFloat('constraint_eta')", float, doc = "B eta after the dimuon mass constraint", precision=10),
0099 constraint_phi = Var("userFloat('constraint_phi')", float, doc = "B phi after the dimuon mass constraint", precision=10),
0100 constraint_mass_KK = Var("userFloat('constraint_mass_KK')", float, doc = "B mass with KK mass hypothesis after the dimuon mass constraint", precision=10),
0101 constraint_massErr_KK = Var("userFloat('constraint_massErr_KK')", float, doc = "mass uncertainty for the KK mass hypothesis of the dimuon mass constraint", precision=10),
0102 constraint_mass_Kpi = Var("userFloat('constraint_mass_Kpi')", float, doc = "B mass with Kpi mass hypothesis after the dimuon mass constraint", precision=10),
0103 constraint_massErr_Kpi = Var("userFloat('constraint_massErr_Kpi')", float, doc = "mass uncertainty for the Kpi mass hypothesis of the dimuon mass constraint", precision=10),
0104 constraint_mass_piK = Var("userFloat('constraint_mass_piK')", float, doc = "B mass with piK mass hypothesis after the dimuon mass constraint", precision=10),
0105 constraint_massErr_piK = Var("userFloat('constraint_massErr_piK')", float, doc = "mass uncertainty for the piK mass hypothesis of the dimuon mass constraint", precision=10),
0106 constraint_mll = Var("userFloat('constraint_mll')", float, doc = "dimuon mass after the dimuon mass constraint", precision=10),
0107 )
0108 )
0109
0110 DiTrackTable = cms.EDProducer("SimpleCompositeCandidateFlatTableProducer",
0111 src = cms.InputTag("BToTrkTrkMuMu:SelectedTrkTrk"),
0112 cut = cms.string(""),
0113 name = cms.string("DiTrack"),
0114 doc = cms.string("slimmedDiTrack for BPark after basic selection"),
0115 singleton = cms.bool(False),
0116 extension = cms.bool(False),
0117 variables = cms.PSet(
0118 CandVars,
0119 fit_mass_KK = Var("userFloat('fitted_mass_KK')", float, doc="", precision=10),
0120 fit_mass_Kpi = Var("userFloat('fitted_mass_Kpi')", float, doc="", precision=10),
0121 fit_mass_piK = Var("userFloat('fitted_mass_piK')", float, doc="", precision=10),
0122 fit_pt = Var("userFloat('fitted_pt')", float, doc="", precision=10),
0123 fit_eta = Var("userFloat('fitted_eta')", float, doc="", precision=10),
0124 fit_phi = Var("userFloat('fitted_phi')", float, doc="", precision=10),
0125 svprob = Var("userFloat('sv_prob')", float, doc="", precision=10),
0126 trk1_idx = Var("userInt('trk1_idx')", int, doc=""),
0127 trk2_idx = Var("userInt('trk2_idx')", int, doc=""),
0128 vtx_x = Var("userFloat('vtx_x')", float, doc="", precision=10),
0129 vtx_y = Var("userFloat('vtx_y')", float, doc="", precision=10),
0130 vtx_z = Var("userFloat('vtx_z')", float, doc="", precision=10),
0131 l_xy = Var("userFloat('l_xy')", float, doc="", precision=10),
0132 l_xy_unc = Var("userFloat('l_xy_unc')", float, doc="", precision=10),
0133 cos_theta_2D = Var("userFloat('fitted_cos_theta_2D')", float, doc="", precision=10),
0134 sv_prob = Var("userFloat('sv_prob')", float, doc="", precision=10),
0135 sv_ndof = Var("userFloat('sv_ndof')", float, doc="", precision=10),
0136 sv_chi2 = Var("userFloat('sv_chi2')", float, doc="", precision=10),
0137 vtx_cxx = Var("userFloat('vtx_cxx')", float, doc="", precision=10),
0138 vtx_cyy = Var("userFloat('vtx_cyy')", float, doc="", precision=10),
0139 vtx_czz = Var("userFloat('vtx_czz')", float, doc="", precision=10),
0140 vtx_cyx = Var("userFloat('vtx_cyx')", float, doc="", precision=10),
0141 vtx_czx = Var("userFloat('vtx_czx')", float, doc="", precision=10),
0142 vtx_czy = Var("userFloat('vtx_czy')", float, doc="", precision=10)
0143
0144 )
0145 )
0146
0147
0148 CountBToTrkTrkMuMu = cms.EDFilter("PATCandViewCountFilter",
0149 minNumber = cms.uint32(1),
0150 maxNumber = cms.uint32(999999),
0151 src = cms.InputTag("BToTrkTrkMuMu")
0152 )
0153
0154
0155 BToTrkTrkMuMuSequence = cms.Sequence( BToTrkTrkMuMu )
0156 BToTrkTrkMuMuTables = cms.Sequence( BToTrkTrkMuMuTable + DiTrackTable )