def __init__(self, tag, n, inputs, varmap, props): pids = ['K+', 'KS0', 'Lambda0', 'Lambda~0'] if tag == 'RAD' and n == 3: pids.append('gamma') varmap = PrepVarMap(pids, varmap) params = ('$PARAMFILESROOT/data/Hlt2Topo%dBody_BDTParams_%s.txt' % (n, props['RUN1_BDT_%iBODY_PARAMS' % (2 if tag == 'RAD' else n)])) bdttool = self.__classifier(params, varmap, "TrgBBDT") pc = ("(VALUE('%s/%s') > %%(RUN1_BDT_%iBODY%s_MIN)s)" % (bdttool.Type.getType(), bdttool.Name, n, tag)) if tag == 'MU': pc += " & INTREE(HASPROTO & HASMUON & ISMUON)" elif tag == 'E': pc += (" & INTREE(HASPROTO " "& (PIDe > %(RUN1_PIDE_MIN)s))") from HltTracking.HltPVs import PV3D if tag == 'RAD' and props['RUN1_RAD_TOS']: Hlt2ParticleFilter.__init__(self, 'BDT', pc, inputs, tistos='RUN1_TisTosSpec', shared=False, tools=[bdttool], dependencies=[PV3D('Hlt2')]) else: Hlt2ParticleFilter.__init__(self, 'BDT', pc, inputs, shared=False, tools=[bdttool], dependencies=[PV3D('Hlt2')])
def __apply_configuration__(self): from Stages import (TrackGEC, KaonFilter, KS0Filter, Pi0TOSFilter, Pi0Filter, Hb2XNeutralCombiner) from Inputs import Hlt2LooseKaons, KsLL filteredPi0s = Pi0Filter('FilteredPi0s', [Pi0TOSFilter()]) filteredKaons = KaonFilter( 'FilteredKaons', [Hlt2LooseKaons], self.getProp('FilteredKaons').get('TRACK_TISTOS')) filteredKSs = KS0Filter('FilteredKSs', [KsLL], self.getProp('FilteredKSs').get('KS0_TISTOS')) B2Kpi0 = Hb2XNeutralCombiner('B2Kpi0', '[B+ -> K+ pi0]cc', [filteredKaons, filteredPi0s]) B2K0pi0 = Hb2XNeutralCombiner('B2K0pi0', '[B0 -> KS0 pi0]cc', [filteredKSs, filteredPi0s]) from HltTracking.HltPVs import PV3D stages = { 'B2Kpi0': [TrackGEC(), PV3D('Hlt2'), B2Kpi0], 'B2K0pi0': [TrackGEC(), PV3D('Hlt2'), B2K0pi0], } from HltLine.HltLine import Hlt2Line for (linename, algos) in self.algorithms(stages): Hlt2Line('B2Kpi0_' + linename, algos=algos, prescale=self.prescale, postscale=self.postscale, L0DU=self.getProp('Common').get('L0FILTER'), HLT1=self.getProp(linename).get('HLT1FILTER'))
def get_stages(_): from Stages import TrackGEC, Lambda0Filter, Lb2L0GammaCombiner, B2XGammaCombiner from HltTracking.HltPVs import PV3D from Inputs import LambdaLL #, LambdaDD lambda0_ll = Lambda0Filter("Lambda0LL", [LambdaLL]) # lambda0_dd = LambdaFilter("Lambda0LL", [LambdaDD]) # Build stages stages = { 'RadiativeLb2L0GammaLL': [ TrackGEC(), PV3D('Hlt2'), Lb2L0GammaCombiner('Lb2L0GammaLL', '[Lambda_b0 -> Lambda0 gamma]cc', lambda0_ll) ], 'RadiativeLb2L0GammaEELL': [ TrackGEC(), PV3D('Hlt2'), B2XGammaCombiner('Lb2L0GammaEELL', '[Lambda_b0 -> Lambda0 gamma]cc', lambda0_ll, True) ] } return stages
def __init__(self, inputs, gec): pc = ("(PT > %(TRK_PT_MIN)s) & (P > %(TRK_P_MIN)s) " "& (TRCHI2DOF < %(TRK_CHI2_MAX)s) " "& (MIPCHI2DV(PRIMARY) > 16)") from HltTracking.HltPVs import PV3D deps = [FilterEvent(), PV3D('Hlt2')] if gec else [PV3D('Hlt2')] Hlt2ParticleFilter.__init__(self, 'TopoInput4', pc, inputs, shared=True, dependencies=deps)
def get_stages(props): from Stages import TrackGEC, TopoCombiner from HltTracking.HltPVs import PV3D from Hlt2Lines.Topo.Lines import TopoLines from Hlt2Lines.Topo.Stages import FilterMVA from Hlt2Lines.Utilities.Hlt2Stage import Hlt2ExternalStage # Load external stages topo_lines = TopoLines() two_body = Hlt2ExternalStage(topo_lines, topo_lines.stages(props['HHCombiner'])[0]) three_body = Hlt2ExternalStage( topo_lines, topo_lines.stages(props['HHHCombiner'])[0]) # Add the photon two_body_plus_photon = TopoCombiner('HHGammaCombo', 2, two_body) two_body_plus_ee = TopoCombiner('HHGammaComboEE', 2, two_body, True) three_body_plus_photon = TopoCombiner('HHHGammaCombo', 3, three_body) three_body_plus_ee = TopoCombiner('HHHGammaComboEE', 3, three_body, True) # Filter BDTs filtered_two_plus_one = FilterMVA( 21, [two_body_plus_photon], props['HHGammaBBDT'], nickname='HHGammaBBDT', preambulo=['from LoKiCore.math import log10']) filtered_two_plus_ee = FilterMVA(22, [two_body_plus_ee], props['HHGammaEEBBDT'], nickname='HHGammaEEBBDT') filtered_three_plus_one = FilterMVA( 31, [three_body_plus_photon], props['HHHGammaBBDT'], nickname='HHHGammaBBDT', preambulo=['from LoKiCore.math import log10']) filtered_three_plus_ee = FilterMVA(32, [three_body_plus_ee], props['HHHGammaEEBBDT'], nickname='HHHGammaEEBBDT') # Build stages return { 'RadiativeIncHHGamma': [TrackGEC(), PV3D('Hlt2'), filtered_two_plus_one], 'RadiativeIncHHHGamma': [TrackGEC(), PV3D('Hlt2'), filtered_three_plus_one], 'RadiativeIncHHGammaEE': [TrackGEC(), PV3D('Hlt2'), filtered_two_plus_ee], 'RadiativeIncHHHGammaEE': [TrackGEC(), PV3D('Hlt2'), filtered_three_plus_ee] }
def __init__(self, name, xplus="mu", xminus="mu", version="signal"): from HltTracking.HltPVs import PV3D # Dictionary of the inputs inputlist = { "mu": Hlt2Muons, "pi": Hlt2Pions, "K": Hlt2Kaons, "p": Hlt2Protons, "e": Hlt2Electrons, } # Current input inputs = [inputlist[xminus]] if ( xminus == xplus) else [inputlist[xminus], inputlist[xplus]] # dictionary of the daughter cuts d0comb_childcut_list =\ ( { xplus+'+' : self.d0comb_childcut } if ( xplus == xminus ) else \ { xplus+'+' : self.d0comb_childcut, xminus+'+' : self.d0comb_childcut} ) # Decay descriptor decay = "D0 -> " + xplus + "+ " + xminus + "-" if ( xplus == xminus) else "[D0 -> " + xplus + "+ " + xminus + "- ]cc" # Combiner Hlt2Combiner.__init__( self, name, decay, inputs, dependencies=[PV3D('Hlt2')], #tistos = 'TisTosSpec', DaughtersCuts=d0comb_childcut_list, CombinationCut=self.d0comb_combcut_sig if version == "signal" else self.d0comb_combcut, MotherCut=self.d0comb_d0cut, Preambulo=[])
def __init__(self, name, decayDesc, inputSeq): from HltTracking.HltPVs import PV3D # massmin = min(float("%(Sig_M_MIN_HHmumu)s"), float("%(WideMass_M_MIN_HHmumu)s")) # massmax = max(float("%(Sig_M_MAX_HHmumu)s"), float("%(WideMass_M_MAX_HHmumu)s")) # masscut = "in_range(%s, M, %s)" % (massmin, massmax) masscut = "in_range( %(WideMass_M_MIN_HHmumu)s , M , %(WideMass_M_MAX_HHmumu)s )" combcuts = "(AM<2100)" \ "& (AMAXCHILD(PT) > %(TrkPtMAX_HHmumu)s) " \ "& (AMINCHILD( MIPCHI2DV(PRIMARY) ) > %(TrkPVIPChi2_XeeORmue)s ) " \ "& ((APT1+APT2+APT3+APT4) > %(DSumPt_HHmumu)s)" \ "& (AMINDOCA('LoKi::TrgDistanceCalculator') < %(PairMinDoca_HHmumu)s)" \ "& (AMAXDOCA('LoKi::TrgDistanceCalculator') < %(PairMaxDoca_HHmumu)s)" \ "& (AALLSAMEBPV)" mothercuts = masscut + \ "& (VFASPF(VCHI2PDOF) < %(VtxChi2_HHmumu)s) " \ "& (BPVCORRM < %(MCOR_MAX_HHmumu)s)" \ "& (BPVDIRA > %(DDira_HHmumu)s ) " \ "& (BPVVDCHI2> %(VtxPVDispChi2_XeeORmue)s )" \ "& ( SUMTREE( ( (ID=='K+') | (ID=='K-') | (ID=='pi+') | (ID=='pi-') | (ID=='mu+') | (ID=='mu-') | (ID=='e+') | (ID=='e-') ), sqrt(BPVIPCHI2()) ) > %(TrkPVIPChi2MAX_HHmumu)s)"\ "& (BPVIPCHI2() < %(DIPChi2_HHmumu)s )" Hlt2Combiner.__init__(self, name, decayDesc, inputSeq, dependencies=[PV3D('Hlt2')], CombinationCut=combcuts, MotherCut=mothercuts, Preambulo=[], shared=True)
def __init__(self, name, inputs): daughters_cuts = { "mu-": ("(TRCHI2DOF < %(MuonTRCHI2)s ) & (P> %(MuonP)s *MeV) & (PT> %(MuonPT)s* MeV)" + "& (TRGHOSTPROB < %(MuonGHOSTPROB)s)" + "& (PIDmu-PIDpi> %(MuonPIDmu)s )" + "& (PIDmu-PIDp> %(MuonPIDp)s )" + "& (PIDmu-PIDK> %(MuonPIDK)s )" + "& (MIPCHI2DV(PRIMARY)> %(MuonMINIPCHI2)s )"), "pi+": ("(P > %(Lambda0DaugP)s)& (PT > %(Lambda0DaugPT)s)" + "& (TRCHI2DOF < %(Lambda0DaugTrackChi2)s)" + "& (MIPCHI2DV(PRIMARY) > %(Lambda0DaugMIPChi2)s)") } combination_cuts = "(ADOCACHI2CUT(25, ''))" mother_cuts = "( M > %(MajoranaCutM)s*MeV )&( BPVVDCHI2 > %(MajoranaCutFDChi2)s )&( VFASPF(VCHI2/VDOF) < %(Lambda0VertexChi2)s )&( PT > %(Lambda0PT)s*MeV )" decay = "[Lambda0 -> mu- pi+]cc" Hlt2Combiner.__init__(self, name, decay, inputs, nickname='LambdaMuPi', dependencies=[PV3D('Hlt2')], DaughtersCuts=daughters_cuts, CombinationCut=combination_cuts, MotherCut=mother_cuts, Preambulo=[])
def __init__(self, name, decayDesc, inputSeq): from HltTracking.HltPVs import PV3D Lambda_c_masscut = "in_range( %(Lambda_c_WideMass_M_MIN)s , M , %(Lambda_c_WideMass_M_MAX)s )" combcuts = "(AM<2400)" \ "& (AMAXCHILD(PT) > %(TrkPtMAX_Hmumu)s) " \ "& ((APT1+APT2+APT3) > %(DSumPt_Hmumu)s)" \ "& (AMINDOCA('LoKi::TrgDistanceCalculator') < %(PairMinDoca_Hmumu)s)" \ "& (AMAXDOCA('LoKi::TrgDistanceCalculator') < %(PairMaxDoca_Hmumu)s)" \ "& (AALLSAMEBPV)" mothercuts = Lambda_c_masscut + \ "& (VFASPF(VCHI2PDOF) < %(VtxChi2_Hmumu)s) " \ "& (BPVCORRM < %(MCOR_MAX_Hmumu)s)" \ "& (BPVDIRA > %(DDira_Hmumu)s ) " \ "& (BPVVDCHI2> %(VtxPVDispChi2_XeeORmue)s )" \ "& ( SUMTREE( ( (ID=='p+') | (ID=='p~-') | (ID=='pi+') | (ID=='pi-') | (ID=='mu+') | (ID=='mu-') | (ID=='e+') | (ID=='e-') ), sqrt(BPVIPCHI2()) ) > %(TrkPVIPChi2MAX_Hmumu)s)"\ "& (BPVIPCHI2() < %(DIPChi2_Hmumu)s )" Hlt2Combiner.__init__(self, name, decayDesc, inputSeq, dependencies=[PV3D('Hlt2')], CombinationCut=combcuts, MotherCut=mothercuts, Preambulo=[], shared=True)
def __init__(self, inputs): from Hlt1Lines.Hlt1MVALines import Hlt1MVALinesConf props = Hlt1MVALinesConf().getProps() pids = ['K+', 'K-', 'KS0', 'Lambda0', 'Lambda~0'] basic = "(ABSID=='K+')" combos = list(combinations_with_replacement(pids, 2)) decays = ['K*(892)0 -> ' + ' '.join(combo) for combo in combos] cc = ("(APT > %(CMB_PRT_PT_MIN)s) " "& (ANUM((ID=='KS0')|(ABSID=='Lambda0')) < 2) " "& (ACUTDOCACHI2(%(CMB_VRT_CHI2_MAX)s, '')) " "& ((AALLSAMEBPV | (AMINCHILD(MIPCHI2DV(PRIMARY)) > 16)) " "| (ANUM((ID == 'KS0') | (ABSID == 'Lambda0')) > 0)) " "& (AM < %(CMB_VRT_MCOR_MAX)s) " "& (ANUM(" + basic + " & (MIPCHI2DV(PRIMARY) < 16)) <" " %(CMB_TRK_NLT16_MAX)s) ") mc = ("(HASVERTEX)" "& (VFASPF(VCHI2) < %(CMB_VRT_CHI2_MAX)s) " "& (BPVVDCHI2 > %(CMB_VRT_VDCHI2_MIN)s) " "& (in_range(%(CMB_VRT_ETA_MIN)s, BPVETA," " %(CMB_VRT_ETA_MAX)s)) ") from Hlt2Lines.Utilities.Hlt2MergedStage import Hlt2MergedStage merged = [Hlt2MergedStage('Topo2BodyTos', inputs, shared=True)] from HltTracking.HltPVs import PV3D Hlt2Combiner.__init__(self, 'Topo2BodyTos', decays, merged, shared=True, tistos='ALLTOS', dependencies=[PV3D('Hlt2')], CombinationCut=cc, MotherCut=mc)
def __init__(self, inputs, tag=None): cc = ("(AMINCHILD(PT) > %(JET_PT)s)" " & (abs(ACHILD(PHI,1) - ACHILD(PHI,2)) > %(DPHI)s)") if tag == 'SV': cc += (" & ((ACHILD(INFO(9600, -1), 1) != -1)" " | (ACHILD(INFO(9600, -1), 2) != -1))") elif tag == 'SVSV': cc += (" & (ACHILD(INFO(9600, -1), 1) != -1)" " & (ACHILD(INFO(9600, -1), 2) != -1)") elif tag == 'MuMu': cc += (" & (ACHILD(INFO(9601, -1), 1) != -1)" " & (ACHILD(INFO(9601, -1), 2) != -1)") elif tag == "SVMu": cc += (" & (((ACHILD(INFO(9600, -1), 1) != -1)" " & (ACHILD(INFO(9601, -1), 2) != -1))" " | ((ACHILD(INFO(9601, -1), 1) != -1)" " & (ACHILD(INFO(9600, -1), 2) != -1)))") Hlt2Combiner.__init__(self, 'DiJet' + tag, ["CLUSjet -> CELLjet CELLjet"], inputs, dependencies=[PV3D('Hlt2')], CombinationCut=cc, MotherCut='(ALL)', Preambulo=[], shared=True, ParticleCombiners={'': 'ParticleAdder'})
def __init__(self, name, decay, inputs): dc = {'e+': "(MIPCHI2DV(PRIMARY) < %(MaxIpChi2)s)"} cc = ( "(ACHILD(MIPDV(PRIMARY),1) * ACHILD(MIPDV(PRIMARY),2) > %(IpProd)s)" + " & (ACHILD(TRGHOSTPROB,1) + ACHILD(TRGHOSTPROB,2) < %(SumGP)s)" + " & ((ACHILD(MIPCHI2DV(PRIMARY),1) - %(MinIpChi2)s) * (ACHILD(MIPCHI2DV(PRIMARY),2) - %(MinIpChi2)s) > %(IpChi2Prod)s)" ) mc = ("(PCUTA(ALV(1,2) < %(CosAngle)s))" + " & (BPVVDZ > %(VDZ)s)" + " & ((MIPDV(PRIMARY)/BPVVDZ) < %(IpDzRatio)s)" + " & (VFASPF(VX*VX + VY*VY) > %(Rho2)s)" + " & (DOCAMAX < %(DOCA)s)" + " & (VFASPF(VZ) < %(SVZ)s)" + " & (MM < %(Mass)s)" + " & (BPVDIRA > %(Dira)s)") Hlt2Combiner.__init__(self, name, decay, inputs, DaughtersCuts=dc, CombinationCut=cc, MotherCut=mc, shared=True, dependencies=[PV3D('Hlt2')], UseP2PVRelations=False)
def hltRICHMirrorBlock_Streamer( self, name, props ) : from Hlt1Lines.Hlt1GECs import Hlt1GECUnit from Configurables import LoKi__HltUnit as HltUnit props['name'] = name props['PhiCuts'] = ' | '.join(('in_range(%3.2f, TrPHI, %3.2f)' % box for box in props['Phis'])) lineCode = """ TrackCandidates >> FitTrack >> tee ( monitor( TC_SIZE > 0, '# pass TrackFit', LoKi.Monitoring.ContextSvc ) ) >> tee ( monitor( TC_SIZE , 'nFit' , LoKi.Monitoring.ContextSvc ) ) >> ( ( TrPT > %(PT)s ) & ( TrP > %(P)s ) & ( TrCHI2PDOF < %(TrChi2)s ) ) >> tee ( monitor( TC_SIZE > 0, '# pass P/PT/TrackChi2', LoKi.Monitoring.ContextSvc ) ) >> tee ( monitor( TC_SIZE , 'nP/PT/Chi2' , LoKi.Monitoring.ContextSvc ) ) >> ( ( in_range(%(MinETA)s, TrETA, %(MaxETA)s) ) & ( %(PhiCuts)s ) ) >> tee ( monitor( TC_SIZE > 0, '# pass P/PT/ETA/PHI', LoKi.Monitoring.ContextSvc ) ) >> tee ( monitor( TC_SIZE , ' nP/PT/ETA/PHI', LoKi.Monitoring.ContextSvc ) ) >> SINK( 'Hlt1%(name)sDecision' ) >> (TC_SIZE > %(MinTr)s) """ % props hltRICHMirrorBlock_Unit = HltUnit( 'Hlt1'+name+'Unit', Preambulo = self.hltRICHMirror_Preambulo( name ), Code = lineCode ) from HltTracking.HltPVs import PV3D return [ Hlt1GECUnit( props[ 'GEC' ] ), PV3D('Hlt1'), hltRICHMirrorBlock_Unit ]
def hlt1B2GammaGammaLine_Streamer(self, name, props) : from Configurables import LoKi__HltUnit as HltUnit props['name'] = name DiPhotonUnitLineCode = """ L0CaloCandidates >> tee ( monitor( TC_SIZE > 0, '# pass CaloCandidates', LoKi.Monitoring.ContextSvc ) ) >> tee ( monitor( TC_SIZE , 'nCaloCandidates' , LoKi.Monitoring.ContextSvc ) ) >> TC_HLT1DIPHOTONMAKER( 'B_s0', '', %(GAMMA_PT_MIN)s, %(B_SUMPT_MIN)s, %(B_MASS_MIN)s, %(B_MASS_MAX)s, %(B_PT_MIN)s ) >> tee ( monitor( TC_SIZE > 0, '# pass DiPhoton', LoKi.Monitoring.ContextSvc ) ) >> tee ( monitor( TC_SIZE , 'nDiPhotons', LoKi.Monitoring.ContextSvc ) ) >> SINK ('Hlt1B2GammaGammaDecision') >> ~TC_EMPTY """ % props from Hlt1Lines.Hlt1GECs import Hlt1GECUnit from Configurables import LoKi__HltUnit as HltUnit from HltTracking.HltPVs import PV3D hlt1B2GammaGammaLine_DiPhotonUnit = HltUnit('Hlt1%sDiPhotonUnit' % name, #OutputLevel=1, Monitor=True, Preambulo=self.hlt1B2GammaGammaLine_Preambulo(props), Code=DiPhotonUnitLineCode) return [Hlt1GECUnit('Loose'), PV3D('Hlt1'), hlt1B2GammaGammaLine_DiPhotonUnit]
def __apply_configuration__(self): from Hlt1Lines.Hlt1GECs import Hlt1GECUnit gec = Hlt1GECUnit('Loose') from HltTracking.HltPVs import PV3D pvs = PV3D('Hlt1') from Hlt1SharedParticles import Hlt1SharedParticles sharedParticles = Hlt1SharedParticles() pions = sharedParticles.pionUnit() kaons = sharedParticles.kaonUnit() to_build = { 'Bottomonium2PhiPhi': [ gec, pvs, kaons, self.Phi_Unit(self.getProps()), self.HighPTPhi_Unit(self.getProps()), self.Bb2PhiPhi_Unit(self.getProps()) ], 'Bottomonium2KstarKstar': [ gec, pvs, kaons, pions, self.Kst_Unit(self.getProps()), self.HighPTKst_Unit(self.getProps()), self.Bb2KstKst_Unit(self.getProps()) ] } for line, algos in to_build.iteritems(): l0 = self.getProp("l0") self.build_line(line, algos, l0)
def __init__(self, full): self.__full = full name = "Photons" if full else "PhotonsFromL0" from HltLine.HltDecodeRaw import DecodeL0CALO from HltTracking.HltPVs import PV3D super(Photons, self).__init__(name, [], [PV3D('Hlt2'), DecodeL0CALO])
def __init__(self, type, inputs, props): varmap = props['BDT_VARMAP'] if type is "None": nickname = "B2GammaGamma" elif type is "LL": nickname = "B2GammaGamma%s" % type elif type is "DD": nickname = "B2GammaGamma%s" % type elif type is "Double": nickname = "B2GammaGamma%s" % type #params = '/afs/cern.ch/user/s/sbenson/cmtuser/MooreDev_HEAD/ParamFiles/data/Hlt2B2GammaGamma_%s_v2.bbdt' % type bdttool = self.__classifier(props['BDT_PARAMS'], varmap, "TrgBBDT", type=type) pc = ("(VALUE('%s/%s') > %s)" % (bdttool.Type.getType(), bdttool.Name, props['BDT_MIN'])) from HltTracking.HltPVs import PV3D super(FilterBDTGammaGamma, self).__init__('BDT', pc, inputs, shared=False, tools=[bdttool], nickname=nickname, dependencies=[PV3D('Hlt2')])
def __init__(self, name, decay, inputs): dc = { 'Lambda0': "ALL", 'pi+': "(MIPCHI2DV(PRIMARY) > %(Trk_ALL_MIPCHI2DV_MIN)s)" + "& (PT > %(TRPT_MIN)s)" + "& (P > %(TRP_MIN)s)" + "& (TRCHI2DOF < %(TRCHI2DOF_MAX)s)" + "& (MIPCHI2DV(PRIMARY) > %(TRACK_IPCHI2_MIN)s)", 'K+': "(MIPCHI2DV(PRIMARY) > %(Trk_ALL_MIPCHI2DV_MIN)s)" + "& (PT > %(TRPT_MIN)s)" + "& (P > %(TRP_MIN)s)" + "& (TRCHI2DOF < %(TRCHI2DOF_MAX)s)" + "& (MIPCHI2DV(PRIMARY) > %(TRACK_IPCHI2_MIN)s)" } cc = ("(in_range( %(AM_MIN)s, AM, %(AM_MAX)s ))" + " & ((APT1+APT2+APT3) > %(ASUMPT_MIN)s )") mc = ("(CHI2VXNDOF < %(VCHI2PDOF_MAX)s)" + " & (P > %(PMIN)s )" + " & (PT > %(PTMIN)s )" + " & (BPVDIRA > %(BPVDIRA_MIN)s )" + " & (BPVVDCHI2 > %(BPVVDCHI2_MIN)s )" + " & (BPVLTIME() > %(BPVLTIME_MIN)s )") from HltTracking.HltPVs import PV3D super(ChargedHyperonL0HCombiner, self).__init__(name, decay, inputs, dependencies=[PV3D('Hlt2')], tistos=[], DaughtersCuts=dc, CombinationCut=cc, MotherCut=mc)
def __init__(self, name): from HltTracking.HltPVs import PV3D twoMuonDaughterCut = "(TRCHI2DOF< %(Trk_TRCHI2DOF_MAX_mumuX)s )" \ "& (PT> %(Trk_PT_MIN_mumuX)s)" \ "& (P> %(Trk_P_MIN_mumuX)s)" \ "& (MIPCHI2DV(PRIMARY)> %(Trk_MIPCHI2DV_MIN_mumuX)s )" twoMuonCombCut = "(AM<2100)" \ "& ((APT1+APT2)> %(Pair_SumAPT_MIN_mumuX)s)" \ "& (AMINDOCA('LoKi::TrgDistanceCalculator') < %(Pair_AMINDOCA_MAX_mumuX)s )" \ "& (AALLSAMEBPV)" twoMuonMotherCut = "(BPVVD> %(Pair_BPVVD_MIN_mumuX)s )" \ "& (BPVCORRM < %(Pair_BPVCORRM_MAX_mumuX)s)" \ "& (BPVVDCHI2> %(Pair_BPVVDCHI2_MIN_mumuX)s )" #First stage - Combine 2 Body with pt > 500MeV inputs = [Hlt2Muons] Hlt2Combiner.__init__( self, name, [ "J/psi(1S) -> mu+ mu-", "phi(1020) -> mu+ mu+", " rho(770)0 -> mu- mu-" ], inputs, dependencies=[PV3D('Hlt2')], DaughtersCuts={"mu+": twoMuonDaughterCut}, CombinationCut=twoMuonCombCut, MotherCut=twoMuonMotherCut, Preambulo=[], shared=True)
def __init__(self, mode, nickname, stat): if nickname == 'MuonTT': overlap = ( "(AOVERLAP(1,2, LHCb.LHCbID.TT) > %(OverlapTT)s) & (AOVERLAP(1,2, LHCb.LHCbID.Muon) > %(OverlapMuon)s)" ) elif nickname == 'VeloMuon': overlap = ( "(AOVERLAP(1,2, LHCb.LHCbID.Velo) > %(OverlapVelo)s) & (AOVERLAP(1,2, LHCb.LHCbID.Muon) > %(OverlapMuon)s)" ) else: overlap = ( "(AOVERLAP(1,2, LHCb.LHCbID.TT) > %(OverlapTT)s) & ((AOVERLAP(1,2, LHCb.LHCbID.IT) > %(OverlapIT)s) | (AOVERLAP(1,2, LHCb.LHCbID.OT) > %(OverlapOT)s))" ) inputs = [ TagFilter(mode, nickname), ProbeFilter(mode, nickname, stat), LongFilter(mode, nickname) ] decay = "J/psi(1S) -> pi+ mu+ mu-" if mode == 1 else "J/psi(1S) -> pi- mu- mu+" Hlt2Combiner.__init__(self, 'TrackEff' + nickname + str(mode) + stat + 'N3Body', decay, inputs, combiner=N3Body, dependencies=[PV3D('Hlt2')], nickname=nickname, tistos=[], Combination12Cut=overlap, ParticleCombiners={"": "MomentumCombiner"}, MotherCut="ALL", Preambulo=[], shared=True)
def __init__(self, name): code = ("(MINTREE('mu-' == ABSID, MIPCHI2DV(PRIMARY)) > %(IPChi2)s)" + " & (BPVDLS > %(DLS)s)") inputs = [DiMuonFilter('DiMuon')] Hlt2ParticleFilter.__init__(self, name, code, inputs, dependencies = [PV3D('Hlt2')], UseP2PVRelations = False)
def __init__(self, name, inputs, nickname = None, decay = "[B+ -> J/psi(1S) K+]cc", corrm = False): cc = ("(in_range(%(LLhCombAMLow)s, AM, %(LLhCombAMHigh)s)) & " + "(APT1+APT2 > %(LLhSumPTMin)s)") if corrm: mc_mass = " & (in_range(%(LLhCombBPVCORRMLow)s, BPVCORRM, %(LLhCombBPVCORRMHigh)s))" else: mc_mass = " & (in_range(%(LLhCombMLow)s, M, %(LLhCombMHigh)s))" mc = ("(VFASPF(VCHI2)<%(LLhVChi2)s) & (BPVVDCHI2 > %(LLhVDChi2)s)" + " & (BPVIPCHI2()<%(LLhMaxIPChi2)s)" + " & (BPVDIRA > %(LLhMinBPVDIRA)s)" + mc_mass) dc = { } for daug in ['p+', 'pi+', 'K+', 'mu+', 'e+']: dc[daug] = ("(PT > %(BachPt)s)" + " & (P > %(BachP)s)" + " & (MIPCHI2DV(PRIMARY) > %(BachIPChi2)s)") if nickname is None: nickname = name from HltTracking.HltPVs import PV3D Hlt2Combiner.__init__(self, 'PID' + name + 'BCombiner', decay, inputs, shared = True, nickname = nickname, dependencies = [ PV3D('Hlt2') ], tistos = 'CombTisTosSpec', DaughtersCuts = dc, CombinationCut = cc, MotherCut = mc, Preambulo = [ ])
def hlt1TrackBlock_Streamer(self, name, props): from Hlt1Lines.Hlt1GECs import Hlt1GECUnit from Configurables import LoKi__HltUnit as HltUnit props['name'] = name lineCode = """ TrackCandidates >> FitTrack >> tee ( monitor( TC_SIZE > 0, '# pass TrackFit', LoKi.Monitoring.ContextSvc ) ) >> tee ( monitor( TC_SIZE , 'nFit' , LoKi.Monitoring.ContextSvc ) ) >> ( ( TrIDC('isVelo') > %(Velo_NHits)s ) & \ ( TrTNORMIDC > %(TrNTHits)s ) & \ ( TrNVELOMISS < %(Velo_Qcut)s ) ) >> tee ( monitor( TC_SIZE > 0, '# pass track quality', LoKi.Monitoring.ContextSvc ) ) >> tee ( monitor( TC_SIZE , 'nTrQ' , LoKi.Monitoring.ContextSvc ) ) >> ( ( TrPT > %(PT)s * MeV ) & \ ( TrP > %(P)s * MeV ) ) >> tee ( monitor( TC_SIZE > 0, '# pass P/PT', LoKi.Monitoring.ContextSvc ) ) >> tee ( monitor( TC_SIZE , 'nP' , LoKi.Monitoring.ContextSvc ) ) >> ( ( TrCHI2PDOF < %(TrChi2)s ) & \ ( Tr_HLTMIPCHI2 ( 'PV3D' ) > %(IPChi2)s ) ) >> tee ( monitor( TC_SIZE > 0, '# pass TrackChi2/IPChi2', LoKi.Monitoring.ContextSvc ) ) >> tee ( monitor( TC_SIZE , 'nChi2' , LoKi.Monitoring.ContextSvc ) ) >> SINK( 'Hlt1%(name)sDecision' ) >> ~TC_EMPTY """ % props preambulo, trackingAlgos = self.hlt1Track_Preambulo(name) hlt1TrackBlock_Unit = HltUnit('Hlt1' + name + 'Unit', Preambulo=preambulo, Code=lineCode) from HltTracking.HltPVs import PV3D return [ Hlt1GECUnit(props['GEC']), PV3D('Hlt1'), trackingAlgos, hlt1TrackBlock_Unit ]
def __init__(self, name): daughters_cuts = { "pi+" : "(TRCHI2DOF< %(TrChi2)s) & (TRGHOSTPROB< %(TrGP)s) & "+\ "(MIPCHI2DV(PRIMARY)>%(piMinIpChi2)s)", } combination_cuts = "(ADAMASS('K+') < %(KMassWin)s ) & " + \ "(AMAXDOCA('') < %(KMaxDOCA)s )" mother_cuts = "(VFASPF(VCHI2/VDOF)< %(KVtxChi2)s) & " + \ "(PT > %(KMinPt)s ) & " + \ "(ADMASS('K+') < %(KMassWin)s ) & "\ "(BPVDIRA > %(KMinDIRA)s) & "\ "(BPVIPCHI2() < %(KMaxIpChi2)s) & "\ "(BPVLTIME() > %(KMinTauPs)s )" inputs = [Hlt2Pions] decay = "[K+ -> pi+ pi+ pi-]cc" Hlt2Combiner.__init__(self, name, decay, inputs, dependencies=[PV3D('Hlt2')], DaughtersCuts=daughters_cuts, CombinationCut=combination_cuts, MotherCut=mother_cuts, Preambulo=[])
def __init__(self, name, n, inputs): decays = [["[tau- -> rho(770)0 pi-]cc"], ["[tau- -> pi- pi0]cc"]] cc = [ "(APT>%(sumPT)s) & (AMAXDOCA('')<%(DOCA_MAX)s) & (AMINCHILD(PT,ISBASIC)> %(childPT)s) &(AMAXCHILD(PT,ISBASIC)>%(maxchildPT)s)", "(APT>%(sumPT)s) & (AMINCHILD(PT)> %(childPT)s) & (AMAXCHILD(PT)>%(maxchildPT)s)" ] mc = [ "(PT>%(PT)s) & (BPVVDCHI2 > %(FDCHI2_MIN)s) & (VFASPF(VCHI2/VDOF)<%(VCHI2_NDOF_MAX)s) & (BPVVDR > %(FDT_MIN)s) & (BPVCORRM>%(CORRM_MIN)s) & (BPVCORRM<%(CORRM_MAX)s)", "(PT>%(PT)s) & (M>%(M_MIN)s) & (M<%(M_MAX)s)" ] kwargs = {} #set combiner to be momentum combiner for pipi0 if n == 1: kwargs['ParticleCombiners'] = {"": "MomentumCombiner"} from HltTracking.HltPVs import PV3D Hlt2Combiner.__init__(self, name, decays[n], inputs, shared=True, dependencies=[PV3D('Hlt2')], CombinationCut=cc[n], MotherCut=mc[n], **kwargs)
def __init__(self, inputs): pids = ['K+', 'K-'] combos = list(combinations_with_replacement(pids, 1)) basic = "((ABSID=='K+')|(ID=='KS0')|(ABSID=='Lambda0'))" decays = ['B0 -> D*(2010)+ ' + ' '.join(combo) for combo in combos] cc = ("(AM < %(CMB_VRT_MCOR_MAX)s) " "& (ACUTDOCACHI2(%(CMB_VRT_CHI2_MAX)s, '')) " "& (AALLSAMEBPV | (AMINCHILD(MIPCHI2DV(PRIMARY)) > 16)) " "& (APT > %(CMB_PRT_PT_MIN)s) ") mc = ("(HASVERTEX) " "& (VFASPF(VCHI2) < %(CMB_VRT_CHI2_MAX)s) " "& (BPVVDCHI2 > %(CMB_VRT_VDCHI2_MIN)s) " "& (in_range(%(CMB_VRT_ETA_MIN)s, BPVETA," " %(CMB_VRT_ETA_MAX)s)) " "& (BPVDIRA > %(CMB_VRT_DIRA_MIN)s)") from Hlt2Lines.Utilities.Hlt2MergedStage import Hlt2MergedStage merged = [Hlt2MergedStage('Topo4Body', inputs, shared=True)] from HltTracking.HltPVs import PV3D Hlt2Combiner.__init__(self, 'Topo4Body', decays, merged, shared=True, dependencies=[PV3D('Hlt2')], CombinationCut=cc, MotherCut=mc)
def oneTrackStreamer(self, name, props, inputParticles): from copy import deepcopy props = deepcopy(props) props['input'] = inputParticles.outputSelection() props['name'] = name from Configurables import LoKi__HltUnit as HltUnit unit = HltUnit('Hlt1%sUnit' % name, PVSelection="PV3D", Monitor=True, Code=""" SELECTION('%(input)s') >> (TRCHI2DOF < %(TrChi2)s) >> (((PT > %(MaxPT)s) & (BPVIPCHI2() > %(MinIPChi2)s)) | ( in_range( %(MinPT)s, PT, %(MaxPT)s) & (log(BPVIPCHI2()) > (%(Param1)s / ((PT / GeV - %(Param2)s) ** 2) + (%(Param3)s / %(MaxPT)s) * (%(MaxPT)s - PT) + math.log(%(MinIPChi2)s))))) >> SINK('Hlt1%(name)sDecision') >> ~TC_EMPTY """ % props, Preambulo=self.mvaPreambulo()) from Hlt1Lines.Hlt1GECs import Hlt1GECUnit from HltTracking.HltPVs import PV3D return [Hlt1GECUnit(props['GEC']), PV3D('Hlt1'), inputParticles, unit]
def __init__(self, name, nickname, decayDesc, inputs, masswindow): from HltTracking.HltPVs import PV3D masscut = '' if masswindow == 'D': masscut = "in_range(%(D_AM_MIN)s, AM, %(D_AM_MAX)s)" if masswindow == 'Ds': masscut = "in_range(%(Ds_AM_MIN)s, AM, %(Ds_AM_MAX)s)" if masswindow == 'Lc': masscut = "(in_range(%(Lc_AM_MIN)s, AM, %(Lc_AM_MAX)s))" combcuts = masscut + " &((APT1 > %(MIN_D_CHILDPT)s) " \ "| (APT2 > %(MIN_D_CHILDPT)s)" \ "| (APT3 > %(MIN_D_CHILDPT)s)" \ "| (APT4 > %(MIN_D_CHILDPT)s))" \ "& (APT > %(D0_PT_MIN)s)" \ "& (AMINDOCA('') " \ "< %(Pair_AMINDOCA_MAX)s )"\ "& ((APT1+APT2+APT3+APT4) > %(D_SUMPT)s) " parentcuts = "(VFASPF(VCHI2PDOF) < %(D0_VCHI2PDOF_MAX)s)" \ "& (BPVVDCHI2> %(D0_BPVVDCHI2_MIN)s )" \ "& (BPVDIRA > %(D0_BPVDIRA_MIN)s )" Hlt2Combiner.__init__(self, name, decayDesc, inputs = inputs, dependencies = [ PV3D('Hlt2') ], nickname = nickname, CombinationCut = combcuts, MotherCut = parentcuts, Preambulo = [], shared=True)
def __init__(self, name): picut = ("( TRCHI2DOF < %(TrChi2)s )" + " & ( PT > %(PionPT)s)" + " & ( PIDK < %(PidCutPions)s )") kcut = ("( TRCHI2DOF < %(TrChi2)s )" + " & ( PT > %(PionPT)s)" + " & ( PIDK > %(PidCutKaons)s )") pcut = ("( TRCHI2DOF < %(TrChi2)s )" + " & ( PT > %(PionPT)s)" + " & ( PIDp > %(PidCutProtons)s )") dc = {'pi+': picut, 'K+': kcut, 'p+': pcut} cc = ("( (APT1 + APT2) > %(SumPT)s )" + " & ( AM > %(BMassWinLow)s )" + " & ( AM < %(BMassWinHigh)s )" + " & ( ACUTDOCACHI2( %(DOCACHI2)s, '' ) )") mc = ("( PT > %(BPT)s )" + " & ( BPVDIRA > %(BDIRA)s )" + " & ( BPVIPCHI2() < %(BIPCHI2)s )" + " & ( BPVLTIME() > %(BLT)s )") from HltTracking.HltPVs import PV3D from Inputs import Hlt2RichPions, Hlt2RichKaons, Hlt2RichProtons inputs = [Hlt2RichPions] Hlt2Combiner.__init__(self, 'B2PiPi', "B0 -> pi+ pi-", inputs, dependencies=[PV3D('Hlt2')], tistos='TisTosSpec', DaughtersCuts=dc, CombinationCut=cc, MotherCut=mc, Preambulo=[])
def __init__(self, name): code = "BPVDLS > %(DLS)s" from HltLine.Hlt2Monitoring import Hlt2Monitor, Hlt2MonitorMinMax args = {'UseP2PVRelations' : False, 'PostMonitor' : Hlt2Monitor("M", "M(#mu#mu)", 3686, 200, 'M_out', nbins = 25)} inputs = [Psi2SFilter('Psi2S')] Hlt2ParticleFilter.__init__(self, name, code, inputs, dependencies = [PV3D('Hlt2')],**args)