From bd2d83aea233ba815895f96a21827c63160bef7c Mon Sep 17 00:00:00 2001 From: Mengzhen Wang Date: Tue, 24 Sep 2019 12:14:48 +0200 Subject: [PATCH 1/4] upload HLT2 lines for detached Jpsi --- Hlt/Hlt2Conf/options/11144008.py | 25 +++ Hlt/Hlt2Conf/options/12143001.py | 25 +++ Hlt/Hlt2Conf/options/Hlt2DiMuonLines_test.py | 107 +++++++++++ .../python/Hlt2Conf/lines/__init__.py | 1 + .../Hlt2Conf/lines/psi2MuMu_detached.py | 180 ++++++++++++++++++ 5 files changed, 338 insertions(+) create mode 100644 Hlt/Hlt2Conf/options/11144008.py create mode 100644 Hlt/Hlt2Conf/options/12143001.py create mode 100644 Hlt/Hlt2Conf/options/Hlt2DiMuonLines_test.py create mode 100644 Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py diff --git a/Hlt/Hlt2Conf/options/11144008.py b/Hlt/Hlt2Conf/options/11144008.py new file mode 100644 index 00000000000..ba099c34dfb --- /dev/null +++ b/Hlt/Hlt2Conf/options/11144008.py @@ -0,0 +1,25 @@ +from PyConf.environment import EverythingHandler, setupInput + +import os +input_files = [] +decay_descriptor = "11144008" +DDDBTag = 'dddb-20171126' +CONDDBTag = 'sim-20171127-vc-md100' +inputFileType = 'ROOT' + +pfn_dir = "/afs/cern.ch/user/m/mengzhen/Work/workspace/upgrade_dimuon_studies/stack/Moore/Hlt/Hlt2Conf/options/filelist/pfn" +for filename in os.listdir(pfn_dir): + if decay_descriptor in filename: + full_filename = pfn_dir+"/"+filename + inputfiles = open(full_filename) + for line in inputfiles.readlines(): + input_files.append(line.replace("\n","")) + + +setupInput( + input_files, + dataType='Upgrade', + DDDBTag=DDDBTag, + CONDDBTag=CONDDBTag, + Simulation=True, + inputFileType=inputFileType) diff --git a/Hlt/Hlt2Conf/options/12143001.py b/Hlt/Hlt2Conf/options/12143001.py new file mode 100644 index 00000000000..97834cd182d --- /dev/null +++ b/Hlt/Hlt2Conf/options/12143001.py @@ -0,0 +1,25 @@ +from PyConf.environment import EverythingHandler, setupInput + +import os +input_files = [] +decay_descriptor = "12143001" +DDDBTag = 'dddb-20171126' +CONDDBTag = 'sim-20171127-vc-md100' +inputFileType = 'ROOT' + +pfn_dir = "/afs/cern.ch/user/m/mengzhen/Work/workspace/upgrade_dimuon_studies/stack/Moore/Hlt/Hlt2Conf/options/filelist/pfn" +for filename in os.listdir(pfn_dir): + if decay_descriptor in filename: + full_filename = pfn_dir+"/"+filename + inputfiles = open(full_filename) + for line in inputfiles.readlines(): + input_files.append(line.replace("\n","")) + + +setupInput( + input_files, + dataType='Upgrade', + DDDBTag=DDDBTag, + CONDDBTag=CONDDBTag, + Simulation=True, + inputFileType=inputFileType) diff --git a/Hlt/Hlt2Conf/options/Hlt2DiMuonLines_test.py b/Hlt/Hlt2Conf/options/Hlt2DiMuonLines_test.py new file mode 100644 index 00000000000..7dd3471e42d --- /dev/null +++ b/Hlt/Hlt2Conf/options/Hlt2DiMuonLines_test.py @@ -0,0 +1,107 @@ +############################################################################### +# (c) Copyright 2019 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. # +############################################################################### +"""Options for running HLT2 lines. + +Run like any other options file: + + ./Moore/run gaudirun.py hlt2_example.py +""" +from __future__ import absolute_import, division, print_function + +from PyConf.environment import EverythingHandler, setupInput + +from PyConf.Algorithms import FTRawBankDecoder + +from Hlt2Conf.setup import setup +from Hlt2Conf.data_from_file import raw_event_from_file +from Hlt2Conf.lines import hlt2_line_builders + +from RecoConf.reco_objects_from_file import ( + make_raw_data_for_gec_from_file, upfront_reconstruction, + stateProvider_with_simplified_geom) +from RecoConf.hlt1_tracking import require_gec +import os,sys + +setup() + +ftdec_v = 4 + +# When running from Upgrade MC, must use the post-juggling locations of the raw +# event +raw_event_format = 4.3 + +env = EverythingHandler( + threadPoolSize=1, nEventSlots=1, evtMax=100000, debug=False) + + +''' +# a list of available samples for testing +#decay_descriptor = "11144008" +#decay_descriptor = sys.argv[2] +# set the input files and the detector conditions +input_files = [] + + +#read input files: +input_files = [] +pfn_dir = "/afs/cern.ch/user/m/mengzhen/Work/workspace/upgrade_dimuon_studies/stack/Moore/Hlt/Hlt2Conf/options/filelist/pfn" +for filename in os.listdir(pfn_dir): + if decay_descriptor in filename: + full_filename = pfn_dir+"/"+filename + inputfiles = open(full_filename) + for line in inputfiles.readlines(): + input_files.append(line.replace("\n","")) + +#available inputfiles for this dimuon study: +# MinBias 30000000 +# sim+std:/MC/Upgrade/Beam7000GeV-Upgrade-MagDown-Nu7.6-25ns-Pythia8/Sim09c-Up02/Reco-Up01/Trig0x52000000/30000000/LDST +# B0->Jpsi rho, Jpsi->dimuon, rho->pipi, 11144008 +# sim+std:/MC/Upgrade/Beam7000GeV-Upgrade-MagDown-Nu7.6-25ns-Pythia8/Sim09c-Up02/Reco-Up01/Trig0x52000000/11144008/LDST +# B+ -> Jpsi K+, Jpsi->dimuon, 12143001 +# sim+std:/MC/Upgrade/Beam7000GeV-Upgrade-MagDown-Nu7.6-25ns-Pythia8/Sim09c-Up02/Reco-Up01/Trig0x52000000/12143001/LDST +# B -> Jpsi K pi pi, Jpsi->dimuon, 12245021 +# sim+std:/MC/Upgrade/Beam7000GeV-Upgrade-MagDown-Nu7.6-25ns-Pythia8/Sim09c-Up02/Reco-Up01/Trig0x52000000/12245021/LDST +# Lb -> Jpsi p K, Jpsi->dimuon, 15144001 +# sim+std:/MC/Upgrade/Beam7000GeV-Upgrade-MagDown-Nu7.6-25ns-Pythia8/Sim09c-Up02/Reco-Up01/Trig0x52000000/15144001/LDST + +#Use the same files which were used last year. They are produced in same DDDB and CONDDB conditions +DDDBTag = 'dddb-20171126' +CONDDBTag = 'sim-20171127-vc-md100' +inputFileType = 'ROOT' + + + + +setupInput( + input_files, + dataType='Upgrade', + DDDBTag=DDDBTag, + CONDDBTag=CONDDBTag, + Simulation=True, + inputFileType=inputFileType) +''' +######## + +lines_to_run = [ + 'Hlt2Jpsi2MuMuDetachedLine', 'Hlt2psi2S2MuMuDetachedLine' +] + +with FTRawBankDecoder.bind(DecodingVersion=ftdec_v), \ + require_gec.bind(make_raw = make_raw_data_for_gec_from_file, + FTDecodingVersion=ftdec_v), \ + raw_event_from_file.bind(raw_event_format=raw_event_format): + + for name, builder in hlt2_line_builders(lines_to_run).items(): + env.registerLine(name, upfront_reconstruction() + builder()) + +env.register_public_tool(stateProvider_with_simplified_geom()) + +env.configure() diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py index c0d7dc099d3..cb5500e0983 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py @@ -60,3 +60,4 @@ def hlt2_line_builder(name): # Import each module so that the lines are registered from . import D02HH from . import Bs2JpsiPhi +from . import psi2MuMu_detached diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py new file mode 100644 index 00000000000..d18354eb24c --- /dev/null +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py @@ -0,0 +1,180 @@ +############################################################################### +# (c) Copyright 2019 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. # +############################################################################### +"""Definition of D0 -> h- h+ HLT2 lines. + +Final states built are: + +1. D0 -> K- pi+ and it's charge conjugate +2. D*+ -> (D0 -> K- pi+) pi+ and it's charge conjugate +3. D0 -> K- K+ +4. D0 -> pi- pi+ + +The D0 -> h- h+, with identical h species, do not create the charge conjugate +D~0 objects because it would have identical properties and hence would be +a waste of CPU (duplicating the selection and vertexing). This is annoying when +D* tagging is eventually added, however, and one cannot create the 'physical' +charge combinations of `D*+ -> D0 pi+` and `D*- D~0 pi-`. It can be considered +a flaw in the selection framework that we cannot currently express these sorts +of combinations cleanly. +""" +from __future__ import absolute_import, division, print_function +import math + +from GaudiKernel.SystemOfUnits import GeV, MeV, mm, mrad + +from RecoConf.hlt1_tracking import require_pvs, require_gec +from RecoConf.reco_objects_from_file import make_pvs + +from ..algorithms import require_all, ParticleCombinerWithPVs, ParticleFilterWithPVs +from ..framework import configurable +from ..standard_particles import make_has_rich_long_pions, make_has_rich_long_kaons, make_ismuon_long_muon +from . import hlt2_line_builder + +# Charged pion mass in MeV + + +@configurable +def make_selected_muons(make_particles=make_ismuon_long_muon, + make_pvs=make_pvs, + trchi2_max=3, + mipchi2_min=4, + pt_min=500 * MeV, + p_min=1 * GeV, + pid_cut= "PIDmu>0.0"): + """Return maker for particles filtered by thresholds common to charm decay product selections. + + Parameters + ---------- + make_particles + Particle maker function. + make_pvs : callable + Primary vertex maker function. + + Remaining parameters define thresholds for the selection. + """ + code = require_all( + 'PT > {pt_min}', + 'P > {p_min}', + # TODO(AP): Cut value is reasonable for Run 2, but removes basically + # everything in the upgrade sample + # 'TRCHI2 < {trchi2_max}', + 'MIPCHI2DV(PRIMARY) > {mipchi2_min}').format( + pt_min=pt_min, + p_min=p_min, + trchi2_max=trchi2_max, + mipchi2_min=mipchi2_min) + if pid_cut is not None: + code += ' & ({})'.format(pid_cut) + return ParticleFilterWithPVs(make_particles(), make_pvs(), Code=code) + + + +@configurable +def make_dimuon_detached(particles, + descriptors, + pvs, + am_min=2896.9 * MeV, + am_max=3886.1 * MeV, + amaxchild_pt_min=1500 * MeV, + apt_min=2000 * MeV, + amindoca_max=0.1 * mm, + vchi2pdof_max=10, + bpvvdchi2_min=25, + acos_bpvdira_min=17.3 * mrad): + """Return D0 maker with selection tailored for two-body hadronic final states. + + Parameters + ---------- + particles : list + Input particles used in the combination. + descriptors : list + Decay descriptors to be reconstructed. + pvs + Primary vertices used for computing PV-related information. + + Remaining parameters define thresholds for the selection. + """ + combination_code = require_all("in_range({am_min}, AM, {am_max})", + "AMAXCHILD(PT) > {amaxchild_pt_min}", + "APT > {apt_min}", + "AMINDOCA('') < {amindoca_max}").format( + am_min=am_min, + am_max=am_max, + amaxchild_pt_min=amaxchild_pt_min, + apt_min=apt_min, + amindoca_max=amindoca_max) + + cos_bpvdira_min = math.cos(acos_bpvdira_min) + vertex_code = require_all("CHI2VXNDOF < {vchi2pdof_max}", "BPVVALID()", + "BPVVDCHI2() > {bpvvdchi2_min}", + "BPVDIRA() > {cos_bpvdira_min}").format( + vchi2pdof_max=vchi2pdof_max, + bpvvdchi2_min=bpvvdchi2_min, + cos_bpvdira_min=cos_bpvdira_min) + + return ParticleCombinerWithPVs( + particles=particles, + pvs=pvs, + DecayDescriptors=descriptors, + CombinationCut=combination_code, + MotherCut=vertex_code) + +@configurable +def make_Jpsi_detached(particle, + pvs, + m_min = 2996.9 * MeV, + m_max = 3196.9 * MeV): + vertex_code = require_all("in_range({m_min}, M, {m_max})").format( + m_min = m_min, + m_max = m_max) + return ParticleFilterWithPVs(particle, pvs, Code=vertex_code) + +@configurable +def make_psi2S_detached(particle, + pvs, + m_min = 3566.1 * MeV, + m_max = 3786.1 * MeV): + vertex_code = require_all("in_range({m_min}, M, {m_max})").format( + m_min = m_min, + m_max = m_max) + return ParticleFilterWithPVs(particle, pvs, Code=vertex_code) + + + +def charm_prefilters(): + """Return a list of prefilters common to charm HLT2 lines.""" + return [require_gec(), require_pvs(make_pvs())] + + +@hlt2_line_builder('Hlt2Jpsi2MuMuDetachedLine') +def Jpsi2MuMudetached_line(): + muons = make_selected_muons() + pvs = make_pvs() + dimuon = make_dimuon_detached( + particles = [muons], + descriptors = ['J/psi(1S) -> mu+ mu-'], + pvs = pvs + ) + Jpsi = make_Jpsi_detached(dimuon, pvs) + return charm_prefilters() + [Jpsi] + + +@hlt2_line_builder('Hlt2psi2S2MuMuDetachedLine') +def psi2S2MuMudetached_line(): + muons = make_selected_muons() + pvs = make_pvs() + dimuon = make_dimuon_detached( + particles = [muons], + descriptors = ['J/psi(1S) -> mu+ mu-'], + pvs = pvs + ) + Jpsi = make_psi2S_detached(dimuon, pvs) + return charm_prefilters() + [Jpsi] -- GitLab From 599e482226c461f770e5c4cdb11b45f8a6626faa Mon Sep 17 00:00:00 2001 From: Mengzhen Wang Date: Tue, 24 Sep 2019 12:15:49 +0200 Subject: [PATCH 2/4] remove option files --- Hlt/Hlt2Conf/options/11144008.py | 25 ----- Hlt/Hlt2Conf/options/12143001.py | 25 ----- Hlt/Hlt2Conf/options/Hlt2DiMuonLines_test.py | 107 ------------------- 3 files changed, 157 deletions(-) delete mode 100644 Hlt/Hlt2Conf/options/11144008.py delete mode 100644 Hlt/Hlt2Conf/options/12143001.py delete mode 100644 Hlt/Hlt2Conf/options/Hlt2DiMuonLines_test.py diff --git a/Hlt/Hlt2Conf/options/11144008.py b/Hlt/Hlt2Conf/options/11144008.py deleted file mode 100644 index ba099c34dfb..00000000000 --- a/Hlt/Hlt2Conf/options/11144008.py +++ /dev/null @@ -1,25 +0,0 @@ -from PyConf.environment import EverythingHandler, setupInput - -import os -input_files = [] -decay_descriptor = "11144008" -DDDBTag = 'dddb-20171126' -CONDDBTag = 'sim-20171127-vc-md100' -inputFileType = 'ROOT' - -pfn_dir = "/afs/cern.ch/user/m/mengzhen/Work/workspace/upgrade_dimuon_studies/stack/Moore/Hlt/Hlt2Conf/options/filelist/pfn" -for filename in os.listdir(pfn_dir): - if decay_descriptor in filename: - full_filename = pfn_dir+"/"+filename - inputfiles = open(full_filename) - for line in inputfiles.readlines(): - input_files.append(line.replace("\n","")) - - -setupInput( - input_files, - dataType='Upgrade', - DDDBTag=DDDBTag, - CONDDBTag=CONDDBTag, - Simulation=True, - inputFileType=inputFileType) diff --git a/Hlt/Hlt2Conf/options/12143001.py b/Hlt/Hlt2Conf/options/12143001.py deleted file mode 100644 index 97834cd182d..00000000000 --- a/Hlt/Hlt2Conf/options/12143001.py +++ /dev/null @@ -1,25 +0,0 @@ -from PyConf.environment import EverythingHandler, setupInput - -import os -input_files = [] -decay_descriptor = "12143001" -DDDBTag = 'dddb-20171126' -CONDDBTag = 'sim-20171127-vc-md100' -inputFileType = 'ROOT' - -pfn_dir = "/afs/cern.ch/user/m/mengzhen/Work/workspace/upgrade_dimuon_studies/stack/Moore/Hlt/Hlt2Conf/options/filelist/pfn" -for filename in os.listdir(pfn_dir): - if decay_descriptor in filename: - full_filename = pfn_dir+"/"+filename - inputfiles = open(full_filename) - for line in inputfiles.readlines(): - input_files.append(line.replace("\n","")) - - -setupInput( - input_files, - dataType='Upgrade', - DDDBTag=DDDBTag, - CONDDBTag=CONDDBTag, - Simulation=True, - inputFileType=inputFileType) diff --git a/Hlt/Hlt2Conf/options/Hlt2DiMuonLines_test.py b/Hlt/Hlt2Conf/options/Hlt2DiMuonLines_test.py deleted file mode 100644 index 7dd3471e42d..00000000000 --- a/Hlt/Hlt2Conf/options/Hlt2DiMuonLines_test.py +++ /dev/null @@ -1,107 +0,0 @@ -############################################################################### -# (c) Copyright 2019 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. # -############################################################################### -"""Options for running HLT2 lines. - -Run like any other options file: - - ./Moore/run gaudirun.py hlt2_example.py -""" -from __future__ import absolute_import, division, print_function - -from PyConf.environment import EverythingHandler, setupInput - -from PyConf.Algorithms import FTRawBankDecoder - -from Hlt2Conf.setup import setup -from Hlt2Conf.data_from_file import raw_event_from_file -from Hlt2Conf.lines import hlt2_line_builders - -from RecoConf.reco_objects_from_file import ( - make_raw_data_for_gec_from_file, upfront_reconstruction, - stateProvider_with_simplified_geom) -from RecoConf.hlt1_tracking import require_gec -import os,sys - -setup() - -ftdec_v = 4 - -# When running from Upgrade MC, must use the post-juggling locations of the raw -# event -raw_event_format = 4.3 - -env = EverythingHandler( - threadPoolSize=1, nEventSlots=1, evtMax=100000, debug=False) - - -''' -# a list of available samples for testing -#decay_descriptor = "11144008" -#decay_descriptor = sys.argv[2] -# set the input files and the detector conditions -input_files = [] - - -#read input files: -input_files = [] -pfn_dir = "/afs/cern.ch/user/m/mengzhen/Work/workspace/upgrade_dimuon_studies/stack/Moore/Hlt/Hlt2Conf/options/filelist/pfn" -for filename in os.listdir(pfn_dir): - if decay_descriptor in filename: - full_filename = pfn_dir+"/"+filename - inputfiles = open(full_filename) - for line in inputfiles.readlines(): - input_files.append(line.replace("\n","")) - -#available inputfiles for this dimuon study: -# MinBias 30000000 -# sim+std:/MC/Upgrade/Beam7000GeV-Upgrade-MagDown-Nu7.6-25ns-Pythia8/Sim09c-Up02/Reco-Up01/Trig0x52000000/30000000/LDST -# B0->Jpsi rho, Jpsi->dimuon, rho->pipi, 11144008 -# sim+std:/MC/Upgrade/Beam7000GeV-Upgrade-MagDown-Nu7.6-25ns-Pythia8/Sim09c-Up02/Reco-Up01/Trig0x52000000/11144008/LDST -# B+ -> Jpsi K+, Jpsi->dimuon, 12143001 -# sim+std:/MC/Upgrade/Beam7000GeV-Upgrade-MagDown-Nu7.6-25ns-Pythia8/Sim09c-Up02/Reco-Up01/Trig0x52000000/12143001/LDST -# B -> Jpsi K pi pi, Jpsi->dimuon, 12245021 -# sim+std:/MC/Upgrade/Beam7000GeV-Upgrade-MagDown-Nu7.6-25ns-Pythia8/Sim09c-Up02/Reco-Up01/Trig0x52000000/12245021/LDST -# Lb -> Jpsi p K, Jpsi->dimuon, 15144001 -# sim+std:/MC/Upgrade/Beam7000GeV-Upgrade-MagDown-Nu7.6-25ns-Pythia8/Sim09c-Up02/Reco-Up01/Trig0x52000000/15144001/LDST - -#Use the same files which were used last year. They are produced in same DDDB and CONDDB conditions -DDDBTag = 'dddb-20171126' -CONDDBTag = 'sim-20171127-vc-md100' -inputFileType = 'ROOT' - - - - -setupInput( - input_files, - dataType='Upgrade', - DDDBTag=DDDBTag, - CONDDBTag=CONDDBTag, - Simulation=True, - inputFileType=inputFileType) -''' -######## - -lines_to_run = [ - 'Hlt2Jpsi2MuMuDetachedLine', 'Hlt2psi2S2MuMuDetachedLine' -] - -with FTRawBankDecoder.bind(DecodingVersion=ftdec_v), \ - require_gec.bind(make_raw = make_raw_data_for_gec_from_file, - FTDecodingVersion=ftdec_v), \ - raw_event_from_file.bind(raw_event_format=raw_event_format): - - for name, builder in hlt2_line_builders(lines_to_run).items(): - env.registerLine(name, upfront_reconstruction() + builder()) - -env.register_public_tool(stateProvider_with_simplified_geom()) - -env.configure() -- GitLab From 452f3ae69e28a90c53a265345e2e205fc2dcedb4 Mon Sep 17 00:00:00 2001 From: Gitlab CI Date: Tue, 24 Sep 2019 10:21:05 +0000 Subject: [PATCH 3/4] Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Moore/-/jobs/5565365 --- .../python/Hlt2Conf/lines/__init__.py | 2 +- .../Hlt2Conf/lines/psi2MuMu_detached.py | 62 +++++++------------ 2 files changed, 25 insertions(+), 39 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py index cb5500e0983..319fced6f11 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/__init__.py @@ -60,4 +60,4 @@ def hlt2_line_builder(name): # Import each module so that the lines are registered from . import D02HH from . import Bs2JpsiPhi -from . import psi2MuMu_detached +from . import psi2MuMu_detached diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py index d18354eb24c..65b91bf8998 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py @@ -43,12 +43,12 @@ from . import hlt2_line_builder @configurable def make_selected_muons(make_particles=make_ismuon_long_muon, - make_pvs=make_pvs, - trchi2_max=3, - mipchi2_min=4, - pt_min=500 * MeV, - p_min=1 * GeV, - pid_cut= "PIDmu>0.0"): + make_pvs=make_pvs, + trchi2_max=3, + mipchi2_min=4, + pt_min=500 * MeV, + p_min=1 * GeV, + pid_cut="PIDmu>0.0"): """Return maker for particles filtered by thresholds common to charm decay product selections. Parameters @@ -76,19 +76,18 @@ def make_selected_muons(make_particles=make_ismuon_long_muon, return ParticleFilterWithPVs(make_particles(), make_pvs(), Code=code) - @configurable def make_dimuon_detached(particles, - descriptors, - pvs, - am_min=2896.9 * MeV, - am_max=3886.1 * MeV, - amaxchild_pt_min=1500 * MeV, - apt_min=2000 * MeV, - amindoca_max=0.1 * mm, - vchi2pdof_max=10, - bpvvdchi2_min=25, - acos_bpvdira_min=17.3 * mrad): + descriptors, + pvs, + am_min=2896.9 * MeV, + am_max=3886.1 * MeV, + amaxchild_pt_min=1500 * MeV, + apt_min=2000 * MeV, + amindoca_max=0.1 * mm, + vchi2pdof_max=10, + bpvvdchi2_min=25, + acos_bpvdira_min=17.3 * mrad): """Return D0 maker with selection tailored for two-body hadronic final states. Parameters @@ -127,28 +126,21 @@ def make_dimuon_detached(particles, CombinationCut=combination_code, MotherCut=vertex_code) + @configurable -def make_Jpsi_detached(particle, - pvs, - m_min = 2996.9 * MeV, - m_max = 3196.9 * MeV): +def make_Jpsi_detached(particle, pvs, m_min=2996.9 * MeV, m_max=3196.9 * MeV): vertex_code = require_all("in_range({m_min}, M, {m_max})").format( - m_min = m_min, - m_max = m_max) + m_min=m_min, m_max=m_max) return ParticleFilterWithPVs(particle, pvs, Code=vertex_code) + @configurable -def make_psi2S_detached(particle, - pvs, - m_min = 3566.1 * MeV, - m_max = 3786.1 * MeV): +def make_psi2S_detached(particle, pvs, m_min=3566.1 * MeV, m_max=3786.1 * MeV): vertex_code = require_all("in_range({m_min}, M, {m_max})").format( - m_min = m_min, - m_max = m_max) + m_min=m_min, m_max=m_max) return ParticleFilterWithPVs(particle, pvs, Code=vertex_code) - def charm_prefilters(): """Return a list of prefilters common to charm HLT2 lines.""" return [require_gec(), require_pvs(make_pvs())] @@ -159,10 +151,7 @@ def Jpsi2MuMudetached_line(): muons = make_selected_muons() pvs = make_pvs() dimuon = make_dimuon_detached( - particles = [muons], - descriptors = ['J/psi(1S) -> mu+ mu-'], - pvs = pvs - ) + particles=[muons], descriptors=['J/psi(1S) -> mu+ mu-'], pvs=pvs) Jpsi = make_Jpsi_detached(dimuon, pvs) return charm_prefilters() + [Jpsi] @@ -172,9 +161,6 @@ def psi2S2MuMudetached_line(): muons = make_selected_muons() pvs = make_pvs() dimuon = make_dimuon_detached( - particles = [muons], - descriptors = ['J/psi(1S) -> mu+ mu-'], - pvs = pvs - ) + particles=[muons], descriptors=['J/psi(1S) -> mu+ mu-'], pvs=pvs) Jpsi = make_psi2S_detached(dimuon, pvs) return charm_prefilters() + [Jpsi] -- GitLab From 51f39cbb8708d68982cc72b7f6a06115d0f3a57f Mon Sep 17 00:00:00 2001 From: Mengzhen Wang Date: Tue, 24 Sep 2019 13:07:52 +0200 Subject: [PATCH 4/4] remove dira cut --- Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py index 65b91bf8998..1374db870b9 100644 --- a/Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py +++ b/Hlt/Hlt2Conf/python/Hlt2Conf/lines/psi2MuMu_detached.py @@ -87,7 +87,7 @@ def make_dimuon_detached(particles, amindoca_max=0.1 * mm, vchi2pdof_max=10, bpvvdchi2_min=25, - acos_bpvdira_min=17.3 * mrad): + acos_bpvdira_min=0 * mrad): """Return D0 maker with selection tailored for two-body hadronic final states. Parameters @@ -111,13 +111,13 @@ def make_dimuon_detached(particles, apt_min=apt_min, amindoca_max=amindoca_max) - cos_bpvdira_min = math.cos(acos_bpvdira_min) + cos_bpvdira_max = math.cos(acos_bpvdira_min) vertex_code = require_all("CHI2VXNDOF < {vchi2pdof_max}", "BPVVALID()", "BPVVDCHI2() > {bpvvdchi2_min}", - "BPVDIRA() > {cos_bpvdira_min}").format( + "BPVDIRA() < {cos_bpvdira_max}").format( vchi2pdof_max=vchi2pdof_max, bpvvdchi2_min=bpvvdchi2_min, - cos_bpvdira_min=cos_bpvdira_min) + cos_bpvdira_max=cos_bpvdira_max) return ParticleCombinerWithPVs( particles=particles, -- GitLab