Exemplo n.º 1
0
def InDetGeometryCfg(flags):
    acc = ComponentAccumulator()
    from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
    acc.merge(PixelGeometryCfg(flags))
    from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg
    acc.merge(SCT_GeometryCfg(flags))
    if not flags.GeoModel.Run == "RUN4":
        from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg
        acc.merge(TRT_GeometryCfg(flags))
    acc.merge(InDetServiceMaterialCfg(flags))
    return acc
Exemplo n.º 2
0
def PrepareStandAloneBTagCfg(inputFlags):
    result = ComponentAccumulator()

    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
    result.merge(PoolReadCfg(inputFlags))

    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
    acc = TrackingGeometrySvcCfg(inputFlags)
    result.merge(acc)

    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    result.merge(MuonGeoModelCfg(inputFlags))

    GeometryDBSvc = CompFactory.GeometryDBSvc
    result.addService(GeometryDBSvc("InDetGeometryDBSvc"))

    from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
    result.merge(PixelGeometryCfg(inputFlags))

    # get standard config for magnetic field - map and cache
    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    result.merge(MagneticFieldSvcCfg(inputFlags))

    from IOVDbSvc.IOVDbSvcConfig import addFolders, addFoldersSplitOnline

    #load folders needed for Run2 ID alignment
    result.merge(
        addFoldersSplitOnline(inputFlags,
                              "INDET",
                              "/Indet/Onl/Align",
                              "/Indet/Align",
                              className="AlignableTransformContainer"))
    result.merge(addFolders(inputFlags, ['/TRT/Align'], 'TRT_OFL'))

    #load folders needed for IBL
    result.merge(addFolders(inputFlags, ['/Indet/IBLDist'], 'INDET_OFL'))

    return result
Exemplo n.º 3
0
def InDetClusterizationAlgorithmsCfg(flags, **kwargs):
    top_acc = ComponentAccumulator()
    ### configure top_acc to be able to read input file
    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
    top_acc.merge(PoolReadCfg(flags))

    ### obtain pixel and SCT geometry
    from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
    from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg
    top_acc.merge(PixelGeometryCfg(flags))
    top_acc.merge(SCT_GeometryCfg(flags))

    #redoPatternRecoAndTracking = kwargs.pop('redoPatternRecoAndTracking')
    # @TODO propagate suffix and/or prefix ?
    top_acc.merge(BCM_ZeroSuppressionCfg(flags))

    # Pixel clusterization
    ## @TODO is this correct flag to be used here to turn on pixel clusterization
    if flags.Detector.GeometryPixel:
        top_acc.merge(PixelClusterizationCfg(flags, **kwargs))
        if flags.InDet.doSplitReco:
            top_acc.merge(PixelClusterizationPUCfg(flags, **kwargs))

    # SCT clusterization
    ## @TODO is this correct flag to be used here to turn on SCT clusterization
    if flags.Detector.GeometrySCT:
        top_acc.merge(SCTClusterizationCfg(flags, **kwargs))
        if flags.InDet.doSplitReco:
            top_acc.merge(SCTClusterizationPUCfg(flags, **kwargs))

    # from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg
    # top_acc.merge( PixelConditionsSummaryCfg(flags))
    # FIXME - the above returns a tool. Need to do something with it!

    from SiLorentzAngleTool.SCT_LorentzAngleConfig import SCT_LorentzAngleCfg
    top_acc.popToolsAndMerge(SCT_LorentzAngleCfg(flags))
    return top_acc
Exemplo n.º 4
0
def PixelDigitizationBasicToolCfg(flags,
                                  name="PixelDigitizationBasicTool",
                                  **kwargs):
    """Return ComponentAccumulator with configured PixelDigitizationTool"""
    acc = PixelGeometryCfg(flags)

    # module parameters
    acc.merge(
        PixelConfigCondAlgCfg(flags,
                              UseCalibConditions=True,
                              UseDeadmapConditions=True,
                              UseDCSStateConditions=False,
                              UseDCSStatusConditions=False,
                              UseDCSHVConditions=True,
                              UseDCSTemperatureConditions=True,
                              UseTDAQConditions=False))
    # charge calibration
    acc.merge(PixelChargeCalibCondAlgCfg(flags))
    # NEW FOR RUN3    acc.merge(PixelChargeLUTCalibCondAlgCfg(flags))
    # DCS setup
    acc.merge(PixelDCSCondHVAlgCfg(flags))
    acc.merge(PixelDCSCondTempAlgCfg(flags))
    # cabling setup
    acc.merge(PixelHitDiscCnfgAlgCfg(flags))
    acc.merge(PixelReadoutSpeedAlgCfg(flags))
    acc.merge(PixelCablingCondAlgCfg(flags))
    # deadmap
    acc.merge(PixelDCSCondStateAlgCfg(flags))
    acc.merge(PixelDCSCondStatusAlgCfg(flags))
    # NEW FOR RUN3    acc.merge(PixelDeadMapCondAlgCfg(flags))
    # offline calibration
    acc.merge(PixelDistortionAlgCfg(flags))
    acc.merge(PixelOfflineCalibCondAlgCfg(flags))

    acc.popToolsAndMerge(PixelConditionsSummaryCfg(flags))
    acc.popToolsAndMerge(PixelSiPropertiesCfg(flags))
    acc.popToolsAndMerge(PixelLorentzAngleCfg(flags))
    acc.merge(PixelCablingSvcCfg(flags))

    # set up tool handle lists
    chargeTools = []
    feSimTools = []
    chargeTools.append(acc.popToolsAndMerge(SensorSimPlanarToolCfg(flags)))
    if flags.GeoModel.Run == "RUN4":
        feSimTools.append(BarrelRD53SimToolCfg(flags))
        feSimTools.append(EndcapRD53SimToolCfg(flags))
    else:
        chargeTools.append(acc.popToolsAndMerge(SensorSim3DToolCfg(flags)))
        feSimTools.append(BarrelFEI4SimToolCfg(flags))
        feSimTools.append(DBMFEI4SimToolCfg(flags))
        feSimTools.append(BarrelFEI3SimToolCfg(flags))
        feSimTools.append(EndcapFEI3SimToolCfg(flags))
    kwargs.setdefault("InputObjectName", "PixelHits")
    kwargs.setdefault("ChargeTools", chargeTools)
    kwargs.setdefault("FrontEndSimTools", feSimTools)
    kwargs.setdefault("EnergyDepositionTool", EnergyDepositionToolCfg(flags))
    if flags.Digitization.DoXingByXingPileUp:
        kwargs.setdefault("FirstXing", Pixel_FirstXing(flags))
        kwargs.setdefault("LastXing", Pixel_LastXing(flags))

    PixelDigitizationTool = CompFactory.PixelDigitizationTool
    acc.setPrivateTools(PixelDigitizationTool(name, **kwargs))
    return acc
Exemplo n.º 5
0
def MuonCombinedReconstructionCfg(flags):
    result = ComponentAccumulator()

    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
    result.merge(GeoModelCfg(flags))

    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    result.merge(MuonGeoModelCfg(flags))

    from LArGeoAlgsNV.LArGMConfig import LArGMCfg
    result.merge(LArGMCfg(flags))

    from TileGeoModel.TileGMConfig import TileGMCfg
    result.merge(TileGMCfg(flags))

    from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
    result.merge(BeamPipeGeometryCfg(flags))

    from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
    result.merge(PixelGeometryCfg(flags))

    from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg
    result.merge(SCT_GeometryCfg(flags))

    from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg
    result.merge(TRT_GeometryCfg(flags))

    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
    result.merge(TrackingGeometrySvcCfg(flags))

    muon_edm_helper_svc = CompFactory.Muon.MuonEDMHelperSvc("MuonEDMHelperSvc")
    result.addService(muon_edm_helper_svc)

    # Set up to read Tracks.
    from TrkConfig.TrackCollectionReadConfig import TrackCollectionReadCfg
    result.merge(TrackCollectionReadCfg(flags, 'Tracks'))

    result.merge(MuonCombinedInDetCandidateAlg(flags))
    result.merge(MuonCombinedMuonCandidateAlgCfg(flags))

    if flags.MuonCombined.doStatisticalCombination or flags.MuonCombined.doCombinedFit:
        result.merge(MuonCombinedAlgCfg(flags))

    if flags.MuonCombined.doMuGirl:
        result.merge(
            MuonInsideOutRecoAlgCfg(flags, name="MuonInsideOutRecoAlg"))
        if flags.MuonCombined.doMuGirlLowBeta:
            result.merge(MuGirlStauAlgCfg)

    if flags.MuonCombined.doCaloTrkMuId:
        result.merge(MuonCaloTagAlgCfg(flags))

    if flags.MuonCombined.doMuonSegmentTagger:
        result.merge(MuonSegmentTagAlgCfg(flags))

    # runs over outputs and create xAODMuon collection
    acc = MuonCreatorAlgCfg(flags)
    result.merge(acc)

    if flags.MuonCombined.doMuGirl and flags.MuonCombined.doMuGirlLowBeta:
        # Has to be at end if not using sequencer. If we drop this requirement, can be moved above
        result.merge(StauCreatorAlgCfg(flags))

    return result
Exemplo n.º 6
0
def TPCnvTest(infile,
              keys,
              useGeoModelSvc=False,
              useIOVDbSvc=False,
              doPixel=False,
              doSCT=False,
              doTRT=False,
              doLAr=False,
              doTile=False,
              doMuon=False):
    # Make sure we don't have a stale file catalog.
    if os.path.exists('PoolFileCatalog.xml'):
        os.remove('PoolFileCatalog.xml')

    if ('ATLAS_REFERENCE_TAG' not in globals()
            and 'ATLAS_REFERENCE_TAG' in os.environ):
        ATLAS_REFERENCE_TAG = os.environ['ATLAS_REFERENCE_TAG']  # noqa: F841

    refpaths = [
        os.environ.get('ATLAS_REFERENCE_DATA', None),
        '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art',
        '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs',
        '/afs/cern.ch/atlas/maxidisk/d33/referencefiles'
    ]

    if infile.startswith('rtt:'):
        infile = infile[4:]
    infile = find_file(infile, refpaths)

    # Provide MC input
    ConfigFlags.Input.Files = [infile]
    ConfigFlags.GeoModel.AtlasVersion = 'ATLAS-R1-2012-03-01-00'
    ConfigFlags.GeoModel.Align.Dynamic = False
    ConfigFlags.Detector.GeometryPixel = doPixel
    ConfigFlags.Detector.GeometrySCT = doSCT
    ConfigFlags.Detector.GeometryTRT = doTRT
    ConfigFlags.Detector.GeometryLAr = doLAr
    ConfigFlags.Detector.GeometryTile = doTile
    ConfigFlags.Detector.GeometryMuon = doMuon
    ConfigFlags.lock()

    # Construct ComponentAccumulator
    acc = MainServicesCfg(ConfigFlags)
    acc.merge(PoolReadCfg(ConfigFlags))
    if useIOVDbSvc:
        acc.merge(IOVDbSvcCfg(ConfigFlags))
    if useGeoModelSvc:
        if ConfigFlags.Detector.GeometryPixel:
            acc.merge(PixelGeometryCfg(ConfigFlags))
            useGeoModelSvc = True
        if ConfigFlags.Detector.GeometrySCT:
            acc.merge(SCT_GeometryCfg(ConfigFlags))
            useGeoModelSvc = True
        if ConfigFlags.Detector.GeometryTRT:
            acc.merge(TRT_GeometryCfg(ConfigFlags))
            useGeoModelSvc = True
        if ConfigFlags.Detector.GeometryLAr:
            acc.merge(LArGMCfg(ConfigFlags))
            useGeoModelSvc = True
        if ConfigFlags.Detector.GeometryTile:
            acc.merge(TileGMCfg(ConfigFlags))
            useGeoModelSvc = True
        if ConfigFlags.Detector.GeometryMuon:
            acc.merge(MuonGeoModelCfg(ConfigFlags))
            useGeoModelSvc = True
        #acc.merge(ForDetGeometryCfg(ConfigFlags))
        acc.merge(GeoModelCfg(ConfigFlags))
        acc.getService("GeoModelSvc").IgnoreTagDifference = True
    acc.addEventAlgo(
        Dumper('dumper', ConfigFlags.Input.Files[0], keys, refpaths),
        'AthAlgSeq')
    return acc.run(maxEvents=10)
Exemplo n.º 7
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