示例#1
0
def test_EventSelection():
    alg = MockConfGenerator()
    evtSel = EventSelection('DummyEvtSel', Algorithm=alg)
    newSel = dummy('NewEvtSel', evtSel)
    assert newSel.selection().name() == 'DummyEvtSel'
    assert newSel.outputLocation() == ''
    assert len(newSel.members()) == 1
示例#2
0
 def _2topo( self, name): 
     from Configurables import DoubleTopoTool as DT
     code = "ACCEPT('DoubleTopoTool/"+name+"_DoubleTopoLine_DT')"
     alg = LoKi__VoidFilter(name+'_DoubleTopoLineFilter',Code=code)
     sel = EventSelection(name+'_DoubleTopoEventSel',Algorithm=alg)
     dt = DT(name+'_DoubleTopoLine_DT')
     dt.minAngle = self.__confdict__["my2TOPO"]["ANGLE_MIN"]
     dt.minMass = self.__confdict__["my2TOPO"]["M_MIN"]
     dt.minDPhi = self.__confdict__["my2TOPO"]["DPHI_MIN"]
     return sel
def filterDZ(name, DZAnyPV, MySelection):

    return EventSelection(
        #
        LoKi__VoidFilter(
            name + 'filterDZ',
            Code=" ( minMyZ - minPVZ ) < %(DZAnyPV)s*mm " % locals(),
            Preambulo=[
                "from LoKiPhys.decorators import *",
                "minMyZ = SOURCE('%s') >> min_value( VFASPF(VZ) )" %
                (MySelection.outputLocation()),
                "minPVZ = VSOURCE('Rec/Vertex/Primary') >> min_value(VZ) "
            ]))
示例#4
0
    def __init__(self, moduleName, config):

        LineBuilder.__init__(self, moduleName, config)

        # pre-filter inputs
        uppions = filterInputs('PiUP', [StdNoPIDsUpPions], config['UPSTREAM'])
        pions = filterInputs('Pi', [StdAllNoPIDsPions], config['ALL'])
        kaons = filterInputs('K', [StdAllNoPIDsKaons], config['ALL'])
        protons = filterInputs('P', [StdAllNoPIDsProtons], config['ALL'])
        ks_dd = filterInputs('KS0_DD', [dataOnDemand("StdLooseKsDD")],
                             config['KS0'])
        ks_ll = filterInputs('KS0_LL', [dataOnDemand("StdLooseKsLL")],
                             config['KS0'])
        ks = {"DD": [ks_dd], "LL": [ks_ll]}
        lambda0_dd = filterInputs('Lambda0_DD',
                                  [dataOnDemand("StdLooseLambdaDD")],
                                  config['Lambda0'])
        lambda0_ll = filterInputs('Lambda0_LL',
                                  [dataOnDemand("StdLooseLambdaLL")],
                                  config['Lambda0'])
        lambda0 = {"DD": [lambda0_dd], "LL": [lambda0_ll]}
        pi0_merged = filterPi0s('Merged', [StdLooseMergedPi0], config['Pi0'])
        pi0_resolved = filterPi0s('Resolved', [StdLooseResolvedPi0],
                                  config['Pi0'])
        pi0 = {"Merged": [pi0_merged], "Resolved": [pi0_resolved]}
        pcut = 'P > %s' % config['Pi0']['FROM_B_P_MIN']
        pi0_fromB_merged = filterSelection('Pi0FromBMerged', pcut,
                                           [pi0_merged])
        pi0_fromB_resolved = filterSelection('Pi0FromBResolved', pcut,
                                             [pi0_resolved])
        pi0_fromB = {
            'Merged': [pi0_fromB_merged],
            'Resolved': [pi0_fromB_resolved]
        }
        muons = filterInputs('MU', [StdLooseMuons],
                             config['ALL'])  # make muons (for D -> phi mu nu)

        # pre-filter hard inputs (these could have been used in HLT2)
        topoPions = topoInputs('Pi', [pions])
        topoKaons = topoInputs('K', [kaons])
        topoProtons = topoInputs('P', [protons])

        # make D->X, etc. inputs
        d = DBuilder(pions, kaons, ks, pi0, uppions, muons, config['D2X'],
                     config['PID'])
        dst = DstarBuilder(d, pions, pi0, config['Dstar'], config['PID'])

        # X -> hh
        hh = HHBuilder(pions, kaons, protons, ks, pi0_fromB, config['HH'],
                       config['PID'])

        # X -> hhh
        hhh = HHHBuilder(pions, kaons, protons, config['HHH'], config['PID'])

        # Lc -> X
        lc = LcBuilder(pions, kaons, protons, config['D2X'], config['PID'])
        xicc = XiccBuilder(lc, pions, config['D2X'])

        # make B->DX
        b2dx = B2DXBuilder(d, dst, topoPions, topoKaons, ks, pi0_fromB, hh,
                           hhh, config['B2X'])
        self._makeLines(b2dx.lines, config)

        # Lb -> X
        lb2x = Lb2XBuilder(lc, xicc, d, hh, topoPions, topoKaons, topoProtons,
                           pions, kaons, hhh, dst, lambda0, config['B2X'])
        self._makeLines(lb2x.lines, config)

        # Unbiased lines
        ltub = LTUnbiasedBuilder(d, config['B2X'])
        self._makeLines(ltub.lines, config)

        # UP D* lines
        for line in b2dx.lines:
            for sel in line.selections:
                if sel.name().find('WS') > 0: continue
                dstar_sel = makeB2DstarX(sel, uppions, config['B2X'])
                self._makeLine(ProtoLine([dstar_sel], line.pre), config)

        # Double Topo line
        from Configurables import DoubleTopoTool as DT
        code = "ACCEPT('DoubleTopoTool/DoubleTopoLine_DT')"
        alg = LoKi__VoidFilter('DoubleTopoLineFilter', Code=code)
        sel = EventSelection('DoubleTopoEventSel', Algorithm=alg)
        dt = DT('DoubleTopoLine_DT')
        dt.minAngle = config['2TOPO']['ANGLE_MIN']
        dt.minMass = config['2TOPO']['M_MIN']
        dt.minDPhi = config['2TOPO']['DPHI_MIN']
        hlt = "HLT_PASS_RE('Hlt2Topo.*Decision')"
        sline = StrippingLine('DoubleTopoLine', 1.0, selection=sel, HLT=hlt)
        self.registerLine(sline)

        # pseudo double topo line
        sline = StrippingLine('PseudoDoubleTopoLine',
                              1.0,
                              selection=makeDoubleTopo(topoKaons,
                                                       config['BB']),
                              HLT=hlt)
        self.registerLine(sline)

        # B->D0X inclusive line
        cuts = "(PT > %d*MeV) & (ADMASS('D0') < 25*MeV) & (MIPCHI2DV(PRIMARY)>%d)" \
               % (config['D0INC']['PT_MIN'],config['D0INC']['IPCHI2_MIN'])
        sel = filterSelection('D02KPIPIDMTIGHT', cuts, d.kpi_pid_tight)
        sel = tosSelection(sel, {'Hlt2Topo2BodyBBDTDecision%TOS': 0})
        hlt = "HLT_PASS_RE('Hlt2Topo2BodyBBDTDecision')"
        sline = StrippingLine('D02HHTopoTOSLine', 1.0, selection=sel, HLT=hlt)
        self.registerLine(sline)
示例#5
0
    def __init__( self, name, config ):
        LineBuilder.__init__( self, name, config )

        #######################################################################
        ###                                                                 ###
        ###     VELO BASED VERTEXING SEQUENCE                               ###
        ###                                                                 ###
        #######################################################################

        bestTracks = AutomaticData("Rec/Track/Best")

        withVeloTracksForVertexing = bestTracks
        if self.configurationParameter("FilterVelo")["Apply"]:
            from GaudiConfUtils.ConfigurableGenerators import SelectVeloTracksNotFromPV

            veloWithIP = SelectVeloTracksNotFromPV()
            self.validatedSetProps( "FilterVelo", DisplVerticesLinesConf.veloWithIPCuts, veloWithIP )

            withVeloTracksForVertexing = Selection( "%sVeloFilteredTracks" % self.name()
                                           , RequiredSelections = [ bestTracks ]
                                           , Algorithm = veloWithIP
                                           )

        # Displaced Vertex reconstruction with best tracks (dominated by those with a Velo segment)
        from Configurables import PatPV3D, PVOfflineTool, PVSeed3DTool, LSAdaptPV3DFitter, LSAdaptPVFitter

        withVeloVertexFinder = PVOfflineTool( "%sWithVeloVertexFinder" % self.name()
                                 , PVsChi2Separation = 0
                                 , PVsChi2SeparationLowMult = 0
                                 , PVSeedingName   = "PVSeed3DTool"
                                 , PVFitterName    = "LSAdaptPV3DFitter"
                                 )
        withVeloVertexFinder.addTool(PVSeed3DTool)
        withVeloVertexFinder.PVSeed3DTool.MinCloseTracks       = 3

        withVeloVertexFinder.addTool(LSAdaptPV3DFitter)
        withVeloVertexFinder.LSAdaptPV3DFitter.maxIP2PV        = 2.0*units.mm
        withVeloVertexFinder.LSAdaptPV3DFitter.MinTracks       = 4

        withVeloVertexAlg = PatPV3D( "%sWithVeloVertexAlg" )
        withVeloVertexAlg.addTool( withVeloVertexFinder, name="PVOfflineTool" )

        withVeloVertexing = SelectionPatPV3DWrapper( "%sWithVeloVertexing" % self.name()
                              , withVeloVertexAlg
                              , RequiredSelections = [ withVeloTracksForVertexing ]
                              )

        # Make Particles out of the RecVertices
        from GaudiConfUtils.ConfigurableGenerators import LLParticlesFromRecVertices

        rv2pWithVelo = LLParticlesFromRecVertices(
                           VerticesFromVeloOnly = False
                         , WriteP2PVRelations   = False
                         , ForceP2PVBuild       = False
                         , VeloProtoParticlesLocation = "Phys/%s/VeloProtoP" % self.name()
                         )
        self.validatedSetProps( "RV2PWithVelo", DisplVerticesLinesConf.recoCuts + DisplVerticesLinesConf.singleCuts, rv2pWithVelo )

        withVeloCandidates = Selection( "%sWithVeloCandidates" % self.name()
                               , RequiredSelections = [ withVeloVertexing ]
                               , Algorithm          = rv2pWithVelo
                               , InputDataSetter    = "RecVertexLocations"
                               )

        #######################################################################
        ###                                                                 ###
        ###     DOWNSTREAM VERTEXING SEQUENCE                               ###
        ###                                                                 ###
        #######################################################################

        from GaudiConfUtils.ConfigurableGenerators import CopyDownstreamTracks

        downTracks = Selection( "%sDownstreamTracks" % self.name()
                       , RequiredSelections = [ bestTracks ]
                       , Algorithm          = CopyDownstreamTracks()
                       )

        # Displaced Vertex reconstruction from downstream tracks
        downVertexFinder = PVOfflineTool( "%sDownVertexFinder" % self.name()
                                        , RequireVelo     = False
                                        , PVsChi2Separation = 0
                                        , PVsChi2SeparationLowMult = 0
                                        , PVSeedingName   = "PVSeed3DTool"
                                        , PVFitterName    = "LSAdaptPVFitter"
                                        )
        downVertexFinder.addTool(PVSeed3DTool)
        downVertexFinder.PVSeed3DTool.TrackPairMaxDistance = 2.0*units.mm
        downVertexFinder.PVSeed3DTool.zMaxSpread           = 20.0*units.mm
        downVertexFinder.PVSeed3DTool.MinCloseTracks       = 4
        downVertexFinder.addTool(LSAdaptPVFitter)
        downVertexFinder.LSAdaptPVFitter.MinTracks          = 4
        downVertexFinder.LSAdaptPVFitter.maxChi2            = 400.0
        downVertexFinder.LSAdaptPVFitter.maxDeltaZ          = 0.0005 *units.mm
        downVertexFinder.LSAdaptPVFitter.maxDeltaChi2NDoF   = 0.002
        downVertexFinder.LSAdaptPVFitter.acceptTrack        = 0.000000001
        downVertexFinder.LSAdaptPVFitter.trackMaxChi2       = 9
        downVertexFinder.LSAdaptPVFitter.trackMaxChi2Remove = 64

        downVertexAlg = PatPV3D( "%sDownVertexAlg" % self.name() )
        downVertexAlg.addTool(downVertexFinder, name="PVOfflineTool")

        downVertexing = SelectionPatPV3DWrapper( "%sDownVertexing" % self.name()
                          , downVertexAlg
                          , RequiredSelections = [ downTracks ]
                          )

        # Make Particles out of the RecVertices
        rv2pDown = LLParticlesFromRecVertices(
                       VerticesFromVeloOnly = False
                     , WriteP2PVRelations   = False
                     , ForceP2PVBuild       = False
                     #, OutputLevel          = VERBOSE
                     )
        self.validatedSetProps( "RV2PDown", DisplVerticesLinesConf.recoCuts + DisplVerticesLinesConf.singleCuts, rv2pDown )

        downCandidates = Selection( "%sDownCandidates" % self.name()
                           , RequiredSelections = [ downVertexing ]
                           , Algorithm          = rv2pDown
                           , InputDataSetter    = "RecVertexLocations"
                           )

        #######################################################################
        ###                                                                 ###
        ###     LINE DEFINITIONS                                            ###
        ###                                                                 ###
        #######################################################################

        ##============================== Single ===================================##

        singleLineNames = [ p.split("Single")[1].split("Selection")[0]
                                for p in self.configKeys()
                                    if p.startswith("Single")
                                    and p.endswith("Selection")
                          ]

        for lAcroName in singleLineNames:
            lShortName = "Single%s" % lAcroName             # SingleMedium
            lSelName   = "%sSelection" % lShortName         # SingleMediumSelection
            lLineName  = "%s%s" % (self.name(), lShortName) # DisplVerticesSingleMedium

            # Choose between Velo-based and downstream vertexing input
            candidates = withVeloCandidates
            code = None
            if "Down" in lAcroName:
                candidates = downCandidates
                code = self.getLLPSelection( self.validatedGetProps(lSelName, DisplVerticesLinesConf.singleCuts + DisplVerticesLinesConf.downCuts) )
            else:
                code = self.getLLPSelection( self.validatedGetProps(lSelName, DisplVerticesLinesConf.singleCuts) )

            lineFilter = FilterDesktop(
                             DecayDescriptor    = LLPLHCbName
                           , Preambulo          = DisplVerticesLinesConf.llpSelectionPreambulo
                           , Code               = code
                           , WriteP2PVRelations = False
                           , ForceP2PVBuild     = False
                           #, OutputLevel        = VERBOSE
                           )

            lineSel = Selection( "".join(( self.name(), lSelName ))
                        , RequiredSelections = [ candidates ]
                        , Algorithm          = lineFilter
                        )

            line = StrippingLine(lLineName
                     , prescale  = self.validatedGetProps(lSelName, ["PreScale"])["PreScale"]
                     , selection = lineSel
                     ## , FILTER    = { "Preambulo" : [ "nVeloTracks   = RECSUMMARY(13,  0)"
                     ##                               , "nVeloClusters = RECSUMMARY(30, -1)"
                     ##                               , "from LoKiCore.functions import *" ]
                     ##               , "Code"      : "monitor( 1.*nVeloTracks/nVeloClusters , Gaudi.Histo1DDef('Number of Velo Tracks / Clusters', 0., 1., 100) , 'NumVeloTracksPerCluster' ) < 0.2" }
                     )
            if lShortName in self.configurationParameter("HLT"):
                line.HLT = self.configurationParameter("HLT")[lShortName]

            self.registerLine(line)

        ##============================== Double ===================================##

        doubleLineNames = [ p.split("Double")[1].split("Selection")[0]
                                for p in self.configKeys()
                                    if p.startswith("Double")
                                    and p.endswith("Selection")
                          ]
        for lAcroName in doubleLineNames:
            lShortName = "Double%s" % lAcroName
            lSelName   = "%sSelection" % lShortName
            lLineName  = "%s%s" % (self.name(), lShortName)

            combinationCut, motherCut = self.getResonanceSelection( self.validatedGetProps(lSelName, DisplVerticesLinesConf.doubleResonanceCuts) )
            lineFilter = CombineParticles(
                             DecayDescriptor    = "H_10 -> %s %s" % (LLPLHCbName, LLPLHCbName)
                           , Preambulo          = DisplVerticesLinesConf.llpSelectionPreambulo
                           , DaughtersCuts      = { LLPLHCbName : self.getLLPSelection( self.validatedGetProps(lSelName, DisplVerticesLinesConf.singleCuts) ) }
                           , CombinationCut     = combinationCut
                           , MotherCut          = motherCut
                           , WriteP2PVRelations = False
                           , ForceP2PVBuild     = False
                           #, OutputLevel        = VERBOSE
                           )
            lineSel = Selection( "".join(( self.name(), lSelName ))
                        , RequiredSelections = [ withVeloCandidates ]
                        , Algorithm          = lineFilter
                        )
            line = StrippingLine(lLineName
                     , prescale  = self.validatedGetProps(lSelName, ["PreScale"])["PreScale"]
                     , selection = lineSel
                     )
            if lShortName in self.configurationParameter("HLT"):
                line.HLT = self.configurationParameter("HLT")[lShortName]

            self.registerLine(line)

        ##============================== HLT PS ===================================##

        hltPSLineNames = [ p.split("HLTPS")[0]
                               for p in self.configKeys()
                                   if p.endswith("HLTPS")
                         ]
        for lAcroName in hltPSLineNames:
            lShortName = "%sHLTPS" % lAcroName
            lLineName  = "%s%s" % (self.name(), lShortName) # DisplVerticesSingleMedium

            hltSelAlg = GaudiSequenceroid(ModeOR = True, ShortCircuit = False,
                Members = [ GaudiSequencer( "%sHltFilterTCK%s-%s" % (lLineName, tckBegin, tckEnd),
                                            Members = [ ODINFilter("%sODINFilterTCK%s-%s" % (lLineName, tckBegin, tckEnd), Code="( ODIN_TCK >= %s ) & ( ODIN_TCK <= %s )" % (tckBegin, tckEnd))
                                                      , HltFilter("%sHltDecisionFilterTCK%s-%s" % (lLineName, tckBegin, tckEnd), Code=hltFilter) ])
                            for (tckBegin, tckEnd), hltFilter in self.validatedGetProps("HLT", [lShortName])[lShortName]
                          ]
                )

            hltSelection = EventSelection( "%sHltFilter" % lLineName
                              , Algorithm = hltSelAlg
                              )

            line = StrippingLine(lLineName
                     , prescale  = self.validatedGetProps(lShortName, ["PreScale"])["PreScale"]
                     , selection = hltSelection
                     )

            self.registerLine(line)

        ##============================== OTHER  ===================================##

        hltEffLineNames = [ p.split("HltEff")[1].split("Selection")[0]
                                for p in self.configKeys()
                                    if p.startswith("HltEff")
                                    and p.endswith("Selection")
                          ]
        for lShortName in hltEffLineNames:
            lSelName  = "HltEff%sSelection" % lShortName
            lLineName = "%s%s" % (self.name(), lShortName)

            # HltEff lines are single, Velo-vertexing based lines
            lineFilter = FilterDesktop(
                             DecayDescriptor    = LLPLHCbName
                           , Preambulo          = DisplVerticesLinesConf.llpSelectionPreambulo
                           , Code               = self.getLLPSelection( self.validatedGetProps(lSelName, DisplVerticesLinesConf.singleCuts) )
                           , WriteP2PVRelations = False
                           , ForceP2PVBuild     = False
                           #, OutputLevel        = VERBOSE
                           )

            lineSel = Selection( "".join(( self.name(), lSelName ))
                        , RequiredSelections = [ withVeloCandidates ]
                        , Algorithm          = lineFilter
                        )

            line = StrippingLine(lLineName
                     , prescale  = self.validatedGetProps(lSelName, ["PreScale"])["PreScale"]
                     # these lines MUST have an HLT filter
                     , HLT       = self.configurationParameter("HLT")[lShortName]
                     , selection = lineSel
                     )

            self.registerLine(line)
示例#6
0
    def __init__(self, name, config):
        LineBuilder.__init__(self, name, config)

        #######################################################################
        ###                                                                 ###
        ###     VELO BASED VERTEXING SEQUENCE                               ###
        ###                                                                 ###
        #######################################################################

        bestTracks = AutomaticData("Rec/Track/Best")

        withVeloTracksForVertexing = bestTracks

        if self.configurationParameter("VeloGEC")["Apply"]:
            from GaudiConfUtils.ConfigurableGenerators import VeloEventShapeCutsS20p3

            veloGEC = VeloEventShapeCutsS20p3()
            self.validatedSetProps("VeloGEC",
                                   DisplVerticesLinesConf.veloGECCuts, veloGEC)

            withVeloTracksForVertexing = PassThroughSelection(
                "%sVeloGEC" % self.name(),
                RequiredSelection=withVeloTracksForVertexing,
                Algorithm=veloGEC)

        if self.configurationParameter("FilterVelo")["Apply"]:
            from GaudiConfUtils.ConfigurableGenerators import SelectVeloTracksNotFromPVS20p3

            veloWithIP = SelectVeloTracksNotFromPVS20p3()
            self.validatedSetProps("FilterVelo",
                                   DisplVerticesLinesConf.veloWithIPCuts,
                                   veloWithIP)

            withVeloTracksForVertexing = Selection(
                "%sVeloFilteredTracks" % self.name(),
                RequiredSelections=[withVeloTracksForVertexing],
                Algorithm=veloWithIP)

        # Displaced Vertex reconstruction with best tracks (dominated by those with a Velo segment)
        from Configurables import PatPV3D, PVOfflineTool, PVSeed3DTool, LSAdaptPV3DFitter, LSAdaptPVFitter

        withVeloVertexAlg = PatPV3D("%sWithVeloVertexAlg" % self.name())
        withVeloVertexFinder = addPrivateToolAndGet(withVeloVertexAlg,
                                                    PVOfflineTool)
        withVeloVertexFinder.PVsChi2Separation = 0
        withVeloVertexFinder.PVsChi2SeparationLowMult = 0
        withVeloSeeder = addPrivateToolAndGet(withVeloVertexFinder,
                                              PVSeed3DTool)
        withVeloVertexFinder.PVSeedingName = withVeloSeeder.getTitleName()
        withVeloSeeder.MinCloseTracks = 3
        withVeloFitter = addPrivateToolAndGet(withVeloVertexFinder,
                                              LSAdaptPV3DFitter)
        withVeloVertexFinder.PVFitterName = withVeloFitter.getTitleName()
        withVeloFitter.MinTracks = 4

        withVeloVertexing = SelectionPatPV3DWrapper(
            "%sWithVeloVertexing" % self.name(),
            withVeloVertexAlg,
            RequiredSelections=[withVeloTracksForVertexing])

        # Make Particles out of the RecVertices
        from GaudiConfUtils.ConfigurableGenerators import LLParticlesFromRecVertices

        rv2pWithVelo = LLParticlesFromRecVertices(
            VerticesFromVeloOnly=False,
            RequireUpstreamPV=False,
            WriteP2PVRelations=False,
            ForceP2PVBuild=False,
            VeloProtoParticlesLocation="Phys/%s/VeloProtoP" % self.name())
        self.validatedSetProps(
            "RV2PWithVelo", DisplVerticesLinesConf.recoCuts +
            DisplVerticesLinesConf.singleCuts, rv2pWithVelo)

        withVeloCandidates = Selection("%sWithVeloCandidates" % self.name(),
                                       RequiredSelections=[withVeloVertexing],
                                       Algorithm=rv2pWithVelo,
                                       InputDataSetter="RecVertexLocations")

        #######################################################################
        ###                                                                 ###
        ###     DOWNSTREAM VERTEXING SEQUENCE                               ###
        ###                                                                 ###
        #######################################################################

        from GaudiConfUtils.ConfigurableGenerators import CopyDownstreamTracks

        downTracks = Selection("%sDownstreamTracks" % self.name(),
                               RequiredSelections=[bestTracks],
                               Algorithm=CopyDownstreamTracks())

        # Displaced Vertex reconstruction from downstream tracks
        downVertexAlg = PatPV3D("%sDownVertexAlg" % self.name())
        downVertexFinder = addPrivateToolAndGet(downVertexAlg, PVOfflineTool)
        downVertexFinder.RequireVelo = False
        downVertexFinder.PVsChi2Separation = 0
        downVertexFinder.PVsChi2SeparationLowMult = 0
        downSeeder = addPrivateToolAndGet(downVertexFinder, PVSeed3DTool)
        downVertexFinder.PVSeedingName = downSeeder.getTitleName()
        downSeeder.TrackPairMaxDistance = 2.0 * units.mm
        downSeeder.zMaxSpread = 20.0 * units.mm
        downSeeder.MinCloseTracks = 4
        downFitter = addPrivateToolAndGet(downVertexFinder, LSAdaptPVFitter)
        downVertexFinder.PVFitterName = downFitter.getTitleName()
        downFitter.MinTracks = 4
        downFitter.maxChi2 = 400.0
        downFitter.maxDeltaZ = 0.0005 * units.mm
        downFitter.maxDeltaChi2NDoF = 0.002
        downFitter.acceptTrack = 0.000000001
        downFitter.trackMaxChi2 = 9
        downFitter.trackMaxChi2Remove = 64

        downVertexing = SelectionPatPV3DWrapper(
            "%sDownVertexing" % self.name(),
            downVertexAlg,
            RequiredSelections=[downTracks])

        # Make Particles out of the RecVertices
        rv2pDown = LLParticlesFromRecVertices(VerticesFromVeloOnly=False,
                                              RequireUpstreamPV=False,
                                              WriteP2PVRelations=False,
                                              ForceP2PVBuild=False
                                              #, OutputLevel          = VERBOSE
                                              )
        self.validatedSetProps(
            "RV2PDown", DisplVerticesLinesConf.recoCuts +
            DisplVerticesLinesConf.singleCuts, rv2pDown)

        downCandidates = Selection("%sDownCandidates" % self.name(),
                                   RequiredSelections=[downVertexing],
                                   Algorithm=rv2pDown,
                                   InputDataSetter="RecVertexLocations")

        #######################################################################
        ###                                                                 ###
        ###     HLT JET SEQUENCE                                            ###
        ###                                                                 ###
        #######################################################################
        # timing is already fine, so one algo with loose JetID is sufficient

        # Hlt prefilter and vertex candidates from Hlt2
        from Configurables import HltVertexConverterS20p3
        revivedHlt2Candidates = "Phys/%sHlt2Cand/Particles" % self.name()
        hltCandReviver = GaudiSequenceroid(
            ModeOR=True,
            ShortCircuit=False,
            Members=[
                GaudiSequencer(
                    "%sHlt2CandFilterTCK%s-%s" %
                    (self.name(), tckBegin, tckEnd),
                    Members=(LoKi_Filters(
                        HLT2_Code=
                        "in_range( {begin}, HLT_TCK % 0x40000000 , {end} ) & ( {decisions} )"
                        .format(begin=tckBegin,
                                end=tckEnd,
                                decisions=" | ".join(
                                    "HLT_PASS('%s')" % ln
                                    for ln in hltLines))).filters(
                                        "%sHlt2DecisionFilterTCK%s-%s" %
                                        (self.name(), tckBegin, tckEnd)) +
                             [
                                 HltVertexConverterS20p3(
                                     "%sHltConverter%s-%s" %
                                     (self.name(), tckBegin, tckEnd),
                                     HltSelReports="Hlt2/SelReports",
                                     HltLines=hltLines,
                                     Recursive=True,
                                     Output=revivedHlt2Candidates,
                                     WriteP2PVRelations=False,
                                     ForceP2PVBuild=False)
                             ])) for (tckBegin, tckEnd), hltLines in
                self.configurationParameter("HLT")["SignalLines"]
            ])
        hltCandSelection = EventSelection("%sHltCandidates" % self.name(),
                                          Algorithm=hltCandReviver)

        hltVeloGEC = VeloEventShapeCutsS20p3()
        self.validatedSetProps("VeloGEC", DisplVerticesLinesConf.veloGECCuts,
                               hltVeloGEC)
        hltVeloGEC.HistoProduce = False
        hltVeloGECSel = EventSelection("%sHltVeloGEC" % self.name(),
                                       Algorithm=hltVeloGEC)

        hlt2CandAndGECSelection = Selection(
            "".join((self.name(), "Hlt2CandVertices")),
            RequiredSelections=[
                hltCandSelection,
                AutomaticData(revivedHlt2Candidates), hltVeloGECSel
            ],
            Algorithm=FilterDesktop(
                Code="( ABSID == '{pid}' )".format(pid=LLPLHCbName),
                WriteP2PVRelations=False,
                ForceP2PVBuild=False))

        #######################################################################
        ###                                                                 ###
        ###     LINE DEFINITIONS                                            ###
        ###                                                                 ###
        #######################################################################
        # one line for every configuratoin key of the format
        # "Single.*Selection"
        # "JetSingle.*Selection"
        # "JetHltSingle.*Selection"
        # "Double.*Selection"
        # ".*HLTPS"
        # "HltEff.*Selection"

        ##============================== Single ===================================##

        singleLineNames = [
            p.split("Single")[1].split("Selection")[0]
            for p in self.configKeys()
            if p.startswith("Single") and p.endswith("Selection")
        ]

        for lAcroName in singleLineNames:
            lShortName = "Single%s" % lAcroName  # SingleMedium
            lSelName = "%sSelection" % lShortName  # SingleMediumSelection
            lLineName = "%s%s" % (self.name(), lShortName
                                  )  # DisplVerticesSingleMedium

            # Choose between Velo-based and downstream vertexing input
            candidates = withVeloCandidates
            code = None
            if "Down" in lAcroName:
                candidates = downCandidates
                code = self.getLLPSelection(
                    self.validatedGetProps(
                        lSelName, DisplVerticesLinesConf.singleCuts +
                        DisplVerticesLinesConf.downCuts))
            else:
                code = self.getLLPSelection(
                    self.validatedGetProps(lSelName,
                                           DisplVerticesLinesConf.singleCuts))

            lineFilter = FilterDesktop(
                DecayDescriptor=LLPLHCbName,
                Preambulo=DisplVerticesLinesConf.llpSelectionPreambulo,
                Code=code,
                WriteP2PVRelations=False,
                ForceP2PVBuild=False
                #, OutputLevel        = VERBOSE
            )

            lineSel = Selection("".join((self.name(), lSelName)),
                                RequiredSelections=[candidates],
                                Algorithm=lineFilter)

            line = StrippingLine(lLineName,
                                 prescale=self.validatedGetProps(
                                     lSelName, ["PreScale"])["PreScale"],
                                 selection=lineSel,
                                 RequiredRawEvents=["Calo"],
                                 RelatedInfoTools=[{
                                     "Type": "AddVeloEventShapeS21",
                                     "TopSelection": lineSel,
                                     "Location": "P2VES"
                                 }])
            if lShortName in self.configurationParameter("HLT"):
                line.HLT2 = self.configurationParameter("HLT")[lShortName]

            self.registerLine(line)

        ##========================= Single with jets ==============================##

        jetSingleLineNames = [
            p.split("JetSingle")[1].split("Selection")[0]
            for p in self.configKeys()
            if p.startswith("JetSingle") and p.endswith("Selection")
        ]

        for lAcroName in jetSingleLineNames:
            lShortName = "JetSingle%s" % lAcroName  # JetSingleMedium
            lSelName = "%sSelection" % lShortName  # JetSingleMediumSelection
            lLineName = "%s%s" % (self.name(), lShortName
                                  )  # DisplVerticesJetSingleMedium

            # Choose between Velo-based and downstream vertexing input
            vertexCandidates = withVeloCandidates
            code = self.getLLPSelection(
                self.validatedGetProps(lSelName,
                                       DisplVerticesLinesConf.singleCuts))

            vertexFilter = FilterDesktop(
                DecayDescriptor=LLPLHCbName,
                Preambulo=DisplVerticesLinesConf.llpSelectionPreambulo,
                Code=code,
                WriteP2PVRelations=False,
                ForceP2PVBuild=False
                #, OutputLevel        = VERBOSE
            )

            goodVertices = Selection("".join(
                (self.name(), lSelName, "Vertices")),
                                     RequiredSelections=[vertexCandidates],
                                     Algorithm=vertexFilter)

            jetProps = self.validatedGetProps(lSelName,
                                              DisplVerticesLinesConf.jetCuts)
            vertWithJets = Selection("".join((self.name(), lSelName, "Jets")),
                                     RequiredSelections=[goodVertices],
                                     Algorithm=self.makeJetCandidateAlg(
                                         "".join((self.name(), lSelName,
                                                  "JetAlg")),
                                         MinNumJets=jetProps["MinNumJets"],
                                         ConeSize=jetProps["ConeSize"],
                                         JetIDCut=jetProps["JetIDCut"],
                                         MinDOCABL=jetProps["MinDOCABL"]))
            jetCode = self.getLLPJetSelection(jetProps)
            jetCandFilter = FilterDesktop(DecayDescriptor=LLPLHCbName,
                                          Preambulo=self.jetSelectionPreambulo,
                                          Code=jetCode,
                                          WriteP2PVRelations=False,
                                          ForceP2PVBuild=False)
            lineSel = Selection("".join((self.name(), lSelName)),
                                RequiredSelections=[vertWithJets],
                                Algorithm=jetCandFilter)

            line = StrippingLine(lLineName,
                                 prescale=self.validatedGetProps(
                                     lSelName, ["PreScale"])["PreScale"],
                                 selection=lineSel,
                                 RequiredRawEvents=["Calo"],
                                 RelatedInfoTools=[{
                                     "Type": "AddVeloEventShapeS21",
                                     "TopSelection": lineSel,
                                     "Location": "P2VES"
                                 }])
            if lShortName in self.configurationParameter("HLT"):
                line.HLT2 = self.configurationParameter("HLT")[lShortName]

            self.registerLine(line)

        ##============= Single with jets based on Hlt candidate ==================##

        jetHltSingleLineNames = [
            p.split("JetHltSingle")[1].split("Selection")[0]
            for p in self.configKeys()
            if p.startswith("JetHltSingle") and p.endswith("Selection")
        ]

        for lAcroName in jetHltSingleLineNames:
            lShortName = "JetHltSingle%s" % lAcroName  # JetHltSingleMedium
            lSelName = "%sSelection" % lShortName  # JetHltSingleMediumSelection
            lLineName = "%s%s" % (self.name(), lShortName
                                  )  # DisplVerticesJetHltSingleMedium

            jetProps = self.validatedGetProps(lSelName,
                                              DisplVerticesLinesConf.jetCuts)
            vertWithJets = Selection(
                "".join((self.name(), lSelName, "HltJets")),
                RequiredSelections=[hlt2CandAndGECSelection],
                Algorithm=self.makeJetCandidateAlg(
                    "".join((self.name(), lSelName, "HltJetAlg")),
                    MinNumJets=jetProps["MinNumJets"],
                    ConeSize=jetProps["ConeSize"],
                    JetIDCut=jetProps["JetIDCut"],
                    MinDOCABL=jetProps["MinDOCABL"]))
            jetCode = self.getLLPJetSelection(jetProps)
            jetCandFilter = FilterDesktop(DecayDescriptor=LLPLHCbName,
                                          Preambulo=self.jetSelectionPreambulo,
                                          Code=jetCode,
                                          WriteP2PVRelations=False,
                                          ForceP2PVBuild=False)
            lineSel = Selection("".join((self.name(), lSelName)),
                                RequiredSelections=[vertWithJets],
                                Algorithm=jetCandFilter)

            line = StrippingLine(lLineName,
                                 prescale=self.validatedGetProps(
                                     lSelName, ["PreScale"])["PreScale"],
                                 selection=lineSel,
                                 RequiredRawEvents=["Calo"],
                                 RelatedInfoTools=[{
                                     "Type": "AddVeloEventShapeS21",
                                     "TopSelection": lineSel,
                                     "Location": "P2VES"
                                 }])
            if lShortName in self.configurationParameter("HLT"):
                line.HLT2 = self.configurationParameter("HLT")[lShortName]

            self.registerLine(line)

        ##============================== Double ===================================##

        doubleLineNames = [
            p.split("Double")[1].split("Selection")[0]
            for p in self.configKeys()
            if p.startswith("Double") and p.endswith("Selection")
        ]
        for lAcroName in doubleLineNames:
            lShortName = "Double%s" % lAcroName
            lSelName = "%sSelection" % lShortName
            lLineName = "%s%s" % (self.name(), lShortName)

            combinationCut, motherCut = self.getResonanceSelection(
                self.validatedGetProps(
                    lSelName, DisplVerticesLinesConf.doubleResonanceCuts))
            lineFilter = CombineParticles(
                DecayDescriptor="H_10 -> %s %s" % (LLPLHCbName, LLPLHCbName),
                Preambulo=DisplVerticesLinesConf.llpSelectionPreambulo,
                DaughtersCuts={
                    LLPLHCbName:
                    self.getLLPSelection(
                        self.validatedGetProps(
                            lSelName, DisplVerticesLinesConf.singleCuts))
                },
                CombinationCut=combinationCut,
                MotherCut=motherCut,
                WriteP2PVRelations=False,
                ForceP2PVBuild=False
                #, OutputLevel        = VERBOSE
            )
            lineSel = Selection("".join((self.name(), lSelName)),
                                RequiredSelections=[withVeloCandidates],
                                Algorithm=lineFilter)
            line = StrippingLine(lLineName,
                                 prescale=self.validatedGetProps(
                                     lSelName, ["PreScale"])["PreScale"],
                                 selection=lineSel,
                                 RequiredRawEvents=["Calo"],
                                 RelatedInfoTools=[{
                                     "Type": "AddVeloEventShapeS21",
                                     "TopSelection": lineSel,
                                     "Location": "P2VES"
                                 }])
            if lShortName in self.configurationParameter("HLT"):
                line.HLT2 = self.configurationParameter("HLT")[lShortName]

            self.registerLine(line)

        ##============================== HLT PS ===================================##

        hltPSLineNames = [
            p.split("HLTPS")[0] for p in self.configKeys()
            if p.endswith("HLTPS")
        ]
        for lAcroName in hltPSLineNames:
            lShortName = "%sHLTPS" % lAcroName
            lLineName = "%s%s" % (self.name(), lShortName
                                  )  # DisplVerticesSingleMedium

            orFilters = []
            for (tckBegin, tckEnd), hltFilter in self.validatedGetProps(
                    "HLT", [lShortName])[lShortName]:
                filters = LoKi_Filters(
                    HLT2_Code=
                    "in_range( {begin}, HLT_TCK % 0x40000000, {end} ) & ( {decisions} )"
                    .format(begin=tckBegin, end=tckEnd,
                            decisions=hltFilter)).filters(
                                "%sHlt2FilterTCK%s-%s" %
                                (lLineName, tckBegin, tckEnd))
                assert len(filters) == 1
                orFilters.append(filters[0])
            assert len(orFilters) == len(
                self.validatedGetProps("HLT", [lShortName])[lShortName])

            hltSelection = EventSelection("%sHltFilter" % lLineName,
                                          Algorithm=GaudiSequenceroid(
                                              ModeOR=True,
                                              ShortCircuit=False,
                                              Members=orFilters))

            line = StrippingLine(
                lLineName,
                prescale=self.validatedGetProps(lShortName,
                                                ["PreScale"])["PreScale"],
                selection=hltSelection,
                RequiredRawEvents=["Muon", "Calo", "Rich", "Velo", "Tracker"])

            self.registerLine(line)

        ##============================== OTHER  ===================================##

        hltEffLineNames = [
            p.split("HltEff")[1].split("Selection")[0]
            for p in self.configKeys()
            if p.startswith("HltEff") and p.endswith("Selection")
        ]
        for lShortName in hltEffLineNames:
            lSelName = "HltEff%sSelection" % lShortName
            lLineName = "%s%s" % (self.name(), lShortName)

            # HltEff lines are single, Velo-vertexing based lines
            lineFilter = FilterDesktop(
                DecayDescriptor=LLPLHCbName,
                Preambulo=DisplVerticesLinesConf.llpSelectionPreambulo,
                Code=self.getLLPSelection(
                    self.validatedGetProps(lSelName,
                                           DisplVerticesLinesConf.singleCuts)),
                WriteP2PVRelations=False,
                ForceP2PVBuild=False
                #, OutputLevel        = VERBOSE
            )

            lineSel = Selection("".join((self.name(), lSelName)),
                                RequiredSelections=[withVeloCandidates],
                                Algorithm=lineFilter)

            line = StrippingLine(
                lLineName,
                prescale=self.validatedGetProps(lSelName,
                                                ["PreScale"])["PreScale"]
                # these lines MUST have an HLT filter
                ,
                HLT2=self.configurationParameter("HLT")[lShortName],
                selection=lineSel,
                RequiredRawEvents=["Muon", "Calo", "Rich", "Velo", "Tracker"],
                RelatedInfoTools=[{
                    "Type": "AddVeloEventShapeS21",
                    "TopSelection": lineSel,
                    "Location": "P2VES"
                }])

            self.registerLine(line)
示例#7
0
    def __init__(self, name, config):

        LineBuilder.__init__(self, name, config)

        self._myname = name

        # High pT Topo line
        from Configurables import HighPtTopoTool as HighpTDT
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_40000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_40000', Code=code)
        sel = EventSelection('HighPtTopoEventSel_40000', Algorithm=alg)
        dt = HighpTDT('HighPtTopoLine_DT_40000')
        dt.minpT = config['pT']
        hlt = "HLT_PASS_RE('Hlt2Topo.*Decision')"
        sline = StrippingLine(name + '%(pT)s' % config,
                              prescale=config['HighPtTopo40000_Prescale'],
                              postscale=config['HighPtTopo_Postscale'],
                              selection=sel,
                              HLT=hlt)
        self.registerLine(sline)

        # High pT Topo line
        from Configurables import HighPtTopoTool as HighpTDT
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_20000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_20000', Code=code)
        sel = EventSelection('HighPtTopoEventSel_20000', Algorithm=alg)
        dt = HighpTDT('HighPtTopoLine_DT_20000')
        dt.minpT = config['pT20']
        hlt = "HLT_PASS_RE('Hlt2Topo.*Decision')"
        sline = StrippingLine(name + '%(pT20)s' % config,
                              prescale=config['HighPtTopo20000_Prescale'],
                              postscale=config['HighPtTopo_Postscale'],
                              selection=sel,
                              HLT=hlt)
        self.registerLine(sline)

        # High pT Topo line
        from Configurables import HighPtTopoTool as HighpTDT
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_10000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_10000', Code=code)
        sel = EventSelection('HighPtTopoEventSel_10000', Algorithm=alg)
        dt = HighpTDT('HighPtTopoLine_DT_10000')
        dt.minpT = config['pT10']
        hlt = "HLT_PASS_RE('Hlt2Topo.*Decision')"
        sline = StrippingLine(name + '%(pT10)s' % config,
                              prescale=config['HighPtTopo10000_Prescale'],
                              postscale=config['HighPtTopo_Postscale'],
                              selection=sel,
                              HLT=hlt)
        self.registerLine(sline)

        # High pT Topo line
        from Configurables import HighPtTopoTool as HighpTDT
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_1000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_1000', Code=code)
        sel = EventSelection('HighPtTopoEventSel_1000', Algorithm=alg)
        dt = HighpTDT('HighPtTopoLine_DT_1000')
        dt.minpT = config['pT1']
        hlt = "HLT_PASS_RE('Hlt2Topo.*Decision')"
        sline = StrippingLine(name + '%(pT1)s' % config,
                              prescale=config['HighPtTopo1000_Prescale'],
                              postscale=config['HighPtTopo_Postscale'],
                              selection=sel,
                              HLT=hlt)
        self.registerLine(sline)

        from Configurables import HighPtTopoTool as HighpTDT
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_20000_Cone55')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_20000_Cone55', Code=code)
        sel = EventSelection('HighPtTopoEventSel_20000_Cone55', Algorithm=alg)
        dt = HighpTDT('HighPtTopoLine_DT_20000_Cone55')
        dt.minconepT = config['pTcone']
        dt.conesize = config['conesize']
        dt.minpT = config['pT20']
        hlt = "HLT_PASS_RE('Hlt2Topo.*Decision')"
        sline = StrippingLine(
            name + '%(pT20)s_Cone55' % config,
            prescale=config['HighPtTopo20000_Cone55_Prescale'],
            postscale=config['HighPtTopo_Postscale'],
            selection=sel,
            HLT=hlt)
        self.registerLine(sline)
示例#8
0
    def __init__(self, moduleName, config) :
        
        LineBuilder.__init__(self, moduleName, config)

        # pre-filter inputs
        pions = filterInputs('Pi',[StdAllNoPIDsPions],config['ALL'])
        kaons = filterInputs('K',[StdAllNoPIDsKaons],config['ALL'])
        protons = filterInputs('P',[StdAllNoPIDsProtons],config['ALL'])
        ks_dd = filterInputs('KS0_DD',[dataOnDemand("StdLooseKsDD")],
                                       config['KS0']) 
        ks_ll = filterInputs('KS0_LL',[dataOnDemand("StdLooseKsLL")],
                             config['KS0'])
        ks = {"DD":[ks_dd],"LL":[ks_ll]}
        pi0_merged   = filterPi0s('Merged',[StdLooseMergedPi0],config['Pi0'])
        pi0_resolved = filterPi0s('Resolved',[StdLooseResolvedPi0],
                                  config['Pi0'])
        pi0 = {"Merged":[pi0_merged],"Resolved":[pi0_resolved]}
        pcut = 'P > %s' % config['Pi0']['FROM_B_P_MIN']
        pi0_fromB_merged = filterSelection('Pi0FromBMerged',pcut,[pi0_merged])
        pi0_fromB_resolved = filterSelection('Pi0FromBResolved',pcut,
                                             [pi0_resolved])
        pi0_fromB = {'Merged':[pi0_fromB_merged],
                     'Resolved':[pi0_fromB_resolved]}
        
        # pre-filter hard inputs (these could have been used in HLT2)
        topoPions = topoInputs('Pi',[pions])
        topoKaons = topoInputs('K',[kaons])
        topoProtons = topoInputs('P',[protons])
        
        # make D->X, etc. inputs
        d = DBuilder(pions,ks,pi0,config['D2X'],config['PID'])
        dst = DstarBuilder(d,pions,pi0,config['Dstar'],config['PID'])

        # X -> hh
        hh = HHBuilder(pions,kaons,protons,ks,pi0_fromB,config['HH'],
                       config['PID'])

        # X -> hhh
        hhh = HHHBuilder(pions,kaons,protons,config['HHH'])

        # Lc -> X
        lc = LcBuilder(pions,kaons,protons,config['D2X'],config['PID'])

        # make B->DX
        b2dx = B2DXBuilder(d,dst,topoPions,topoKaons,ks,pi0_fromB,hh,hhh,
                           config['B2X'])
        self._makeLines(b2dx.lines,config)

        # Lb -> X
        lb2x = Lb2XBuilder(lc,d,hh,topoPions,topoKaons,topoProtons,hhh,dst,
                           config['B2X'])
        self._makeLines(lb2x.lines,config)

        # Unbiased lines
        ltub = LTUnbiasedBuilder(d,config['B2X'])
        self._makeLines(ltub.lines,config)

        # Double Topo line
        from Configurables import DoubleTopoTool as DT
        code = "ACCEPT('DoubleTopoTool/DoubleTopoLine_DT')"
        alg = LoKi__VoidFilter('DoubleTopoLineFilter',Code=code)
        sel = EventSelection('DoubleTopoEventSel',Algorithm=alg)
        dt = DT('DoubleTopoLine_DT')
        dt.minAngle = 2/57.
        dt.minMass = 19000
        hlt = "HLT_PASS_RE('Hlt2Topo.*Decision')"
        sline = StrippingLine('DoubleTopoLine',1.0,selection=sel,HLT=hlt)
        self.registerLine(sline)

        # High pT Topo line
        from Configurables import HighPtTopoTool as HighpTDT
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_40000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_40000',Code=code)
        sel = EventSelection('HighPtTopoEventSel_40000',Algorithm=alg)
        dt = HighpTDT('HighPtTopoLine_DT_40000')
        dt.minpT = 40000
        hlt = "HLT_PASS_RE('Hlt2Topo.*Decision')"
        sline = StrippingLine('HighPtTopoLine_40000',1.0,selection=sel,HLT=hlt)
        self.registerLine(sline)

        from Configurables import HighPtTopoTool as HighpTDT
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_20000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_20000',Code=code)
        sel = EventSelection('HighPtTopoEventSel_20000',Algorithm=alg)
        dt = HighpTDT('HighPtTopoLine_DT_20000')
        dt.minpT = 20000
        hlt = "HLT_PASS_RE('Hlt2Topo.*Decision')"
        sline = StrippingLine('HighPtTopoLine_20000',0.1,selection=sel,HLT=hlt)
        self.registerLine(sline)
示例#9
0
    def __init__( self, name, config ) :

        LineBuilder.__init__( self, name, config )


        # High pT Topo line
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_40000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_40000',Code=code)
        sel = EventSelection('HighPtTopoEventSel_40000',Algorithm=alg)
        dt = HighpTDT('HighPtTopoLine_DT_40000')
        dt.minpT = config['pT']

        # Split HLT configuration
        config_split_HLT(dt)
        
        sline = StrippingLine(name+'%(pT)s'%config,
                              prescale  = config[ 'HighPtTopo40000_Prescale' ],
                              postscale = config[ 'HighPtTopo_Postscale' ],
                              selection=sel,
                              HLT2=config['HLT2'])
        self.registerLine(sline)


        # High pT Topo line
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_20000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_20000',Code=code)
        sel = EventSelection('HighPtTopoEventSel_20000',Algorithm=alg)
        dt = HighpTDT('HighPtTopoLine_DT_20000')
        dt.minpT = config['pT20']

        # Split HLT configuration
        config_split_HLT(dt)

        sline = StrippingLine(name+'%(pT20)s'%config,
                              prescale  = config[ 'HighPtTopo20000_Prescale' ],
                              postscale = config[ 'HighPtTopo_Postscale' ],
                              selection=sel,
                              HLT2=config['HLT2'])
        self.registerLine(sline)


        # High pT Topo line
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_10000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_10000',Code=code)
        sel = EventSelection('HighPtTopoEventSel_10000',Algorithm=alg)
        dt = HighpTDT('HighPtTopoLine_DT_10000')
        dt.minpT = config['pT10']

        # Split HLT configuration
        config_split_HLT(dt)

        sline = StrippingLine(name+'%(pT10)s'%config,
                              prescale  = config[ 'HighPtTopo10000_Prescale' ],
                              postscale = config[ 'HighPtTopo_Postscale' ],
                              selection=sel,
                              HLT2=config['HLT2'])
        self.registerLine(sline)


        # High pT Topo line
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_1000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_1000',Code=code)
        sel = EventSelection('HighPtTopoEventSel_1000',Algorithm=alg)
        dt = HighpTDT('HighPtTopoLine_DT_1000')
        dt.minpT = config['pT1']

        # Split HLT configuration
        config_split_HLT(dt)

        sline = StrippingLine(name+'%(pT1)s'%config,
                              prescale  = config[ 'HighPtTopo1000_Prescale' ],
                              postscale = config[ 'HighPtTopo_Postscale' ],
                              selection=sel,
                              HLT2=config['HLT2'])
        self.registerLine(sline)


        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_20000_Cone55')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_20000_Cone55',Code=code)
        sel = EventSelection('HighPtTopoEventSel_20000_Cone55',Algorithm=alg)
        dt = HighpTDT('HighPtTopoLine_DT_20000_Cone55')
        dt.minconepT = config['pTcone']
        dt.conesize = config['conesize']
        dt.minpT = config['pT20']

        # Split HLT configuration
        config_split_HLT(dt)

        sline = StrippingLine(name+'%(pT20)s_Cone55'%config,
                              prescale  = config[ 'HighPtTopo20000_Cone55_Prescale' ],
                              postscale = config[ 'HighPtTopo_Postscale' ],
                              selection=sel,
                              HLT2=config['HLT2'])
        self.registerLine(sline)
示例#10
0
    def __init__( self, name, config ) :

        LineBuilder.__init__( self, name, config )


        # High pT Topo line
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_40000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_40000',Code=code)
        sel = EventSelection('HighPtTopoEventSel_40000',Algorithm=alg)
        dt = HighPtTopoTool('HighPtTopoLine_DT_40000')
        dt.minpT = config['pT']
        ## Available after Phys/TopologicalTools v1r1+
        ## Conditional can be removed afterward (hasattr doesn't work here)
        if 'hltdecision' in dir(dt):
          dt.hltdecision = config['HLT2']  

        # Split HLT configuration
        config_split_HLT(dt)
        
        sline = StrippingLine(name+'%(pT)i'%config,
                              prescale  = config[ 'HighPtTopo40000_Prescale' ],
                              postscale = config[ 'HighPtTopo_Postscale' ],
                              selection=sel,
                              HLT2="HLT_PASS_RE('%s')"%config['HLT2'])
        self.registerLine(sline)


        # High pT Topo line
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_20000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_20000',Code=code)
        sel = EventSelection('HighPtTopoEventSel_20000',Algorithm=alg)
        dt = HighPtTopoTool('HighPtTopoLine_DT_20000')
        dt.minpT = config['pT20']
        ## Available after Phys/TopologicalTools v1r1+
        ## Conditional can be removed afterward (hasattr doesn't work here)
        if 'hltdecision' in dir(dt):
          dt.hltdecision = config['HLT2']  

        # Split HLT configuration
        config_split_HLT(dt)

        sline = StrippingLine(name+'%(pT20)i'%config,
                              prescale  = config[ 'HighPtTopo20000_Prescale' ],
                              postscale = config[ 'HighPtTopo_Postscale' ],
                              selection=sel,
                              HLT2="HLT_PASS_RE('%s')"%config['HLT2'])
        self.registerLine(sline)


        # High pT Topo line
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_10000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_10000',Code=code)
        sel = EventSelection('HighPtTopoEventSel_10000',Algorithm=alg)
        dt = HighPtTopoTool('HighPtTopoLine_DT_10000')
        dt.minpT = config['pT10']
        ## Available after Phys/TopologicalTools v1r1+
        ## Conditional can be removed afterward (hasattr doesn't work here)
        if 'hltdecision' in dir(dt):
          dt.hltdecision = config['HLT2']  

        # Split HLT configuration
        config_split_HLT(dt)

        sline = StrippingLine(name+'%(pT10)i'%config,
                              prescale  = config[ 'HighPtTopo10000_Prescale' ],
                              postscale = config[ 'HighPtTopo_Postscale' ],
                              selection=sel,
                              HLT2="HLT_PASS_RE('%s')"%config['HLT2'])
        self.registerLine(sline)


        # High pT Topo line
        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_1000')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_1000',Code=code)
        sel = EventSelection('HighPtTopoEventSel_1000',Algorithm=alg)
        dt = HighPtTopoTool('HighPtTopoLine_DT_1000')
        dt.minpT = config['pT1']
        ## Available after Phys/TopologicalTools v1r1+
        ## Conditional can be removed afterward (hasattr doesn't work here)
        if 'hltdecision' in dir(dt):
          dt.hltdecision = config['HLT2']  

        # Split HLT configuration
        config_split_HLT(dt)

        sline = StrippingLine(name+'%(pT1)i'%config,
                              prescale  = config[ 'HighPtTopo1000_Prescale' ],
                              postscale = config[ 'HighPtTopo_Postscale' ],
                              selection=sel,
                              HLT2="HLT_PASS_RE('%s')"%config['HLT2'])
        self.registerLine(sline)


        code = "ACCEPT('HighPtTopoTool/HighPtTopoLine_DT_20000_Cone55')"
        alg = LoKi__VoidFilter('HighPtTopoLineFilter_20000_Cone55',Code=code)
        sel = EventSelection('HighPtTopoEventSel_20000_Cone55',Algorithm=alg)
        dt = HighPtTopoTool('HighPtTopoLine_DT_20000_Cone55')
        dt.minconepT = config['pTcone']
        dt.conesize = config['conesize']
        dt.minpT = config['pT20']
        ## Available after Phys/TopologicalTools v1r1+
        ## Conditional can be removed afterward (hasattr doesn't work here)
        if 'hltdecision' in dir(dt):
          dt.hltdecision = config['HLT2']  


        # Split HLT configuration
        config_split_HLT(dt)

        sline = StrippingLine(name+'%(pT20)i_Cone55'%config,
                              prescale  = config[ 'HighPtTopo20000_Cone55_Prescale' ],
                              postscale = config[ 'HighPtTopo_Postscale' ],
                              selection=sel,
                              HLT2="HLT_PASS_RE('%s')"%config['HLT2'])
        self.registerLine(sline)