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 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 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 __MakeMuSel__(self): """ the bachelor muon selection, takes some keyword arguements to make a muon selection """ from GaudiConfUtils.ConfigurableGenerators import FilterDesktop from PhysSelPython.Wrappers import Selection import StandardParticles if hasattr(StandardParticles, "StdAllLooseMuons"): from StandardParticles import StdAllLooseMuons as StdLooseMuons else: from StandardParticles import StdLooseMuons MuForB0q = FilterDesktop(Code=self.MuCut) SelMuForB0q = Selection("SelMuFor" + self._name, Algorithm=MuForB0q, RequiredSelections=[StdLooseMuons]) self.MuSel = SelMuForB0q
def kaons ( self ) : """ Get the kaons """ sel = self._selection ( 'KaonSelection') if sel : return sel _KaonFilter = FilterDesktop ( Code = """ ( 'K+' == ABSID ) & ( %s ) """ % self.kaonCuts() ) # sel = Selection ( 'SelKaonsFor' + self.name() , Algorithm = _KaonFilter , RequiredSelections = [ StdLooseKaons ] ) return self._add_selection ( 'KaonSelection' , sel )
def makeBc2JpsiMu( name, SelJpsi2MuMu, MuonBcTRCHI2DOF, MuonBcPT, MuonBcP, BcVtxCHI2, BcUpperMass, BcLowerMass, BcPT ): #--------------------------- # Muon #--------------------------- from StandardParticles import StdAllNoPIDsMuons as NoPIDsMuonsForBc2JpsiMu # MuBc Cut MuonBcCut = "(PT > %(MuonBcPT)s *MeV) & (P > %(MuonBcP)s *MeV) & (TRCHI2DOF < %(MuonBcTRCHI2DOF)s)" % locals() _MuonBcFilter = FilterDesktop( Code = MuonBcCut ) SelMuonBc = Selection("SelMuonBc_"+name, Algorithm = _MuonBcFilter, RequiredSelections = [ NoPIDsMuonsForBc2JpsiMu ]) #--------------------------- # Bc -> J/psi(MuMu) Mu X #--------------------------- # Comb cut combCut = "(in_range( %(BcLowerMass)s *MeV, AM, %(BcUpperMass)s *MeV))" % locals() # Bc Cut BcCut = "(VFASPF(VCHI2PDOF)< %(BcVtxCHI2)s ) & (PT > %(BcPT)s *MeV)" % locals() _Bc2JpsiMuX = CombineParticles( DecayDescriptor = "[ B_c+ -> J/psi(1S) mu+ ]cc", CombinationCut = combCut, MotherCut = BcCut, ReFitPVs = True ) return Selection( name, Algorithm = _Bc2JpsiMuX, RequiredSelections = [ SelJpsi2MuMu, SelMuonBc ] )
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 makeEEdd(config): eedd = DiElectronMaker('EEDDForDarkBoson') eedd.Particle = "KS0" selector = trackSelector(eedd, trackTypes=["Downstream"]) eedd.addTool(ProtoParticleCALOFilter, name='Electron') eedd.Electron.Selection = ["RequiresDet='CALO' CombDLL(e-pi)>'%s'" \ % config['PID']['E']['PIDe_MIN']] eedd.DiElectronMassMax = 5000 eedd.DiElectronMassMin = 0 eedd.DiElectronPtMin = 250 eedd.ElectronPtMin = 100 eedd.ElectronPIDcut = config['PID']['E']['PIDe_MIN'] sel = Selection('EEDDDarkBosonSel', Algorithm=eedd) code = LoKiCuts(['HASVERTEX', 'BPVVDCHI2', 'VCHI2DOF'], config['V']).code() #print 'makeEEdd', code return Selection('FilterEEDDDarkBoson', Algorithm=FilterDesktop(Code=code), RequiredSelections=[sel])
def _filterTau(self, name, tauInput, config): """ Tau filter """ # _cut = "(PT>1000.*MeV) & (M>500.*MeV) & (M<2000.*MeV) & (BPVDIRA>0.99) & (VFASPF(VCHI2) < 16) & (BPVVDCHI2>16) & (BPVVDRHO>0.1*mm) & (BPVVDRHO<7.0*mm) & (BPVVDZ>5.0*mm)"#" & (AMAXDOCA('')<0.2*mm) & (ANUM(PT > 800*MeV)) _cut = " (BPVVDZ>5.0*mm) & (BPVDIRA>0.99)" _preambulo = [ "c1c2c3 = ('pi+') == ABSID", "ipsm = MINTREE( c1c2c3 , MIPCHI2DV(PRIMARY) )" ] _filter = FilterDesktop(Code=_cut, Preambulo=_preambulo) # _filter = FilterDesktop( Code = _cut) return Selection(name, Algorithm=_filter, RequiredSelections=[tauInput])
def __init__( self, name, config ): LineBuilder.__init__( self, name, config ) allLooseMuons = AutomaticData("Phys/StdAllLooseMuons/Particles") muonSel = Selection( "%sMuonSelection" % self.name(), RequiredSelections = [ allLooseMuons ], Algorithm = FilterDesktop( Code = "( PT > %(MinPT)f ) & ( MIPDV('') > %(MinIP)f )" % config ) ) testLine = StrippingLine( "%sHighPTHighIPMuonLine" % self.name(), selection = muonSel, L0DU = config['L0DU'], HLT1 = config['HLT1'], HLT2 = config['HLT2'], RequiredRawEvents = config['RawEvents'], ) self.registerLine(testLine)
def protons ( self ) : """ Get the proton selection """ sel = self._selection ( 'ProtonSelection') if sel : return sel _ProtonFilter = FilterDesktop ( Code = """ ( 'p+' == ABSID ) & ( %s ) """ % self.protonCuts() ) sel = Selection ( 'SelProtonsFor' + self.name() , Algorithm = _ProtonFilter , RequiredSelections = [ StdLooseProtons ] ) # return self._add_selection ( 'ProtonSelection' , sel )
def __init__(self, name, config) : self.name = name LineBuilder.__init__(self, name, config) _trkFilter = FilterDesktop(Code = "(TRGHOSTPROB < 0.6) & (PT>250.*MeV) & (TRCHI2DOF < 4) & (MIPCHI2DV(PRIMARY) > 16)") self.TrackList = Selection( 'TrackList' + self.name, Algorithm = _trkFilter, RequiredSelections = [StdLooseKaons]) self.TrackList1 = Selection( 'TrackList1' + self.name, Algorithm = _trkFilter, RequiredSelections = [StdNoPIDsPions]) self.DiTrackList = mkDiTrackList( name="TracksForPhi" + self.name, trkList=self.TrackList, MinPTCut = config['Q2BResMinPT'], MinPCut = config['Q2BResMinP'], MinMassCut = config['Q2BResPhiMinMass'], MaxMassCut = config['Q2BResPhiMaxMass'], VtxChi2DOFCut = config['Q2BResVtxChiDOF'] ) self.DiTrackList1 = mkDiTrackList1( name="TracksForf0" + self.name, trkList=self.TrackList1, MinPTCut = config['Q2BResMinPT'], MinPCut = config['Q2BResMinP'], MinMassCut = config['Q2BResf0MinMass'], MaxMassCut = config['Q2BResf0MaxMass'], VtxChi2DOFCut = config['Q2BResVtxChiDOF'] ) Bs2Phif0Name = self.name self.B2CharmlessPhif0 = mkBs2Phif0( Bs2Phif0Name, diTrkList=self.DiTrackList, diTrkList1=self.DiTrackList1, MinMassCut = config['Q2BBMinM'], MaxMassCut = config['Q2BBMaxM'], VtxChi2DOFCut = config['Q2BBVtxChi2DOF'], BIPchi2Cut = config['Q2BIPCHI2']) self.Bs2Phif0Line = StrippingLine( name+"Line", prescale = config['Q2BPrescale'], selection = self.B2CharmlessPhif0, EnableFlavourTagging = True ) self.registerLine(self.Bs2Phif0Line)
def __K10__(self,Kshort,Pions,conf): """ K_1 0 -> Ks pi+ pi- """ _k102kspipi = CombineParticles() _k102kspipi.DecayDescriptors = [ "K_1(1270)0 -> KS0 pi+ pi-" ] _k102kspipi.CombinationCut = self.__A1CombCut__(conf) _k102kspipi.MotherCut = self.__A1Cut__(conf) _sel_k10 = Selection( "Selection_"+self.name+"_k10", Algorithm=_k102kspipi, RequiredSelections=[Kshort,Pions] ) pick = Selection(self.name+"_K10_PickDecay", Algorithm = FilterDesktop( Code = "(DECTREE('K_1(1270)0 -> KS0 pi+ pi-'))" ), RequiredSelections = [_sel_k10]) return pick
def makeD0(name, KaonProbNN, pionProbNN, TrGhostProb): """ Create and return a D0->Kpi Selection object, starting from DataOnDemand 'Phys/StdLooseD02KPi'. @arg name: name of the Selection. @arg KaonProbNN: PID of Kaon @arg pionProbNN: PID of pion @arg TrGhostProb: Ghost probability of pion/kaon @return: Selection object """ _code = "(MAXTREE(ABSID=='K+',PROBNNk) > %(KaonProbNN)s) & (MAXTREE(ABSID=='pi+',PROBNNpi) > %(pionProbNN)s) & CHILDCUT( (TRGHOSTPROB<%(TrGhostProb)s) , 1 ) & CHILDCUT( (TRGHOSTPROB<%(TrGhostProb)s) , 2 )" % locals( ) _D0Filter = FilterDesktop(Code=_code) _stdD02Kpi = DataOnDemand(Location="Phys/StdLooseD02KPi/Particles") return Selection(name, Algorithm=_D0Filter, RequiredSelections=[_stdD02Kpi])
def filterJpsi2MuMuForD0mumu(name, MuonPT, MuonP, MuonTRCHI2DOF, MuonBPVIPCHI2, MuonMaxBPVIPCHI2, MuonMaxPT, MuMuMinMass, MuMuMaxMass, MuMuVCHI2PDOF, MuMuPT, MuMuBPVVDCHI2, MuMuBPVDIRA, MuMuBPVIPCHI2): _StdLooseJpsi2MuMu = DataOnDemand( Location='Phys/StdLooseJpsi2MuMu/Particles') MuonCut = "(MINTREE('mu+'==ABSID,PT) > %(MuonPT)s *MeV) & (MINTREE('mu+'==ABSID,P) > %(MuonP)s *MeV) & (MINTREE('mu+'==ABSID,P) > %(MuonP)s *MeV) & (MAXTREE('mu+'==ABSID,TRCHI2DOF) < %(MuonTRCHI2DOF)s) & (MINTREE('mu+'==ABSID,MIPCHI2DV(PRIMARY)) > %(MuonBPVIPCHI2)s *MeV) & (MAXTREE('mu+'==ABSID,MIPCHI2DV(PRIMARY)) > %(MuonMaxBPVIPCHI2)s *MeV) & (MAXTREE('mu+'==ABSID,PT)> %(MuonMaxPT)s *MeV) " % locals( ) MuonCut += " & (MM > %(MuMuMinMass)s) & (MM < %(MuMuMaxMass)s) & (VFASPF(VCHI2PDOF)< %(MuMuVCHI2PDOF)s) & (PT > %(MuMuPT)s) & (BPVDIRA> %(MuMuBPVDIRA)s) & (BPVVDCHI2> %(MuMuBPVVDCHI2)s) & (MIPCHI2DV(PRIMARY)< %(MuMuBPVIPCHI2)s)" % locals( ) _MuMu = FilterDesktop(Code=MuonCut) return Selection(name, Algorithm=_MuMu, RequiredSelections=[_StdLooseJpsi2MuMu])
def filterEE(which,econf,xconf,inputs): code = "(ID=='J/psi(1S)') & (PT > %s) & (MINTREE('e+'==ABSID,PIDe) > %s)" \ % (xconf['PT_MIN'],econf['PIDe_MIN']) code += " & (MINTREE('e+'==ABSID,MIPCHI2DV(PRIMARY)) > %s)" \ % econf['MIPCHI2DV_MIN'] code += " & (MINTREE('e+'==ABSID,PT) > %s)" % econf['PT_MIN'] code += " & (MAXTREE('e+'==ABSID,TRGHP) < %s)" % econf['TRGHP_MAX'] code = LoKiCuts.combine([code,LoKiCuts(['HASVERTEX','BPVVDCHI2','VCHI2DOF'], xconf).code()]) #print "filterEE: ", code sel = Selection(which+'FilterEEDarkBosonFilter', Algorithm=FilterDesktop(Code=code), RequiredSelections=inputs) sub = SubstitutePID(which+'EESubPIDDarkBoson', Code="DECTREE('J/psi(1S) -> e+ e-')") sub.MaxChi2PerDoF = -666 sub.Substitutions = {'J/psi(1S) -> e+ e-' : 'KS0'} return Selection(which+'EESubPIDDarkBosonSel',Algorithm=sub, RequiredSelections=[sel])
def makeKst2Kpi( self, name, config ) : # define all the cuts _trkChi2Cut1 = "(CHILDCUT((TRCHI2DOF<%s),1))" % config['Trk_Chi2'] _trkChi2Cut2 = "(CHILDCUT((TRCHI2DOF<%s),2))" % config['Trk_Chi2'] _trkGhostProbCut1 = "(CHILDCUT((TRGHOSTPROB<%s),1))" % config['Trk_GhostProb'] _trkGhostProbCut2 = "(CHILDCUT((TRGHOSTPROB<%s),2))" % config['Trk_GhostProb'] _allCuts = _trkChi2Cut1 _allCuts += '&'+_trkChi2Cut2 _allCuts += '&'+_trkGhostProbCut1 _allCuts += '&'+_trkGhostProbCut2 # make the filter _filterKst2Kpi = FilterDesktop( Code = _allCuts ) _stdKst2Kpi = DataOnDemand(Location="Phys/StdVeryLooseDetachedKst2Kpi/Particles") # make and store the Selection object self.selKst2Kpi = Selection( name, Algorithm = _filterKst2Kpi, RequiredSelections = [_stdKst2Kpi] )
def _filterDiLepton(self, name, dilepton, params, idcut=None): """ Handy interface for dilepton filter """ _Code = "(PT > %(DiLeptonPT)s *MeV) & "\ "(MM < %(UpperMass)s *MeV) & "\ "(MINTREE(ABSID<14,PT)>%(LeptonPT)s *MeV) & "\ "(MINTREE(ABSID<14,MIPCHI2DV(PRIMARY))>%(LeptonIPCHI2)s) & "\ "(VFASPF(VCHI2/VDOF)<9) & (BPVVDCHI2> %(DiLeptonFDCHI2)s) & "\ "(MIPCHI2DV(PRIMARY) > %(DiLeptonIPCHI2)s )" % params # add additional cut on PID if requested if idcut: _Code += (" & " + idcut) _Filter = FilterDesktop(Code=_Code) return Selection(name, Algorithm=_Filter, RequiredSelections=[dilepton])
def makeKstar(name, TrIPchi2Kst, TrChi2, KstMassWin, KstVCHI2) : """ Create and return a K*->Kpi Selection object, starting from DataOnDemand 'Phys/StdVeryLooseDetachedKst2Kpi'. @arg name: name of the Selection. @arg TrIPchi2Kst: tracks IP chi2 @arg TrChi2: tracks chi2 @arg KstMassWin: K* mass window @arg KstVCHI2: vertex chi2 of the K* @return: Selection object """ _preambulo = ["goodTrack = ((MIPCHI2DV(PRIMARY) > %(TrIPchi2Kst)s) & (TRCHI2DOF < %(TrChi2)s))" % locals(), "goodKstar = (((VFASPF(VCHI2/VDOF) < %(KstVCHI2)s)) & (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 __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 makePhi2KK(name, TrIPchi2Phi, TrChi2, PhiMassWin, PhiVCHI2) : """ Create and return a Phi->KK Selection object, starting from DataOnDemand 'Phys/StdLoosePhi2KK'. @arg name: name of the Selection. @arg TrIPchi2Phi: minimum IP chi2 of the K+ tracks @arg TrChi2: minimum chi2 of the K+ tracks @arg PhiMassWin: selected Phi mass window @arg PhiVCHI2: vertex chi2 of the Phi @return: Selection object """ _preambulo = ["goodKaon = ((MIPCHI2DV(PRIMARY) > %(TrIPchi2Phi)s) & (TRCHI2DOF < %(TrChi2)s))" % locals(), "goodPhi = (((VFASPF(VCHI2/VDOF) < %(PhiVCHI2)s)) & (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 filterJpsi2ee(name, ElectronPT, ElectronP, ElectronPIDe, ElectronTRCHI2DOF, eeMinMass, eeMaxMass, eeVCHI2PDOF, eePT): _StdLooseJpsi2ee = DataOnDemand(Location='Phys/StdLooseJpsi2ee/Particles') ElectronCut = "(MINTREE('e+'==ABSID,PT) > %(ElectronPT)s *MeV)"\ " & (MINTREE('e+'==ABSID,P) > %(ElectronP)s *MeV)"\ " & (MINTREE('e+'==ABSID,PIDe) > %(ElectronPIDe)s)"\ " & (MAXTREE('e+'==ABSID,TRCHI2DOF) < %(ElectronTRCHI2DOF)s)" % locals() eeCut = "(MM > %(eeMinMass)s) & (MM < %(eeMaxMass)s)"\ " & (VFASPF(VCHI2PDOF)< %(eeVCHI2PDOF)s)"\ " & (PT > %(eePT)s)" % locals() _ee = FilterDesktop(Code=ElectronCut + " & " + eeCut) return Selection(name + "_SelJpsi2ee", Algorithm=_ee, RequiredSelections=[_StdLooseJpsi2ee])
def applyBDT(name, LineName, SelBd2eeKstar, BDTCutValue, BDTWeightsFile): _FilterBd2eeKstar = FilterDesktop( Code="FILTER('Bd2eeKstarBDTSelection/Bd2eeKstarBDT')") BDTSel = Selection(name, Algorithm=_FilterBd2eeKstar, RequiredSelections=[SelBd2eeKstar]) """ Name is special here, since this is the last algorithm, whose name seems to be the one of the stripping line.... """ from Configurables import Bd2eeKstarBDTSelection MyBDT = Bd2eeKstarBDTSelection(LineName + '.Bd2eeKstarBDT') MyBDT.BDTCut = BDTCutValue MyBDT.WeightsFile = BDTWeightsFile return BDTSel
def _filterDiLepton(self, name, dilepton, params, idcut=None): """ Handy interface for dilepton filter """ # No Ghost probability cut here, as it is already implemented in the _makell functions _Code = "(ID=='J/psi(1S)') & "\ "(PT > %(DiLeptonPT)s *MeV) & "\ "(MM < %(UpperMass)s *MeV) & "\ "(MINTREE(ABSID<14,PT)>%(LeptonPT)s *MeV) & "\ "(MINTREE(ABSID<14,MIPCHI2DV(PRIMARY))>%(LeptonIPCHI2)s) & "\ "(VFASPF(VCHI2/VDOF)<9) & (BPVVDCHI2> %(DiLeptonFDCHI2)s) & "\ "(MIPCHI2DV(PRIMARY) > %(DiLeptonIPCHI2)s )" % params # add additional cut on PID if requested if idcut: _Code += (" & " + idcut) _Filter = FilterDesktop(Code=_Code) return Selection(name, Algorithm=_Filter, RequiredSelections=[dilepton])
def goodMuonsForBc(self): """ Get muons for tau """ if hasattr(self, 'GoodMuonsForBc_Selection'): return self.GoodMuonsForBc_Selection ## helper selection of 'tight' muons _MuonsForBc = FilterDesktop(Code=self.__confdict__['GoodMuonsForBc']) ## make selection self.GoodMuonsForBc_Selection = Selection( ## self.name + "GoodMuonsForBcMuons", ## Algorithm=_MuonsForBc, ## RequiredSelections=[self.threeGoodMuons()]) return self.GoodMuonsForBc_Selection
def kaonsTight(self): """ Tight kaons for B -> psi X lines """ sel = self._selection('TightKaon_Selection') if sel: return sel alg = FilterDesktop( ## Preambulo=self['Preambulo'], ## Code=self['TightK'], ## ) sel = Selection("SelTightKFor" + self.name(), Algorithm=alg, RequiredSelections=[self.kaons()]) return self._add_selection('TightKaon_Selection', sel)
def kaons(self): """ Kaons for B -> psi X lines """ sel = self._selection('Kaon_Selection') if sel: return sel alg = FilterDesktop( ## Preambulo=self['Preambulo'], ## Code=self['KaonCut'], ## ) sel = Selection("SelKFor" + self.name(), Algorithm=alg, RequiredSelections=[StdLooseKaons]) return self._add_selection('Kaon_Selection', sel)
def __A1__(self, Pions, conf): """ Make A1 objects: a_1 - > pi pi pi """ # First make an a_1(1260)+ selection _a12pipipi = CombineParticles() _a12pipipi.DecayDescriptors = [ "[a_1(1260)+ -> pi+ pi+ pi-]cc" ] _a12pipipi.CombinationCut = self.__A1CombCut__(conf) _a12pipipi.MotherCut = self.__A1Cut__(conf) _sel_a1 = Selection( "Selection_"+self.name+"_a1", Algorithm=_a12pipipi, RequiredSelections=[Pions] ) pick = Selection(self.name+"_A1_PickDecay", Algorithm = FilterDesktop( Code = "(DECTREE('a_1(1260)+ -> pi+ pi+ pi-')) | (DECTREE('a_1(1260)- -> pi+ pi- pi-'))" ), RequiredSelections = [_sel_a1]) return pick
def makePhoton(name, photonPT): """Create photon Selection object starting from DataOnDemand 'Phys/StdLooseAllPhotons'. @arg name: name of the Selection. @arg photonPT: PT of the photon @return: Selection object """ # Configure clusterization #from Configurables import CaloClusterizationTool, CellularAutomatonAlg #clust = CellularAutomatonAlg("EcalClust") #clust.addTool(CaloClusterizationTool,'CaloClusterizationTool') #clust.CaloClusterizationTool.ETcut = 300 #clust.CaloClusterizationTool.withET = True # Prepare selection _code = "(PT> %(photonPT)s*MeV)" % locals() _gammaFilter = FilterDesktop(Code=_code) _stdGamma = StdLooseAllPhotons return Selection(name, Algorithm=_gammaFilter, RequiredSelections=[_stdGamma])
def makeDz(name, MaxDzDeltaM, MinDzPt, MaxDzVertChi2DOF, MinDzPVVDChi2, MinDzIPChi2, MinDzDauPt, MinDzDauIPChi2, MaxDzDauTrkChi2, MinDzPIDK): _code = "(PT>%(MinDzPt)s*MeV)" % locals() _code += "& (VFASPF(VCHI2/VDOF)<%(MaxDzVertChi2DOF)s)" % locals() _code += "& (BPVVDCHI2>%(MinDzPVVDChi2)s)" % locals() _code += "& (MIPCHI2DV(PRIMARY)>%(MinDzIPChi2)s)" % locals() _code += "& CHILDCUT ( PT > %(MinDzDauPt)s , 1 )" % locals() _code += "& CHILDCUT ( PT > %(MinDzDauPt)s , 2 )" % locals() _code += "& CHILDCUT ( MIPCHI2DV ( PRIMARY ) > %(MinDzDauIPChi2)s , 1 )" % locals( ) _code += "& CHILDCUT ( MIPCHI2DV ( PRIMARY ) > %(MinDzDauIPChi2)s , 2 )" % locals( ) _code += "& CHILDCUT ( TRCHI2DOF < %(MaxDzDauTrkChi2)s , 1 )" % locals() _code += "& CHILDCUT ( TRCHI2DOF < %(MaxDzDauTrkChi2)s , 2 )" % locals() _code += "& (ADMASS('D0') < %(MaxDzDeltaM)s*MeV)" % locals() _code += "& CHILDCUT ( PIDK-PIDpi > %(MinDzPIDK)s , 1 )" % locals() _DzFilter = FilterDesktop(Code=_code) _stdDz = DataOnDemand(Location="Phys/StdLooseD02KPi/Particles") return Selection(name, Algorithm=_DzFilter, RequiredSelections=[_stdDz])