예제 #1
0
def generateChainConfigs(chainDict):

    listOfChainDicts = splitChainDict(chainDict)
    log.debug("Will generate Config for monitor chain: %s",
              chainDict['chainName'])

    listOfChainDefs = []

    #streamers will never have more than one chainPart but this is still
    #needed to move to the correct format [{}]->{}
    for subChainDict in listOfChainDicts:

        Monitor = MonitorChainConfiguration(subChainDict).assembleChain()

        listOfChainDefs += [Monitor]
        log.debug('length of chaindefs %s', len(listOfChainDefs))

    if len(listOfChainDefs) > 1:
        log.warning(
            "This is a streamer with more than one chainPart, is this really intended?"
        )
        theChainDef = mergeChainDefs(listOfChainDefs, chainDict)
    else:
        theChainDef = listOfChainDefs[0]

    log.debug("theChainDef %s", theChainDef)

    return theChainDef
예제 #2
0
def generateChainConfigs( chainDict ):
    log.debug('dictionary is: %s\n', pprint.pformat(chainDict))

    
    listOfChainDicts = splitChainDict(chainDict)
    listOfChainDefs = []

    jet = JetChainConfiguration(chainDict).assembleChain()

    for subChainDict in listOfChainDicts:

        Bjet = BjetChainConfiguration(subChainDict).assembleChain() 
        jet.steps = jet.steps + Bjet.steps

        listOfChainDefs += [jet]
        log.debug('length of chaindefs %s', len(listOfChainDefs) )
        

    if len(listOfChainDefs)>1:
        log.warning("Implement case for multi-bjet chain!!") 
        theChainDef = listOfChainDefs[0] #needs to be implemented properly
    else:
        theChainDef = listOfChainDefs[0]

    log.debug("theChainDef: %s" , theChainDef)

    return theChainDef
예제 #3
0
def generateChainConfigs(chainDict):

    listOfChainDicts = splitChainDict(chainDict)
    listOfChainDefs = []

    for subChainDict in listOfChainDicts:
        log.debug('Assembling subChainsDict %s for chain %s',
                  len(listOfChainDefs), subChainDict['chainName'])
        Test = TestChainConfiguration(subChainDict).assembleChain()

        listOfChainDefs += [Test]

    if len(listOfChainDefs) > 1:
        theChainDef = mergeChainDefs(listOfChainDefs, chainDict)
    else:
        theChainDef = listOfChainDefs[0]

    return theChainDef
예제 #4
0
def generateChainConfigs(chainDict):
    log.debug('dictionary is: %s\n', pprint.pformat(chainDict))

    listOfChainDicts = splitChainDict(chainDict)
    listOfChainDefs = []

    for subChainDict in listOfChainDicts:
        log.debug('Assembling subChainsDict %s for chain %s',
                  len(listOfChainDefs), subChainDict['chainName'])
        Photon = PhotonChainConfiguration(subChainDict).assembleChain()

        listOfChainDefs += [Photon]

    if len(listOfChainDefs) > 1:
        theChainDef = mergeChainDefs(listOfChainDefs, chainDict)
    else:
        theChainDef = listOfChainDefs[0]

    return theChainDef
예제 #5
0
def generateChainConfigs(chainDict):

    if not chainDict['topo']:
        log.error('No topo given -> not a bphysics chain...')

    listOfChainDicts = splitChainDict(chainDict)

    listOfChainDefs = []
    for subChainDict in listOfChainDicts:
        subChain = BphysicsChainConfiguration(
            subChainDict).assembleBphysChain()
        listOfChainDefs += [subChain]

    log.debug('length of chaindefs %s', len(listOfChainDefs))

    if len(listOfChainDefs) > 1:
        chainDef = mergeChainDefs(listOfChainDefs, chainDict)
    else:
        chainDef = listOfChainDefs[0]

    log.debug('ChainDef %s', chainDef)
    return chainDef
예제 #6
0
def generateChains( flags, chainDict ):
    chainDict = splitChainDict(chainDict)[0]
    
    # Step 1 (L2MuonSA)
    stepName = getChainStepName('Muon', 1)
    stepReco, stepView = createStepView(stepName)

    acc = ComponentAccumulator()
    acc.addSequence(stepView)

    # Set EventViews for L2MuonSA step
    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import InViewReco
    reco = InViewReco("L2MuFastReco")

    #external data loading to view
    reco.mergeReco( MuFastViewDataVerifier() )


    # decoding
    # Get RPC BS decoder 
    from MuonConfig.MuonBytestreamDecodeConfig import RpcBytestreamDecodeCfg
    rpcAcc = RpcBytestreamDecodeCfg( flags, forTrigger=True )
    rpcAcc.getEventAlgo("RpcRawDataProvider").RoIs = reco.name+"RoIs"
    reco.mergeReco( rpcAcc )

    # Get RPC BS->RDO convertor
    from MuonConfig.MuonRdoDecodeConfig import RpcRDODecodeCfg    
    rpcAcc = RpcRDODecodeCfg( flags, forTrigger=True )
    rpcAcc.getEventAlgo("RpcRdoToRpcPrepData").RoIs = reco.name+"RoIs"
    reco.mergeReco( rpcAcc )

    # Get TGC BS decoder 
    from MuonConfig.MuonBytestreamDecodeConfig import TgcBytestreamDecodeCfg
    tgcAcc = TgcBytestreamDecodeCfg( flags, forTrigger=True )
    tgcAcc.getEventAlgo("TgcRawDataProvider").RoIs = reco.name+"RoIs"
    reco.mergeReco( tgcAcc )

    # Get TGC BS->RDO convertor
    from MuonConfig.MuonRdoDecodeConfig import TgcRDODecodeCfg    
    tgcAcc = TgcRDODecodeCfg( flags, forTrigger=True )
    tgcAcc.getEventAlgo("TgcRdoToTgcPrepData").RoIs = reco.name+"RoIs"
    reco.mergeReco( tgcAcc )

    # Get MDT BS decoder 
    from MuonConfig.MuonBytestreamDecodeConfig import MdtBytestreamDecodeCfg
    mdtAcc = MdtBytestreamDecodeCfg( flags, forTrigger=True )
    mdtAcc.getEventAlgo("MdtRawDataProvider").RoIs = reco.name+"RoIs"
    reco.mergeReco( mdtAcc )

    # Get MDT BS->RDO convertor
    from MuonConfig.MuonRdoDecodeConfig import MdtRDODecodeCfg    
    mdtAcc = MdtRDODecodeCfg( flags, forTrigger=True )
    mdtAcc.getEventAlgo("MdtRdoToMdtPrepData").RoIs = reco.name+"RoIs"
    reco.mergeReco( mdtAcc )

    # Get CSC BS decoder 
    from MuonConfig.MuonBytestreamDecodeConfig import CscBytestreamDecodeCfg
    cscAcc = CscBytestreamDecodeCfg( flags, forTrigger=True )
    cscAcc.getEventAlgo("CscRawDataProvider").RoIs = reco.name+"RoIs"
    reco.mergeReco( cscAcc )

    # Get CSC BS->RDO convertor
    from MuonConfig.MuonRdoDecodeConfig import CscRDODecodeCfg    
    cscAcc = CscRDODecodeCfg( flags, forTrigger=True )
    cscAcc.getEventAlgo("CscRdoToCscPrepData").RoIs = reco.name+"RoIs"
    reco.mergeReco( cscAcc )

    # Get CSC cluster builder
    from MuonConfig.MuonRdoDecodeConfig import CscClusterBuildCfg
    cscAcc = CscClusterBuildCfg( flags, forTrigger=True )
    reco.mergeReco( cscAcc )



    # Get Reco alg of muFast Step in order to set into the view
    algAcc, alg = l2MuFastAlgCfg( flags, roisKey=reco.name+"RoIs")

    l2MuFastAlgAcc = ComponentAccumulator()
    l2MuFastAlgAcc.addEventAlgo(alg)
    
    reco.mergeReco( l2MuFastAlgAcc )
    reco.merge( algAcc )
    #    l2muFastReco = l2MuFastRecoCfg(flags)
    acc.merge( reco, sequenceName=stepReco.getName() )

    ### Set muon step1 ###
    l2muFastHypo = l2MuFastHypoCfg( flags,
                                    name = 'TrigL2MuFastHypo',
                                    muFastInfo = 'MuonL2SAInfo' )

    acc.addEventAlgo(l2muFastHypo, sequenceName=stepView.getName())

    l2muFastSequence = CAMenuSequence( Sequence = reco.sequence(),
                                     Maker = reco.inputMaker(),
                                     Hypo = l2muFastHypo,
                                     HypoToolGen = TrigMufastHypoToolFromDict,
                                     CA = acc )

    l2muFastStep = ChainStep( name=stepName, Sequences=[l2muFastSequence], chainDicts=[chainDict] )

    ### Set muon step2 ###
    # Please set up L2muComb step here

    #EF MS only
    stepEFMSName = getChainStepName('EFMSMuon', 2)
    stepEFMSReco, stepEFMSView = createStepView(stepEFMSName)

    #Clone and replace offline flags so we can set muon trigger specific values
    muonflags = flags.cloneAndReplace('Muon', 'Trigger.Offline.Muon')
    muonflags.Muon.useTGCPriorNextBC=True
    muonflags.Muon.enableErrorTuning=False
    muonflags.Muon.MuonTrigger=True
    muonflags.Muon.SAMuonTrigger=True
    muonflags.lock()

    accMS = ComponentAccumulator()
    accMS.addSequence(stepEFMSView)

    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import InViewReco
    recoMS = InViewReco("EFMuMSReco")
    recoMS.inputMaker().RequireParentView = True
    
    #Probably this block will eventually need to move somewhere more central
    from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
    accMS.merge( BeamPipeGeometryCfg(flags) ) 
    
    from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
    accMS.merge(PixelGeometryCfg(flags))
    
    from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg
    accMS.merge(SCT_GeometryCfg(flags))
    
    from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg
    accMS.merge(TRT_GeometryCfg(flags))
    
    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
    accMS.merge(TrackingGeometrySvcCfg(flags))
    ###################
    
    EFMuonViewDataVerifier = EFMuonViewDataVerifierCfg()
    recoMS.mergeReco(EFMuonViewDataVerifier)

    from MuonConfig.MuonSegmentFindingConfig import MooSegmentFinderAlgCfg
    segCfg = MooSegmentFinderAlgCfg(muonflags,name="TrigMooSegmentFinder",UseTGCNextBC=False, UseTGCPriorBC=False)
    recoMS.mergeReco(segCfg)

    from MuonConfig.MuonTrackBuildingConfig import MuonTrackBuildingCfg
    trkCfg = MuonTrackBuildingCfg(muonflags, name="TrigMuPatTrackBuilder")
    recoMS.mergeReco(trkCfg)

    cnvCfg = MuonTrackParticleCnvCfg(muonflags, name = "TrigMuonTrackParticleCnvAlg")
    recoMS.mergeReco(cnvCfg)

    from MuonCombinedConfig.MuonCombinedReconstructionConfig import MuonCombinedMuonCandidateAlgCfg
    candCfg = MuonCombinedMuonCandidateAlgCfg(muonflags, name = "TrigMuonCandidateAlg")
    recoMS.mergeReco(candCfg)

    from MuonCombinedConfig.MuonCombinedReconstructionConfig import MuonCreatorAlgCfg
    creatorCfg = MuonCreatorAlgCfg(muonflags, name = "TrigMuonCreatorAlg")
    recoMS.mergeReco(creatorCfg)

    accMS.merge(recoMS, sequenceName=stepEFMSReco.getName())

    efmuMSHypo = efMuMSHypoCfg( muonflags,
                                name = 'TrigMuonEFMSonlyHypo',
                                inputMuons = "Muons" )

    accMS.addEventAlgo(efmuMSHypo, sequenceName=stepEFMSView.getName())

    efmuMSSequence = CAMenuSequence( Sequence = recoMS.sequence(),
                                     Maker = recoMS.inputMaker(),
                                     Hypo = efmuMSHypo, 
                                     HypoToolGen = TrigMuonEFMSonlyHypoToolFromDict,
                                     CA = accMS )

    efmuMSStep = ChainStep( name=stepEFMSName, Sequences=[efmuMSSequence], chainDicts=[chainDict] )

    l1Thresholds=[]
    for part in chainDict['chainParts']:
        l1Thresholds.append(part['L1threshold'])
    
    log.debug('dictionary is: %s\n', pprint.pformat(chainDict))


    chain = Chain( name=chainDict['chainName'], L1Thresholds=l1Thresholds, ChainSteps=[ l2muFastStep, efmuMSStep ] )
    return chain