Beispiel #1
0
if hasattr(runArgs, "ZDCOn"):
    if runArgs.ZDCOn:
        DetFlags.ZDC_setOn()
if hasattr(runArgs, "HGTDOn"):
    if runArgs.HGTDOn:
        checkHGTDOn = getattr(DetFlags, 'HGTD_setOn', None)
        if checkHGTDOn is not None:
            checkHGTDOn()
        else:
            atlasG4log.warning(
                'The HGTD DetFlag is not supported in this release')

DetFlags.Print()

if DetFlags.Forward_on():
    if DetFlags.FwdRegion_on() or DetFlags.ZDC_on() or DetFlags.ALFA_on(
    ) or DetFlags.AFP_on():
        ## Do not filter high eta particles
        if simFlags.EventFilter.statusOn:
            simFlags.EventFilter.get_Value()['EtaPhiFilters'] = False
        ## ForwardTransport is applied to particles hitting BeamPipe::SectionF46
        DetFlags.bpipe_setOn()

    if DetFlags.FwdRegion_on():
        # Do full simulation rather than beam transport
        simFlags.ForwardDetectors = 1
        atlasG4log.info(
            'FwdRegion switched on, so will run Full Simulation of the Forward Region rather than Forward Transport.'
        )
    elif DetFlags.ZDC_on() or DetFlags.ALFA_on() or DetFlags.AFP_on():
        ## Use the ForwardTransport package to do the beam transport
        atlasG4log.info(
Beispiel #2
0
        job.G4TestAlg.SimTestTools += [
            CfgGetter.getPrivateTool("CSCHitsTestTool", checkType=True)
        ]
    if MuonGeometryFlags.hasMM():
        job.G4TestAlg.SimTestTools += [
            CfgGetter.getPrivateTool("MMHitsTestTool", checkType=True)
        ]
    if MuonGeometryFlags.hasSTGC():
        job.G4TestAlg.SimTestTools += [
            CfgGetter.getPrivateTool("sTGCHitsTestTool", checkType=True)
        ]
    if DetFlags.Truth_on():
        job.G4TestAlg.SimTestTools += [
            CfgGetter.getPrivateTool("MuonEntryLayerTestTool", checkType=True)
        ]
        job.G4TestAlg.SimTestTools += [
            CfgGetter.getPrivateTool("MuonExitLayerTestTool", checkType=True)
        ]
if DetFlags.Lucid_on():
    job.G4TestAlg.SimTestTools += [
        CfgGetter.getPrivateTool("LucidHitsTestTool", checkType=True)
    ]
if DetFlags.ALFA_on():
    job.G4TestAlg.SimTestTools += [
        CfgGetter.getPrivateTool("ALFA_SimHitsTestTool", checkType=True)
    ]
if DetFlags.ZDC_on():
    job.G4TestAlg.SimTestTools += [
        CfgGetter.getPrivateTool("ZDCHitsTestTool", checkType=True)
    ]
Beispiel #3
0
    def hits_persistency():
        """ HITS POOL file persistency
        """
        from G4AtlasApps.SimFlags import simFlags
        from AthenaCommon.DetFlags import DetFlags
        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream

        ## Not yet understood, but need to treat StreamHITS as alg in Hive.
        ## Seems to also work fine outside of Hive, but to be extra safe I'm
        ## only changing it in Hive.
        from AthenaCommon.ConcurrencyFlags import jobproperties as concurrencyProps
        if concurrencyProps.ConcurrencyFlags.NumThreads() > 0:
            as_alg = True
        else:
            as_alg = False
        ## NB. Two-arg constructor is needed, since otherwise metadata writing fails!
        stream1 = AthenaPoolOutputStream("StreamHITS",
                                         athenaCommonFlags.PoolHitsOutput(),
                                         asAlg=as_alg)

        ## Write geometry tag info - move to main method
        #import EventInfoMgt.EventInfoMgtInit

        ## EventInfo & TruthEvent always written by default
        stream1.ForceRead = True
        stream1.ItemList = [
            "EventInfo#*", "McEventCollection#TruthEvent", "JetCollection#*"
        ]

        ## If we are running quasi-stable particle simulation, include the original event record
        if hasattr(
                simFlags, 'IncludeParentsInG4Event'
        ) and simFlags.IncludeParentsInG4Event.statusOn and simFlags.IncludeParentsInG4Event(
        ):
            stream1.ItemList += ["McEventCollection#GEN_EVENT"]

        stream1.ItemList += ["xAOD::JetContainer#*", "xAOD::JetAuxContainer#*"]

        ## Make stream aware of aborted events
        stream1.AcceptAlgs = ["G4AtlasAlg"]

        ## Detectors

        ## Inner Detector
        if DetFlags.ID_on():
            stream1.ItemList += [
                "SiHitCollection#*", "TRTUncompressedHitCollection#*",
                "TrackRecordCollection#CaloEntryLayer"
            ]
        ## Calo
        if DetFlags.Calo_on():
            stream1.ItemList += [
                "CaloCalibrationHitContainer#*",
                "LArHitContainer#*",
                "TileHitVector#*",
                #"SimpleScintillatorHitCollection#*",
                "TrackRecordCollection#MuonEntryLayer"
            ]
        ## Muon
        if DetFlags.Muon_on():
            stream1.ItemList += [
                "RPCSimHitCollection#*", "TGCSimHitCollection#*",
                "CSCSimHitCollection#*", "MDTSimHitCollection#*",
                "TrackRecordCollection#MuonExitLayer"
            ]
            if hasattr(simFlags, 'SimulateNewSmallWheel'):
                if simFlags.SimulateNewSmallWheel():
                    stream1.ItemList += ["GenericMuonSimHitCollection#*"]
        ## Lucid
        if DetFlags.Lucid_on():
            stream1.ItemList += ["LUCID_SimHitCollection#*"]

        ## FwdRegion
        if DetFlags.FwdRegion_on():
            stream1.ItemList += ["SimulationHitCollection#*"]

        ## ZDC
        if DetFlags.ZDC_on():
            stream1.ItemList += [
                "ZDC_SimPixelHit_Collection#*", "ZDC_SimStripHit_Collection#*"
            ]
        ## ALFA
        if DetFlags.ALFA_on():
            stream1.ItemList += [
                "ALFA_HitCollection#*", "ALFA_ODHitCollection#*"
            ]

        ## AFP
        if DetFlags.AFP_on():
            stream1.ItemList += [
                "AFP_TDSimHitCollection#*", "AFP_SIDSimHitCollection#*"
            ]

        ### Ancillary scintillators
        #stream1.ItemList += ["ScintillatorHitCollection#*"]

        ## TimingAlg
        stream1.ItemList += ["RecoTimingObj#EVNTtoHITS_timings"]

        ## Add cosmics and test beam configuration hit persistency if required cf. geom tag
        layout = simFlags.SimLayout.get_Value()
        if "tb" not in layout:
            from AthenaCommon.BeamFlags import jobproperties
            if jobproperties.Beam.beamType() == 'cosmics' or \
                    (hasattr(simFlags, "WriteTR") and simFlags.WriteTR.statusOn) or \
                    (hasattr(simFlags, "ReadTR") and simFlags.ReadTR.statusOn):
                stream1.ItemList += [
                    "TrackRecordCollection#CosmicRecord",
                    "TrackRecordCollection#CosmicPerigee"
                ]
        else:
            ## CTB-specific
            if layout.startswith("ctb"):
                if simFlags.LArFarUpstreamMaterial.statusOn and simFlags.LArFarUpstreamMaterial.get_Value(
                ):
                    stream1.ItemList.append(
                        "TrackRecordCollection#LArFarUpstreamMaterialExitLayer"
                    )
            ## Persistency of test-beam layout
            if layout.startswith('ctb') or layout.startswith('tb_Tile2000_'):
                stream1.ItemList += ["TBElementContainer#*"]
Beispiel #4
0
def getHITSStreamItemList():
    hitsItemList=[]
    ## EventInfo & TruthEvent always written by default
    hitsItemList = ["EventInfo#*",
                    "McEventCollection#TruthEvent",
                    "JetCollection#*"]
    from G4AtlasApps.SimFlags import simFlags
    if simFlags.SimulationFlavour() is not None and 'ongLived' in simFlags.SimulationFlavour(): # to catch LongLived and longLived
        hitsItemList += ["McEventCollection#GEN_EVENT"]
    from PyJobTransforms.trfUtils import releaseIsOlderThan
    if releaseIsOlderThan(20,0):
        #Hack to maintain compatibility of G4AtlasApps trunk with
        #19.2.X.Y after EDM changes in release 20.0.0.
        hitsItemList += ["xAOD::JetContainer_v1#*",
                         "xAOD::JetAuxContainer_v1#*"]
    else:
        hitsItemList += ["xAOD::JetContainer#*",
                           "xAOD::JetAuxContainer#*"]
    ## Detectors
    from AthenaCommon.DetFlags import DetFlags
    ## Inner Detector
    if DetFlags.ID_on():
        hitsItemList += ["SiHitCollection#*",
                         "TRTUncompressedHitCollection#*",
                         "TrackRecordCollection#CaloEntryLayer"]
    ## Calo
    if DetFlags.Calo_on():
        hitsItemList += ["CaloCalibrationHitContainer#*",
                         "LArHitContainer#*",
                         "TileHitVector#*",
                         #"SimpleScintillatorHitCollection#*",
                         "TrackRecordCollection#MuonEntryLayer"]
    ## Muon
    if DetFlags.Muon_on():
        hitsItemList += ["RPCSimHitCollection#*",
                         "TGCSimHitCollection#*",
                         "CSCSimHitCollection#*",
                         "MDTSimHitCollection#*",
                         "TrackRecordCollection#MuonExitLayer"]
    ## FwdRegion
    if DetFlags.FwdRegion_on():
        hitsItemList += ["SimulationHitCollection#*"]

    ## Lucid
    if DetFlags.Lucid_on():
        hitsItemList += ["LUCID_SimHitCollection#*"]

    ## ZDC
    if DetFlags.ZDC_on():
        hitsItemList += ["ZDC_SimPixelHit_Collection#*",
                             "ZDC_SimStripHit_Collection#*"]
    ## ALFA
    if DetFlags.ALFA_on():
        hitsItemList += ["ALFA_HitCollection#*","ALFA_ODHitCollection#*"]

    ## AFP
    if DetFlags.AFP_on():
        hitsItemList += ["AFP_TDSimHitCollection#*","AFP_SIDSimHitCollection#*"]

    ## Ancillary scintillators
    #hitsItemList += ["ScintillatorHitCollection#*"]

    ## TimingAlg
    hitsItemList +=["RecoTimingObj#EVNTtoHITS_timings"]

    if simFlags.RecordStepInfo.get_Value():
        hitsItemList +=["ISF_FCS_Parametrization::FCS_StepInfoCollection#MergedEventSteps"]

    ## add xAOD::TrackParticles output collection Parametric Simulation
    if simFlags.SimulationFlavour == "ParametricSimulation":
        hitsItemList +=["xAOD::TrackParticleContainer#*",
                            "xAOD::TrackParticleAuxContainer#*"]
    ## Add cosmics and test beam configuration hit persistency if required cf. geom tag
    layout = simFlags.SimLayout.get_Value()
    if "tb" not in layout:
        from AthenaCommon.BeamFlags import jobproperties
        if jobproperties.Beam.beamType() == 'cosmics' or \
                (hasattr(simFlags, "WriteTR") and simFlags.WriteTR.statusOn) or \
                (hasattr(simFlags, "ReadTR") and simFlags.ReadTR.statusOn):
            hitsItemList += ["TrackRecordCollection#CosmicRecord", "TrackRecordCollection#CosmicPerigee"]
    else:
        ## CTB-specific
        if layout.startswith("ctb"):
            if simFlags.LArFarUpstreamMaterial.statusOn and simFlags.LArFarUpstreamMaterial.get_Value():
                hitsItemList.append("TrackRecordCollection#LArFarUpstreamMaterialExitLayer")
        ## Persistency of test-beam layout
        if layout.startswith('ctb') or layout.startswith('tb_Tile2000_'):
            hitsItemList += ["TBElementContainer#*"]
    return hitsItemList