def filterTisTos(self, name,
                  PhiInput,
                  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 = [ PhiInput ] )
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 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 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])
Esempio n. 5
0
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])
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
Esempio n. 7
0
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()
Esempio n. 8
0
def makeTISTOSFilter(name, dict_TISTOS):
    specs = dict_TISTOS
    from Configurables import TisTosParticleTagger
    tisTosFilter = TisTosParticleTagger(name + 'TISTOSFilter')
    tisTosFilter.TisTosSpecs = specs
    return tisTosFilter
Esempio n. 9
0
# 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]
)
Esempio n. 10
0
def makeD2KS0KDD(
        name,
        # KS0 selection
        KS0DDSel
    # 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,
        D_BPVLTIME_MIN,
        UseTOS,
        TisTosSpecs):
    """
        Create and return a D(s) -> KS0 K Selection object.
        Arguments:
        name             : name of the Selection.
        ks0llSel         : KS0DD -> 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(
    )


    _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 K+]cc",
                               CombinationCut=_combCuts,
                               MotherCut=_motherCuts)

    sel = Selection(name,
                    Algorithm=_Dmeson,
                    RequiredSelections=[KS0DDSel, BachKaonsSel])

    if not UseTOS:
        return sel
    else:
        return Selection(name + "_TOS",
                         Algorithm=TisTosParticleTagger(
                             name + "TOSTagger", TisTosSpecs=TisTosSpecs),
                         RequiredSelections=[sel])