コード例 #1
0
def fatrasConversionCreatorCfg(flags,
                               name="ISF_FatrasConversionCreator",
                               **kwargs):

    mlog = logging.getLogger(name)
    mlog.debug('Start configuration')

    result = ComponentAccumulator()

    result.merge(RNG(flags.Random.Engine))
    kwargs.setdefault("RandomNumberService", result.getService("AthRNGSvc"))
    kwargs.setdefault("RandomStreamName", flags.Sim.Fatras.RandomStreamName)

    result.merge(ParticleBrokerSvcCfg(flags))
    kwargs.setdefault("ParticleBroker",
                      result.getService("ISF_ParticleBrokerSvc"))

    acc = fatrasPhysicsValidationToolCfg(flags)
    phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool')
    result.merge(acc)
    kwargs.setdefault("PhysicsValidationTool", phys_val_cfg)

    kwargs.setdefault("PhysicsProcessCode",
                      14)  # TODO: to be taken from central definition
    kwargs.setdefault("ValidationMode", flags.Sim.ISF.ValidationMode)

    iFatras__PhotonConversionTool = CompFactory.iFatras.PhotonConversionTool
    result.addPublicTool(iFatras__PhotonConversionTool(name=name, **kwargs))

    return result
コード例 #2
0
def fatrasG4HadIntProcessorCfg(flags,
                               name="ISF_FatrasG4HadIntProcessor",
                               **kwargs):
    mlog = logging.getLogger(name)
    mlog.debug('Start configuration')

    result = ComponentAccumulator()

    result.merge(RNG(flags.Random.Engine))
    kwargs.setdefault("RandomNumberService", result.getService("AthRNGSvc"))
    kwargs.setdefault("RandomStreamName", flags.Sim.Fatras.RandomStreamName)

    result.merge(ParticleBrokerSvcCfg(flags))
    kwargs.setdefault("ParticleBroker",
                      result.getService("ISF_ParticleBrokerSvc"))

    acc = TruthServiceCfg(flags)
    kwargs.setdefault("TruthRecordSvc", acc.getPrimary())
    result.merge(acc)

    result.merge(fatrasPhysicsValidationToolCfg(flags))
    phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool')
    kwargs.setdefault("PhysicsValidationTool", phys_val_cfg)

    kwargs.setdefault("ValidationMode", flags.Sim.ISF.ValidationMode)
    kwargs.setdefault("MomentumCut", flags.Sim.Fatras.MomCutOffSec)

    iFatras__G4HadIntProcessor = CompFactory.iFatras.G4HadIntProcessor
    result.addPublicTool(iFatras__G4HadIntProcessor(name=name, **kwargs))

    return result
コード例 #3
0
def testCfg(configFlags):
    result = ComponentAccumulator()

    tool1 = CompFactory.CaloUtils.ToolWithConstantsTestTool \
            ('tool1',
             prefix = 'test.',
             cf1 = 2.5,
             ci1 = 10,
             cb1 = False,
             ca1 = "[3, 4.5, 6]",
             ca2 = "[[4, 5], [6, 7], [9, 8]]")
    result.addPublicTool(tool1)

    tool2 = CompFactory.CaloUtils.ToolWithConstantsTestTool \
            ('tool2',
             CondKey = 'test2Cond',
             DBHandleKey = 'test2Cond',
             prefix = 'test.',
             cf1 = 2.5,
             ci1 = 10,
             ca1 = "[3, 4.5, 6]")
    result.addPublicTool(tool2)

    result.addEventAlgo(TestAlg('TestAlg'))
    return result
コード例 #4
0
def fatrasSimHitCreatorIDCfg(flags,
                             name="ISF_FatrasSimHitCreatorID",
                             **kwargs):
    """Return ISF_FatrasSimHitCreatorID configured with ComponentAccumulator"""

    mlog = logging.getLogger(name)
    mlog.debug('Start configuration')

    result = ComponentAccumulator()

    acc = fatrasHitCreatorPixelCfg(flags)
    pixel_hit_cfg = acc.getPublicTool('ISF_FatrasHitCreatorPixel')
    result.merge(acc)
    kwargs.setdefault("PixelHitCreator", pixel_hit_cfg)

    acc = fatrasHitCreatorSCTCfg(flags)
    sct_hit_cfg = acc.getPublicTool('ISF_FatrasHitCreatorSCT')
    result.merge(acc)
    kwargs.setdefault("SctHitCreator", sct_hit_cfg)

    acc = fatrasHitCreatorTRTCfg(flags)
    trt_hit_cfg = acc.getPublicTool("ISF_FatrasHitCreatorTRT")
    result.merge(acc)
    kwargs.setdefault("TrtHitCreator", trt_hit_cfg)

    kwargs.setdefault("OutputLevel", flags.Exec.OutputLevel)

    iFatras__SimHitCreatorID = CompFactory.iFatras.SimHitCreatorID
    result.addPublicTool(iFatras__SimHitCreatorID(name=name, **kwargs))
    return result
コード例 #5
0
def MuonChi2TrackFitterCfg(flags, name='MuonChi2TrackFitter', **kwargs):
    Trk__KalmanUpdator = CompFactory.Trk.KalmanUpdator
    Trk__GlobalChi2Fitter = CompFactory.Trk.GlobalChi2Fitter
    import MuonConfig.MuonRIO_OnTrackCreatorConfig  # Trying to avoid circular dependencies here

    result = ComponentAccumulator()

    extrapolator_CA = MuonExtrapolatorCfg(flags)
    extrapolator = extrapolator_CA.getPrimary()
    result.addPublicTool(extrapolator)  # TODO remove
    result.merge(extrapolator_CA)

    acc = MuonConfig.MuonRIO_OnTrackCreatorConfig.MuonRotCreatorCfg(flags)
    rotcreator = acc.getPrimary()
    result.merge(acc)

    measurement_updater = Trk__KalmanUpdator()
    result.addPublicTool(measurement_updater)  #FIXME

    kwargs.setdefault("ExtrapolationTool", extrapolator)
    kwargs.setdefault("RotCreatorTool", rotcreator)
    kwargs.setdefault("MeasurementUpdateTool", measurement_updater)
    kwargs.setdefault("StraightLine", False)
    kwargs.setdefault("OutlierCut", 3.0)
    kwargs.setdefault("GetMaterialFromTrack", False)
    kwargs.setdefault("RejectLargeNScat", True)

    # take propagator and navigator from the extrapolator
    kwargs.setdefault("PropagatorTool", extrapolator.Propagators[0])
    kwargs.setdefault("NavigatorTool", extrapolator.Navigator)

    fitter = Trk__GlobalChi2Fitter(name=name, **kwargs)
    result.setPrivateTools(fitter)
    # print fitter
    return result
コード例 #6
0
def MetaDataSvcCfg(flags, toolNames=[]):
    # should cover most use cases (POOL, RAW) when called with appropriate toolNames argument
    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
    from AthenaConfiguration.ComponentFactory import CompFactory
    from six import string_types

    result = ComponentAccumulator()

    result.addService(CompFactory.StoreGateSvc("MetaDataStore"))
    result.addService(CompFactory.StoreGateSvc("InputMetaDataStore"))

    svc = CompFactory.MetaDataSvc("MetaDataSvc")
    svc.MetaDataContainer = "MetaDataHdr"
    result.addService(svc)
    result.addService(
        CompFactory.ProxyProviderSvc(ProviderNames=["MetaDataSvc"]))

    for name in toolNames:
        if not isinstance(name, string_types):
            from AthenaCommon.Logging import logging
            log = logging.getLogger("MetaDataSvcConfig")
            log.error(
                'Attempted to pass a non-string argument as a metadata tool name'
            )
            continue
        thistool = CompFactory.getComps(name)[0]()
        result.addPublicTool(thistool)
        svc.MetaDataTools += [thistool]

    return result
コード例 #7
0
def SensitiveDetectorMasterToolCfg(ConfigFlags,
                                   name="SensitiveDetectorMasterTool",
                                   **kwargs):
    result = ComponentAccumulator()
    if "ATLAS" in ConfigFlags.GeoModel.AtlasVersion:
        accSensitiveDetector = generateSensitiveDetectorList(ConfigFlags)
        kwargs.setdefault(
            "SensitiveDetectors",
            result.popToolsAndMerge(accSensitiveDetector))  #list of tools
    elif "tb_Tile2000_2003" in ConfigFlags.GeoModel.AtlasVersion:

        accSensitiveDetector = generateTestBeamSensitiveDetectorList(
            ConfigFlags)
        kwargs.setdefault("SensitiveDetectors",
                          result.popToolsAndMerge(
                              accSensitiveDetector))  #list of tools here!
    elif "tb_LArH6" in ConfigFlags.GeoModel.AtlasVersion:
        pass
    elif "ctbh8" in ConfigFlags.GeoModel.AtlasVersion:

        accSensitiveDetector = generateTestBeamSensitiveDetectorList(
            ConfigFlags)
        kwargs.setdefault("SensitiveDetectors",
                          result.popToolsAndMerge(
                              accSensitiveDetector))  #list of tools here!

    result.addPublicTool(SensitiveDetectorMasterTool(
        name, **kwargs))  #note -this is still a public tool
    return result
コード例 #8
0
def fatrasHitCreatorPixelCfg(flags,
                             name="ISF_FatrasHitCreatorPixel",
                             **kwargs):
    """Return ISF_FatrasHitCreatorPixel configured with ComponentAccumulator"""
    mlog = logging.getLogger(name)
    mlog.debug('Start configuration')

    result = ComponentAccumulator()

    hits_collection_name = generate_mergeable_collection_name(
        bare_collection_name="PixelHits",
        mergeable_collection_suffix="_Fatras",
        merger_input_property="PixelHits")

    result.merge(RNG(flags.Random.Engine))
    kwargs.setdefault("RandomNumberService", result.getService("AthRNGSvc"))
    kwargs.setdefault("RandomStreamName", flags.Sim.Fatras.RandomStreamName)
    kwargs.setdefault("IdHelperName", 'PixelID')
    kwargs.setdefault("CollectionName", hits_collection_name)

    # NOTE   why it is here ?
    # FastHitConvertTool = CompFactory.FastHitConvertTool
    kwargs.setdefault("UseConditionsTool", False)

    iFatras__HitCreatorSilicon = CompFactory.iFatras.HitCreatorSilicon
    result.addPublicTool(iFatras__HitCreatorSilicon(name=name, **kwargs))
    return result
コード例 #9
0
def MuonCaloTagToolCfg(flags, name='MuonCaloTagTool', **kwargs ):  
    result = ComponentAccumulator()
    kwargs.setdefault("CaloMuonTagLoose",       CompFactory.CaloMuonTag(name = "CaloMuonTagLoose", TagMode="Loose") )
    kwargs.setdefault("CaloMuonTagTight",       CompFactory.CaloMuonTag() )
    result.addPublicTool(kwargs['CaloMuonTagLoose'])
    result.addPublicTool(kwargs['CaloMuonTagTight'])
    acc = CaloMuonLikelihoodToolCfg(flags)
    kwargs.setdefault("CaloMuonLikelihoodTool", acc.popPrivateTools() )
    result.addPublicTool(kwargs['CaloMuonLikelihoodTool'])
    result.merge(acc)
    acc = CaloMuonScoreToolCfg(flags)
    kwargs.setdefault("CaloMuonScoreTool", acc.popPrivateTools() )
    result.addPublicTool(kwargs['CaloMuonScoreTool'])
    result.merge(acc)
    acc = TrackDepositInCaloToolCfg(flags)
    trackDepositInCaloTool = acc.popPrivateTools()
    result.addPublicTool(trackDepositInCaloTool)
    kwargs.setdefault("TrackDepositInCaloTool", trackDepositInCaloTool  )
    result.merge(acc)
    acc = CaloTrkMuIdAlgTrackSelectorToolCfg(flags)
    calotrkmuidalgtrackselectortool = acc.popPrivateTools()
    result.addPublicTool(calotrkmuidalgtrackselectortool)
    kwargs.setdefault("TrackSelectorTool",   calotrkmuidalgtrackselectortool     )
    result.merge(acc)
    kwargs.setdefault("doCaloLR", True)
    tool = CompFactory.MuonCombined.MuonCaloTagTool(name, **kwargs )
    result.setPrivateTools(tool)
    return result
コード例 #10
0
def createLArRoI_Map(flags):
    acc = ComponentAccumulator()
    LArRoI_Map = CompFactory.LArRoI_Map

    from IOVDbSvc.IOVDbSvcConfig import addFolders
    from LArCabling.LArCablingConfig import LArFebRodMappingCfg, LArCalibIdMappingCfg

    LArCablingLegacyService = CompFactory.LArCablingLegacyService
    cablingTool = LArCablingLegacyService()  # this is realy a tool
    # needed by above
    acc.merge(LArFebRodMappingCfg(flags))
    acc.merge(LArCalibIdMappingCfg(flags))

    CaloTriggerTowerService = CompFactory.CaloTriggerTowerService
    triggerTowerTool = CaloTriggerTowerService()
    acc.merge(addFolders(flags, ['/LAR/Identifier/LArTTCellMapAtlas'], 'LAR'))
    acc.merge(addFolders(flags, ['/LAR/Identifier/OnOffIdMap'], 'LAR'))

    acc.merge(
        addFolders(flags, [
            '/CALO/Identifier/CaloTTOnOffIdMapAtlas',
            '/CALO/Identifier/CaloTTOnAttrIdMapAtlas',
            '/CALO/Identifier/CaloTTPpmRxIdMapAtlas'
        ], 'CALO'))

    LArRoI_Map = LArRoI_Map()
    LArRoI_Map.CablingSvc = cablingTool
    LArRoI_Map.TriggerTowerSvc = triggerTowerTool
    acc.addPublicTool(LArRoI_Map)  # should become private tool

    return acc
コード例 #11
0
def FastSimulationMasterToolCfg(ConfigFlags, **kwargs):
    result = ComponentAccumulator()
    FastSimulationList = result.popToolsAndMerge(
        generateFastSimulationListCfg(ConfigFlags))
    kwargs.setdefault("FastSimulations", FastSimulationList)
    result.addPublicTool(
        FastSimulationMasterTool(name="FastSimulationMasterTool", **kwargs))
    return result
コード例 #12
0
def fatrasSimToolCfg(flags, name="ISF_FatrasSimTool", **kwargs):
    mlog = logging.getLogger(name)
    mlog.debug('Start configuration')

    result = ComponentAccumulator()

    if "SimHitCreatorID" not in kwargs:
        acc = fatrasSimHitCreatorIDCfg(flags)
        id_cfg = acc.getPublicTool('ISF_FatrasSimHitCreatorID')
        result.merge(acc)
        kwargs.setdefault("SimHitCreatorID", id_cfg)

    acc = fatrasSimHitCreatorMSCfg(flags)
    ms_cfg = acc.getPublicTool('ISF_FatrasSimHitCreatorMS')
    result.merge(acc)
    kwargs.setdefault("SimHitCreatorMS", ms_cfg)

    acc = fatrasParticleDecayHelperCfg(flags)
    pdhelper_cfg = acc.getPublicTool('ISF_FatrasParticleDecayHelper')
    result.merge(acc)
    kwargs.setdefault("ParticleDecayHelper", pdhelper_cfg)

    acc = ParticleHelperCfg(flags)
    part_helper_cfg = acc.getPublicTool('ISF_ParticleHelper')
    result.merge(acc)
    kwargs.setdefault("ParticleHelper", part_helper_cfg)

    acc = fatrasKinematicFilterCfg(flags)
    kin_filter_cfg = acc.getPublicTool('ISF_FatrasKinematicFilter')
    result.merge(acc)
    kwargs.setdefault("TrackFilter", kin_filter_cfg)
    kwargs.setdefault("NeutralFilter", kin_filter_cfg)
    kwargs.setdefault("PhotonFilter", kin_filter_cfg)

    acc = fatrasExtrapolatorCfg(flags)
    extrapolator_cfg = acc.getPublicTool('ISF_FatrasExtrapolator')
    kwargs.setdefault("Extrapolator", extrapolator_cfg)
    result.merge(acc)

    acc = fatrasPhysicsValidationToolCfg(flags)
    phys_val_cfg = acc.getPublicTool('ISF_FatrasPhysicsValidationTool')
    result.merge(acc)
    kwargs.setdefault("PhysicsValidationTool", phys_val_cfg)

    acc = fatrasProcessSamplingToolCfg(flags)
    proc_samp_cfg = acc.getPublicTool('ISF_FatrasProcessSamplingTool')
    result.merge(acc)
    kwargs.setdefault("ProcessSamplingTool", proc_samp_cfg)

    kwargs.setdefault("OutputLevel", flags.Exec.OutputLevel)
    kwargs.setdefault("ValidationOutput", flags.Sim.ISF.ValidationMode)

    result.merge(RNG(flags.Random.Engine))
    kwargs.setdefault("RandomNumberService", result.getService("AthRNGSvc"))

    iFatras__TransportTool = CompFactory.iFatras.TransportTool
    result.addPublicTool(iFatras__TransportTool(name=name, **kwargs))
    return result
コード例 #13
0
def fatrasPdgG4ParticleCfg(flags, name="ISF_FatrasPdgG4Particle", **kwargs):
    mlog = logging.getLogger(name)
    mlog.debug('Start configuration')

    result = ComponentAccumulator()

    iFatras__PDGToG4Particle = CompFactory.iFatras.PDGToG4Particle
    result.addPublicTool(iFatras__PDGToG4Particle(name=name, **kwargs))
    return result
コード例 #14
0
def MuTagAmbiguitySolverToolCfg(flags,
                                name='MuTagAmbiguitySolverTool',
                                **kwargs):
    #TODO: defaults in cxx
    kwargs.setdefault("RejectOuterEndcap", True)
    kwargs.setdefault("RejectMatchPhi", True)
    tool = CompFactory.MuTagAmbiguitySolverTool(name, **kwargs)
    result = ComponentAccumulator()
    result.addPublicTool(tool, primary=True)
    return result
コード例 #15
0
def fatrasPropagatorCfg(flags, name="ISF_FatrasPropagator", **kwargs):
    mlog = logging.getLogger(name)
    mlog.debug('Start configuration')

    result = ComponentAccumulator()

    Trk__RungeKuttaPropagator = CompFactory.Trk.RungeKuttaPropagator
    result.addPublicTool(Trk__RungeKuttaPropagator(name=name, **kwargs))

    return result
コード例 #16
0
def G4RunManagerHelperCfg(flags, name="ISF_G4RunManagerHelper", **kwargs):
    mlog = logging.getLogger(name)
    mlog.debug('Start configuration')

    result = ComponentAccumulator()

    iGeant4__G4RunManagerHelper = CompFactory.iGeant4.G4RunManagerHelper
    result.addPublicTool(iGeant4__G4RunManagerHelper(name=name, **kwargs))

    return result
コード例 #17
0
def MdtDriftCircleOnTrackCreatorCfg(flags,
                                    name="MdtDriftCircleOnTrackCreator",
                                    **kwargs):
    result = ComponentAccumulator()

    # setup dependencies missing in C++. TODO: fix in C++
    #
    # acc = MdtCalibrationDbSvcCfg(flags)
    # result.merge(acc)

    acc = MdtCalibrationDbToolCfg(flags)
    mdt_calibibration_db_tool = acc.getPrimary()
    result.merge(acc)
    kwargs.setdefault("CalibrationDbTool", mdt_calibibration_db_tool)

    acc = MdtCalibrationToolCfg(flags)
    mdt_calibibration_tool = acc.getPrimary()
    result.merge(acc)
    kwargs.setdefault("CalibrationTool", mdt_calibibration_tool)

    kwargs.setdefault("DoMagneticFieldCorrection",
                      flags.Muon.Calib.correctMdtRtForBField)
    kwargs.setdefault("DoWireSag", flags.Muon.useWireSagCorrections)
    kwargs.setdefault("DoSlewingCorrection",
                      flags.Muon.Calib.correctMdtRtForTimeSlewing)

    if flags.Beam.Type == 'cosmics' or flags.Beam.Type == 'singlebeam':
        kwargs.setdefault("DoTofCorrection", False)
        kwargs.setdefault("DoFixedError", True)
        kwargs.setdefault("TimingMode", 1)
        kwargs.setdefault("UseParametrisedError", True)

    else:  # collisions simulation/data settings
        kwargs.setdefault("DoTofCorrection", True)
        kwargs.setdefault("DoFixedError", False)
        kwargs.setdefault("DoErrorScaling", False)
        kwargs.setdefault(
            "TimeWindowSetting", MdtCalibWindowNumber(
                'Collision_data'))  # MJW: should this be Collision_G4 ???
        kwargs.setdefault("UseParametrisedError", False)

        if not flags.Input.isMC:
            kwargs.setdefault("CreateTubeHit", True)  # BroadErrors
            kwargs.setdefault(
                "UseLooseErrors",
                flags.Muon.useLooseErrorTuning)  # LooseErrors on data

    kwargs.setdefault("IsMC", flags.Input.isMC)

    if flags.Muon.MuonTrigger:
        kwargs.setdefault("doMDT", False)

    result.addPublicTool(Muon__MdtDriftCircleOnTrackCreator(name, **kwargs),
                         primary=True)
    return result
コード例 #18
0
def ActsTrackingGeometryToolCfg(configFlags, name="ActsTrackingGeometryTool"):
    result = ComponentAccumulator()

    acc = ActsTrackingGeometrySvcCfg(configFlags)
    result.merge(acc)

    Acts_ActsTrackingGeometryTool = CompFactory.ActsTrackingGeometryTool
    actsTrackingGeometryTool = Acts_ActsTrackingGeometryTool(name)
    result.addPublicTool(actsTrackingGeometryTool)

    return result, actsTrackingGeometryTool
コード例 #19
0
def TRT_CablingSvcCfg(flags):
    """Return a ComponentAccumulator for TRT_CablingSvc service"""
    acc = ComponentAccumulator()
    # Properly configure MC/data for TRT cabling
    TRT_FillCablingData_DC3 = CompFactory.TRT_FillCablingData_DC3
    tool = TRT_FillCablingData_DC3(RealData=not flags.Input.isMC)
    acc.addPublicTool(tool)
    # Setup TRT cabling service
    TRT_CablingSvc = CompFactory.TRT_CablingSvc
    acc.addService(TRT_CablingSvc())
    return acc
コード例 #20
0
def MuidCaloEnergyMeasCfg(flags, name='MuidCaloEnergyMeas', **kwargs ):
    result = ComponentAccumulator()
    muidcaloenergyparam =  MuidCaloEnergyParam(flags)
    kwargs.setdefault("CaloParamTool",  muidcaloenergyparam)
    result.addPublicTool(muidcaloenergyparam)
    # FIXME! Need to setup the folders for CaloNoiseKey (which is why this needs a CA) 
    # Not sure how to do : if flags.haveRIO.Calo_on() but TBH, if the cells aren't there it will abort anyway
    kwargs.setdefault("CellContainerLocation" , "AllCalo" )
    kwargs.setdefault("NoiseThresInSigmas"    , 4. )
    tool = CompFactory.Rec.MuidCaloEnergyMeas(name,**kwargs)
    result.setPrivateTools(tool)
    return result
コード例 #21
0
def fatrasNeutralPropagatorIDCfg(flags,
                                 name="ISF_FatrasNeutralPropagatorID",
                                 **kwargs):
    mlog = logging.getLogger(name)
    mlog.debug('Start configuration')

    result = ComponentAccumulator()

    Trk__StraightLinePropagator = CompFactory.Trk.StraightLinePropagator
    result.addPublicTool(Trk__StraightLinePropagator(name=name, **kwargs))

    return result
コード例 #22
0
def fatrasPhysicsValidationToolCfg(flags,
                                   name="ISF_FatrasPhysicsValidationTool",
                                   **kwargs):
    mlog = logging.getLogger(name)
    mlog.debug('Start configuration')

    result = ComponentAccumulator()
    kwargs.setdefault("ValidationStreamName", "ISFFatras")

    iFatras__PhysicsValidationTool = CompFactory.iFatras.PhysicsValidationTool
    result.addPublicTool(iFatras__PhysicsValidationTool(name=name, **kwargs))
    return result
コード例 #23
0
def MuonClusterOnTrackCreatorCfg(flags,
                                 name="MuonClusterOnTrackCreator",
                                 **kwargs):
    result = ComponentAccumulator()
    if not flags.Input.isMC:  # collisions real data or simulated first data
        # scale TGC eta hit errors as long as TGC eta are not well aligned
        kwargs.setdefault("DoFixedErrorTgcEta", True)
        kwargs.setdefault("FixedErrorTgcEta", 15.)

    muon_cluster_rot_creator = Muon__MuonClusterOnTrackCreator(name, **kwargs)
    result.addPublicTool(muon_cluster_rot_creator, primary=True)
    return result
コード例 #24
0
def fatrasSimHitCreatorMSCfg(flags,
                             name="ISF_FatrasSimHitCreatorMS",
                             **kwargs):
    """Return ISF_FatrasSimHitCreatorMS configured with ComponentAccumulator"""

    mlog = logging.getLogger(name)
    mlog.debug('Start configuration')

    result = ComponentAccumulator()

    mergeable_collection_suffix = "_Fatras"

    mdt_hits_collection_name = generate_mergeable_collection_name(
        bare_collection_name="MDT_Hits",
        mergeable_collection_suffix=mergeable_collection_suffix,
        merger_input_property="MDTHits")

    rpc_hits_collection_name = generate_mergeable_collection_name(
        bare_collection_name="RPC_Hits",
        mergeable_collection_suffix=mergeable_collection_suffix,
        merger_input_property="RPCHits")

    tgc_hits_collection_name = generate_mergeable_collection_name(
        bare_collection_name="TGC_Hits",
        mergeable_collection_suffix=mergeable_collection_suffix,
        merger_input_property="TGCHits")

    csc_hits_collection_name = generate_mergeable_collection_name(
        bare_collection_name="CSC_Hits",
        mergeable_collection_suffix=mergeable_collection_suffix,
        merger_input_property="CSCHits")
    result.merge(RNG(flags.Random.Engine))
    kwargs.setdefault("RandomNumberService", result.getService("AthRNGSvc"))
    kwargs.setdefault("RandomStreamName", flags.Sim.Fatras.RandomStreamName)
    #####
    # Extrapolator from ACTS to be added TODO
    # kwargs.setdefault("Extrapolator" , getPublicTool('ISF_FatrasExtrapolator'))
    #####
    kwargs.setdefault("MDTCollectionName", mdt_hits_collection_name)
    kwargs.setdefault("RPCCollectionName", rpc_hits_collection_name)
    kwargs.setdefault("TGCCollectionName", tgc_hits_collection_name)
    kwargs.setdefault("CSCCollectionName", csc_hits_collection_name)

    Muon__MuonTGMeasurementTool = CompFactory.Muon.MuonTGMeasurementTool
    muon_tgmeasurement_tool = Muon__MuonTGMeasurementTool(
        name='MuonTGMeasurementTool', UseDSManager=True)
    result.addPublicTool(muon_tgmeasurement_tool)
    kwargs.setdefault("MeasurementTool", muon_tgmeasurement_tool)

    iFatras__SimHitCreatorMS = CompFactory.iFatras.SimHitCreatorMS
    result.addPublicTool(iFatras__SimHitCreatorMS(name=name, **kwargs))
    return result
コード例 #25
0
def MooSegmentFinderAlg_NCBCfg(flags, name="MuonSegmentMaker_NCB", **kwargs):
    result = ComponentAccumulator()

    # Configure NCB MooSegmentFinder
    acc = CscSegmentUtilToolCfg(flags,
                                name='CscSegmentUtilTool_NCB',
                                TightenChi2=False,
                                IPconstraint=False)
    csc_segment_util_tool = acc.getPrimary()
    result.merge(acc)

    acc = Csc2dSegmentMakerCfg(flags,
                               name='Csc2dSegmentMaker_NCB',
                               segmentTool=csc_segment_util_tool)
    csc_2d_segment_maker = acc.getPrimary()
    result.merge(acc)

    acc = Csc4dSegmentMakerCfg(flags,
                               name='Csc4dSegmentMaker_NCB',
                               segmentTool=csc_segment_util_tool)
    csc_4d_segment_maker = acc.getPrimary()
    result.merge(acc)

    acc = MooSegmentFinderCfg(flags,
                              name='MooSegmentFinder_NCB',
                              Csc2dSegmentMaker=csc_2d_segment_maker,
                              Csc4dSegmentMaker=csc_4d_segment_maker,
                              DoMdtSegments=False,
                              DoSegmentCombinations=False,
                              DoSegmentCombinationCleaning=False)
    segment_finder_tool = (acc.popPrivateTools())
    result.addPublicTool(segment_finder_tool)
    result.merge(acc)

    kwargs.setdefault('SegmentFinder', segment_finder_tool)

    # Now set other NCB properties
    kwargs.setdefault('MuonPatternCombinationLocation',
                      "NCB_MuonHoughPatternCombinations")
    kwargs.setdefault('MuonSegmentOutputLocation', "NCB_MuonSegments")
    kwargs.setdefault('UseCSC', flags.Muon.doCSCs)
    kwargs.setdefault('UseMDT', False)
    kwargs.setdefault('UseRPC', False)
    kwargs.setdefault('UseTGC', False)
    kwargs.setdefault('UseTGCPriorBC', False)
    kwargs.setdefault('UseTGCNextBC', False)
    kwargs.setdefault('doTGCClust', False)
    kwargs.setdefault('doRPCClust', False)

    acc = MooSegmentFinderAlgCfg(flags, name=name, **kwargs)
    result.merge(acc)
    return result
コード例 #26
0
def ActsExtrapolationToolCfg(configFlags, name="ActsExtrapolationTool"):
    result = ComponentAccumulator()

    acc = MagneticFieldSvcCfg(configFlags)
    result.merge(acc)

    acc, actsTrackingGeometryTool = ActsTrackingGeometryToolCfg(configFlags)
    result.merge(acc)

    Acts_ActsExtrapolationTool = CompFactory.ActsExtrapolationTool
    actsExtrapolationTool = Acts_ActsExtrapolationTool(name)
    result.addPublicTool(actsExtrapolationTool, primary=True)
    return result
コード例 #27
0
def InDetNavigatorCfg(flags, name='InDetNavigator', **kwargs):
    the_name = makeName(name, kwargs)
    result = ComponentAccumulator()
    if 'TrackingGeometrySvc' not in kwargs:
        from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
        tmpAcc = TrackingGeometrySvcCfg(flags)
        kwargs.setdefault("TrackingGeometrySvc", tmpAcc.getPrimary())
        result.merge(tmpAcc)

    tool = CompFactory.Trk.Navigator(name=the_name, **kwargs)
    result.addPublicTool(tool)
    result.setPrivateTools(tool)
    return result
コード例 #28
0
def MuonSeededSegmentFinderCfg(flags,
                               name="MuonSeededSegmentFinder",
                               **kwargs):
    Muon__MuonSeededSegmentFinder = CompFactory.Muon.MuonSeededSegmentFinder
    from MuonConfig.MuonSegmentFindingConfig import DCMathSegmentMakerCfg, MdtMathSegmentFinder  # FIXME - should really shift this to RecTools then.
    result = ComponentAccumulator()

    mdt_segment_finder = MdtMathSegmentFinder(flags,
                                              name="MCTBMdtMathSegmentFinder",
                                              UseChamberTheta=False,
                                              AssociationRoadWidth=1.5)
    result.addPublicTool(mdt_segment_finder)

    if "SegmentMaker" not in kwargs or "SegmentMakerNoHoles" not in kwargs:
        seg_maker = ""
        acc = {}
        if flags.Beam.Type == 'collisions':
            acc = DCMathSegmentMakerCfg(flags,
                                        name="MCTBDCMathSegmentMaker",
                                        MdtSegmentFinder=mdt_segment_finder,
                                        SinAngleCut=0.04,
                                        DoGeometry=True)
        else:  # cosmics or singlebeam
            acc = DCMathSegmentMakerCfg(flags,
                                        name="MCTBDCMathSegmentMaker",
                                        MdtSegmentFinder=mdt_segment_finder,
                                        SinAngleCut=0.1,
                                        DoGeometry=False,
                                        AddUnassociatedPhiHits=True)
        seg_maker = acc.getPrimary()
        result.merge(acc)
        kwargs.setdefault("SegmentMaker", seg_maker)
        kwargs.setdefault("SegmentMakerNoHoles",
                          seg_maker)  #FIXME. Just remove one.
    if not flags.Detector.GeometryCSC:
        kwargs.setdefault("CscPrepDataContainer", "")
    if not flags.Detector.GeometrysTGC:
        kwargs.setdefault("sTgcPrepDataContainer", "")
    if not flags.Detector.GeometryMM:
        kwargs.setdefault("MMPrepDataContainer", "")

    kwargs.setdefault("Printer", MuonEDMPrinterTool(flags))

    kwargs.setdefault(
        'TgcPrepDataContainer',
        'TGC_MeasurementsAllBCs' if not flags.Muon.useTGCPriorNextBC
        and not flags.Muon.useTGCPriorNextBC else 'TGC_Measurements')

    muon_seeded_segment_finder = Muon__MuonSeededSegmentFinder(name, **kwargs)
    result.setPrivateTools(muon_seeded_segment_finder)
    return result
コード例 #29
0
def InDetExtrapolatorCfg(flags, name='InDetExtrapolator', **kwargs):
    result = ComponentAccumulator()
    # FIXME copied from the old config, also needs fixing on the c++ side.
    if 'Propagators' not in kwargs:
        tmpAcc = InDetPropagatorCfg(flags)
        kwargs.setdefault(
            "Propagators",
            [tmpAcc.getPrimary()])  # [ InDetPropagator, InDetStepPropagator ],
        result.merge(tmpAcc)
    propagator = kwargs.get('Propagators')[0].name if kwargs.get(
        'Propagators', None) is not None and len(
            kwargs.get('Propagators', None)) > 0 else None

    if 'MaterialEffectsUpdators' not in kwargs:
        tmpAcc = InDetMaterialEffectsUpdatorCfg(flags)
        kwargs.setdefault("MaterialEffectsUpdators", [tmpAcc.getPrimary()])
        result.merge(tmpAcc)
    material_updator = kwargs.get(
        'MaterialEffectsUpdators')[0].name if kwargs.get(
            'MaterialEffectsUpdators', None) is not None and len(
                kwargs.get('MaterialEffectsUpdators', None)) > 0 else None

    if 'Navigator' not in kwargs:
        tmpAcc = InDetNavigatorCfg(flags)
        kwargs.setdefault("Navigator", tmpAcc.getPrimary())
        result.merge(tmpAcc)

    sub_propagators = []
    sub_updators = []

    # -------------------- set it depending on the geometry ----------------------------------------------------
    # default for ID is (Rk,Mat)
    sub_propagators += [propagator]
    sub_updators += [material_updator]

    # default for Calo is (Rk,MatLandau)
    sub_propagators += [propagator]
    sub_updators += [material_updator]

    # default for MS is (STEP,Mat)
    #  sub_propagators += [ InDetStepPropagator.name() ]
    sub_updators += [material_updator]
    # @TODO should check that all sub_propagators and sub_updators are actually defined.

    kwargs.setdefault("SubPropagators", sub_propagators)
    kwargs.setdefault("SubMEUpdators", sub_updators)

    extrapolator = CompFactory.Trk.Extrapolator(name, **kwargs)
    result.addPublicTool(extrapolator, primary=True)
    return result
コード例 #30
0
def testCfg (configFlags):
    result = ComponentAccumulator()

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

    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    result.merge (MagneticFieldSvcCfg(configFlags, UseDCS = False))

    Muon__MdtRdoToPrepDataTool = CompFactory.Muon.MdtRdoToPrepDataTool
    result.addPublicTool (Muon__MdtRdoToPrepDataTool ('Muon__MdtRdoToPrepDataTool', OutputLevel = 1))
    
    result.addEventAlgo (TestAlg ('TestAlg'))
    return result