Exemplo n.º 1
0
    def __apply_configuration__(self):
        from HltLine.HltLine import Hlt2Line
        from Configurables import HltANNSvc
        stages = self.stages()
        for (nickname, algos) in self.algorithms(stages):
            linename = 'DiMuon' + nickname if nickname != 'DiMuon' else nickname
            if "Turbo" in nickname:
                Hlt2Line(linename,
                         prescale=self.prescale,
                         algos=algos,
                         postscale=self.postscale,
                         Turbo=True,
                         PersistReco=self.getProps()['PersistReco'].get(
                             nickname, False))
            else:
                Hlt2Line(linename,
                         prescale=self.prescale,
                         algos=algos,
                         postscale=self.postscale)

            if nickname is 'JPsi':
                HltANNSvc().Hlt2SelectionID.update(
                    {"Hlt2DiMuonJPsiDecision": 50201})
            if nickname is 'JPsiTurbo':
                HltANNSvc().Hlt2SelectionID.update(
                    {'Hlt2DiMuonJPsiTurboDecision': 50212})
Exemplo n.º 2
0
    def configurePersistence(self, hlt1Lines, lines, stage):
        """
        persistify vertices
        """
        ## and persist some vertices...
        from Configurables import HltVertexReportsMaker
        vertices = ['PV3D']
        selections = set()
        for i in hlt1Lines:
            selections = selections.union(
                set([j for j in i.outputSelections()]))
        vertices = [i for i in vertices if i in selections]

        vtxMaker = HltVertexReportsMaker(stage + "VtxReportsMaker")
        vtxMaker.VertexSelections = vertices
        #Can't do this any longer, need replacing with a smart way to get the vertex locations
        #HltVertexReportsMaker().Context = "HLT"
        vtxMaker.PVLocation = onlinePV()["PV3D"]

        ## do not write out the candidates for the vertices we store
        from Configurables import Hlt1SelReportsMaker, Hlt2SelReportsMaker
        configs = {'Hlt1': Hlt1SelReportsMaker, 'Hlt2': Hlt2SelReportsMaker}
        selMaker = configs[stage](stage + "SelReportsMaker")
        selMaker.SelectionMaxCandidates.update(
            dict([(i, 0) for i in vertices if i.endswith('Decision')]))

        ## Related info locations need to be passed the SelReportsMaker and the
        ## HltANNSvc needs to be updated
        from Configurables import HltANNSvc
        locIDs = HltANNSvc().RelInfoLocations
        infoLocs = []
        for line in lines:
            locs = line.relatedInfoLocations()
            infoLocs.extend(locs)
            if locs:
                selMaker.RelatedInfoLocations[line.decision()] = locs
        __updateDict__(locIDs, 50, sorted(list(set(infoLocs))))
        HltANNSvc().RelInfoLocations = locIDs

        # Veto some selections
        veto = [
            'TES:Trig/L0/FullCalo', 'TES:Trig/L0/MuonCtrl',
            'TES:Hlt/Vertex/ASidePV3D', 'TES:Hlt/Vertex/CSidePV3D',
            'TES:Hlt2/Track/Forward', 'RZVeloBW', 'TES:Hlt/Track/RZVelo',
            'TES:Hlt2/Track/Velo', 'TES:Hlt/Vertex/PV3D',
            'TES:Hlt/Track/MuonSegmentForL0Single'
        ]
        selMaker.SelectionMaxCandidatesDebug = dict([(i, 0) for i in veto])
Exemplo n.º 3
0
    def __apply_configuration__(self):

        _stages = self.stages()
        _relatedInfo = self.relatedInfo()

        ## Other line Hlt2LinesConfigurableUser, like that for the DPS lines,
        ## can call self.stages().  This can (but probably won't) happen
        ## before __slots__ is updated with the configuration.  In order to
        ## guarantee that the __slots__ are updated prior to the definition of
        ## the inclusive lines, either the dependence of this configurable and
        ## all others that call its stages() must be explicitly defined, or,
        ## as is done here, the inclusive lines are defined first and only
        ## here in __apply_configuration__ and not in stages().
        _stages.update(self.__inclHHXStages())

        from HltLine.HltLine import Hlt2Line
        for nickname, algos, relatedInfo in self.algorithms(_stages):
            doturbo = True if (nickname.find('Turbo') > -1) else False
            Hlt2Line('CharmHad' + nickname,
                     prescale=self.prescale,
                     algos=algos,
                     postscale=self.postscale,
                     Turbo=doturbo,
                     PersistReco=self.getProps()['PersistReco'].get(
                         'Hlt2CharmHad' + nickname, False),
                     RelatedInfo=relatedInfo)
            if "Dst_2D0Pi0_D02KPi_XSec" in nickname:
                HltANNSvc().Hlt2SelectionID.update(
                    {"Hlt2CharmHadDst_2D0Pi0_D02KPi_XSecTurboDecision": 57222})
Exemplo n.º 4
0
 def _registerToHltANNSvc(self):
     """Register the packed object locations in the HltANNSvc."""
     from Configurables import HltANNSvc
     locations = list(itertools.chain(*self.packedObjectLocations()))
     # We need to register the locations of (non-reconstructed) data
     # that is referenced by the some of the packed objects.
     locations += [
         '/Event/Raw/Ecal/Digits',
         '/Event/Raw/Prs/Digits',
         '/Event/Raw/Spd/Digits',
     ]
     location_ids = {loc: i + 1 for i, loc in enumerate(locations)}
     print {i: loc for loc, i in location_ids.items()}
     HltANNSvc().PackedObjectLocations = location_ids
Exemplo n.º 5
0
    def __apply_configuration__(self):
        from HltLine.HltLine import Hlt2Line
        from Configurables import HltANNSvc
        lines = self.getProp('CloneLines')
        for (module, lines) in lines.iteritems():
            # Import the other module that has the stages.
            mod = importlib.import_module('Hlt2Lines.' + module + '.Lines')
            # Instantiate the configurable
            conf = getattr(mod, module + 'Lines')()
            # Loop over the line, use the configurable to get the algorithms and
            # instantiate the turbo lines.
            for line in lines:
                stages = conf.stages(line)
                algos = dict(conf.algorithms({'Turbo': stages}))
                if module is not 'Radiative':
                    Hlt2Line(module + line + 'Turbo',
                             prescale=self.prescale,
                             algos=algos['Turbo'],
                             postscale=self.postscale,
                             Turbo=True)
                else:
                    Hlt2Line(line + 'Turbo',
                             prescale=self.prescale,
                             algos=algos['Turbo'],
                             postscale=self.postscale,
                             Turbo=True)

                if module is 'DiMuon':
                    if line is 'JPsi':
                        HltANNSvc().Hlt2SelectionID.update({
                            'Hlt2' + module + line + 'Turbo' + 'Decision':
                            50212
                        })
                elif module is 'Radiative':
                    if line is 'RadiativeB2GammaGamma':
                        HltANNSvc().Hlt2SelectionID.update(
                            {'Hlt2' + line + 'Turbo' + 'Decision': 50213})
Exemplo n.º 6
0
def upANN():
    from Configurables import HltANNSvc
    if "PatForwardTool/PestiForward" in HltANNSvc().InfoID:
        print "It is certainly there in InfoID!!", HltANNSvc(
        ).InfoID["PatForwardTool/PestiForward"]
    if "PatForwardTool/PestiForward" in HltANNSvc().Hlt1SelectionID:
        print "It is certainly there in SelectionID!!", HltANNSvc(
        ).Hlt1SelectionID["PatForwardTool/PestiForward"]
    HltANNSvc().Hlt1SelectionID["PatForwardTool/PestiForward"] = 106302
    HltANNSvc().InfoID["PatForwardTool/PestiForward"] = 6302
Exemplo n.º 7
0
 def __apply_configuration__(self):
     from HltLine.HltLine import Hlt2Line
     from Stages import CreatePions, JpsiReFitPVsFilter
     stages = {
         'CreateReco': [CreatePions("AllOfThem")],
         'JPsiReFitPVsTurbo': [JpsiReFitPVsFilter("JpsiReFitPVsFilter")]
     }
     for nickname, algos in self.algorithms(stages):
         if nickname is 'JPsiReFitPVsTurbo':
             HltANNSvc().Hlt2SelectionID.update(
                 {"Hlt2JPsiReFitPVsTurboDecision": 57221})
             Hlt2Line(nickname,
                      prescale=self.prescale,
                      algos=algos,
                      postscale=self.postscale,
                      Turbo=True)
         else:
             Hlt2Line(nickname,
                      priority=1,
                      prescale=self.prescale,
                      algos=algos,
                      postscale=self.postscale)
Exemplo n.º 8
0
    def configureANNSelections(self):
        """
        Assigned numbers configuration
        """

        ### TODO: use the computed indices available from the lines...
        ### TODO: what about shared selections??? (which appear with multiple indices!)
        ###       but which have names not prefixed by the line name
        ### Make sure that the ANN Svc has everything it will need
        from HltLine.HltLine import hlt1Selections, hlt1Decisions
        from HltLine.HltLine import hlt2Selections, hlt2Decisions
        from Configurables import HltANNSvc
        hltSelections = {
            'Hlt1': (hlt1Selections(), hlt1Decisions(), 1000, 11000),
            'Hlt2': (hlt2Selections(), hlt2Decisions(), 5000, 50000)
        }
        for stage, (selections, decisions, decStart,
                    selStart) in hltSelections.iteritems():
            ids = getattr(HltANNSvc(), '%sSelectionID' % stage)
            missing = [
                i for i in sorted(set(selections['Output']) - set(ids.keys()))
                if not i.startswith('TES:')
            ]
            missing += [i for i in sorted(set(decisions) - set(ids.keys()))]
            missing = sorted(list(set(missing)))
            missingDecisions = [i for i in missing if i.endswith('Decision')]
            __updateDict__(ids, decStart, missingDecisions)
            missingSelections = [
                i for i in missing if not i.endswith('Decision')
            ]
            __updateDict__(ids, selStart, missingSelections)
            log.warning('# added %d %s selections to HltANNSvc' %
                        (len(missingSelections), stage))
            log.warning('# added %d %s decisions to HltANNSvc' %
                        (len(missingDecisions), stage))

        if self.getProp('PruneHltANNSvc'):
            # prune all Decisions which are not members of Htl1 or Hlt2...
            def genName(c):
                if type(c) != str: c = c.name()
                return '%sDecision' % c

            for stage in ('Hlt1', 'Hlt2'):
                decnames = set([genName(i) for i in Sequence(stage).Members])
                # remove 'stale' entries
                ids = getattr(HltANNSvc(), '%sSelectionID' % stage)
                extradecnames = [
                    i for i in ids.keys()
                    if i.endswith('Decision') and i not in decnames
                ]
                #print 'stale %s entries : %s ' % (stage, extradecnames)
                for i in extradecnames:
                    del ids[i]
                setattr(HltANNSvc(), '%sSelectionID' % stage, ids)

        # given that both Hlt1 and Hlt2 end up in the same rawbank, and thus
        # effectively 'share a namespace' we MUST make sure that there is no overlap
        # between Hlt1SelectionID and Hlt2SelectionID -- because if there is, on
        # decoding, the Hlt1SelectionID _will_ be used... (as all the decoding knows
        # is the number, and it first checks Hlt1SelectionID).
        overlap = set(HltANNSvc().Hlt1SelectionID.values()).intersection(
            HltANNSvc().Hlt2SelectionID.values())
        if overlap:
            raise RuntimeError, ' # Hlt1 and Hlt2 have overlapping ID values: %s -- this will cause problems when decoding the raw bank' % overlap
    (1, 2), bankTypes, ((decoders, "Decoder"), (encoders, "Writer"))):
    algType = "Hlt{0}Reports{1}".format(t, at)
    algName = "Hlt{0}{1}Reports{2}".format(stage, t, at)
    conf = getattr(Configurables, algType)(algName)
    conf.SourceID = stage
    conf.setProp("{0}Hlt{1}ReportsLocation".format(locs[at], t),
                 "Hlt{0}/{1}Reports".format(stage, t))
    seq.Members.append(conf.getFullName())

for atype in bankTypes:
    bank = "Hlt" + atype + "Reports"
    dump.RawBanks.append(bank)
    killer.BankTypes.append(bank)

from Configurables import HltANNSvc
HltANNSvc().Hlt1SelectionID = {'PV3D': 10103, 'ProtoPV3D': 10117}
HltANNSvc().Hlt2SelectionID = {'PV3D': 50103, 'ProtoPV3D': 50117}

killer2.BankTypes = killer.BankTypes + ["ODIN"]
killer2.DefaultIsKill = True

ApplicationMgr().TopAlg += [dump, decoders, killer, encoders, killer2]

#writer
from GaudiConf import IOHelper
from Configurables import LHCb__MDFWriter
IOHelper('MDF', 'MDF').outStream("rewritten.mdf",
                                 LHCb__MDFWriter("writer", Compress=0),
                                 writeFSR=False)

#inputfile
Exemplo n.º 10
0
    def __apply_configuration__(self):
        from Stages import DetachedLLFilter, BCombiner, JPsiMuMuPosTagged, JPsiMuMuNegTagged, \
            JPsiEEPosTagged, JPsiEENegTagged, JPsiEEL0PosTagged, JPsiEEL0NegTagged, \
            PhiMuMuPosTagged, PhiMuMuNegTagged, KSFilter, BachelorPions, SharedSoftPions, \
            LambdaFilter, Lc2KPPi, D02K3Pi, D02KPi, Lc2KPPi_Prompt, BachelorKaons, BachelorMuons, \
            JPsiPPPosTagged, JPsiPPNegTagged, UnbiasedPhiKK, PhiKKPosTagged, PhiKKNegTagged, \
            Ds2KKPi_PKTag, Ds2MuMuPi_MuPTag, Ds2MuMuPi_MuMTag
        from Inputs import KsLL, KsDD, LambdaLL, LambdaDD

        from Hlt2Lines.CharmHad.Stages import TagDecay

        ds2phipi = "[D_s+ -> phi(1020) pi+]cc"
        stagemap = {
            'Muon': {
                'DetJPsiMuMuPosTagged': [
                    DetachedLLFilter("JPsiMuMuPos",
                                     JPsiMuMuPosTagged,
                                     nickname="JPsiMuMu")
                ],
                'DetJPsiMuMuNegTagged': [
                    DetachedLLFilter("JPsiMuMuNeg",
                                     JPsiMuMuNegTagged,
                                     nickname="JPsiMuMu")
                ],
                'DetPhiMuMuPosTagged': [
                    DetachedLLFilter("PhiMuMuPos",
                                     PhiMuMuPosTagged,
                                     nickname="PhiMuMu")
                ],
                'DetPhiMuMuNegTagged': [
                    DetachedLLFilter("PhiMuMuNeg",
                                     PhiMuMuNegTagged,
                                     nickname="PhiMuMu")
                ],
                'B2KJPsiMuMuPosTagged': [
                    BCombiner("JPsiMuMuPos",
                              [JPsiMuMuPosTagged, BachelorKaons],
                              nickname="JPsiMuMu")
                ],
                'B2KJPsiMuMuNegTagged': [
                    BCombiner("JPsiMuMuNeg",
                              [JPsiMuMuNegTagged, BachelorKaons],
                              nickname="JPsiMuMu")
                ],
                'Ds2PiPhiMuMuPosTagged': [
                    BCombiner('PhiMuMuPos', [PhiMuMuPosTagged, BachelorPions],
                              nickname="PhiMuMu",
                              decay=ds2phipi)
                ],
                'Ds2PiPhiMuMuNegTagged': [
                    BCombiner('PhiMuMuNeg', [PhiMuMuNegTagged, BachelorPions],
                              nickname="PhiMuMu",
                              decay=ds2phipi)
                ],
            },
            'Electron': {
                'DetJPsiEEPosTagged': [
                    DetachedLLFilter("JPsiEEPos",
                                     JPsiEEPosTagged,
                                     nickname="JPsiEE")
                ],
                'DetJPsiEENegTagged': [
                    DetachedLLFilter("JPsiEENeg",
                                     JPsiEENegTagged,
                                     nickname="JPsiEE")
                ],
                'B2KJPsiEEPosTagged': [
                    BCombiner('JPsiEEPos', [JPsiEEPosTagged, BachelorKaons],
                              nickname="JPsiEE")
                ],
                'B2KJPsiEENegTagged': [
                    BCombiner('JPsiEENeg', [JPsiEENegTagged, BachelorKaons],
                              nickname="JPsiEE")
                ]
            },
            'ElectronFromL0': {
                'DetJPsiEEL0PosTagged': [
                    DetachedLLFilter("JPsiEEL0Pos",
                                     JPsiEEL0PosTagged,
                                     nickname="JPsiEE")
                ],
                'DetJPsiEEL0NegTagged': [
                    DetachedLLFilter("JPsiEEL0Neg",
                                     JPsiEEL0NegTagged,
                                     nickname="JPsiEE")
                ],
                'B2KJPsiEEL0PosTagged': [
                    BCombiner('JPsiEEL0Pos',
                              [JPsiEEL0PosTagged, BachelorKaons],
                              nickname="JPsiEE")
                ],
                'B2KJPsiEEL0NegTagged': [
                    BCombiner('JPsiEEL0Neg',
                              [JPsiEEL0NegTagged, BachelorKaons],
                              nickname="JPsiEE")
                ]
            },
            'Other': {
                'Ks2PiPiLL': [KSFilter('Ks2PiPiLL', KsLL)],
                'Ks2PiPiDD': [KSFilter('Ks2PiPiDD', KsDD)],
                'Lambda2PPiLL': [LambdaFilter('Lambda2PPiLL', LambdaLL)],
                'Lambda2PPiDD': [LambdaFilter('Lambda2PPiDD', LambdaDD)],
                'Lambda2PPiLLhighPT':
                [LambdaFilter('Lambda2PPiLLhighPT', LambdaLL)],
                'Lambda2PPiDDhighPT':
                [LambdaFilter('Lambda2PPiDDhighPT', LambdaDD)],
                'Lambda2PPiLLveryhighPT':
                [LambdaFilter('Lambda2PPiLLveryhighPT', LambdaLL)],
                'Lambda2PPiDDveryhighPT':
                [LambdaFilter('Lambda2PPiDDveryhighPT', LambdaDD)],
                'Lambda2PPiLLisMuon':
                [LambdaFilter('Lambda2PPiLLisMuon', LambdaLL, ismuon=True)],
                'Lambda2PPiDDisMuon':
                [LambdaFilter('Lambda2PPiDDisMuon', LambdaDD, ismuon=True)],
                'DetJPsiPPPosTagged': [
                    DetachedLLFilter("JPsiPPPos",
                                     JPsiPPPosTagged,
                                     nickname="JPsiPP")
                ],
                'DetJPsiPPNegTagged': [
                    DetachedLLFilter("JPsiPPNeg",
                                     JPsiPPNegTagged,
                                     nickname="JPsiPP")
                ],
                'B2KJPsiPPPosTagged': [
                    BCombiner('JPsiPPPos', [JPsiPPPosTagged, BachelorKaons],
                              nickname="JPsiPP")
                ],
                'B2KJPsiPPNegTagged': [
                    BCombiner('JPsiPPNeg', [JPsiPPNegTagged, BachelorKaons],
                              nickname='JPsiPP')
                ],
                'Lb2LcPi': [
                    BCombiner('Lb2LcPi', [Lc2KPPi, BachelorPions],
                              decay='[Lambda_b0 -> Lambda_c+ pi-]cc')
                ],
                'Lb2LcMuNu': [
                    BCombiner('Lb2LcMuNu', [Lc2KPPi, BachelorMuons],
                              decay='[Lambda_b0 -> Lambda_c+ mu-]cc',
                              corrm=True)
                ],
                'Lc2KPPi': [Lc2KPPi_Prompt
                            ],  # new inclusive Lc line without Sc0,++ tag.
                'Ds2KKPiSSTagged': [Ds2KKPi_PKTag],
                'Ds2MuMuPiPosTagged': [Ds2MuMuPi_MuPTag],
                'Ds2MuMuPiNegTagged': [Ds2MuMuPi_MuMTag],
                # These next two need shared=True so the Turbo versions don't re-do the combination
                'Sc02LcPi': [
                    TagDecay('PIDSc02LcPi',
                             "[Sigma_c0 -> Lambda_c+ pi-]cc",
                             inputs=[Lc2KPPi_Prompt, SharedSoftPions],
                             nickname='Sc2LcPi',
                             shared=True)
                ],
                'Scpp2LcPi': [
                    TagDecay('PIDScpp2LcPi',
                             "[Sigma_c++ -> Lambda_c+ pi+]cc",
                             inputs=[Lc2KPPi_Prompt, SharedSoftPions],
                             nickname='Sc2LcPi',
                             shared=True)
                ],
                # D0 -> K3pi noPID line
                'D02KPiPiPi': [D02K3Pi],
                'D02KPiPiPiTag': [
                    TagDecay('PIDD02KPiPiPiTag',
                             "[D*(2010)+ -> D0 pi+]cc",
                             inputs=[D02K3Pi, SharedSoftPions],
                             shared=True,
                             nickname='D02KPiPiPiTag')
                ],

                # D0 -> Kpi noPID line
                'D02KPiTag': [
                    TagDecay('PIDD02KPiTag',
                             "[D*(2010)+ -> D0 pi+]cc",
                             inputs=[D02KPi, SharedSoftPions],
                             shared=True,
                             nickname='D02KPiTag')
                ],
                'DetPhiKKUnbiased': [
                    DetachedLLFilter("PhiKKUnbiased",
                                     UnbiasedPhiKK,
                                     nickname="PhiKKUnbiased")
                ],
                'Ds2PiPhiKKUnbiased': [
                    BCombiner("PhiKKUnbiased", [UnbiasedPhiKK, BachelorPions],
                              nickname='PhiKKUnbiased',
                              decay=ds2phipi)
                ],
                'DetPhiKKPosTagged': [
                    DetachedLLFilter("PhiKKPos",
                                     PhiKKPosTagged,
                                     nickname="PhiKK")
                ],
                'DetPhiKKNegTagged': [
                    DetachedLLFilter("PhiKKNeg",
                                     PhiKKNegTagged,
                                     nickname='PhiKK')
                ],
                'Ds2PiPhiKKPosTagged': [
                    BCombiner('PhiKKPos', [PhiKKPosTagged, BachelorPions],
                              nickname="PhiKK",
                              decay=ds2phipi)
                ],
                'Ds2PiPhiKKNegTagged': [
                    BCombiner('PhiKKNeg', [PhiKKNegTagged, BachelorPions],
                              nickname="PhiKK",
                              decay=ds2phipi)
                ]
            }
        }

        from HltLine.HltLine import Hlt2Line
        for turbo in turboversions:
            for category, stages in stagemap.iteritems():
                for (nickname, algos) in self.algorithms(stages):
                    linename = 'PID' + nickname
                    l0reqdict = self.getProp("L0Req")
                    hlt1reqdict = self.getProp('Hlt1Req')
                    l0cuts = l0reqdict.get(nickname,
                                           l0reqdict.get(category, None))
                    hlt1cuts = hlt1reqdict.get(nickname,
                                               hlt1reqdict.get(category, None))
                    doturbo = (len(turbo) > 0)
                    Hlt2Line(linename + turbo,
                             prescale=self.prescale,
                             algos=algos,
                             postscale=self.postscale,
                             L0DU=l0cuts,
                             HLT1=hlt1cuts,
                             Turbo=doturbo)
            from Configurables import HltANNSvc
            HltANNSvc().Hlt2SelectionID.update({
                'Hlt2PID' + n + turbo + 'Decision': v + 200 * (len(turbo) > 0)
                for n, v in {
                    'DetJPsiMuMuPosTagged': 50020,
                    'DetJPsiMuMuNegTagged': 50021,
                    'DetPhiMuMuPosTagged': 50022,
                    'DetPhiMuMuNegTagged': 50023,
                    'B2KJPsiMuMuPosTagged': 50024,
                    'B2KJPsiMuMuNegTagged': 50025,
                    'Ds2PiPhiMuMuPosTagged': 50026,
                    'Ds2PiPhiMuMuNegTagged': 50027,
                    'Lb2LcMuNu': 50028,
                    'DetJPsiEEPosTagged': 50029,
                    'DetJPsiEENegTagged': 50030,
                    'B2KJPsiEEPosTagged': 50031,
                    'B2KJPsiEENegTagged': 50032,
                    'DetJPsiEEL0PosTagged': 50033,
                    'DetJPsiEEL0NegTagged': 50034,
                    'B2KJPsiEEL0PosTagged': 50035,
                    'B2KJPsiEEL0NegTagged': 50036,
                    'Ks2PiPiLL': 50037,
                    'Ks2PiPiDD': 50038,
                    'Lambda2PPiLL': 50039,
                    'Lambda2PPiDD': 50040,
                    'Lambda2PPiLLhighPT': 50041,
                    'Lambda2PPiDDhighPT': 50042,
                    'Lambda2PPiLLisMuon': 50043,
                    'Lambda2PPiDDisMuon': 50044,
                    'Lb2LcPi': 50045,
                    'Sc02LcPi': 50046,
                    'Scpp2LcPi': 50047,
                    'D02KPiPiPi': 50048,
                    'D02KPiPiPiTag': 50049,
                    'D02KPiTag': 50050,
                    'Lambda2PPiLLveryhighPT': 50051,
                    'Lambda2PPiDDveryhighPT': 50052,
                    'DetJPsiPPPosTagged': 50053,
                    'DetJPsiPPNegTagged': 50054,
                    'B2KJPsiPPPosTagged': 50055,
                    'B2KJPsiPPNegTagged': 50056,
                    'DetPhiKKUnbiased': 50057,
                    'Ds2PiPhiKKUnbiased': 50058,
                    'DetPhiKKPosTagged': 50059,
                    'DetPhiKKNegTagged': 50060,
                    'Ds2PiPhiKKPosTagged': 50061,
                    'Ds2PiPhiKKNegTagged': 50062,
                    'Lc2KPPi': 50063
                }.iteritems()
            })
Exemplo n.º 11
0
    def __configureRoutingBits(self, streams):
        """
        Configuration of HLT Routing bits, there are 96 bits in total.
        These bits are used in the DAQ to route events.
         0- 7 : reserved for ODIN
         8-31: reserved for L0
        32-63: reserved for Hlt1
        64-96: reserved for Hlt2

        NOTE: All bits are defined in an EDMS document:
              https://edms.cern.ch/document/1146861/1.3
        NOTE: any change in the _meaning_ of any of the routing bits needs to be
              communicated with online, alignment and offline, to ensure the events
              are still properly routed!!!
        """

        from Hlt1Lines.HltL0Candidates import L0Channels

        from Configurables import HltRoutingBitsWriter
        # note: 'Decision' at the end is needed to _exclude_Hlt1Global

                      # RB 33 Lumi after HLT1
        routingBits = { 33 : "HLT_PASS_RE('^Hlt1Lumi.*Decision$')"
                      # RB 35 Beam-Gas for Velo alignment
                      , 35 : "HLT_PASS_RE('Hlt1BeamGas.*Decision')"
                      # RB 40 Velo (closing) monitoring
                      , 40 : "HLT_PASS_RE('Hlt1(Velo|BeamGas).*Decision')"
                      # RB 46 HLT1 physics for monitoring and alignment
                      , 46 : "HLT_PASS_RE('Hlt1(?!ODIN)(?!L0)(?!Lumi)(?!Tell1)(?!MB)(?!NZS)(?!Velo)(?!BeamGas)(?!Incident).*Decision')"
                      # RB 48 NoBias, prescaled
                      , 48 : "HLT_PASS('Hlt1MBNoBiasDecision')"
                      # RB 53 Tracker alignment
                      , 53 : "HLT_PASS_RE('Hlt1Calib(TrackingKPiDetached|HighPTLowMultTrks)Decision')"
                      # RB 54 RICH mirror alignment
                      , 54 : "HLT_PASS_RE('Hlt1CalibRICH.*Decision')"
                      # RB 55 NoBias, rate-limited
                      , 55 : "HLT_PASS('Hlt1MBNoBiasRateLimitedDecision')"
                      # RB 56 Muon alignment
                      , 56 : "HLT_PASS('Hlt1CalibMuonAlignJpsiDecision')"
                      # RB 57 Tell1 Error events
                      , 57 : "HLT_PASS('Hlt1Tell1ErrorDecision')"
                      # 64--96: Hlt2
                      # RB 85 Turbo stream with full raw event
                      , 85 : "HLT_TURBOPASS_RE('^Hlt2.*(?!TurboCalib)Decision$')"
                      # RB 86 BEAMGAS stream
                      , 86 : "HLT_PASS_SUBSTR('Hlt2BeamGas')"
                      # RB 87 for the full (non-turbo(calib)) stream
                      , 87 : "HLT_NONTURBOPASS_RE('Hlt2(?!BeamGas)(?!Lumi).*Decision')"
                      # RB 88 for Turbo stream, includes lumi events.
                      # this now excludes turbocalib events which have their own stream/routing bit
                      , 88 : "HLT_TURBOPASS_RE('^Hlt2.*(?!TurboCalib)Decision$')"
                      # RB 89 for the parked stream; reserved but not set for now
                      # RB 90 for TurboCalib stream, includes lumi events.
                      , 90 : "HLT_TURBOPASS_RE('^Hlt2.*TurboCalibDecision$')"
                      # RB 91 for the NOBIAS stream
                      , 91 : "HLT_PASS('Hlt2MBNoBiasDecision')"
                      # RB 92 for online DQ on HLT2 output
                      , 92 : "HLT_PASS('Hlt2(%s)Decision')" % '|'.join(self.getProp("Hlt2LinesForDQ"))
                      # RB 93 for SMOG physics; reserved
                      # RB 94 LUMI stream
                      , 94 : self.getProp('LumiPredicate')
                      # RB 95 Reserved for not-lumi-exclusive, set stream-by-stream
                      }

        ## Update routing bits in case of non-standard expressions
        for stream, (bit, expr, on) in streams.items():
            if expr == None and on:
                if bit not in routingBits:
                    log.fatal("Attempt to enable %s stream with the default expression, which is not defined." % stream)
                    raise RuntimeError
            elif on:
                log.warning( 'Setting non standard routing bit expression for %s stream' % stream)
                log.warning( 'Now:     %s' % expr)
                log.warning( 'Default: %s' % routingBits.get(bit, "Disabled"))
                log.warning( '##########################################################' )
                routingBits[bit] = expr
            elif bit in routingBits:
                # Stream is disabled, remove the preset bit
                routingBits.pop(bit)

        ## Record the settings in the ANN service
        from Configurables       import HltANNSvc
        if self.getProp("Split") == "Hlt1":
            HltANNSvc().RoutingBits = {v : k for k, v in routingBits.iteritems() if k < 64}
        else :
            HltANNSvc().RoutingBits = {v : k for k,v in routingBits.iteritems()}

        # LoKi::Hybrid::HltFactory is what RoutingBitsWriter uses as predicate factory..
        # make sure 'strings' is known...
        # make sure 'RATE,SCALE and SKIP' are known...
        from Configurables import LoKi__Hybrid__HltFactory as HltFactory
        HltFactory('ToolSvc.LoKi::Hybrid::HltFactory').Modules += [ 'LoKiCore.functions', 'LoKiNumbers.sources' ]
        #  forward compatibility: HltFactory will become private for HltRoutingBitsWriter...

        # and, last but not least, tell the writers what they should write..
        HltRoutingBitsWriter('Hlt1RoutingBitsWriter').RoutingBits = {k : v for k, v in routingBits.iteritems() if k < 64}
        HltFactory('Hlt1RoutingBitsWriter.LoKi::Hybrid::HltFactory').Modules += [ 'LoKiCore.functions', 'LoKiNumbers.sources' ]

        return routingBits
Exemplo n.º 12
0
from Configurables import Tesla
from Gaudi.Configuration import *

from Configurables import RecombineRawEvent, DecodeRawEvent
RecombineRawEvent()
DecodeRawEvent().DataOnDemand = True

## Tell HltANNSvc the ID of your line
# NEEDED WHEN NOT RUNNING FROM A TCK
# YOU CAN FIND THE ID IN THE PYTHON IMPLEMENTATION
# IN Hlt/Hlt2Lines
from Configurables import HltANNSvc
Hlt2ID = HltANNSvc().Hlt2SelectionID
if "Hlt2Global" not in Hlt2ID: Hlt2ID.update({"Hlt2Global": 2})
HltANNSvc().Hlt1SelectionID = {'PV3D': 10103, 'ProtoPV3D': 10117}
Hlt2ID.update({
    'Hlt2IncPhiDecision': 50000,
    'Hlt2IncPhiSidebandsDecision': 50003,
    'Hlt2IncPhiTrackFitDecision': 50002
})
#from Configurables import ConfigTarFileAccessSvc
#ConfigTarFileAccessSvc().File='/afs/cern.ch/user/s/sbenson/cmtuser/Moore_v23r2/TCKData/config.tar'

Tesla().TriggerLines = ["Hlt2IncPhi"]  # Enter your trigger line here
Tesla().EvtMax = -1
Tesla().OutputLevel = DEBUG

from GaudiConf.IOHelper import IOHelper
ioh = IOHelper()
ioh.setupServices()
ioh.inputFiles(["/PATH/TO/INPUT"])
Exemplo n.º 13
0
from Configurables import HltANNSvc

# 11K - 20K : added automatically by configuration...
# 50K+ : used by Hlt2

# Hlt1Global is hardcoded in the C++ to 1
# PV3D needs to be added explicitly
HltANNSvc().Hlt1SelectionID.update({"Hlt1Global": 1, 'PV3D': 10103})

# Hlt2 selection IDs. The one for Hlt2Global is hardcoded in the SelReportsMaker.
# The others are selections that are not created by trigger lines.
HltANNSvc().Hlt2SelectionID.update({
    'Hlt2Global': 2,
    'PV3D': 50103,
    '_RefitPVs': 50104,
    'Hlt2RecSummary': 65000
})

#/ generated by parsing the logfile, of a job _without_ explicitly specified
#/ InfoID, with:
#/ awk 'BEGIN{n="foo"}/autogenerated: InfoID/{if (substr($6,0,length(n))!=n) {n=$6; i =(1+int(i/100))*100} ; print sprintf( "    %-40s: %4d,","\""$6"\"",++i)}' logfile

##
## InfoID below 1000 is reserved for the tracking reconstruction group (JAH 020409)
##
HltANNSvc().InfoID = {
    "FitIP": 1001,
    "FitTrack": 1003,
    "FitIP_PV3D": 1004,
    "AntiEleConf": 1101,
    "Calo3DChi2": 1301,