def makeTau2PhiMu(name): """ Please contact Giulio Dujany if you think of prescaling this line! Arguments: name : name of the Selection. """ #from Configurables import OfflineVertexFitter Tau2PhiMu = CombineParticles() Tau2PhiMu.DecayDescriptor = " [ tau+ -> phi(1020) mu+ ]cc" makePhi = CombineParticles() makePhi.DecayDescriptor = "phi(1020) -> K+ K-" makePhi.DaughtersCuts = { "K+": "(ISLONG) & (TRCHI2DOF < 3 ) & (TRGHOSTPROB<0.3) & (PT>300*MeV) & (PIDK > 0) & ( BPVIPCHI2 () > 9 )", "K-": "(ISLONG) & (TRCHI2DOF < 3 ) & (TRGHOSTPROB<0.3) & (PT>300*MeV) & (PIDK > 0) & ( BPVIPCHI2 () > 9 )" } _kaons = DataOnDemand(Location='Phys/StdLooseKaons/Particles') makePhi.CombinationCut = "(ADAMASS('phi(1020)')<30*MeV)" makePhi.MotherCut = " ( VFASPF(VCHI2) < 25 ) & (MIPCHI2DV(PRIMARY)> 9)" SelPhi = Selection(name + "SelPhi", Algorithm=makePhi, RequiredSelections=[_kaons]) Tau2PhiMu.DaughtersCuts = { "mu-": " ( PT > 300 * MeV ) & ( TRCHI2DOF < 3 ) & (TRGHOSTPROB<0.3) & ( BPVIPCHI2 () > 9 )" } Tau2PhiMu.CombinationCut = "(ADAMASS('tau-')<150*MeV)" Tau2PhiMu.MotherCut = "( VFASPF(VCHI2) < 25 ) & ( (BPVLTIME () * c_light) > 50 * micrometer ) & ( BPVIPCHI2() < 100 ) " _stdLooseMuons = DataOnDemand(Location="Phys/StdLooseMuons/Particles") SelTau = Selection(name + "makeTau", Algorithm=Tau2PhiMu, RequiredSelections=[SelPhi, _stdLooseMuons]) # Trigger selection from Configurables import TisTosParticleTagger _tisTosFilter = TisTosParticleTagger(name + "Triggered") _tisTosFilter.TisTosSpecs = { 'L0Global%TIS': 0, 'L0MuonDecision%TOS': 0, 'Hlt1TrackAllL0Decision%TOS': 0, 'Hlt1TrackMuonDecision%TOS': 0 } SelTau_triggered = Selection( name, Algorithm=_tisTosFilter, RequiredSelections=[SelTau], ) return SelTau_triggered
def makeTISTOS(name, _input, _hlttos): from Configurables import TisTosParticleTagger _tisTosFilter = TisTosParticleTagger(name + "Tagger") _tisTosFilter.TisTosSpecs = _hlttos return Selection(name, Algorithm=_tisTosFilter, RequiredSelections=[_input])
def TOSFilter(name, _input, _trigger): from Configurables import TisTosParticleTagger _tisTosFilter = TisTosParticleTagger(name + "Tagger") _tisTosFilter.TisTosSpecs = {_trigger: 0} return Selection(name, Algorithm=_tisTosFilter, RequiredSelections=[_input])
def TOSFilter(name, _input, _specs): from Configurables import TisTosParticleTagger from PhysSelPython.Wrappers import Selection _tisTosFilter = TisTosParticleTagger(name + "Tagger") _tisTosFilter.TisTosSpecs = _specs return Selection(name, Algorithm=_tisTosFilter, RequiredSelections=[_input])
def TOSFilter( name = None, sel = None, trigger = None ): if len(trigger) == 0: return sel from Configurables import TisTosParticleTagger _filter = TisTosParticleTagger(name+"_TriggerTos") _filter.TisTosSpecs = trigger _sel = Selection("Sel" + name + "_TriggerTos", RequiredSelections = [ sel ], Algorithm = _filter ) return _sel
def TOSFilter(self, name=None, sel=None, trigger=None): from Configurables import TisTosParticleTagger _filter = TisTosParticleTagger(name + "_TriggerTos") _filter.TisTosSpecs = {trigger + "%TOS": 0} from PhysSelPython.Wrappers import Selection _sel = Selection("Sel" + name + "_TriggerTos", RequiredSelections=sel, Algorithm=_filter) return _sel
def TOSFilter(name=None, sel=None): from Configurables import TisTosParticleTagger _filter = TisTosParticleTagger(name + "_TriggerTos") #_filter.TisTosSpecs = { "Hlt1Global%TOS" : 0, "Hlt2Global%TOS" : 0 } _filter.TisTosSpecs = {"Hlt1.*Decision%TOS": 0, "Hlt2.*Decision%TOS": 0} _filter.NoRegex = False _sel = Selection("Sel" + name + "_TriggerTos", RequiredSelections=[sel], Algorithm=_filter) return _sel
def makeTISTOS(name, _input, _trigger): from Configurables import TisTosParticleTagger _tisTosFilter = TisTosParticleTagger(name + "Tagger") _tisTosFilter.TisTosSpecs = {_trigger: 0} #_tisTosFilter.ProjectTracksToCalo = False #_tisTosFilter.CaloClustForCharged = False #_tisTosFilter.CaloClustForNeutral = False #_tisTosFilter.TOSFrac = { 4:0.0, 5:0.0 } return Selection(name, Algorithm=_tisTosFilter, RequiredSelections=[_input])
def makeTISTOSSelection(selection, Specs): from Configurables import TisTosParticleTagger myTagger = TisTosParticleTagger('myTagger') myTagger.TisTosSpecs = Specs # ### :::::: to speed things up: # myTagger.ProjectTracksToCalo = False # myTagger.CaloClustForCharged = False # myTagger.CaloClustForNeutral = False # myTagger.TOSFrac = {4:0.0, 5:0.0} return Selection(selection.name() + "TISTOS", Algorithm=myTagger, RequiredSelections=[selection])
def TOSFilter( name = None, sel = None ): """ Function to return a selection object, filtering for TOS candidates from input selection """ from Configurables import TisTosParticleTagger _filter = TisTosParticleTagger(name+"_TriggerTos") _filter.TisTosSpecs = { "Hlt1Global%TOS" : 0, "Hlt2Global%TOS" : 0 } _filter.NoRegex = True _sel = Selection("Sel" + name + "_TriggerTos", RequiredSelections = [ sel ], Algorithm = _filter ) return _sel
def makeTISTOS(name, _input, _trigger, _level): from Configurables import TisTosParticleTagger _tisTosFilter = TisTosParticleTagger(name + "Tagger") if 1 == _level: _tisTosFilter.TisTosSpecs = {_trigger + 'Decision%TOS': 0} else: _tisTosFilter.TisTosSpecs = { _trigger + 'Decision%TOS': 0, _trigger + 'WideMassDecision%TOS': 0 } return Selection(name, Algorithm=_tisTosFilter, RequiredSelections=[_input])
def TOSFilter( name = None, sel = None, trigger = None ): """ Function to return a selection object, filtering for TOS candidates from input selection """ from Configurables import TisTosParticleTagger _filter = TisTosParticleTagger(name+"_TriggerTos") _filter.TisTosSpecs = { trigger+"%TOS" : 0 } _filter.NoRegex = True from PhysSelPython.Wrappers import Selection _sel = Selection("Sel" + name + "_TriggerTos", RequiredSelections = sel, Algorithm = _filter ) return _sel
def makeD2KS0K(name, # KS0 selection KS0LLSel # Bach kaons selection ,BachKaonsSel # Cuts to be used # D meson cuts # Combo cuts ,DMesonComboLowMass ,DMesonComboHighMass ,DMesonComboDOCA ,DMesonAPT ,DMesonADOCAChi2 # Mother cuts ,DMesonMotherLowMass ,DMesonMotherHighMass ,DMesonMotherVertexChi2 ,DMesonMotherMIPChi2 ,DMesonMotherPT ,KS0ZDiff ,DMesonFlightDistChi2 ,UseTOS ,TisTosSpecs ) : """ Create and return a D(s) -> KS0 K Selection object. Arguments: name : name of the Selection. ks0llSel : KS0LL -> pi+pi- Selection object. All rest : Cuts used - self-explanatory naming """ # Define the combination, mother and daughter cuts # _combCuts = "(APT > %(DMesonAPT)s) & (ACUTDOCACHI2(%(DMesonADOCAChi2)s,'')) & in_range(%(DMesonComboLowMass)s, AM, %(DMesonComboHighMass)s)" % locals() _combCuts = "(APT > %(DMesonAPT)s) & (ACUTDOCACHI2(%(DMesonADOCAChi2)s,'')) & in_range(%(DMesonComboLowMass)s, AM, %(DMesonComboHighMass)s)" % locals() # &(AMAXDOCA('LoKi::DistanceCalculator') < %(DMesonComboDOCA)s * mm _motherCuts = "(PT > %(DMesonMotherPT)s*MeV) & (VFASPF(VCHI2/VDOF) < %(DMesonMotherVertexChi2)s) & in_range(%(DMesonMotherLowMass)s, MM, %(DMesonMotherHighMass)s) & ((CHILD( VFASPF(VZ) , 'KS0' == ID ) - VFASPF(VZ)) > %(KS0ZDiff)s) & (MIPCHI2DV(PRIMARY) < %(DMesonMotherMIPChi2)s) & (BPVVDCHI2 > %(DMesonFlightDistChi2)s)" % locals() # _motherCuts = "(PT > %(DMesonMotherPT)s*MeV) & (VFASPF(VCHI2/VDOF) < %(DMesonMotherVertexChi2)s) & in_range(%(DMesonMotherLowMass)s, MM, %(DMesonMotherHighMass)s) & (MIPCHI2DV(PRIMARY) < %(DMesonMotherMIPChi2)s) & (BPVVDCHI2 > %(DMesonFlightDistChi2)s) & ((CHILD( VFASPF(VZ) , 'KS0' == ID ) - VFASPF(VZ)) > %(KS0ZDiff)s)" % locals() # Define the combine particles _Dmeson = CombineParticles( DecayDescriptor = "[D+ -> KS0 K+]cc", CombinationCut = _combCuts, MotherCut = _motherCuts) sel = Selection ( name, Algorithm = _Dmeson, RequiredSelections = [KS0LLSel, BachKaonsSel]) if not UseTOS: return sel else: return Selection( name+"_TOS" , Algorithm = TisTosParticleTagger( name + "TOSTagger",TisTosSpecs = TisTosSpecs ) , RequiredSelections = [ sel ] )
def select(self): """ Get data and selection """ from PhysSelPython.Wrappers import Selection, SelectionSequence, DataOnDemand, AutomaticData # from StandardParticles import StdLooseMuons, StdLooseKaons from Configurables import FilterDesktop, CombineParticles, OfflineVertexFitter, LoKi__HDRFilter from GaudiKernel.PhysicalConstants import c_light evtPreselectors = [] if dataSample.isPrescaled != False: if dataSample.isPrescaled == True: dataSample.isPrescaled = 0.1 prescaler = DeterministicPrescaler("Prescaler", AcceptFraction = dataSample.isPrescaled) evtPreselectors.append(prescaler) # # Stripping filter strippingFilter = LoKi__HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+self.lineName+"Decision')", Location="/Event/Strip/Phys/DecReports" ) evtPreselectors.append(strippingFilter) stripped_data = AutomaticData(Location = self.lineLocation) # Trigger selection from Configurables import TisTosParticleTagger _tisTosFilter = TisTosParticleTagger( self.name + "Triggered" ) _tisTosFilter.TisTosSpecs = { 'L0Global%TUS' : 0, 'L0Global%TIS' : 0, } for trigger in trigger_list: for tistos in ['TIS', 'TUS']: _tisTosFilter.TisTosSpecs['{0}%{1}'.format(trigger, tistos)] = 0 triggered_data = Selection( self.name+'TriggerSelection', Algorithm = _tisTosFilter, RequiredSelections = [ stripped_data ], ) Candidate_selection = stripped_data #triggered_data self.sequence = SelectionSequence('Seq'+self.name, TopSelection = Candidate_selection, EventPreSelector = evtPreselectors)
def makeTISTOSFilter(name): specs = {'Hlt2Topo(2|3|4)Body.*Decision%TOS':0, 'Hlt2Topo(2|3|4)Body.*Decision%TIS':0, 'Hlt2IncPhi.*Decision%TOS':0, 'Hlt2IncPhi.*Decision%TIS':0, 'Hlt2RadiativeTopo.*Decision%TOS':0, ## Cut based raditive topological 'Hlt2RadiativeTopo.*Decision%TIS':0, ## Cut based raditive topological 'Hlt2TopoRad.*Decision%TOS':0, ## BBDT based radiative topological 'Hlt2TopoRad.*Decision%TIS':0} ## BBDT based radiative topological from Configurables import TisTosParticleTagger tisTosFilter = TisTosParticleTagger(name+'TISTOSFilter') tisTosFilter.TisTosSpecs = specs #tisTosFilter.ProjectTracksToCalo = False #tisTosFilter.CaloClustForCharged = False #tisTosFilter.CaloClustForNeutral = False #tisTosFilter.TOSFrac = {4:0.0, 5:0.0} return tisTosFilter
def _makeTISTOSFilter(self, name, specs): from Configurables import TisTosParticleTagger tisTosFilter = TisTosParticleTagger(name + 'TISTOSFilter') tisTosFilter.TisTosSpecs = specs tisTosFilter.ProjectTracksToCalo = False tisTosFilter.CaloClustForCharged = False tisTosFilter.CaloClustForNeutral = False tisTosFilter.TOSFrac = {4: 0.0, 5: 0.0} return tisTosFilter
def makeTisTos(name, selection, hltTisTosSpec={}): outSel = selection if len(hltTisTosSpec) > 0: _tisTosFilter = TisTosParticleTagger(name + 'TisTos', TisTosSpecs=hltTisTosSpec) outSel = Selection(name, Algorithm=_tisTosFilter, RequiredSelections=[selection]) return outSel
def makeTOSFilter(name): specs = {'Hlt2CharmHadMinBiasD02KPiDecision%TOS': 0} from Configurables import TisTosParticleTagger tisTosFilter = TisTosParticleTagger(name + 'TOSFilter') tisTosFilter.TisTosSpecs = specs tisTosFilter.ProjectTracksToCalo = False tisTosFilter.CaloClustForCharged = False tisTosFilter.CaloClustForNeutral = False tisTosFilter.TOSFrac = {4: 0.0, 5: 0.0} return tisTosFilter
def oneTosMonitor(name="None", input=None, calo=False): from PhysSelPython.Wrappers import Selection, SelectionSequence from Configurables import TisTosParticleTagger, ParticleMonitor, PrintDecayTree Tosser = TisTosParticleTagger(name + "Tosser") Tosser.TisTosSpecs = {name + "Decision%TOS": 0} Tosser.ProjectTracksToCalo = calo Tosser.CaloClustForCharged = calo s1 = Selection("TOSPresel" + name, Algorithm=Tosser, RequiredSelections=[input]) tools = ["MomentumPlotTool"] if ('Muon' in name): tools += ["MuonPlotTool"] plotter = ParticleMonitor(name + "TosMoni", PlotTools=tools) # Make things a bit faster if ('L0Hadron' in name): plotter.MotherCut = "PT>1*GeV" else: plotter.MotherCut = "PT>0.5*GeV" s2 = Selection("TOSSel" + name, Algorithm=plotter, RequiredSelections=[s1]) ss = SelectionSequence("TOSSeq" + name, TopSelection=s2) return ss.sequence()
def makeTISTOSFilter(name): specs = {'Hlt2Topo.*Decision%TOS':0, 'Hlt2Topo.*Decision%TIS':0, 'Hlt2IncPhi.*Decision%TOS':0,'Hlt2IncPhi.*Decision%TIS':0} from Configurables import TisTosParticleTagger tisTosFilter = TisTosParticleTagger(name+'TISTOSFilter') tisTosFilter.TisTosSpecs = specs tisTosFilter.ProjectTracksToCalo = False tisTosFilter.CaloClustForCharged = False tisTosFilter.CaloClustForNeutral = False tisTosFilter.TOSFrac = {4:0.0, 5:0.0} return tisTosFilter
def makeTISTOSSel(name, sel, trigger): from Configurables import TisTosParticleTagger tisTosFilter = TisTosParticleTagger(name + "Filter") tisTosFilter.TisTosSpecs = {trigger: 0} # the rest ist only to speed it up... (TISTOSsing only done with tracking system) tisTosFilter.ProjectTracksToCalo = False tisTosFilter.CaloClustForCharged = False tisTosFilter.CaloClustForNeutral = False tisTosFilter.TOSFrac = {4: 0.0, 5: 0.0} return Selection(name, Algorithm=tisTosFilter, RequiredSelections=[sel])
def filterHLT2ForBJpsiK(name, BJpsiKSel, triggers): """ Filter B->J/psi K to be triggered on mu+track for the long track muon and Kaon """ Hlt2BJpsiK = TisTosParticleTagger(name + "_Hlt2BJpsiK") #Hlt2BJpsiK.TisTosSpecs = { "Hlt2MuTrackDecision%TOS" : 0} Hlt2BJpsiK.TisTosSpecs = triggers Hlt2BJpsiK.ProjectTracksToCalo = False Hlt2BJpsiK.CaloClustForCharged = False Hlt2BJpsiK.CaloClustForNeutral = False Hlt2BJpsiK.TOSFrac = {4: 0.0, 5: 0.0} Hlt2BJpsiK.NoRegex = True #Hlt2BJpsiK.PassOnAll = True return Selection(name, Algorithm=Hlt2BJpsiK, RequiredSelections=[BJpsiKSel])
def makeTISTOS(name, sel, trigger): from Configurables import TisTosParticleTagger tisTosFilter = TisTosParticleTagger(name + "_Tagger") tisTosFilter.TisTosSpecs = {trigger: 0} tisTosFilter.ProjectTracksToCalo = False tisTosFilter.CaloClustForCharged = False tisTosFilter.CaloClustForNeutral = False #tisTosFilter.TOSFrac = { 4:0.0, 5:0.0 } return Selection(name, Algorithm=tisTosFilter, RequiredSelections=[sel])
def selHlt1Upsilon(name, longPartsFilter, triggers): """ Filter the long track muon to be TOS on a HLT1 single muon trigger, for Upsilon selection """ Hlt1Upsilon = TisTosParticleTagger(name + "Hlt1Upsilon") #Hlt1Upsilon.TisTosSpecs = { "Hlt1TrackMuonDecision%TOS" : 0, "Hlt1SingleMuonNoIPDecision%TOS" : 0, "Hlt1SingleMuonHighPTDecision%TOS" : 0} Hlt1Upsilon.TisTosSpecs = triggers Hlt1Upsilon.ProjectTracksToCalo = False Hlt1Upsilon.CaloClustForCharged = False Hlt1Upsilon.CaloClustForNeutral = False Hlt1Upsilon.TOSFrac = {4: 0.0, 5: 0.0} Hlt1Upsilon.NoRegex = True #Hlt1Upsilon.PassOnAll = True # TESTING! # return Selection(name + "_SelHlt1Upsilon", Algorithm=Hlt1Upsilon, RequiredSelections=[longPartsFilter])
def selHlt2Z(name, hlt1Filter, triggers): """ Filter the long track muon to be TOS on a HLT2 single muon trigger, for Z selection """ Hlt2Z = TisTosParticleTagger(name + "Hlt2Z") #Hlt2Z.TisTosSpecs = { "Hlt2SingleMuonHighPTDecision%TOS" : 0} Hlt2Z.TisTosSpecs = triggers Hlt2Z.ProjectTracksToCalo = False Hlt2Z.CaloClustForCharged = False Hlt2Z.CaloClustForNeutral = False Hlt2Z.TOSFrac = {4: 0.0, 5: 0.0} Hlt2Z.NoRegex = True #Hlt2Z.PassOnAll = True # TESTING! # return Selection(name + "_SelHlt2Z", Algorithm=Hlt2Z, RequiredSelections=[hlt1Filter])
def selHlt2BJpsiKMu(name, hlt1Filter, triggers): """ Filter the long track muon to be TUS on a HLT2 mu+track trigger, for B->J/psi K selection (mainly a speed up) """ Hlt2BJpsiKMu = TisTosParticleTagger(name + "Hlt2BJpsiKMu") #Hlt2BJpsiKMu.TisTosSpecs = { "Hlt2MuTrackDecision%TUS" : 0} # TUS, not TOS, not a typo!!! Hlt2BJpsiKMu.TisTosSpecs = triggers Hlt2BJpsiKMu.ProjectTracksToCalo = False Hlt2BJpsiKMu.CaloClustForCharged = False Hlt2BJpsiKMu.CaloClustForNeutral = False Hlt2BJpsiKMu.TOSFrac = {4: 0.0, 5: 0.0} Hlt2BJpsiKMu.NoRegex = True #Hlt2BJpsiKMu.PassOnAll = True # TESTING! # return Selection(name + "_SelHlt2BJpsiKMu", Algorithm=Hlt2BJpsiKMu, RequiredSelections=[hlt1Filter])
def filterTisTos(self, name, DiMuonInput, myTisTosSpecs): from Configurables import TisTosParticleTagger myTagger = TisTosParticleTagger(name + "_TisTosTagger") myTagger.TisTosSpecs = myTisTosSpecs # To speed it up, TisTos only with tracking system myTagger.ProjectTracksToCalo = False myTagger.CaloClustForCharged = False myTagger.CaloClustForNeutral = False myTagger.TOSFrac = {4: 0.0, 5: 0.0} return Selection(name + "_SelTisTos", Algorithm=myTagger, RequiredSelections=[DiMuonInput])
def selHlt2BJpsiKK( name, longPartsFilter, triggers ): # No HLT1 needed, as event in HLT1 already triggered with single muon """ Filter the long track Kaon to be TUS on a HLT2 mu+track trigger, for B->J/psi K selection (mainly a speed up) """ Hlt2BJpsiKK = TisTosParticleTagger(name + "Hlt2BJpsiKK") #Hlt2BJpsiKK.TisTosSpecs = { "Hlt2MuTrackDecision%TUS" : 0} # TUS, not TOS, not a typo!!! Hlt2BJpsiKK.TisTosSpecs = triggers Hlt2BJpsiKK.ProjectTracksToCalo = False Hlt2BJpsiKK.CaloClustForCharged = False Hlt2BJpsiKK.CaloClustForNeutral = False Hlt2BJpsiKK.TOSFrac = {4: 0.0, 5: 0.0} Hlt2BJpsiKK.NoRegex = True #Hlt2BJpsiKK.PassOnAll = True # TESTING! # return Selection(name + "_SelHlt2BJpsiKK", Algorithm=Hlt2BJpsiKK, RequiredSelections=[longPartsFilter])
# triggered regardless of the muon. sel_stripped_Mu_filtered_evt = Selection( 'SelMyStrippedMuFilteredEvent', Algorithm=FilterDesktop( 'MyStrippedFiltered', Code="INTREE((ABSID == 'mu+') & (TIS('L0.*', 'L0TriggerTisTos')))" ), RequiredSelections=[pr_stripped] ) # We build our own Muons, instead of using stripping line Muons for MC. # See https://github.com/umd-lhcb/lhcb-ntuples-gen/issues/25 for an explanation. sel_unstripped_tis_filtered_Mu = Selection( 'SelMyUnstrippedFilteredMu', Algorithm=TisTosParticleTagger( 'MyMuTisTagger', Inputs=['Phys/StdAllNoPIDsMuons/Particles'], TisTosSpecs={'L0Global%TIS': 0}), RequiredSelections=[pr_all_nopid_Mu] ) # NOTE: 'stripped' selections require the existence of a stripping line, which # only exists in data, and flagged MC, NOT filtered MC. # # This is because typically MC is either flagged or filtered, but not # both. # NOTE: We decide to do Muon TIS-filtering for run 1 as well for consistency. sel_stripped_charged_K = Selection( 'SelMyStrippedChargedK', Algorithm=FilterInTrees('MyChargedK', Code="(ABSID == 'K+')"), RequiredSelections=[sel_stripped_Mu_filtered_evt] )
def makeTISTOSFilter(name, dict_TISTOS): specs = dict_TISTOS from Configurables import TisTosParticleTagger tisTosFilter = TisTosParticleTagger(name + 'TISTOSFilter') tisTosFilter.TisTosSpecs = specs return tisTosFilter
def makeD2KS0PiDD( name, # KS0 selection KS0DDSel # Bach pions selection , BachPionsSel # Cuts to be used # D meson cuts # Combo cuts , DMesonComboLowMass, DMesonComboHighMass, DMesonComboDOCA, DMesonAPT, DMesonADOCAChi2 # Mother cuts , DMesonMotherLowMass, DMesonMotherHighMass, DMesonMotherVertexChi2, DMesonMotherMIPChi2, DMesonMotherPT, KS0ZDiff, DMesonFlightDistChi2, D_BPVLTIME_MIN, UseTOS, TisTosSpecs): """ Create and return a D -> KS0 Pi Selection object. Arguments: name : name of the Selection. ks0llSel : KS0DD -> pi+pi- Selection object. All rest : Cuts used - self-explanatory naming """ # Define the combination and mother cuts # _combCuts = "(APT > %(DMesonAPT)s) & (ACUTDOCACHI2(%(DMesonADOCAChi2)s,'')) & in_range(%(DMesonComboLowMass)s, AM, %(DMesonComboHighMass)s)" % locals() _combCuts = "(APT > %(DMesonAPT)s) & (ACUTDOCACHI2(%(DMesonADOCAChi2)s,'')) & in_range(%(DMesonComboLowMass)s, AM, %(DMesonComboHighMass)s)" % locals( ) _motherCuts = ("(PT > %(DMesonMotherPT)s) & (VFASPF(VCHI2PDOF) < %(DMesonMotherVertexChi2)s) &"\ " in_range(%(DMesonMotherLowMass)s, MM, %(DMesonMotherHighMass)s) &"\ " ((CHILD( VFASPF(VZ) , 'KS0' == ID ) - VFASPF(VZ)) > %(KS0ZDiff)s) &"\ " (MIPCHI2DV(PRIMARY) < %(DMesonMotherMIPChi2)s) &"\ " (BPVLTIME() > %(D_BPVLTIME_MIN)s) & (BPVVDCHI2 > %(DMesonFlightDistChi2)s)") % locals() # Define the combine particles _Dmeson = CombineParticles(DecayDescriptor="[D+ -> KS0 pi+]cc", CombinationCut=_combCuts, MotherCut=_motherCuts) sel = Selection(name, Algorithm=_Dmeson, RequiredSelections=[KS0DDSel, BachPionsSel]) if not UseTOS: return sel else: return Selection(name + "_TOS", Algorithm=TisTosParticleTagger( name + "TOSTagger", TisTosSpecs=TisTosSpecs), RequiredSelections=[sel])