def makeKaons(name, TrChi2, TrIPChi2, TrGhost, MesonPT): """Create pi+ Selection object starting from DataOnDemand 'Phys/StdLooseKaons'. @arg name: name of the Selection. @arg TrChi2: track chi2/dof of the kaons @arg TrIPChi2: trakc IP chi2/dof of the kaons @arg TrGhost: trakc ghost probability of the kaons @arg MesonPT: PT of the kaons @return: Selection object """ code = "(PT > %(MesonPT)s) & (TRGHOSTPROB < %(TrGhost)s) & (TRCHI2DOF<%(TrChi2)s) & ISBASIC & (MIPCHI2DV(PRIMARY) > %(TrIPChi2)s)" % locals( ) kaonFilter = FilterDesktop(Code=code) stdkaon = DataOnDemand(Location="Phys/StdLooseKaons/Particles") return Selection(name, Algorithm=kaonFilter, RequiredSelections=[stdkaon])
def makeKS2DD( self, name, config ) : # define all the cuts _massCut = "(ADMASS('KS0')<%s*MeV)" % config['KS_DD_MassWindow'] _vtxCut = "(VFASPF(VCHI2)<%s)" % config['KS_DD_VtxChi2'] _fdCut = "(BPVVDCHI2>%s)" % config['KS_DD_FDChi2'] _momCut = "(P>%s*MeV)" % config['KS_DD_Pmin'] _allCuts = _momCut+'&'+_massCut+'&'+_vtxCut+'&'+_fdCut # get the KS's to filter _stdKSDD = DataOnDemand( Location = "Phys/StdLooseKsDD/Particles" ) # make the filter _filterKSDD = FilterDesktop( Code = _allCuts ) # make and store the Selection object self.selKS2DD = Selection( name, Algorithm = _filterKSDD, RequiredSelections = [_stdKSDD] )
def makeSlowPi(name, TrChi2, PionLocation): """ Create Photons from DataOnDemand 'Phys/StdLoosePions'. @arg name: name of the Selection. @arg TrChi2: minimum chi2 of the tracks @return: Selection object """ _code = '(TRCHI2DOF < %(TrChi2)s)' % locals() print 'making slowPion:', _code _slowpiFilter = FilterDesktop(Code=_code) _slowPi = DataOnDemand(Location=PionLocation) return Selection(name, Algorithm=_slowpiFilter, RequiredSelections=[_slowPi])
def makeKS2LL( self, name, config ) : # define all the cuts _massCut = "(ADMASS('KS0')<%s*MeV)" % config['KS_LL_MassWindow'] _vtxCut = "(VFASPF(VCHI2)<%s)" % config['KS_LL_VtxChi2'] _fdCut = "(BPVVDCHI2>%s)" % config['KS_LL_FDChi2'] _trkChi2Cut1 = "(CHILDCUT((TRCHI2DOF<%s),1))" % config['Trk_Chi2'] _trkChi2Cut2 = "(CHILDCUT((TRCHI2DOF<%s),2))" % config['Trk_Chi2'] _allCuts = _massCut+'&'+_vtxCut+'&'+_fdCut+'&'+_trkChi2Cut1+'&'+_trkChi2Cut2 # get the KS's to filter _stdKSLL = DataOnDemand( Location = "Phys/StdLooseKsLL/Particles" ) # make the filter _filterKSLL = FilterDesktop( Code = _allCuts ) # make and store the Selection object self.selKS2LL = Selection( name, Algorithm = _filterKSLL, RequiredSelections = [_stdKSLL] )
def filterPions(name, inputName, trackFromDCutP, trackFromDCutPIDe, trackFromDCutPIDp, pionFromDCutPIDK, pionFromDCutTRCHI2DOF): """ Apply cuts to pion daughters of D0 """ _strCutP = "(P > %(trackFromDCutP)s *MeV)" % locals() _strCutPIDe = "(PIDe-PIDpi < %(trackFromDCutPIDe)s )" % locals() _strCutPIDp = "(PIDp-PIDpi < %(trackFromDCutPIDp)s ) " % locals() _strCutPIDK = "(PIDK -PIDpi < %(pionFromDCutPIDK)s ) " % locals() _strCutChi2 = "(TRCHI2DOF < %(pionFromDCutTRCHI2DOF)s )" % locals() _strCuts = '(' + _strCutP + '&' + _strCutPIDe + '&' + _strCutPIDp \ + '&' + _strCutPIDK + '&' + _strCutChi2 + ')' _trackFilter = FilterDesktop(Code=_strCuts) inputTracks = DataOnDemand(Location=inputName) return Selection(name, Algorithm=_trackFilter, RequiredSelections=[inputTracks])
def makeJpsi2MuMu(name, MuonPT, MuonP, MuonTRCHI2DOF, MuMuParticleName, MuMuVtxCHI2, MuMuMassWindow, MuMuPT): _StdLooseDiMuon = DataOnDemand(Location="Phys/StdLooseDiMuon/Particles") #MuonCut = "(MINTREE('mu+'==ABSID,PT) > %(MuonPT)s *MeV) & (MINTREE('mu+'==ABSID,P) > %(MuonP)s *MeV) & (MAXTREE('mu+'==ABSID,TRCHI2DOF) < %(MuonTRCHI2DOF)s)" % locals() MuonCut = "(CHILDCUT((TRCHI2DOF < %(MuonTRCHI2DOF)s),1)) & (CHILDCUT((TRCHI2DOF < %(MuonTRCHI2DOF)s),2)) & (CHILDCUT((PT > %(MuonPT)s *MeV),1)) & (CHILDCUT((PT > %(MuonPT)s *MeV),2))" % locals( ) MuMuCut = "(ADMASS(%(MuMuParticleName)s) < %(MuMuMassWindow)s *MeV) & (VFASPF(VCHI2PDOF)< %(MuMuVtxCHI2)s) & (PT > %(MuMuPT)s *MeV)" % locals( ) _MuMu = FilterDesktop(Code=MuonCut + " & " + MuMuCut) return Selection(name + "_SelP2MuMu", Algorithm=_MuMu, RequiredSelections=[_StdLooseDiMuon])
def makeKstar(name, TrChi2, KstMassWin) : """ Create and return a K*->Kpi Selection object, starting from DataOnDemand 'Phys/StdVeryLooseDetachedKst2Kpi'. @arg name: name of the Selection. @arg TrChi2: tracks chi2 @arg KstMassWin: K* mass window @return: Selection object """ _preambulo = ["goodTrack = ((TRCHI2DOF < %(TrChi2)s))" % locals(), "goodKstar = ((ADMASS('K*(892)0') < %(KstMassWin)s*MeV))" % locals()] _code = "goodKstar & CHILDCUT( goodTrack , 1 ) & CHILDCUT( goodTrack , 2 )" _kstFilter = FilterDesktop(Preambulo=_preambulo, Code=_code) _stdKst2Kpi = DataOnDemand(Location="Phys/StdVeryLooseDetachedKst2Kpi/Particles") return Selection(name, Algorithm=_kstFilter, RequiredSelections=[_stdKst2Kpi])
def makeLc23mu(self, name): Lc23mu = DaVinci__N3BodyDecays("Combine" + name) Lc23mu.DecayDescriptors = [ "[Lambda_c+ -> mu+ mu+ mu-]cc", "[Lambda_c+ -> mu+ mu+ mu+]cc" ] Lc23mu.DaughtersCuts = {"mu+": self.TrackCuts} Lc23mu.Combination12Cut = self.Combination12Cuts Lc23mu.CombinationCut = self.CombinationCutsLoose Lc23mu.MotherCut = self.MotherCuts _myMuons = DataOnDemand(Location="Phys/StdLooseMuons/Particles") return Selection(name, Algorithm=Lc23mu, RequiredSelections=[_myMuons])
def makePhi2KK(name, TrChi2, PhiMassWin) : """ Create and return a Phi->KK Selection object, starting from DataOnDemand 'Phys/StdLoosePhi2KK'. @arg name: name of the Selection. @arg TrChi2: minimum chi2 of the K+ tracks @arg PhiMassWin: selected Phi mass window @return: Selection object """ _preambulo = ["goodKaon = ((TRCHI2DOF < %(TrChi2)s))" % locals(), "goodPhi = ((ADMASS('phi(1020)') < %(PhiMassWin)s*MeV))" % locals()] _code = 'goodPhi & CHILDCUT( goodKaon, 1 ) & CHILDCUT( goodKaon, 2 )' _phiFilter = FilterDesktop(Preambulo=_preambulo, Code=_code) _stdPhi2KK = DataOnDemand(Location="Phys/StdLoosePhi2KK/Particles") return Selection(name, Algorithm=_phiFilter, RequiredSelections=[_stdPhi2KK])
def DForBu2D0h_D02KShh_KSLLAlg_WS(self): ''' D0->KS Pi Pi, D0->KS K Pi, D0->KS K K, KS LL selections ''' import GaudiKernel.SystemOfUnits as Units from PhysSelPython.Wrappers import Selection import StandardParticles if hasattr(StandardParticles, "StdAllNoPIDsPions"): from StandardParticles import StdAllNoPIDsPions as MyStdLoosePions_D2KShh_LL_WS else: from StandardParticles import StdNoPIDsPions as MyStdLoosePions_D2KShh_LL_WS if hasattr(StandardParticles, "StdAllNoPIDsKaons"): from StandardParticles import StdAllNoPIDsKaons as MyStdLooseKaons_D2KShh_LL_WS else: from StandardParticles import StdNoPIDsKaons as MyStdLooseKaons_D2KShh_LL_WS #from StandardParticles import StdAllNoPIDsPions as MyStdLoosePions_D2KShh_LL_WS #from StandardParticles import StdAllNoPIDsKaons as MyStdLooseKaons_D2KShh_LL_WS SelKSLL_Bu2D0h_noPID_WS = DataOnDemand( Location="Phys/StdVeryLooseKsLL/Particles") DForBu2D0h_D02KShh_KSLL_WS = CombineParticles( DecayDescriptors=[ "D0 -> KS0 pi+ pi+", "D0 -> KS0 pi- pi-", "D0 -> KS0 K+ pi+", "D0 -> KS0 K- pi-", "D0 -> KS0 K+ K+", "D0 -> KS0 K- K-" ], DaughtersCuts={ "pi+": self.D_LL_DaughterCut_WS, "K+": self.D_LL_DaughterCut_WS, "KS0": "ALL" }, CombinationCut=self.D_LL_CombCut_WS, MotherCut=self.D_LL_MotherCut_WS) SelDForBu2D0h_D02KShh_KSLL_WS = Selection( self._myname + "SelDForBu2D0h_D02KShh_KSLL_WS", Algorithm=DForBu2D0h_D02KShh_KSLL_WS, RequiredSelections=[ SelKSLL_Bu2D0h_noPID_WS, MyStdLoosePions_D2KShh_LL_WS, MyStdLooseKaons_D2KShh_LL_WS ]) self.MergedD0_KShh_noPID_LL_WS = SelDForBu2D0h_D02KShh_KSLL_WS
def filterDiMu(self, name, MuonPT, MuonTRCHI2DOF, MuonPID, MuMuMinMass, MuMuMaxMass, MuMuVCHI2PDOF, MuMuPT): _StdLooseDiMuon = DataOnDemand( Location='Phys/StdLooseDiMuon/Particles') MuonCut = "(MINTREE('mu+'==ABSID,PT) > %(MuonPT)s ) & (MAXTREE('mu+'==ABSID,TRCHI2DOF) < %(MuonTRCHI2DOF)s) & (MINTREE('mu+'==ABSID,PIDmu)> %(MuonPID)s)" % locals( ) # MuonCut = " (MAXTREE('mu+'==ABSID,TRCHI2DOF) < %(MuonTRCHI2DOF)s) & (MINTREE('mu+'==ABSID,PIDmu)> %(MuonPID)s )" % locals() MuMuCut = "(MM > %(MuMuMinMass)s *GeV) & (MM < %(MuMuMaxMass)s *GeV) & (VFASPF(VCHI2PDOF)< %(MuMuVCHI2PDOF)s) & (PT > %(MuMuPT)s *GeV)" % locals( ) _MuMu = FilterDesktop(Code=MuonCut + " & " + MuMuCut) return Selection(name + "_SelMuMu", Algorithm=_MuMu, RequiredSelections=[_StdLooseDiMuon])
def makeLambda2DD( self, name, config ) : # define all the cuts _massCut = "(ADMASS('Lambda0')<%s*MeV)" % config['Lambda_DD_MassWindow'] _vtxCut = "(VFASPF(VCHI2)<%s) " % config['Lambda_DD_VtxChi2'] _fdChi2Cut = "(BPVVDCHI2>%s)" % config['Lambda_DD_FDChi2'] _fdCut = "(VFASPF(VMINVDDV(PRIMARY))>%s)" % config['Lambda_DD_FD'] _momCut = "(P>%s*MeV)" % config['Lambda_DD_Pmin'] _allCuts = _momCut+'&'+_massCut+'&'+_vtxCut+'&'+_fdCut+'&'+_fdChi2Cut # get the Lambda0's to filter _stdLambdaDD = DataOnDemand(Location = "Phys/StdLooseLambdaDD/Particles") # make the filter _filterLambdaDD = FilterDesktop( Code = _allCuts ) # make and store the Selection object return Selection( name, Algorithm = _filterLambdaDD, RequiredSelections = [_stdLambdaDD] )
def makeLc(localName): # Pick up standard Lambdac -> p K- pi+ _stdLc = DataOnDemand(Location='Phys/StdLooseLambdac2PKPi/Particles') # Filter to reduce rate: _strCutK = '( CHILD(PIDK,1) - CHILD(PIDpi,1) > 5.0 )' _strCutp = '( CHILD(PIDp,2) - CHILD(PIDpi,2) > 5.0 )' _strCutpi = '( CHILD(PIDpi,3) - CHILD(PIDK,3) > 0.0 )' _strCutTrackChi2 = '( (CHILD(TRCHI2DOF,1)<4.0) & (CHILD(TRCHI2DOF,2)<4.0) & (CHILD(TRCHI2DOF,3)<4.0) )' _strCutDIRA = '( BPVDIRA > 0.95 )' _strCutFD = '( BPVVDCHI2 > 25 )' _strCutMass = '( (M > 2185.0*MeV) & (M < 2385*MeV) )' _strCutIP = '( NINGENERATION( (MIPCHI2DV(PRIMARY) > 30.0), 1) >= 1 )' _strCutLc = '(' + _strCutK + '&' + _strCutpi + '&' + _strCutp + '&' + _strCutTrackChi2 + '&' + _strCutDIRA + '&' + _strCutFD + '&' + _strCutMass + '&' + _strCutIP + ')' _filterLc = FilterDesktop(Code=_strCutLc) return Selection(localName, Algorithm=_filterLc, RequiredSelections=[_stdLc])
def GetRequiredSels(self, Alg): """ Extract the list of RequiredSelections from an object with fixes input locations """ if hasattr(Alg, 'Inputs'): from PhysSelPython.Wrappers import DataOnDemand _requires = [] for loc in Alg.Inputs: _requires += [DataOnDemand(Location=loc)] Alg.Inputs = [] return _requires else: raise Exception("Algorithm does not have property 'Inputs'")
def __MakeDstar__(self): """ Dstar for the selection Here [D*(2010)+ -> pi+ D0]cc """ from GaudiConfUtils.ConfigurableGenerators import FilterDesktop from PhysSelPython.Wrappers import Selection, DataOnDemand DstarsForB0d = FilterDesktop( Code = self.totalDstarCut ) #print "\nCreating Dstar from CommonParticles\n" MyStdDstars = DataOnDemand(Location = 'Phys/StdLooseDstarWithD02KPi/Particles') SelDstarsForB0d = Selection("SelDstarsFor"+self._name,Algorithm=DstarsForB0d, RequiredSelections = [MyStdDstars]) self.DstarSel=SelDstarsForB0d
def makeB24p(self, name): # to select B(s) -> p p p p B24p = DaVinci__N4BodyDecays("Combine" + name) B24p.DecayDescriptors = [ "[B0 -> p+ p+ p~- p~-]cc", "[B0 -> p+ p+ p+ p~-]cc" ] B24p.DaughtersCuts = { "p+": self.TrackCuts + " & ((PIDp-PIDpi)>0)" + " & ((PIDp-PIDK)>0)" } B24p.Combination12Cut = self.CommonCombi12Cuts B24p.Combination123Cut = self.CommonCombi123Cuts B24p.CombinationCut = self.CommonCombiCuts B24p.MotherCut = self.MotherCuts _myProtons = DataOnDemand(Location="Phys/StdLooseProtons/Particles") return Selection(name, Algorithm=B24p, RequiredSelections=[_myProtons])
def makePseudoJPsi(self,name) : """ Make PseudoJpsi (combination of two detached muons) Arguments: name : name of the selection """ PseudoJPsi = CombineParticles("Combine"+name) PseudoJPsi.DecayDescriptor = "J/psi(1S) -> mu+ mu-" PseudoJPsi.DaughtersCuts = { "mu+" : "(MIPCHI2DV(PRIMARY)> %(muIpChi2)s )"\ "&(TRCHI2DOF < %(muTrChi2Dof)s )" %self.config} PseudoJPsi.CombinationCut = " (AMAXDOCA('')<%(KSdoca)s*mm)" %self.config PseudoJPsi.MotherCut = "ALL" _stdLooseMuons = DataOnDemand(Location = "Phys/StdAllLooseMuons/Particles") return Selection (name, Algorithm = PseudoJPsi, RequiredSelections = [ _stdLooseMuons])
def __init__(self, name, config): LineBuilder.__init__(self, name, config) self.name = name self.config = config """ DiMuon """ self.SelDiMuon = self.createSubSel( OutputList=self.name + "SelDiMuon", InputList=DataOnDemand(Location='Phys/StdLooseDiMuon/Particles'), Cuts=config['TotalCuts']) self.DiMuonForXsectionLine = StrippingLine(self.name + 'Line', prescale=config['Prescale'], checkPV=config['CheckPV'], algos=[self.SelDiMuon]) self.registerLine(self.DiMuonForXsectionLine)
def filterJpsi2MuMuDetached(name, MuonPT, MuonP, MuonPIDmu, MuonTRCHI2DOF, MuMuMinMass, MuMuMaxMass, MuMuVCHI2PDOF, MuMuPT, MuMuDLS): _StdLooseJpsi2MuMu = DataOnDemand( Location='Phys/StdLooseJpsi2MuMu/Particles') MuonCut = "(MINTREE('mu+'==ABSID,PT) > %(MuonPT)s *MeV) & (MINTREE('mu+'==ABSID,P) > %(MuonP)s *MeV) & (MAXTREE('mu+'==ABSID,TRCHI2DOF) < %(MuonTRCHI2DOF)s) & (MINTREE('mu+'==ABSID,PIDmu) > %(MuonPIDmu)s)" % locals( ) MuMuCut = "(MM > %(MuMuMinMass)s) & (MM < %(MuMuMaxMass)s) & (VFASPF(VCHI2PDOF)< %(MuMuVCHI2PDOF)s) & (PT > %(MuMuPT)s) & (BPVDLS>%(MuMuDLS)s)" % locals( ) _MuMu = FilterDesktop(Code=MuonCut + " & " + MuMuCut) return Selection(name + "_SelJpsi2MuMu", Algorithm=_MuMu, RequiredSelections=[_StdLooseJpsi2MuMu])
def makeDstar(name, inputD0, preFitDstarMassCut, cutChi2, SoftPionCutPIDe, cutPT, wideDMCutLower, wideDMCutUpper) : """ Given a list of D0, try to make D*+ -> D0 pi+ """ _softPi = DataOnDemand(Location = 'Phys/StdLoosePions/Particles') _cutsSoftPi = '( PIDe-PIDpi < %(SoftPionCutPIDe)s )' % locals() _cutsDstarComb = "ADAMASS('D*(2010)+') < %(preFitDstarMassCut)s *MeV" % locals() _cutsDstarMoth_base = '(PT > %(cutPT)s * MeV) & (VFASPF(VCHI2/VDOF) < %(cutChi2)s )' % locals() _cutsDstarMoth_DM = '(MM - CHILD(MM,1) - CHILD(MM,2) > %(wideDMCutLower)s *MeV) & (MM - CHILD(MM,1) - CHILD(MM,2) < %(wideDMCutUpper)s *MeV)' % locals() _cutsDstarMoth = '(' + _cutsDstarMoth_base + ' & ' + _cutsDstarMoth_DM + ')' _Dstar = CombineParticles( DecayDescriptor = "[D*(2010)+ -> D0 pi+]cc", DaughtersCuts = { "pi+" : _cutsSoftPi }, CombinationCut = _cutsDstarComb, MotherCut = _cutsDstarMoth) return Selection ( name, Algorithm = _Dstar, RequiredSelections = inputD0 + [_softPi])
def makeDstar(_name, inputD0, Dstar_cuts): _softPi = DataOnDemand(Location='Phys/StdAllLoosePions/Particles') _inputD0_conj = Selection("SelConjugateD0For" + _name, Algorithm=ConjugateNeutralPID('ConjugateD0For' + _name), RequiredSelections=[inputD0]) _cutsSoftPi = '( PT > %(Dstar_SoftPion_PT)s *MeV )' % Dstar_cuts _cutsDstarComb = '(AM - ACHILD(M,1) + 5 > %(Dstar_wideDMCutLower)s *MeV) & (AM - ACHILD(M,1) - 5 < %(Dstar_wideDMCutUpper)s *MeV)' % Dstar_cuts _cutsDstarMoth_base = '(VFASPF(VCHI2/VDOF) < %(Dstar_Chi2)s )' % Dstar_cuts _cutsDstarMoth_DM = '(M - CHILD(M,1) > %(Dstar_wideDMCutLower)s *MeV) & (M - CHILD(M,1) < %(Dstar_wideDMCutUpper)s *MeV)' % Dstar_cuts _cutsDstarMoth = '(' + _cutsDstarMoth_base + ' & ' + _cutsDstarMoth_DM + ')' _Dstar = CombineParticles(DecayDescriptor="[D*(2010)+ -> D0 pi+]cc", DaughtersCuts={"pi+": _cutsSoftPi}, CombinationCut=_cutsDstarComb, MotherCut=_cutsDstarMoth) return Selection(name="Sel" + _name, Algorithm=_Dstar, RequiredSelections=[inputD0, _inputD0_conj] + [_softPi])
def makeJp(name, MaxJpDeltaM, MinJpPt, MaxJpVertChi2DOF, MinJpPVVDChi2, MinJpIPChi2, MinJpDauPt, MinJpDauIPChi2, MaxJpDauTrkChi2): _code = "( ADMASS('J/psi(1S)') < %(MaxJpDeltaM)s*MeV)" % locals() _code += "& ( PT > %(MinJpPt)s )" % locals() _code += "& ( VFASPF(VCHI2/VDOF) < %(MaxJpVertChi2DOF)s )" % locals() _code += "& ( BPVVDCHI2 > %(MinJpPVVDChi2)s )" % locals() _code += "& ( MIPCHI2DV(PRIMARY) > %(MinJpIPChi2)s )" % locals() _code += "& CHILDCUT ( MIPCHI2DV ( PRIMARY ) > %(MinJpDauIPChi2)s , 1 )" % locals( ) _code += "& CHILDCUT ( MIPCHI2DV ( PRIMARY ) > %(MinJpDauIPChi2)s , 2 )" % locals( ) _code += "& CHILDCUT ( PT > %(MinJpDauPt)s , 1 )" % locals() _code += "& CHILDCUT ( PT > %(MinJpDauPt)s , 2 )" % locals() _code += "& CHILDCUT ( TRCHI2DOF < %(MaxJpDauTrkChi2)s , 1 )" % locals() _code += "& CHILDCUT ( TRCHI2DOF < %(MaxJpDauTrkChi2)s , 2 )" % locals() _JpFilter = FilterDesktop(Code=_code) _stdJp = DataOnDemand(Location="Phys/StdLooseDiMuon/Particles") return Selection(name, Algorithm=_JpFilter, RequiredSelections=[_stdJp])
def __FilterSelectionJPsi__(self, lName, JPsiCuts): ''' J/psi(1S) -> mu+ mu- filter (from StdLooseJpsi2MuMu) ''' from PhysSelPython.Wrappers import DataOnDemand StdJPsi = DataOnDemand(Location = "Phys/StdLooseJpsi2MuMu/Particles") from GaudiConfUtils.ConfigurableGenerators import FilterDesktop FilterJPsi = FilterDesktop() #FilterJPsi.InputPrimaryVertices = self.__PVOutputLocation__ FilterJPsi.Code = JPsiCuts from PhysSelPython.Wrappers import Selection SelJPsi = Selection("SelFilter_" + lName + "_JPsi", Algorithm = FilterJPsi, RequiredSelections = [StdJPsi]) return SelJPsi
def makeKS(name, MaxKSDeltaM, MinKSPt, MaxKSVertChi2DOF, MinKSPVVDChi2, MinKSIPChi2, MinKSDauPt, MinKSDauIPChi2, MaxKSDauTrkChi2): _code = "(ADMASS('K*(892)0') < %(MaxKSDeltaM)s*MeV)" % locals() _code += "& ( PT > %(MinKSPt)s )" % locals() _code += "& ( VFASPF(VCHI2/VDOF) < %(MaxKSVertChi2DOF)s )" % locals() _code += "& ( BPVVDCHI2 > %(MinKSPVVDChi2)s )" % locals() _code += "& ( MIPCHI2DV(PRIMARY) > %(MinKSIPChi2)s )" % locals() _code += "& CHILDCUT ( MIPCHI2DV ( PRIMARY ) > %(MinKSDauIPChi2)s , 1 )" % locals( ) _code += "& CHILDCUT ( MIPCHI2DV ( PRIMARY ) > %(MinKSDauIPChi2)s , 2 )" % locals( ) _code += "& CHILDCUT ( PT > %(MinKSDauPt)s , 1 )" % locals() _code += "& CHILDCUT ( PT > %(MinKSDauPt)s , 2 )" % locals() _code += "& CHILDCUT ( TRCHI2DOF < %(MaxKSDauTrkChi2)s , 1 )" % locals() _code += "& CHILDCUT ( TRCHI2DOF < %(MaxKSDauTrkChi2)s , 2 )" % locals() _KSFilter = FilterDesktop(Code=_code) _stdKS = DataOnDemand(Location="Phys/StdLooseKstar2Kpi/Particles") return Selection(name, Algorithm=_KSFilter, RequiredSelections=[_stdKS])
def makePh(name, MaxPhDeltaM, MinPhPt, MaxPhVertChi2DOF, MinPhPVVDChi2, MinPhIPChi2, MinPhDauPt, MinPhDauIPChi2, MaxPhDauTrkChi2): _code = "( ADMASS('phi(1020)') < %(MaxPhDeltaM)s*MeV)" % locals() _code += "& ( PT > %(MinPhPt)s )" % locals() _code += "& ( VFASPF(VCHI2/VDOF) < %(MaxPhVertChi2DOF)s )" % locals() _code += "& ( BPVVDCHI2 > %(MinPhPVVDChi2)s )" % locals() _code += "& ( MIPCHI2DV(PRIMARY) > %(MinPhIPChi2)s )" % locals() _code += "& CHILDCUT ( MIPCHI2DV ( PRIMARY ) > %(MinPhDauIPChi2)s , 1 )" % locals( ) _code += "& CHILDCUT ( MIPCHI2DV ( PRIMARY ) > %(MinPhDauIPChi2)s , 2 )" % locals( ) _code += "& CHILDCUT ( PT > %(MinPhDauPt)s , 1 )" % locals() _code += "& CHILDCUT ( PT > %(MinPhDauPt)s , 2 )" % locals() _code += "& CHILDCUT ( TRCHI2DOF < %(MaxPhDauTrkChi2)s , 1 )" % locals() _code += "& CHILDCUT ( TRCHI2DOF < %(MaxPhDauTrkChi2)s , 2 )" % locals() _PhFilter = FilterDesktop(Code=_code) _stdPh = DataOnDemand(Location="Phys/StdLooseDetachedPhi2KK/Particles") return Selection(name, Algorithm=_PhFilter, RequiredSelections=[_stdPh])
def makeJpsi2MuMu( self, name, config): """ Cuts: - Jpsi_MassWindow : mass acceptance of Jpsi """ # define all the cuts _massCut = "(ADMASS('J/psi(1S)')<%s*MeV)" % config['Jpsi_MassWindow'] _allCuts = _massCut # AutomaticData is for data on the DST Jpsi_Data = DataOnDemand( Location = "Phys/StdMassConstrainedJpsi2MuMu/Particles" ) # Filter the Jpsi for tighter cut _Jpsi_Filter = FilterDesktop( Code = _allCuts) # make a Selection self.selJpsi = Selection(name , Algorithm = _Jpsi_Filter, RequiredSelections = [ Jpsi_Data ])
def makePhi2KK( name, PhiWin, # 20 PhiPT, # 500 PhiVFASPF, # 16 PhiMAXTRCHI2DOF, # <5 PhiMINTRCHI2DOF # >-2 ): _stdPhi2KK = DataOnDemand(Location="Phys/StdLoosePhi2KK/Particles") _code = "(ADMASS('phi(1020)') < %(PhiWin)s) & (PT > %(PhiPT)s *MeV) & (VFASPF(VCHI2) < %(PhiVFASPF)s) & (MAXTREE('K+'==ABSID, TRCHI2DOF) < %(PhiMAXTRCHI2DOF)s) & (MINTREE('K+'==ABSID, PIDK) > %(PhiMINTRCHI2DOF)s)" % locals( ) _phiFilter = FilterDesktop(Code=_code) # print ' makePhi2KK ', name, 'Code ', _code return Selection(name, Algorithm=_phiFilter, RequiredSelections=[_stdPhi2KK])
def _Bs2JpsieePhiLine( self, dielectron, name, config ) : _jpsi = FilterDesktop("FilterJpsi2eeFor"+name, Code = " (MM > %(JpsiMassMin)s *MeV)" \ " & (MM < %(JpsiMassMax)s *MeV)" \ " & (MINTREE('e+'==ABSID,PIDe-PIDpi) > %(ElectronPID)s )" \ " & (MINTREE('e+'==ABSID,PT) > %(ElectronPT)s *MeV)" \ " & (MAXTREE('e+'==ABSID,TRCHI2DOF) < %(ElectronTrackCHI2pDOF)s)" \ " & (VFASPF(VCHI2/VDOF) < %(JpsiVertexCHI2pDOF)s)" % config ) Jpsi = Selection("SelJpsi2eeFor"+name, Algorithm = _jpsi, RequiredSelections = [dielectron]) _stdPhi = DataOnDemand(Location="Phys/StdLoosePhi2KK/Particles") _phi = FilterDesktop("FilterPhi2KKFor"+name, Code = " (PT > %(PhiPT)s *MeV)" \ " & (MINTREE('K+'==ABSID,PIDK-PIDpi) > %(KaonPID)s )" \ " & (MAXTREE('K+'==ABSID,TRCHI2DOF) < %(KaonTrackCHI2pDOF)s)" \ " & (VFASPF(VCHI2/VDOF) < %(PhiVertexCHI2pDOF)s)" \ " & (MM > %(PhiMassMin)s *MeV)" \ " & (MM < %(PhiMassMax)s *MeV)" % config ) Phi = Selection("SelPhi2KKFor"+name, Algorithm = _phi, RequiredSelections = [_stdPhi]) CC = "(AM > %(BsMassMin)s *MeV) & (AM < %(BsMassMax)s *MeV)" % config MC = "(VFASPF(VCHI2/VDOF) < %(BsVertexCHI2pDOF)s) & (BPVDIRA > %(BsDIRA)s)" % config _Bs = CombineParticles("CombineBsFor"+name, DecayDescriptor = "B_s0 -> J/psi(1S) phi(1020)", CombinationCut = CC , MotherCut = MC, ReFitPVs = False ) Bs = Selection(name, Algorithm = _Bs, RequiredSelections = [Jpsi, Phi]) return StrippingLine(name+"Line" , prescale = config['Prescale'] , postscale = 1 , selection = Bs , EnableFlavourTagging = True )#, MDSTFlag = True )
def makeKst2Kpi(name, KaonPT, KaonIPCHI2, PionPT, PionIPCHI2, KstarPT, KaonPIDK, KstarVCHI2, KstarMassWin, PionPIDK, MaxGHOSTPROB): """ Create and return a Kstar -> K+pi- Selection object. Starts from DataOnDemand 'Phys/StdVeryLooseDetachedKst2Kpi'. Arguments: name : name of the Selection. KaonPT : Minimum transverse momentum of K (MeV). KaonIPCHI2 : Minimum impact parameter chi2 of K. PionPT : Minimum transverse momentum of pi (MeV). PionIPCHI2 : Minimum impact parameter chi2 of pi. PionPIDK : Maximum PID_{K-pi} of pi. KstarPT : Minimum transverse momentum of Kstar (MeV). KaonPIDK : Minimum PID_{K-pi} of K. KstarVCHI2 : Maximum Kstar vertex chi2 per degree of freedom. KstarMassWin : Kstar invariant mass window around PDG mass value (MeV). MaxGHOSTPROB : Maximum Ghost Probability """ KstarCuts = "(INTREE((ABSID=='K+') & (PT > %(KaonPT)s *MeV) & (MIPCHI2DV(PRIMARY)> %(KaonIPCHI2)s) & (PIDK > %(KaonPIDK)s) & (TRGHOSTPROB< %(MaxGHOSTPROB)s) ))"\ "& (INTREE((ABSID=='pi-') & (PT > %(PionPT)s *MeV) & (MIPCHI2DV(PRIMARY)> %(PionIPCHI2)s) & (PIDK < %(PionPIDK)s ) & (TRGHOSTPROB< %(MaxGHOSTPROB)s) ))"\ "& (ADMASS('K*(892)0') < %(KstarMassWin)s *MeV)"\ "& (VFASPF(VCHI2/VDOF)< %(KstarVCHI2)s) & (PT > %(KstarPT)s *MeV)"% locals() _KstarFilter = FilterDesktop("_filterFor"+name) _KstarFilter.Code = KstarCuts _stdKst2Kpi = DataOnDemand(Location="Phys/StdVeryLooseDetachedKst2Kpi/Particles") return Selection (name, Algorithm = _KstarFilter, RequiredSelections = [_stdKst2Kpi])
def makeXi(localName, inputList, cutWide, cutTight, configDict = _my_immutable_config) : _stdPi = DataOnDemand(Location = configDict['Xi_Pi_InputList']) _strCutPiForXi = "(P>%(Xi_Pi_P_Min)s)" \ "& (TRCHI2DOF<%(Xi_Pi_TRCHI2DOF_Max)s)" \ "& (PT>%(Xi_Pi_PT_Min)s)" \ "& (MIPCHI2DV(PRIMARY)>%(Xi_Pi_MIPCHI2DV_Min)s)" % configDict _strCutCombXi = "( ADAMASS('Xi-') < %(cutWide)s * MeV )" % locals() _strCutMothMass = "( ADMASS('Xi-') < %(cutTight)s * MeV )" % locals() _strCutMothChi2 = "(VFASPF(VCHI2)<%(Xi_VCHI2_Max)s)" % configDict _strCutMothXi = _strCutMothMass + '&' + _strCutMothChi2 _combineXi = CombineParticles( DecayDescriptor = '[Xi- -> Lambda0 pi-]cc', DaughtersCuts = { "pi-": _strCutPiForXi }, CombinationCut = _strCutCombXi, MotherCut = _strCutMothXi ) return Selection ( localName, Algorithm = _combineXi, RequiredSelections = [ inputList, _stdPi ] )