globalflags.DetGeo.set_Value_and_Lock('atlas') globalflags.Luminosity.set_Value_and_Lock('zero') globalflags.InputFormat.set_Value_and_Lock('bytestream') if MC: globalflags.DataSource.set_Value_and_Lock('geant4') else: globalflags.DataSource.set_Value_and_Lock('data') if RUN2: globalflags.DatabaseInstance="CONDBR2" else: globalflags.DatabaseInstance="COMP200" from AthenaCommon.BeamFlags import jobproperties jobproperties.Beam.beamType.set_Value_and_Lock('cosmics') from AthenaCommon.DetFlags import DetFlags DetFlags.Calo_setOff() #Switched off to avoid geometry DetFlags.ID_setOff() DetFlags.Muon_setOff() DetFlags.Truth_setOff() DetFlags.LVL1_setOff() DetFlags.digitize.all_setOff() DetFlags.detdescr.ID_setOff() DetFlags.detdescr.Muon_setOff() DetFlags.detdescr.LAr_setOff() DetFlags.detdescr.Tile_setOn() DetFlags.readRDOBS.Tile_setOn() DetFlags.Print() from AthenaCommon.GlobalFlags import jobproperties if RUN2: jobproperties.Global.DetDescrVersion = "ATLAS-R2-2016-01-00-01" else: jobproperties.Global.DetDescrVersion = "ATLAS-R1-2012-02-00-00"
def _do_jobproperties(self): """ Place to handle JobProperties . """ AtlasG4Eng.G4Eng.log.info('SimSkeleton :: _do_JobProperties starting') ## Import extra flags if it hasn't already been done from G4AtlasApps.SimFlags import simFlags if not simFlags.extra_flags: simFlags.load_ctb_flags() # - switch off tasks DetFlags.pileup.all_setOff() DetFlags.simulateLVL1.all_setOff() DetFlags.digitize.all_setOff() 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() # - see if there are beam-conditions if (simFlags.BeamConditions.statusOn and simFlags.BeamConditions.get_Value()): try: AtlasG4Eng.G4Eng.log.info(' SimCtbKernel: '+\ ' loading CTB beam-conditions from the'+\ ' CTB run-condition file !!') BeamCond = __import__(modulepath, globals(), locals(), prepath).BeamCond beam_cond_obj = BeamCond.retrieve_Run( simFlags.RunNumber.get_Value()) beam_cond_obj._map() except: AtlasG4Eng.G4Eng.log.warning(' SimCtbKernel: '+ 'No particular beam conditions found for the run '+\ str(simFlags.RunNumber.get_Value())) # - switch off non-existing detectors DetFlags.FCal_setOff() DetFlags.HEC_setOff() # - Muons off for 13.0.0 release DetFlags.Muon_setOff() AtlasG4Eng.G4Eng.log.info( 'SimCtbKernel : Muons are not supported in releases >= 13.0.0') # - photon runs under run-conditions. For all the photon runs with # run number > 2860 SCT and Pixel were not at the beam # -- LAr material studies if (simFlags.SimLayout.get_Value() == 'ctbh8_lar-material'): DetFlags.SCT_setOff() DetFlags.Muon_setOff() if (simFlags.SimLayout.get_Value() == 'ctbh8_calodata'): DetFlags.ID_setOff() DetFlags.Muon_setOff() # # Note: for combined runs tag 04 in IDET # photon runs tag 08 # larmaterial runs tag 01 if simFlags.SimLayout.get_Value( ) == 'ctbh8_combined' and not simFlags.IdetOracleTag.statusOn: simFlags.IdetOracleTag = "InnerDetector-CTB-04-01" elif simFlags.SimLayout.get_Value( ) == 'ctbh8_phothon' and not simFlags.IdetOracleTag.statusOn: simFlags.IdetOracleTag = "InnerDetector-CTB-08-01" elif simFlags.SimLayout.get_Value( ) == 'ctbh8_lar-material' and not simFlags.IdetOracleTag.statusOn: simFlags.IdetOracleTag = "InnerDetector-CTB-01-01" else: simFlags.IdetOracleTag.set_On() # globalflags.DataSource = "geant4" globalflags.DetGeo = "ctbh8" ## mgallas this is a hack! needed for GeoModel and IOVDbSvc # TODO: Wow! Is this really still needed? import __main__ __main__.DetDescrVersion = 'CTB' __main__.globalflags = globalflags globalflags.DetDescrVersion = 'CTB' ## 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( ) if not simFlags.ISFRun: from G4AtlasApps.G4Atlas_Metadata import checkForSpecialConfigurationMetadata checkForSpecialConfigurationMetadata() ## Print out flags if AtlasG4Eng.G4Eng.log.getEffectiveLevel() < 40: AtlasG4Eng.G4Eng.log.info( 'SimCtbKernel : printing detector flags DetFlags') DetFlags.Print() AtlasG4Eng.G4Eng.log.info( 'SimCtbKernel : printing simulation flags simFlags') jobproperties.print_JobProperties('tree&value') jobproperties.lock_JobProperties() AtlasG4Eng.G4Eng.log.info('SimSkeleton :: _do_JobProperties done')
if ('vp1GlobCond' in dir()): from IOVDbSvc.CondDB import conddb conddb.setGlobalTag(vp1GlobCond) if vp1FilterEvents: import DumpGeo.VP1EvtFilter vp1FilterEvents = DumpGeo.VP1EvtFilter.parseFilterString(vp1FilterEvents) DumpGeo.VP1EvtFilter.installEventFilter(vp1FilterEvents) from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() #Detector setup: from AthenaCommon.DetFlags import DetFlags if (vp1ID): DetFlags.ID_setOn() else: DetFlags.ID_setOff() if (vp1Calo): DetFlags.Calo_setOn() else: DetFlags.Calo_setOff() if (vp1Muon): DetFlags.Muon_setOn() else: DetFlags.Muon_setOff() if (vp1LUCID): DetFlags.Lucid_setOn() else: DetFlags.Lucid_setOff() if (vp1ALFA): DetFlags.ALFA_setOn() else: DetFlags.ALFA_setOff() if (vp1ForwardRegion): DetFlags.FwdRegion_setOn() else: DetFlags.FwdRegion_setOff() if (vp1ZDC): DetFlags.ZDC_setOn() else: DetFlags.ZDC_setOff() DetFlags.Print() if (vp1CustomGeometry): print "Configuring Custom geometry."
def _do_jobproperties(self): """ Place to handle JobProperties . """ AtlasG4Eng.G4Eng.log.info('SimSkeleton :: _do_JobProperties starting') ## Import extra flags if it hasn't already been done from G4AtlasApps.SimFlags import simFlags if not simFlags.extra_flags: simFlags.load_tbLArH6_flags() # - switch off tasks DetFlags.pileup.all_setOff() DetFlags.simulateLVL1.all_setOff() DetFlags.overlay.all_setOff() DetFlags.digitize.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() DetFlags.ID_setOff() DetFlags.Muon_setOff() DetFlags.Tile_setOff() globalflags.DataSource = "geant4" globalflags.DetGeo = "ctbh6" # mgallas this is a hack! needed for GeoModel and IOVDbSvc # TODO: Wow! Is this really still needed? import __main__ __main__.globalflags = globalflags if simFlags.SimLayout.get_Value() == "tb_LArH6_2003": globalflags.DetDescrVersion = 'ATLAS-H6-2003-02' __main__.DetDescrVersion = globalflags.DetDescrVersion.get_Value() elif simFlags.SimLayout.get_Value() == "tb_LArH6_2002": globalflags.DetDescrVersion = 'ATLAS-H6-2002-01' __main__.DetDescrVersion = globalflags.DetDescrVersion.get_Value() elif simFlags.SimLayout.get_Value() == "tb_LArH6EC_2002": globalflags.DetDescrVersion = 'ATLAS-TBEC-01' __main__.DetDescrVersion = globalflags.DetDescrVersion.get_Value() elif simFlags.SimLayout.get_Value() == "tb_LArH6_2004": globalflags.DetDescrVersion = 'ATLAS-H6-2004-00' __main__.DetDescrVersion = globalflags.DetDescrVersion.get_Value() ## 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( ) if not simFlags.ISFRun: from G4AtlasApps.G4Atlas_Metadata import checkForSpecialConfigurationMetadata checkForSpecialConfigurationMetadata() ## Print flags if AtlasG4Eng.G4Eng.log.getEffectiveLevel() < 40: AtlasG4Eng.G4Eng.log.info( 'SimCtbKernel : printing detector flags DetFlags') DetFlags.Print() AtlasG4Eng.G4Eng.log.info( 'SimCtbKernel : printing simulation flags simFlags') jobproperties.print_JobProperties('tree&value') jobproperties.lock_JobProperties() AtlasG4Eng.G4Eng.log.info('SimSkeleton :: _do_JobProperties done')