def makeKsLoose(name): return MergedSelection( name, RequiredSelections=[ DataOnDemand(Location="Phys/StdLooseKsDD/Particles"), DataOnDemand(Location="Phys/StdLooseKsLL/Particles") ])
def makeDplus2VMuNu(name, muonFromBSel, RhoSel, KstarSel, PAIR_SumPTMin, D_MassMax, D_DOCA, D_MinP, Dplus_FD, D_MCORR_MIN, D_MCORR_MAX, D_BPVVDZ, D_VtxChi2): """ Create and return a D+ -> VMuNu selection object. """ hadrons = MergedSelection("MergedVectorHadrons" + name, RequiredSelections=[KstarSel, RhoSel]) _combinationCuts = "(AM < %(D_MassMax)s *MeV) "\ "& ((APT1+APT2) > %(PAIR_SumPTMin)s *MeV) "\ "& (AMAXDOCA('') < %(D_DOCA)s *mm )" % locals() _motherCuts = "(P > %(D_MinP)s *MeV) "\ "& (BPVVD > %(Dplus_FD)s *mm) "\ "& (in_range(%(D_MCORR_MIN)s *MeV ,BPVCORRM,%(D_MCORR_MAX)s *MeV)) "\ "& (BPVVDZ > %(D_BPVVDZ)s *mm) "\ "& (VFASPF(VCHI2/VDOF)<%(D_VtxChi2)s) " % locals() _Dplus2VMuNu = CombineParticles( DecayDescriptors=["[D+ -> mu+ K*(892)0]cc", "[D+ -> mu+ rho(770)0]cc"], MotherCut=_motherCuts, CombinationCut=_combinationCuts) return Selection(name, Algorithm=_Dplus2VMuNu, RequiredSelections=[muonFromBSel, hadrons])
def __Bs__(self, Dimuon, Protons, Kaons, Pions, Kshort, Lambda, Phi, Rho, Dplus, Kstar, Lambdastar, Kstar2KsPi, Kstar2KPi0, conf): """ Make and return a Bs selection """ _b2xmumu = CombineParticles() _b2xmumu.DecayDescriptors = [ "B0 -> J/psi(1S) phi(1020)", "[B0 -> J/psi(1S) K*(892)0]cc", "B0 -> J/psi(1S) rho(770)0", "B0 -> J/psi(1S) KS0", "[B+ -> J/psi(1S) K+]cc", "[B+ -> J/psi(1S) pi+]cc", "[B+ -> J/psi(1S) K*(892)+]cc", "[B+ -> J/psi(1S) D+]cc", "[Lambda_b0 -> J/psi(1S) Lambda0]cc", "[Lambda_b0 -> J/psi(1S) Lambda(1520)0]cc" ] _b2xmumu.CombinationCut = "(AM > 4900.0 *MeV) & (AM < 7000.0 *MeV)" _b2xmumu.MotherCut = self.__BsCuts__(conf) _sel_Daughters = MergedSelection( "Selection_" + self.name + "_daughters", RequiredSelections=[ Protons, Kaons, Pions, Kshort, Lambda, Phi, Rho, Dplus, Kstar, Lambdastar, Kstar2KsPi, Kstar2KPi0 ]) sel = Selection("Selection_" + self.name + "_bs2xmumu", Algorithm=_b2xmumu, RequiredSelections=[Dimuon, _sel_Daughters]) return sel
def _makeB2LLX(self, name, dilepton, hadrons, params, masscut="(ADAMASS('B+')<1000*MeV"): """ CombineParticles / Selection for the B """ _Cut = "((VFASPF(VCHI2/VDOF)< %(BVertexCHI2)s ) "\ "& (BPVIPCHI2()< %(BIPCHI2)s ) "\ "& (BPVDIRA> %(BDIRA)s ) "\ "& (BPVVDCHI2> %(BFlightCHI2)s ))" % params _Decays = [ "[ B+ -> J/psi(1S) K+ ]cc", "[ B0 -> J/psi(1S) K*(892)0 ]cc", "[ B_s0 -> J/psi(1S) phi(1020)]cc" ] _Combine = CombineParticles(DecayDescriptors=_Decays, CombinationCut=masscut, MotherCut=_Cut) _Merge = MergedSelection("Merge" + name, RequiredSelections=hadrons) return Selection(name, Algorithm=_Combine, RequiredSelections=[dilepton, _Merge])
def makeD02kpipi0(name): pi0sel = MergedSelection( "Pi0For" + name, RequiredSelections=[StdLooseMergedPi0, StdLooseResolvedPi0]) str_D0_ChargedDau = "(PT>500*MeV) & (P>5*GeV) & (MIPCHI2DV(PRIMARY)>4) & (TRCHI2DOF<5)" str_D0_Pi0 = "(PT>800*MeV) & (P>5*GeV)" str_D0_CombCuts = "(ADAMASS('D0')<200*MeV) & (ADOCA(1,2) < 1.5) & (AHASCHILD(((ABSID == 'K+') | (ABSID == 'pi+')) & (MIPCHI2DV(PRIMARY)>40)))" str_D0_MotherCuts = "(BPVDIRA>0.9) & (PT>2.5*GeV) & (VFASPF(VCHI2/VDOF)<10) & (BPVVDCHI2>36)" str_D0_DecayDescriptor_RS = "[D0 -> K- pi+ pi0]cc" str_D0_Sidebands = "200*MeV" d0 = CombineParticles() d0.DecayDescriptor = str_D0_DecayDescriptor_RS d0.DaughtersCuts = { "K-": str_D0_ChargedDau + ' & ((PPINFO(LHCb.ProtoParticle.RichDLLk,-1000))>0)', "pi+": str_D0_ChargedDau + ' & ((PPINFO(LHCb.ProtoParticle.RichDLLk,-1000))<0)', "pi0": str_D0_Pi0 } d0.CombinationCut = str_D0_CombCuts d0.MotherCut = str_D0_MotherCuts return Selection( "D02Kpipi0For" + name, Algorithm=d0, RequiredSelections=[pi0sel, StdNoPIDsPions, StdNoPIDsKaons])
def makeBs2D0KS0(name,BIPCHI2,BVCHI2,BPVDLS,BsCombMassMin,BsCombMassMax,BsMassMin,BsMassMax,D0MassMin,D0MassMax,DTF_CHI2NDOF): """ Create and return a Bs -> D0 KS selection """ SelStdLooseKsDD = DataOnDemand(Location = 'Phys/StdLooseKsDD/Particles') SelStdLooseKsLL = DataOnDemand(Location = 'Phys/StdLooseKsLL/Particles') SelStdLooseKs = MergedSelection("KSFor"+name, RequiredSelections = [ SelStdLooseKsDD, SelStdLooseKsLL ] ) SelStdLooseD0 = DataOnDemand(Location = 'Phys/StdLooseD02KPi/Particles') _motherCuts = "(VFASPF(VCHI2/VDOF) < %(BVCHI2)s)" \ "& (BPVDLS > %(BPVDLS)s)" \ "& (M > %(BsMassMin)s*MeV)" \ "& (M < %(BsMassMax)s*MeV)" \ "& (BPVIPCHI2() < %(BIPCHI2)s)" \ "& (DTF_CHI2NDOF(True) < %(DTF_CHI2NDOF)s)" % locals() _combinationCut = "(AM > %(BsCombMassMin)s*MeV)" \ "& (AM < %(BsCombMassMax)s*MeV)" % locals() _daughterCut = "(M > %(D0MassMin)s*MeV)" \ "& (M < %(D0MassMax)s*MeV)" \ "& (MAXTREE(ABSID=='K+',PIDK) > 0)" % locals() _Bs = CombineParticles('_'+name) _Bs.DecayDescriptor = "B0 -> D0 KS0" _Bs.CombinationCut = _combinationCut _Bs.MotherCut = _motherCuts _Bs.DaughtersCuts = {"D0" : _daughterCut} return Selection ( name, Algorithm = _Bs, RequiredSelections = [SelStdLooseD0,SelStdLooseKs])
def _B2XTauMu(self, name, DecayDescriptors, MuSel, XMuSel, MuonP, MuonPT, PIDmu, MuonIPCHI2, BVCHI2DOF, BDIRA, B_FDCHI2, B_MIN_MASS, B_MAX_MASS): _daughtersCuts = { "mu+": "(P > %(MuonP)s *GeV) & (PT > %(MuonPT)s *MeV) & (PIDmu > %(PIDmu)s) & (MIPCHI2DV(PRIMARY) > %(MuonIPCHI2)s )" % locals(), "mu-": "(P > %(MuonP)s *GeV) & (PT > %(MuonPT)s *MeV) & (PIDmu > %(PIDmu)s) & (MIPCHI2DV(PRIMARY) > %(MuonIPCHI2)s )" % locals() } _combinationCut = "(AM<( %(B_MAX_MASS)s + 200) *MeV)" % locals() _motherCut = " (MM < %(B_MAX_MASS)s *MeV)"\ " & (MM> %(B_MIN_MASS)s *MeV)"\ " & (VFASPF(VCHI2/VDOF) < %(BVCHI2DOF)s)"\ " & (BPVDIRA > %(BDIRA)s)"\ " & (BPVVDCHI2 > %(B_FDCHI2)s)" % locals() _B = CombineParticles(DecayDescriptors=DecayDescriptors, DaughtersCuts=_daughtersCuts, CombinationCut=_combinationCut, MotherCut=_motherCut) _sel_Daughters = MergedSelection(name + "_daughters", RequiredSelections=XMuSel) sel = Selection(name, Algorithm=_B, RequiredSelections=[MuSel, _sel_Daughters]) return sel
def __F2__(self, Rho, conf): """ Make a f_2(1950) -> p pbar """ f2SubMMZAlg = SubPIDMMFilter(self.name+"_F2SubMMZ_Alg", Code= "DECTREE('rho(770)0 -> pi+ pi-')", MinMM=0, MaxMM=6050, PIDs = [ [ 'p+', 'p~-'] ] ) f2SubMMPAlg = SubPIDMMFilter(self.name+"_F2SubMMP_Alg", Code= "DECTREE('rho(770)0 -> pi+ pi+')", MinMM=0, MaxMM=6050, PIDs = [ [ 'p+', 'p+'] ] ) f2SubMMMAlg = SubPIDMMFilter(self.name+"_F2SubMMM_Alg", Code= "DECTREE('rho(770)0 -> pi- pi-')", MinMM=0, MaxMM=6050, PIDs = [ [ 'p~-', 'p~-'] ] ) f2SubMMZSel = Selection( self.name+"_F2SubMMZ_Sel", Algorithm = f2SubMMZAlg, RequiredSelections = [ Rho ] ) f2SubMMPSel = Selection( self.name+"_F2SubMMP_Sel", Algorithm = f2SubMMPAlg, RequiredSelections = [ Rho ] ) f2SubMMMSel = Selection( self.name+"_F2SubMMM_Sel", Algorithm = f2SubMMMAlg, RequiredSelections = [ Rho ] ) f2Merge = MergedSelection( self.name+"_F2Merge", RequiredSelections = [ f2SubMMZSel, f2SubMMPSel, f2SubMMMSel ] ) f2SubAlg = SubstitutePID( self.name+"_F2Sub_Alg", Code = "ALL" , #(DECTREE('rho(770)0 -> p+ p~-')) | (DECTREE('rho(770)0 -> p+ p+')) | (DECTREE('rho(770)0 -> p~- p~-'))", MaxChi2PerDoF = -666 ) f2SubAlg.Substitutions = { 'rho(770)0 -> p+ p~-' : 'f_2(1950)' , 'rho(770)0 -> p+ p+' : 'f_2(1950)' , 'rho(770)0 -> p~- p~-' : 'f_2(1950)' } f2SubSel = Selection( self.name+"_F2Sub_Sel", Algorithm = f2SubAlg, RequiredSelections = [ f2Merge ] ) f2FilterAlg = FilterDesktop( Code = "(ABSID=='f_2(1950)')" ) f2FilterSel = Selection( self.name + "_F2Filter", Algorithm = f2FilterAlg, RequiredSelections = [ f2SubSel ] ) return f2FilterSel
def _makeB2GammaX(self, name, photons, hadrons, params, masscut="(ADAMASS('B+')< 1500 *MeV"): """ CombineParticles / Selection for the B """ _Decays = [ "[ B0 -> gamma K*(892)0 ]cc", "[ B_s0 -> gamma phi(1020) ]cc", "[ Lambda_b0 -> gamma Lambda0 ]cc", "[ Lambda_b0 -> gamma Lambda(1520)0 ]cc" ] _Cut = "((VFASPF(VCHI2/VDOF) < %(BVertexCHI2)s) "\ "& (BPVIPCHI2() < %(BIPCHI2)s) "\ "& (BPVDIRA > %(BDIRA)s) "\ "& (BPVVDCHI2 > %(BFlightCHI2)s))" % params _Combine = CombineParticles(DecayDescriptors=_Decays, CombinationCut=masscut, MotherCut=_Cut) _Merge = MergedSelection("Merge" + name, RequiredSelections=hadrons) return Selection(name, Algorithm=_Combine, RequiredSelections=[_Merge, photons])
def makeD02HMuNu(name, muonSel, pionSel, kaonSel, PAIR_SumPTMin, D_MassMax, D_DOCA, D_MinP, D0_FD, D_MCORR_MIN, D_MCORR_MAX, D_BPVVDZ, D_VtxChi2): hadrons = MergedSelection("MergedScalarHadrons" + name, RequiredSelections=[pionSel, kaonSel]) """ Create and return a D0 -> HMuNu selection object. """ _combinationCuts = "(AM < %(D_MassMax)s *MeV) "\ "& ((APT1+APT2) > %(PAIR_SumPTMin)s *MeV) "\ "& (AMAXDOCA('') < %(D_DOCA)s *mm )" % locals() _motherCuts = "(P > %(D_MinP)s *MeV) "\ "& (BPVVD > %(D0_FD)s *mm) "\ "& (in_range(%(D_MCORR_MIN)s *MeV ,BPVCORRM,%(D_MCORR_MAX)s *MeV)) "\ "& (BPVVDZ > %(D_BPVVDZ)s *mm) "\ "& (VFASPF(VCHI2/VDOF)<%(D_VtxChi2)s) " % locals() _D02HMuNu = CombineParticles(DecayDescriptors=[ "[D0 -> mu+ pi-]cc", "[D0 -> mu+ pi+]cc", "[D0 -> mu+ K+]cc", "[D0 -> mu+ K-]cc" ], MotherCut=_motherCuts, CombinationCut=_combinationCuts) return Selection(name, Algorithm=_D02HMuNu, RequiredSelections=[muonSel, hadrons])
def __Bs__(self, Dimuon, Protons, Kaons, Pions, Pi0, Kshort, Lambda, Phi, Rho, Dplus, Kstar, K1, Lambdastar, Kstar2KsPi, Kstar2KPi0, conf): """ Make and return a Bs selection """ _b2xmumu = CombineParticles() _b2xmumu.DecayDescriptors = [ "B0 -> J/psi(1S) phi(1020)", "[B0 -> J/psi(1S) K*(892)0]cc", "B0 -> J/psi(1S) rho(770)0", "B0 -> J/psi(1S) KS0", "[B0 -> J/psi(1S) D~0]cc", "[B+ -> J/psi(1S) K+]cc", "[B+ -> J/psi(1S) pi+]cc", "[B+ -> J/psi(1S) K*(892)+]cc", "[B+ -> J/psi(1S) D+]cc", "[B+ -> J/psi(1S) D*(2010)+]cc", "[Lambda_b0 -> J/psi(1S) Lambda0]cc", "[Lambda_b0 -> J/psi(1S) Lambda(1520)0]cc", "B0 -> J/psi(1S) pi0"] # "[B+ -> J/psi(1S) K_1(1270)+]cc", # removed K1 for timing reasons _b2xmumu.CombinationCut = self.BdCombCut _b2xmumu.MotherCut = self.BdCut _sel_Daughters = MergedSelection("Selection_"+self.name+"_daughters", RequiredSelections = [ Kaons, Pions, Kshort, Lambda, Rho, Phi, Lambdastar, Kstar, self.Dzero, Dplus, self.Dstar, Kstar2KsPi, Kstar2KPi0, Pi0]) sel = Selection( "Selection_"+self.name+"_bs2xmumu", Algorithm = _b2xmumu, RequiredSelections = [ Dimuon, _sel_Daughters ]) return sel
def _makeKPi(self, pipi): '''Makes X -> K+pi- + c.c.''' sel1 = self._makeX2HH('X2KPi', ['K*(892)0 -> pi+ pi-'], '(AM < 2.5*GeV)', self.config, [self.pions]) sel2 = self._makeX2HH('X2KPiBar', ['K*(892)~0 -> pi+ pi-'], '(AM < 2.5*GeV)', self.config, [self.pions]) decays1 = [['K+', 'pi-']] decays2 = [['pi+', 'K-']] filter1 = SubPIDMMFilter('X2KPiSubPID1Beauty2XGamma', Code='ALL', MinMM=700, MaxMM=1100, PIDs=decays1) filter2 = SubPIDMMFilter('X2KPiSubPID2Beauty2XGamma', Code='ALL', MinMM=700, MaxMM=1100, PIDs=decays2) presel1 = Selection('X2KPiSubPID1SelBeauty2XGamma', Algorithm=filter1, RequiredSelections=[sel1]) presel2 = Selection('X2KPiBarSubPID2SelBeauty2XGamma', Algorithm=filter2, RequiredSelections=[sel2]) return [ MergedSelection('X2KPi', RequiredSelections=[presel1, presel2]) ]
def __init__(self, name, config) : LineBuilder.__init__(self, name, config) #self.name = name self.name = "BetaS" # To avoid confusion with line names. self.config = config ### Selections: self.WideJpsiList = DataOnDemand(Location = "Phys/StdMassConstrainedJpsi2MuMu/Particles") self.JpsiList = self.createSubSel( OutputList = 'NarrowJpsiForBetaSPi0' + self.name, InputList = self.WideJpsiList, Cuts = "(PFUNA(ADAMASS('J/psi(1S)')) < %(JpsiMassWindow)s * MeV)" % self.config) self.Pi0ResolvedList = self.createSubSel( OutputList = "ResolvedPi0ForBetaS" + self.name, InputList = DataOnDemand(Location = "Phys/StdLooseResolvedPi0/Particles"), Cuts = "(PT > 1000.*MeV) & (MINTREE('gamma'==ABSID, CL) > 0.05 )") self.Pi0ListMix = MergedSelection("StdLooseCocktailPi0ForBetaS" + self.name, RequiredSelections = [self.Pi0ResolvedList, DataOnDemand(Location = "Phys/StdLooseMergedPi0/Particles")]) self.Pi0List = self.createSubSel( OutputList = "Pi0ForBetaS" + self.name, InputList = self.Pi0ListMix, Cuts = "(PT > 1000.*MeV)") self.makeBd2JpsiPi0()
def test_merged_selection(): sel00 = AutomaticData(Location='Phys/Sel00/Particles') sel01 = AutomaticData(Location='Phys/Sel01/Particles') ms = MergedSelection('Merge00And01', RequiredSelections=[sel00, sel01]) assert ms.name() == 'Merge00And01' assert ms.requiredSelections() == [ ] # should not export its required selections. Algos contained internally. assert ms.outputLocation() == 'Phys/Merge00And01/Particles' assert [alg.name() for alg in ms._algos] == [ 'SelFilterPhys_Sel00_Particles', 'SelFilterPhys_Sel01_Particles', 'Merge00And01' ] assert ms._algos == [ sel00.algorithm(), sel01.algorithm(), ms._sel.algorithm() ]
def mergedTOS(self, name=None, sel=None, trigger1=None, trigger2=None): return MergedSelection(name, RequiredSelections=[ self.TOSFilter(name + trigger1 + "_subsel", [sel], trigger1), self.TOSFilter(name + trigger2 + "_subsel", [sel], trigger2) ])
def _fakedaughters( self ): if self._fakedaughtersSel is not None: return self._fakedaughtersSel from PhysSelPython.Wrappers import MergedSelection _sel_Daughters = MergedSelection("Selection_fakemergeddaughters", RequiredSelections = [self._fakeprotonFilter(),self._fakePPbar(),self._fakePpipi()]) self._fakedaughtersSel=_sel_Daughters return _sel_Daughters
def _create_bJets(self, inputs, test): bjets = TopologicalTagging(self._name+'taggingJet') bjets.ParticleAbsPID = 98 bjets.SVLocation = test.outputLocation() bjets.TriggerLine = self._config["HLT"]["LINETOPO"] + ".*Decision" imergedSel = MergedSelection(self._name+"merged", RequiredSelections=[inputs,test]) return Selection(self._name + "bJets", Algorithm = bjets, RequiredSelections = [imergedSel])
def makeCC2DD(name, D0Sel, DplusSel, DsSel, CCMassCut, CCVtxChi2Ndof, CCMaxD0ChildPT, CCMaxD0TreePT, CCMaxD0MinTreeIpChi2, ) : """ Create and return a X -> DD Selection Object, with D = D0(Kpi) or Dp(Kpipi) Arguments: name : name of the Selection. D0Sel : (D0 -> HH; Dplus,Ds -> HHH) Selection object. CCMassCut : CC invariant mass cuts (not used) CCVtxChi2Ndof : CC vertex Chi2/Ndof cut CCMaxD0ChildPT : highest PT between D0 and D~0 CCMaxD0TreePT : highest PT between all D0/D~0 daughters CCMaxD0MinTreeIpChi2 : max between D0/D~0 minima of daughter's MINIPCHI2 """ ###_motherCuts = "(ALL)" _motherCuts = "(VFASPF(VCHI2PDOF)<%(CCVtxChi2Ndof)s)" % locals() _motherCuts += "&(MAXTREE(ISBASIC,PT)>%(CCMaxD0TreePT)s)" % locals() _combinationCuts = CCMassCut _combinationCuts += "&(AMAXCHILD(PT)>%(CCMaxD0ChildPT)s)" % locals() ## _combinationCuts += "&(AMAXCHILD(MINTREE(BPVIPCHI2()))>%(CCMaxD0MinTreeIpChi2)s)" % locals() ## unused for the moment #print 'makeBs2JpsiPhi', name, 'MotherCuts:', _motherCuts _X = CombineParticles( DecayDescriptors = [ ### pure particle-(anti)particle "psi(3770) -> D0 D~0", "[psi(3770) -> D0 D0]cc", ### C=2, Q=0 "psi(3770) -> D+ D-", "[psi(3770) -> D+ D+]cc", ### C=2, Q=+2 "psi(3770) -> D_s+ D_s-", "[psi(3770) -> D_s+ D_s+]cc", ### C=2, S=2, Q=+2 ################################# mixed (without Ds) "[psi(3770) -> D0 D-]cc", ### Q=-1 "[psi(3770) -> D0 D+]cc", ### C=2, Q=+1 ################################# mixed (with Ds) "[psi(3770) -> D0 D_s-]cc", ### S=-1, Q=-1 "[psi(3770) -> D+ D_s-]cc", ### S=-1, Q=0 "[psi(3770) -> D0 D_s+]cc", ### C=2, S=1, Q=+1 "[psi(3770) -> D+ D_s+]cc", ### C=2, S=1, Q=+2 ], MotherCut = _motherCuts, CombinationCut = _combinationCuts ) DSel = MergedSelection ( name + "MergedDSelection", RequiredSelections = [D0Sel, DplusSel, DsSel] ) return Selection ( name, Algorithm = _X, RequiredSelections = [DSel])
def makeOmegaminus(self): ''' Make an Omega minus candidate ''' Omegaminus2LambdaKLLL = self.createCombinationSel(OutputList = "Omegaminus2LambdaKLLL"+ self.name, DecayDescriptor = "[Omega- -> Lambda0 K-]cc", DaughterLists = [self.GoodLongKaonsList, self.LambdaListLL], DaughterCuts = {"K-" : "(PT>0.1*GeV) & (BPVIPCHI2()>100)"}, PreVertexCuts = "(ADAMASS('Omega-') < %(OmegaMassWindow)s*MeV)"% self.config, PostVertexCuts = "(VFASPF(VCHI2/VDOF)<5) &(BPVLTIME() > 5.0 * ps) & "\ "(BPVVDZ>0) & "\ "(CHILD(VFASPF(VZ),1)-VFASPF(VZ) > 5.0 * mm)" ) ''' Make an Omega minus candidate ''' Omegaminus2LambdaKDDL = self.createCombinationSel(OutputList = "Omegaminus2LambdaKDDL"+ self.name, DecayDescriptor = "[Omega- -> Lambda0 K-]cc", DaughterLists = [self.GoodLongKaonsList, self.LambdaListDD], DaughterCuts = {"K-" : "(PT>0.1*GeV) & (BPVIPCHI2()>100)"}, PreVertexCuts = "(ADAMASS('Omega-') < %(OmegaMassWindow)s*MeV)"% self.config, PostVertexCuts = "(VFASPF(VCHI2/VDOF)<5) &(BPVLTIME() > 5.0 * ps) & "\ "(BPVVDZ>0) & "\ "(CHILD(VFASPF(VZ),1)-VFASPF(VZ) > 5.0 * mm)" ) ''' Make an Omega minus candidate ''' Omegaminus2LambdaKDDD = self.createCombinationSel(OutputList = "Omegaminus2LambdaKDDD"+ self.name, DecayDescriptor = "[Omega- -> Lambda0 K-]cc", DaughterLists = [self.GoodDownstreamKaonsList, self.LambdaListDD], DaughterCuts = {"K-" : "(PT>0.1*GeV) & (BPVIPCHI2()>100)"}, PreVertexCuts = "(ADAMASS('Omega-') < %(OmegaMassWindow)s*MeV)"% self.config, PostVertexCuts = "(VFASPF(VCHI2/VDOF)<3) &(BPVLTIME() > 5.0 * ps) & "\ "(BPVVDZ>0) & "\ "(CHILD(VFASPF(VZ),1)-VFASPF(VZ) > 5.0 * mm)" ) ## Omegaminus2LambdaK is a "Selection" object; MergedSelection passes everything which gets to it ## even when the output list is empty Omegaminus2LambdaK = MergedSelection("Omegaminus2LambdaK" + self.name, RequiredSelections=[ Omegaminus2LambdaKLLL, Omegaminus2LambdaKDDL, Omegaminus2LambdaKDDD ]) ## NullFilter is a "FilterDesktop" object which is a type of "Algorithm" ## This one will pass all candidates NullFilter = FilterDesktop(Code="ALL") ## Omegaminus2Lambda2PiSelection is *also* a Selection, but it is "more selective" ## than Omegaminus2LambdaK in the sense that it passes only events when something ## is in the output list Omegaminus2LambdaKSelection = Selection( "Omegaminus2LambdaKSelection" + self.name, Algorithm=NullFilter, RequiredSelections=[Omegaminus2LambdaK]) Omegaminus2LambdaKLine = StrippingLine( self.name + "Omegaminus2LambdaK", algos=[Omegaminus2LambdaKSelection]) self.registerLine(Omegaminus2LambdaKLine)
def test_dummy_mergedselection(): data0 = AutomaticData(Location='Phys/Data0') data1 = AutomaticData(Location='Phys/Data1') mergedData = MergedSelection('MergedData01', RequiredSelections=[data0, data1]) newData = dummy('NewMergedData', mergedData) assert newData.selection().name() == 'NewMergedData' assert newData.outputLocation() == newData.selection().outputLocation( ) == 'Phys/NewMergedData/Particles' assert len(newData.members()) == 1 assert len(newData.members()[0].Members) == 3
def test_merged_selection_with_existing_selection_name_raises(): sel00 = AutomaticData(Location='Phys/Sel00') sel01 = AutomaticData(Location='Phys/Sel01') sel0 = MergedSelection('MergedSel001', RequiredSelections=[sel00, sel01]) raises(NameError, MergedSelection, 'MergedSel001', RequiredSelections=[sel00])
def makeXiminus(self): ''' Make a Xi minus candidate from long tracks ''' Ximinus2LambdaPiLLL = self.createCombinationSel(OutputList = "Ximinus2LambdaPiLLL"+ self.name, DecayDescriptor = "[Xi- -> Lambda0 pi-]cc", DaughterLists = [self.GoodLongPionsList, self.LambdaListLL], DaughterCuts = {"pi-" : "(PT>0.1*GeV) & (BPVIPCHI2()>100)"}, PreVertexCuts = "(ADAMASS('Xi-') < %(XiMassWindow)s*MeV)"% self.config, PostVertexCuts = "(VFASPF(VCHI2/VDOF)<5) &(BPVLTIME() > 5.0 * ps) & "\ "(BPVVDZ>0) & "\ "(CHILD(VFASPF(VZ),1)-VFASPF(VZ) > 5.0 * mm)" ) ''' Make a Xi minus candidate from a LambdaDD and along pion''' Ximinus2LambdaPiDDL = self.createCombinationSel(OutputList = "Ximinus2LambdaPiDDL"+ self.name, DecayDescriptor = "[Xi- -> Lambda0 pi-]cc", DaughterLists = [self.GoodLongPionsList, self.LambdaListDD], DaughterCuts = {"pi-" : "(PT>0.1*GeV) & (BPVIPCHI2()>100)"}, PreVertexCuts = "(ADAMASS('Xi-') < %(XiMassWindow)s*MeV)"% self.config, PostVertexCuts = "(VFASPF(VCHI2/VDOF)<5) &(BPVLTIME() > 5.0 * ps) & "\ "(BPVVDZ>0) & "\ "(CHILD(VFASPF(VZ),1)-VFASPF(VZ) > 5.0 * mm)" ) ''' Make a Xi minus candidate from downstream tracks''' Ximinus2LambdaPiDDD = self.createCombinationSel(OutputList = "Ximinus2LambdaPiDDD"+ self.name, DecayDescriptor = "[Xi- -> Lambda0 pi-]cc", DaughterLists = [self.GoodDownstreamPionsList, self.LambdaListDD], DaughterCuts = {"pi-" : "(PT>0.1*GeV) & (BPVIPCHI2()>100)"}, PreVertexCuts = "(ADAMASS('Xi-') < %(XiMassWindow)s*MeV)"% self.config, PostVertexCuts = "(VFASPF(VCHI2/VDOF)<3) &(BPVLTIME() > 5.0 * ps) & "\ "(BPVVDZ>0) & "\ "(CHILD(VFASPF(VZ),1)-VFASPF(VZ) > 5.0 * mm)" ) ## Ximinus2LambdaPi is a "Selection" object; MergedSelection passes everything which gets to it ## even when the output list is empty Ximinus2LambdaPi = MergedSelection("Ximinus2LambdaPi" + self.name, RequiredSelections=[ Ximinus2LambdaPiLLL, Ximinus2LambdaPiDDL, Ximinus2LambdaPiDDD ]) ## NullFilter is a "FilterDesktop" object which is a type of "Algorithm" ## This one will pass all candidates NullFilter = FilterDesktop(Code="ALL") ## Ximinus2Lambda2PiSelection is *also* a Selection, but it is "more selective" ## than Ximinus2LambdaPi in the sense that it passes only events when something ## is in the output list Ximinus2LambdaPiSelection = Selection( "Ximinus2LambdaPiSelection" + self.name, Algorithm=NullFilter, RequiredSelections=[Ximinus2LambdaPi]) Ximinus2LambdaPiLine = StrippingLine(self.name + "Ximinus2LambdaPi", algos=[Ximinus2LambdaPiSelection]) self.registerLine(Ximinus2LambdaPiLine)
def _makeKPi0(self): '''Makes X -> K+pi0 + c.c.''' m = self._makeXPLUS2HH('X2KPi0Merged', ['[K*(892)+ -> K+ pi0]cc'], '(AM < 2.0*GeV)', self.config, self.pi0["Merged"] + [self.kaons], True) r = self._makeXPLUS2HH('X2KPi0Resolved', ['[K*(892)+ -> K+ pi0]cc'], '(AM < 2.0*GeV)', self.config, self.pi0["Resolved"] + [self.kaons], True) return [ MergedSelection('X2KPi0Beauty2XGamma', RequiredSelections=[m, r]) ]
def _makePiPi0(self): '''Makes X -> pi+pi0''' m = self._makeXPLUS2HH('X2PiPi0Merged', ['[rho(770)+ -> pi+ pi0]cc'], 'AM < 2.0*GeV', self.config, [self.pions] + self.pi0["Merged"], True) r = self._makeXPLUS2HH('X2PiPi0Resolved', ['[rho(770)+ -> pi+ pi0]cc'], 'AM < 2.0*GeV', self.config, [self.pions] + self.pi0["Resolved"], True) return [ MergedSelection('X2PiPi0Beauty2XGamma', RequiredSelections=[m, r]) ]
def _makeKsPi(self): '''Makes X -> Ks0pi- + c.c.''' ## Change the mass window to 4.5 GeV to improve the timing sel = self._makeXPLUS2HH('X2KsPi', ['[K*(892)+ -> KS0 pi+]cc'], '(AM < 2.0*GeV)', self.config, self.ks + [self.pions]) #ll = self._makeXPLUS2HH('X2KsPiLL',['[K*(892)+ -> KS0 pi+]cc'], # '(AM < 2.5*GeV)',self.config, # self.ks["DD"]+[self.pions]) return [ MergedSelection('X2KsPiAllBeauty2XGamma', RequiredSelections=[sel]) ]
def mesons(self): """ Get the meson ( kaon + pion ) selection """ sel = self._selection('MesonSelection') if sel: return sel # sel = MergedSelection('SelBasicMesonsFor' + self.name(), RequiredSelections=[self.pions(), self.kaons()]) # return self._add_selection('MesonSelection', sel)
def mesons(self): """ Get the meson ( kaon + pion ) selection """ if hasattr(self, 'MesonSelection'): return self.MesonSelection # self.MesonSelection = MergedSelection( ## 'SelBasicMesonsFor' + self._name, RequiredSelections=[self.pions(), self.kaons()]) # return self.MesonSelection
def makeMergedDiMuons(name_jpsi='FullDSTDiMuonJpsi2MuMuDetachedLine', name_psi2s='FullDSTDiMuonPsi2MuMuDetachedLine'): from PhysSelPython.Wrappers import AutomaticData sel_jpsi = AutomaticData('/Event/AllStreams/Phys/%s/Particles' % name_jpsi) sel_psi2s = AutomaticData('/Event/AllStreams/Phys/%s/Particles' % name_psi2s) # ## merged selectoon for J/psi & psi' # from PhysSelPython.Wrappers import MergedSelection return MergedSelection('SelPsisForBandQ', RequiredSelections=[sel_jpsi, sel_psi2s])
def _makeHHWS(self): #from Beauty2Charm_DBuilder import subPIDSels protoSels = self._makePiPiWSSels() decays = [['pi+', 'pi+'], ['pi+', 'K+'], ['K+', 'pi+'], ['K+', 'K+']] plus = subPIDSels(decays, 'X2HHWSPlus', '', '0*MeV', '5000*MeV', [protoSels[0]]) decays = [['pi-', 'pi-'], ['pi-', 'K-'], ['K-', 'pi-'], ['K-', 'K-']] minus = subPIDSels(decays, 'X2HHWSMinus', '', '0*MeV', '5000*MeV', [protoSels[1]]) return [ MergedSelection('X2HHWSBeauty2XGamma', RequiredSelections=[plus, minus]) ]
def makeTopoCands(inputs, addsumpt): all2 = makeTopoAllNBody(2, [inputs]) topo2 = topoNforN(2, all2, addsumpt) topo2 = topoBDT(2, topo2) topo2 = topoSubPID('Topo2Body', topo2) filt2 = topo2for3(all2) all3 = makeTopoAllNBody(3, [inputs, filt2]) topo3 = topoNforN(3, all3, addsumpt) topo3 = topoBDT(3, topo3) topo3 = topoSubPID('Topo3Body', topo3) filt3 = topo3for4(all3) all4 = makeTopoAllNBody(4, [inputs, filt3], 4000 + addsumpt) topo4 = topoNforN(4, all4, addsumpt) topo4 = topoBDT(4, topo4) return [MergedSelection('PseudoTopoCands', [topo2, topo3, topo4])]