def generateMuonSensitiveDetectorList():
    SensitiveDetectorList = []
    from AthenaCommon.DetFlags import DetFlags
    if DetFlags.simulate.Muon_on():
        from G4AtlasApps.SimFlags import simFlags
        from AthenaCommon.BeamFlags import jobproperties
        if jobproperties.Beam.beamType() == 'cosmics':
            SensitiveDetectorList += [
                'MDTSensitiveDetectorCosmics', 'RPCSensitiveDetectorCosmics',
                'TGCSensitiveDetectorCosmics'
            ]
        else:
            SensitiveDetectorList += [
                'MDTSensitiveDetector', 'RPCSensitiveDetector',
                'TGCSensitiveDetector'
            ]
        if simFlags.SimulateNewSmallWheel():
            SensitiveDetectorList += [
                'sTGCSensitiveDetector', 'MicromegasSensitiveDetector'
            ]
        else:
            # CSCs built instead of NSW
            if jobproperties.Beam.beamType() == 'cosmics':
                SensitiveDetectorList += ['CSCSensitiveDetectorCosmics']
            else:
                SensitiveDetectorList += ['CSCSensitiveDetector']
    return SensitiveDetectorList
Esempio n. 2
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#*"]
Esempio n. 3
0
if "atlas_flags" not in simFlags.extra_flags:
    simFlags.load_atlas_flags()
from AthenaCommon.BeamFlags import jobproperties
if jobproperties.Beam.beamType(
) == "cosmics" and "cosmics_flags" not in simFlags.extra_flags:
    simFlags.load_cosmics_flags()

from AthenaCommon.DetFlags import DetFlags
## Tidy up DBM DetFlags: temporary measure
DetFlags.DBM_setOff()

## Tidy up NSW DetFlags: temporary measure
DetFlags.sTGC_setOff()
DetFlags.Micromegas_setOff()
if hasattr(simFlags, 'SimulateNewSmallWheel'):
    if simFlags.SimulateNewSmallWheel():
        DetFlags.sTGC_setOn()
        DetFlags.Micromegas_setOn()

## Switch off tasks
DetFlags.pileup.all_setOff()
DetFlags.simulateLVL1.all_setOff()
DetFlags.digitize.all_setOff()
if not simFlags.IsEventOverlayInputSim():
    DetFlags.overlay.all_setOff()
DetFlags.readRDOPool.all_setOff()
DetFlags.makeRIO.all_setOff()
DetFlags.writeBS.all_setOff()
DetFlags.readRDOBS.all_setOff()
DetFlags.readRIOBS.all_setOff()
DetFlags.readRIOPool.all_setOff()
Esempio n. 4
0
    job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("HECHitsTestTool", checkType=True)]
    if DetFlags.Truth_on():
        job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("CaloEntryLayerTestTool", checkType=True)]
if DetFlags.Tile_on():
    job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("TileHitsTestTool", checkType=True)]
if simFlags.CalibrationRun.get_Value()=='LAr+Tile':
    job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("LArActiveCaloCalibHitsTestTool", checkType=True)]
    job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("LArInactiveCaloCalibHitsTestTool", checkType=True)]
    ##job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("LArDeadMaterialCaloCalibHitsTestTool", checkType=True)]
    job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("TileActiveCellCaloCalibHitsTestTool", checkType=True)]
    job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("TileInactiveCellCaloCalibHitsTestTool", checkType=True)]
    ##job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("TileDeadMaterialCaloCalibHitsTestTool", checkType=True)]
if DetFlags.Muon_on():
    job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("MDTHitsTestTool", checkType=True)]
    job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("RPCHitsTestTool", checkType=True)]
    if hasattr(simFlags, 'SimulateNewSmallWheel') and simFlags.SimulateNewSmallWheel():
        job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("MMHitsTestTool",  checkType=True)]
        job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("sTGCHitsTestTool",  checkType=True)]
    else:
        job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("CSCHitsTestTool", checkType=True)]
    job.G4TestAlg.SimTestTools += [CfgGetter.getPrivateTool("TGCHitsTestTool", 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)]