示例#1
0
def getStandardInTimeOnlyTruthPileUpTools():
    from AthenaCommon.DetFlags import DetFlags
    PileUpToolsList = []
    if DetFlags.pileup.Truth_on():
        from Digitization.DigitizationFlags import digitizationFlags
        if 'NewMerge' in digitizationFlags.experimentalDigi():
            if not athenaCommonFlags.DoFullChain():
                PileUpToolsList += ["NewMergeMcEventCollTool_Signal"]
            if digitizationFlags.doLowPtMinBias.get_Value():
                PileUpToolsList += [
                    "InTimeOnlyNewMergeMcEventCollTool_MinBias"
                ]
            if digitizationFlags.doHighPtMinBias.get_Value():
                PileUpToolsList += [
                    "InTimeOnlyNewMergeMcEventCollTool_HighPtMinBias"
                ]
            if digitizationFlags.doCavern.get_Value():
                PileUpToolsList += ["InTimeOnlyNewMergeMcEventCollTool_Cavern"]
            if digitizationFlags.doBeamGas.get_Value(
            ) or digitizationFlags.doBeamHalo.get_Value():
                PileUpToolsList += [
                    "InTimeOnlyNewMergeMcEventCollTool_HaloGas"
                ]
        else:
            PileUpToolsList += ["InTimeOnlyMcEventCollTool"]
        PileUpToolsList += ["MergeTruthJetsTool"]
        if not athenaCommonFlags.DoFullChain(
        ) and DetFlags.writeRDOPool.Muon_on(
        ):  #possibly this should be digitize.Muon_on()
            PileUpToolsList += ["MergeMuonEntryLayerTool"]
        if DetFlags.writeRDOPool.Calo_on(
        ):  #possibly this should be digitize.Calo_on()
            PileUpToolsList += ["MergeCalibHitsTool"]
    return PileUpToolsList
示例#2
0
def generate_mergeable_collection_name(bare_collection_name,
                                       mergeable_collection_suffix,
                                       merger_input_property, region):
    """
    Generates and returns a collection name that is also registered to
    the ISF CollectionMerger algorithm.

    :param bare_collection_name: name of the collection if no merging
        is taking place.
    :param mergeable_collection_suffix: suffix to the collection in
        case merging is taking place.
    :param merger_input_property: name of the Input* property in the
        CollectionMerger algorithm to add the mergeable collection to.
    """
    hardscatterSG = "OriginalEvent_SG+"
    if simFlags.ISFRun() and ISF_Flags.HITSMergingRequired.get_Value().get(
            region, True):
        mergeable_collection = '{bare}{suffix}'.format(
            bare=bare_collection_name, suffix=mergeable_collection_suffix)

        collection_merger = getAlgorithm('ISF_CollectionMerger')
        input_attribute_name = 'Input{merger_input_property}'.format(
            merger_input_property=merger_input_property)
        merger_input_collections = getattr(collection_merger,
                                           input_attribute_name)
        merger_input_collections.append(mergeable_collection)
    elif athenaCommonFlags.DoFullChain() and DetFlags.pileup.any_on():
        mergeable_collection = hardscatterSG + bare_collection_name
    else:
        mergeable_collection = bare_collection_name

    return mergeable_collection
示例#3
0
def getBeamEffectsAlg(name="BeamEffectsAlg", **kwargs):
    from AthenaCommon.DetFlags import DetFlags
    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
    if athenaCommonFlags.DoFullChain() and DetFlags.pileup.any_on():
        kwargs.setdefault('InputMcEventCollection',
                          'OriginalEvent_SG+GEN_EVENT')  # For Fast Chain
    else:
        kwargs.setdefault('InputMcEventCollection', 'GEN_EVENT')
    kwargs.setdefault('OutputMcEventCollection', 'BeamTruthEvent')
    from G4AtlasApps.SimFlags import simFlags
    kwargs.setdefault(
        "ISFRun", simFlags.ISFRun()
    )  #FIXME Temporary property so that we don't change the output in the initial switch to this code.
    manipulatorList = ['GenEventValidityChecker']
    if hasattr(simFlags, 'Eta') or hasattr(
            simFlags, 'LArTB_H1TableYPos'):  #FIXME Ugly hack
        # TestBeam do nothing else for now
        pass
    else:
        if simFlags.VertexTimeOffset.statusOn and simFlags.VertexTimeOffset.get_Value(
        ) != 0:
            raise RuntimeError('Vertex time offset should not be used!')
        from AthenaCommon.BeamFlags import jobproperties
        if not (simFlags.CavernBG.get_Value() == 'Read'
                or jobproperties.Beam.beamType() == "cosmics"):
            manipulatorList += ["GenEventVertexPositioner"]
        if simFlags.BeamEffectOptions.statusOn:
            manipulatorList += ["GenEventBeamEffectBooster"]
    kwargs.setdefault("GenEventManipulators", manipulatorList)
    return CfgMgr.Simulation__BeamEffectsAlg(name, **kwargs)
示例#4
0
def getEntryLayerToolMT(name="ISF_EntryLayerToolMT", **kwargs):
    kwargs.setdefault('GeoIDSvc'        , 'ISF_GeoIDSvc')
    from G4AtlasApps.SimFlags import simFlags
    kwargs.setdefault('ParticleFilters' , [ simFlags.TruthStrategy.EntryLayerFilterName() ] )
    from AthenaCommon.DetFlags import DetFlags
    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
    if athenaCommonFlags.DoFullChain() and DetFlags.pileup.any_on():
        kwargs.setdefault('EvtStore', 'OriginalEvent_SG') # For Fast Chain
    from ISF_Geant4CommonTools.ISF_Geant4CommonToolsConf import ISF__EntryLayerToolMT
    return ISF__EntryLayerToolMT(name, **kwargs)
示例#5
0
def getStandardSignalOnlyTruthPileUpTools():
    from AthenaCommon.DetFlags import DetFlags
    PileUpToolsList = []
    if DetFlags.pileup.Truth_on():
        from Digitization.DigitizationFlags import digitizationFlags
        if 'NewMerge' in digitizationFlags.experimentalDigi():
            if not athenaCommonFlags.DoFullChain():
                PileUpToolsList += ["NewMergeMcEventCollTool_Signal"]
        else:
            PileUpToolsList += ["SignalOnlyMcEventCollTool"]
        PileUpToolsList += ["MergeTruthJetsTool"]
        if not athenaCommonFlags.DoFullChain(
        ) and DetFlags.writeRDOPool.Muon_on(
        ):  #possibly this should be digitize.Muon_on()
            PileUpToolsList += ["MergeMuonEntryLayerTool"]
        if DetFlags.writeRDOPool.Calo_on(
        ):  #possibly this should be digitize.Calo_on()
            PileUpToolsList += ["MergeCalibHitsTool"]
    return PileUpToolsList
示例#6
0
def getCollectionMerger(name="ISF_CollectionMerger", **kwargs):
    kwargs.setdefault("InputBCMHits", [])
    kwargs.setdefault("InputBLMHits", [])
    kwargs.setdefault("InputPixelHits", [])
    kwargs.setdefault("InputSCTHits", [])
    kwargs.setdefault("InputTRTUncompressedHits", [])

    kwargs.setdefault("InputLArEMBHits", [])
    kwargs.setdefault("InputLArEMECHits", [])
    kwargs.setdefault("InputLArFCALHits", [])
    kwargs.setdefault("InputLArHECHits", [])

    kwargs.setdefault("InputTileHits", [])
    kwargs.setdefault("InputMBTSHits", [])

    kwargs.setdefault("InputCSCHits", [])
    kwargs.setdefault("InputMDTHits", [])
    kwargs.setdefault("InputRPCHits", [])
    kwargs.setdefault("InputTGCHits", [])
    from AthenaCommon.DetFlags import DetFlags
    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
    hardscatterSG = ""
    if athenaCommonFlags.DoFullChain() and DetFlags.pileup.any_on():
        hardscatterSG = "OriginalEvent_SG+"
    kwargs.setdefault("OutputBCMHits", hardscatterSG + "BCMHits")
    kwargs.setdefault("OutputBLMHits", hardscatterSG + "BLMHits")
    kwargs.setdefault("OutputPixelHits", hardscatterSG + "PixelHits")
    kwargs.setdefault("OutputSCTHits", hardscatterSG + "SCT_Hits")
    kwargs.setdefault("OutputTRTUncompressedHits",
                      hardscatterSG + "TRTUncompressedHits")

    kwargs.setdefault("OutputLArEMBHits", hardscatterSG + "LArHitEMB")
    kwargs.setdefault("OutputLArEMECHits", hardscatterSG + "LArHitEMEC")
    kwargs.setdefault("OutputLArFCALHits", hardscatterSG + "LArHitFCAL")
    kwargs.setdefault("OutputLArHECHits", hardscatterSG + "LArHitHEC")

    kwargs.setdefault("OutputTileHits", hardscatterSG + "TileHitVec")
    kwargs.setdefault("OutputMBTSHits", hardscatterSG + "MBTSHits")

    kwargs.setdefault("OutputCSCHits", hardscatterSG + "CSC_Hits")
    kwargs.setdefault("OutputMDTHits", hardscatterSG + "MDT_Hits")
    kwargs.setdefault("OutputRPCHits", hardscatterSG + "RPC_Hits")
    kwargs.setdefault("OutputTGCHits", hardscatterSG + "TGC_Hits")
    return CfgMgr.ISF__CollectionMerger(name, **kwargs)