DetFlags.ID_setOn() DetFlags.Calo_setOff() DetFlags.Muon_setOff() # the global flags globalflags.ConditionsTag = 'OFLCOND-SIM-00-00-00' print globalflags.ConditionsTag #--- AthenaCommon flags --------------------------------------- from AthenaCommon.AthenaCommonFlags import athenaCommonFlags athenaCommonFlags.PoolEvgenInput.set_Off() ### is this necessary? athenaCommonFlags.PoolHitsOutput = 'Hits.pool.root' athenaCommonFlags.EvtMax = 100 #--- Simulation flags ----------------------------------------- from G4AtlasApps.SimFlags import simFlags simFlags.load_atlas_flags() # Going to use an ATLAS layout simFlags.SimLayout = myGeo simFlags.EventFilter.set_Off() myMinEta = -6.0 myMaxEta = 6.0 myPDG = 999 # 999 = Geantinos, 13 = Muons include("GeneratorUtils/StdEvgenSetup.py") theApp.EvtMax = 100 import ParticleGun as PG pg = PG.ParticleGun() pg.sampler.pid = 999 pg.sampler.mom = PG.EEtaMPhiSampler(energy=10000, eta=[-6., 6.])
def _do_jobproperties(self): """ Place to handle JobProperties. """ ## Import extra flags if it hasn't already been done from G4AtlasApps.SimFlags import simFlags if "atlas_flags" not in simFlags.extra_flags: simFlags.load_atlas_flags() if jobproperties.Beam.beamType( ) == "cosmics" and "cosmics_flags" not in simFlags.extra_flags: simFlags.load_cosmics_flags() AtlasG4Eng.G4Eng.log.verbose( 'AtlasSimSkeleton._do_jobproperties :: starting') ## Tidy up DBM DetFlags: temporary measure DetFlags.DBM_setOff() from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags if not MuonGeometryFlags.hasCSC(): DetFlags.CSC_setOff() if not MuonGeometryFlags.hasSTGC(): DetFlags.sTGC_setOff() if not MuonGeometryFlags.hasMM(): DetFlags.Micromegas_setOff() ## 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() DetFlags.writeRIOPool.all_setOff() DetFlags.writeRDOPool.all_setOff() ## Global flags needed by externals from AthenaCommon.GlobalFlags import globalflags globalflags.DataSource = 'geant4' if jobproperties.Beam.beamType() == 'cosmics': globalflags.DetGeo = 'commis' else: globalflags.DetGeo = 'atlas' ## At this point we can set the global job properties flag globalflags.DetDescrVersion = simFlags.SimLayout.get_Value() # Switch off GeoModel Release in the case of parameterization if simFlags.LArParameterization.get_Value( ) > 0 and simFlags.ReleaseGeoModel(): AtlasG4Eng.G4Eng.log.info( 'AtlasSimSkeleton._do_jobproperties :: Running parameterization - switching off GeoModel release!' ) simFlags.ReleaseGeoModel = False ## Translate conditions tag into IOVDbSvc global tag: must be done before job properties are locked!!! from AthenaCommon.AppMgr import ServiceMgr from IOVDbSvc.IOVDbSvcConf import IOVDbSvc ServiceMgr += IOVDbSvc() if not hasattr( globalflags, "ConditionsTag") or not globalflags.ConditionsTag.get_Value(): msg = "AtlasSimSkeleton._do_jobproperties :: conditions tag has not been set and is no longer guessed by SimAtlasKernel. " msg += "You must set the globaltags.ConditionsTag flag in your job options." AtlasG4Eng.G4Eng.log.error(msg) raise SystemExit( "AtlasSimSkeleton._do_jobproperties :: Global ConditionsTag not set" ) if not hasattr(ServiceMgr.IOVDbSvc, 'GlobalTag') or not ServiceMgr.IOVDbSvc.GlobalTag: ServiceMgr.IOVDbSvc.GlobalTag = globalflags.ConditionsTag.get_Value( ) ## Enable floating point exception handling ## FIXME! This seems to cause the jobs to crash in the FpeControlSvc, so commenting this out for now... #from AthenaCommon.AthenaCommonFlags import athenaCommonFlags #athenaCommonFlags.RuntimeStrictness = 'abort' #AtlasG4Eng.G4Eng.log.debug('AtlasSimSkeleton._do_jobproperties :: Enabled floating point exceptions') if not simFlags.ISFRun: from G4AtlasApps.G4Atlas_Metadata import checkForSpecialConfigurationMetadata checkForSpecialConfigurationMetadata() ## Print flags if AtlasG4Eng.G4Eng.log.getEffectiveLevel() < 40: AtlasG4Eng.G4Eng.log.info( 'AtlasSimSkeleton._do_jobproperties :: printing detector flags DetFlags' ) DetFlags.Print() AtlasG4Eng.G4Eng.log.info( 'AtlasSimSkeleton._do_jobproperties :: printing simulation flags simFlags' ) jobproperties.print_JobProperties('tree&value') # Lock the job properties if not running ISF. if not simFlags.ISFRun: jobproperties.lock_JobProperties() AtlasG4Eng.G4Eng.log.verbose( 'AtlasSimSkeleton._do_jobproperties :: done')
# Initialize geometry from AtlasGeoModel import GeoModelInit from AtlasGeoModel import SetGeometryVersion from InDetSLHC_Example.SLHC_JobProperties import SLHC_Flags SLHC_Flags.SLHC_Version = "SLHC-empty-gmx" print SLHC_Flags # .gmx top-file: from SCT_GeoModelXml.SCT_GeoModelXmlConf import SCT_GMX_DetectorTool SCT_GMX_DetectorTool.GmxFilename = "../../../InDetDetDescr/GmxLayouts/data/ITk/Strip/LoI/ITkStrip.gmx" # set the path variables consistently from InDetSLHC_Example.SLHC_Setup import SLHC_Setup SLHC_Setup = SLHC_Setup() from G4AtlasApps.SimFlags import simFlags simFlags.load_atlas_flags() # simFlags.SimLayout='ATLAS-SLHC-02-00-00_VALIDATION' simFlags.SimLayout = 'ATLAS-SLHC-02-00-00' simFlags.SimLayout.set_On() simFlags.EventFilter.set_On() from SiLorentzAngleSvc.LorentzAngleSvcSetup import SCTLorentzAngleSvc # SCTLorentzAngleSvc.OutputLevel=VERBOSE SCTLorentzAngleSvc.SiConditionsServices = None SCTLorentzAngleSvc.Temperature = -20. SCTLorentzAngleSvc.BiasVoltage = 400. SCTLorentzAngleSvc.DepletionVoltage = 70. SCTLorentzAngleSvc.CorrectionFactor = 1.0
# Global conditions tag from AthenaCommon.GlobalFlags import jobproperties jobproperties.Global.ConditionsTag = "OFLCOND-RUN12-SDR-21" # Detector flags from AthenaCommon.DetFlags import DetFlags DetFlags.ID_setOn() DetFlags.Calo_setOn() DetFlags.Muon_setOn() DetFlags.Lucid_setOff() DetFlags.Truth_setOn() # Simulation flags from G4AtlasApps.SimFlags import simFlags simFlags.load_atlas_flags() # Use the default layout simFlags.SimLayout.set_On() # Set the EtaPhi, VertexSpread and VertexRange checks on/off simFlags.EventFilter.set_Off() # Set the LAr parameterization #simFlags.LArParameterization = 2 # Magnetic field simFlags.MagneticField.set_On() # Debug outputs of user actions #CfgGetter.getPublicTool('G4UA::AthenaTrackingActionTool').OutputLevel = DEBUG include("G4AtlasApps/G4Atlas.flat.configuration.py") # Setup the algorithm sequence