def generateSubDetectorList(): SubDetectorList = [] from G4AtlasApps.SimFlags import simFlags from AthenaCommon.BeamFlags import jobproperties if jobproperties.Beam.beamType() == 'cosmics' or \ (simFlags.CavernBG.statusOn and not 'Signal' in simFlags.CavernBG.get_Value() ): if jobproperties.Beam.beamType() == 'cosmics' and hasattr( simFlags, "ReadTR"): SubDetectorList += ['CosmicShortCut'] from AthenaCommon.DetFlags import DetFlags if DetFlags.Muon_on(): SubDetectorList += ['MUONQ02'] #FIXME rename to MUON when safe if DetFlags.ID_on(): SubDetectorList += ['IDET'] if DetFlags.Calo_on(): SubDetectorList += ['CALO'] if DetFlags.ID_on(): #HACK if DetFlags.bpipe_on(): #HACK SubDetectorList += ['BeamPipe'] #HACK if DetFlags.geometry.Lucid_on(): SubDetectorList += ['Lucid'] if simFlags.ForwardDetectors.statusOn: SubDetectorList += ['ForwardRegion'] #if DetFlags.Muon_on(): #HACK # SubDetectorList += ['MUONQ02'] #FIXME rename to MUON when safe #HACK #SubDetectorList += generateFwdSubDetectorList() #FIXME Fwd Detectors not supported yet. return SubDetectorList
def getATLAS_FieldMgrList(): fieldMgrList = [] from G4AtlasApps.SimFlags import simFlags if not simFlags.TightMuonStepping.statusOn or\ not simFlags.TightMuonStepping(): fieldMgrList += ['ATLASFieldManager'] else: fieldMgrList += ['TightMuonsATLASFieldManager'] from AthenaCommon.DetFlags import DetFlags if DetFlags.bpipe_on(): fieldMgrList += ['BeamPipeFieldManager'] if DetFlags.ID_on(): fieldMgrList += ['InDetFieldManager'] if DetFlags.Calo_on( ) and simFlags.MuonFieldOnlyInCalo.statusOn and simFlags.MuonFieldOnlyInCalo( ): fieldMgrList += ['MuonsOnlyInCaloFieldManager'] if DetFlags.Muon_on(): fieldMgrList += ['MuonFieldManager'] if simFlags.ForwardDetectors.statusOn: if DetFlags.geometry.FwdRegion_on(): fieldMgrList += [ 'Q1FwdFieldManager', 'Q2FwdFieldManager', 'Q3FwdFieldManager', 'D1FwdFieldManager', 'D2FwdFieldManager', 'Q4FwdFieldManager', 'Q5FwdFieldManager', 'Q6FwdFieldManager', 'Q7FwdFieldManager', 'Q1HKickFwdFieldManager', 'Q1VKickFwdFieldManager', 'Q2HKickFwdFieldManager', 'Q2VKickFwdFieldManager', 'Q3HKickFwdFieldManager', 'Q3VKickFwdFieldManager', 'Q4VKickAFwdFieldManager', 'Q4HKickFwdFieldManager', 'Q4VKickBFwdFieldManager', 'Q5HKickFwdFieldManager', 'Q6VKickFwdFieldManager', 'FwdRegionFieldManager' ] return fieldMgrList
def getParticlePositionFilterDynamic(name="ISF_ParticlePositionFilterDynamic", **kwargs): # automatically choose the best fitting filter region if DetFlags.Muon_on(): return getParticlePositionFilterWorld(name, **kwargs) elif DetFlags.Calo_on(): return getParticlePositionFilterCalo(name, **kwargs) elif DetFlags.ID_on(): return getParticlePositionFilterID(name, **kwargs) else: return getParticlePositionFilterWorld(name, **kwargs)
def getFatrasGeometryBuilder(name="ISF_FatrasGeometryBuilder", **kwargs): # the geometry builder alg tool # switch on the Detectors #kwargs.setdefault("InDetTrackingGeometry" , DetFlags.ID_on()) #kwargs.setdefault("CaloTrackingGeometry" , DetFlags.Calo_on()) #kwargs.setdefault("MuonTrackingGeometry" , DetFlags.Muon_on()) if DetFlags.ID_on(): kwargs.setdefault("InDetTrackingGeometryBuilder",getPublicTool('ISF_InDetTrackingGeometryBuilder')) if DetFlags.Calo_on(): kwargs.setdefault("CaloTrackingGeometryBuilder" ,getPublicTool('ISF_FatrasCaloTrackingGeometryBuilder')) if DetFlags.Muon_on(): kwargs.setdefault("MuonTrackingGeometryBuilder" ,getPublicTool('ISF_FatrasMuonTrackingGeometryBuilder')) from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__GeometryBuilder return Trk__GeometryBuilder(name, **kwargs )
def generateEnvelopeSensitiveDetectorList(): SensitiveDetectorList = [] from G4AtlasApps.SimFlags import simFlags from AthenaCommon.BeamFlags import jobproperties if jobproperties.Beam.beamType() == 'cosmics' and hasattr( simFlags, "ReadTR") and not simFlags.ReadTR.statusOn: SensitiveDetectorList += ['CosmicRecord'] if not simFlags.ISFRun: from AthenaCommon.DetFlags import DetFlags if DetFlags.ID_on(): SensitiveDetectorList += ['CaloEntryLayer'] if DetFlags.Calo_on(): SensitiveDetectorList += ['MuonEntryLayer'] if DetFlags.geometry.Muon_on(): SensitiveDetectorList += ['MuonExitLayer'] return SensitiveDetectorList
def getEnvelopeMap(): from G4AtlasApps.SimFlags import simFlags from AthenaCommon.DetFlags import DetFlags from AthenaCommon.BeamFlags import jobproperties as beamProps # Map of volume name to output collection name envelopeMap = dict() if (hasattr(simFlags, "LArFarUpstreamMaterial") and simFlags.LArFarUpstreamMaterial.statusOn and simFlags.LArFarUpstreamMaterial.get_Value()): envelopeMap.update({ 'LARFARUPSTREAMMATERIAL::LARFARUPSTREAMMATERIAL': 'LArFarUpstreamMaterialExitLayer' }) if beamProps.Beam.beamType() == 'cosmics': ## First filter volume if simFlags.CosmicFilterVolumeName == "TRT_Barrel": envelopeMap['TRT::BarrelOuterSupport'] = 'TRTBarrelEntryLayer' elif simFlags.CosmicFilterVolumeName == "TRT_EC": envelopeMap['TRT::WheelA'] = 'TRTECAEntryLayer' envelopeMap['TRT::WheelB'] = 'TRTECBEntryLayer' elif simFlags.CosmicFilterVolumeName == "SCT_Barrel": envelopeMap[ 'SCT::ThShieldOuterCly'] = 'SCTBarrelEntryLayer' # could be ThShieldInnerCly or Cyl.. elif simFlags.CosmicFilterVolumeName == "Pixel": envelopeMap['Pixel::Pixel'] = 'PixelEntryLayer' ## If second volume requested if simFlags.CosmicFilterVolumeName2.statusOn: if simFlags.CosmicFilterVolumeName2 == "TRT_Barrel": envelopeMap['TRT::BarrelOuterSupport'] = 'TRTBarrelEntryLayer' elif simFlags.CosmicFilterVolumeName2 == "TRT_EC": envelopeMap['TRT::WheelA'] = 'TRTECAEntryLayer' envelopeMap['TRT::WheelB'] = 'TRTECBEntryLayer' elif simFlags.CosmicFilterVolumeName2 == "SCT_Barrel": envelopeMap[ 'SCT::ThShieldOuterCly'] = 'SCTBarrelEntryLayer' # could be ThShieldInnerCly or Cyl.. elif simFlags.CosmicFilterVolumeName2 == "Pixel": envelopeMap['Pixel::Pixel'] = 'PixelEntryLayer' if not simFlags.ISFRun: if DetFlags.ID_on(): envelopeMap['IDET::IDET'] = 'CaloEntryLayer' if DetFlags.Calo_on(): envelopeMap['CALO::CALO'] = 'MuonEntryLayer' if DetFlags.geometry.Muon_on(): envelopeMap['MUONQ02::MUONQ02'] = 'MuonExitLayer' return envelopeMap
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#*"]
def getATLAS_RegionCreatorList(): regionCreatorList = [] from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags isUpgrade = commonGeoFlags.Run() == "RUN4" or ( commonGeoFlags.Run() == "UNDEFINED" and geoFlags.isSLHC()) isRUN2 = (commonGeoFlags.Run() in [ "RUN2", "RUN3" ]) or (commonGeoFlags.Run() == "UNDEFINED" and geoFlags.isIBL()) from G4AtlasApps.SimFlags import simFlags from AthenaCommon.DetFlags import DetFlags if simFlags.SimulateCavern.get_Value(): regionCreatorList += [ 'SX1PhysicsRegionTool', 'BedrockPhysicsRegionTool', 'CavernShaftsConcretePhysicsRegionTool' ] #regionCreatorList += ['CavernShaftsAirPhysicsRegionTool'] # Not used currently if DetFlags.ID_on(): if DetFlags.pixel_on(): regionCreatorList += ['PixelPhysicsRegionTool'] if DetFlags.SCT_on(): regionCreatorList += ['SCTPhysicsRegionTool'] if DetFlags.TRT_on() and not isUpgrade: regionCreatorList += ['TRTPhysicsRegionTool'] if isRUN2: regionCreatorList += ['TRT_ArPhysicsRegionTool' ] #'TRT_KrPhysicsRegionTool' # FIXME dislike the ordering here, but try to maintain the same ordering as in the old configuration. if DetFlags.bpipe_on(): if simFlags.BeamPipeSimMode.statusOn and simFlags.BeamPipeSimMode( ) != "Normal": regionCreatorList += ['BeampipeFwdCutPhysicsRegionTool'] if simFlags.ForwardDetectors.statusOn and simFlags.ForwardDetectors( ) == 2: regionCreatorList += ['FWDBeamLinePhysicsRegionTool'] if DetFlags.Calo_on(): if DetFlags.geometry.LAr_on(): ## Shower parameterization overrides the calibration hit flag if simFlags.LArParameterization.statusOn and simFlags.LArParameterization() > 0 \ and simFlags.CalibrationRun.statusOn and simFlags.CalibrationRun.get_Value() in ['LAr','LAr+Tile','DeadLAr']: print( 'You requested both calibration hits and frozen showers / parameterization in the LAr.' ) print( ' Such a configuration is not allowed, and would give junk calibration hits where the showers are modified.' ) print( ' Please try again with a different value of either simFlags.LArParameterization (' + str(simFlags.LArParameterization()) + ') or simFlags.CalibrationRun (' + str(simFlags.CalibrationRun.get_Value()) + ')') raise RuntimeError('Configuration not allowed') if simFlags.LArParameterization() > 0: regionCreatorList += [ 'EMBPhysicsRegionTool', 'EMECPhysicsRegionTool', 'HECPhysicsRegionTool', 'FCALPhysicsRegionTool' ] # FIXME 'EMBPhysicsRegionTool' used for parametrization also - do we need a second instance?? regionCreatorList += [ 'EMECParaPhysicsRegionTool', 'FCALParaPhysicsRegionTool', 'FCAL2ParaPhysicsRegionTool' ] if simFlags.LArParameterization.get_Value() > 1: regionCreatorList += [ 'PreSampLArPhysicsRegionTool', 'DeadMaterialPhysicsRegionTool' ] elif simFlags.LArParameterization( ) is None or simFlags.LArParameterization() == 0: regionCreatorList += [ 'EMBPhysicsRegionTool', 'EMECPhysicsRegionTool', 'HECPhysicsRegionTool', 'FCALPhysicsRegionTool' ] ## FIXME _initPR never called for FwdRegion?? #if simFlags.ForwardDetectors.statusOn: # if DetFlags.geometry.FwdRegion_on(): # regionCreatorList += ['FwdRegionPhysicsRegionTool'] if DetFlags.Muon_on(): regionCreatorList += [ 'DriftWallPhysicsRegionTool', 'DriftWall1PhysicsRegionTool', 'DriftWall2PhysicsRegionTool' ] if simFlags.CavernBG.statusOn and simFlags.CavernBG.get_Value( ) != 'Read' and not (simFlags.RecordFlux.statusOn and simFlags.RecordFlux()): regionCreatorList += ['MuonSystemFastPhysicsRegionTool'] return regionCreatorList
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
def configure(self,keys=None): super(MuonStandalone,self).configure(keys) if not self.isEnabled(): return print " configuring MuonStandalone: flags ", muonStandaloneFlags from AthenaCommon.BeamFlags import jobproperties beamFlags = jobproperties.Beam SegmentLocation = "MuonSegments" if muonStandaloneFlags.segmentOrigin == 'TruthTracking': SegmentLocation = "ThirdChainSegments" if muonRecFlags.doNSWNewThirdChain(): getPublicTool("MuonLayerHoughTool") self.addAlg( CfgMgr.MuonLayerHoughAlg( "MuonLayerHoughAlg", PrintSummary = muonStandaloneFlags.printSummary() ) ) if not muonStandaloneFlags.patternsOnly(): SegmentFinder = getPublicTool("MuonClusterSegmentFinderTool") Cleaner = getPublicToolClone("MuonTrackCleaner_seg","MuonTrackCleaner") Cleaner.PullCut = 3 Cleaner.PullCutPhi = 3 SegmentFinder.TrackCleaner = Cleaner # for test purposes allow parallel running of truth segment finding and new segment finder MuonSegmentFinderAlg = CfgMgr.MuonSegmentFinderAlg( "MuonSegmentMaker",SegmentCollectionName=SegmentLocation, MuonPatternCalibration = getPublicTool("MuonPatternCalibration"), MuonPatternSegmentMaker = getPublicTool("MuonPatternSegmentMaker"), MuonTruthSummaryTool = None, PrintSummary = muonStandaloneFlags.printSummary() ) if( muonRecFlags.doCSCs() ): getPublicTool("CscSegmentUtilTool") getPublicTool("Csc2dSegmentMaker") getPublicTool("Csc4dSegmentMaker") else: MuonSegmentFinderAlg.Csc2dSegmentMaker = None MuonSegmentFinderAlg.Csc4dSegmentMaker = None self.addAlg( MuonSegmentFinderAlg ) else: getPublicTool("MuonLayerHoughTool") self.addAlg( CfgMgr.MooSegmentFinderAlg( "MuonSegmentMaker", SegmentFinder = getPublicToolClone("MuonSegmentFinder","MooSegmentFinder", DoSummary=muonStandaloneFlags.printSummary()), MuonSegmentOutputLocation = SegmentLocation, UseCSC = muonRecFlags.doCSCs(), UseMDT = muonRecFlags.doMDTs(), UseRPC = muonRecFlags.doRPCs(), UseTGC = muonRecFlags.doTGCs(), UseTGCPriorBC = muonRecFlags.doTGCs() and muonRecFlags.useTGCPriorNextBC(), UseTGCNextBC = muonRecFlags.doTGCs() and muonRecFlags.useTGCPriorNextBC(), doTGCClust = muonRecFlags.doTGCClusterSegmentFinding(), doRPCClust = muonRecFlags.doRPCClusterSegmentFinding() )) self.addAlg( CfgMgr.MooSegmentFinderAlg( "MuonSegmentMaker_NCB", SegmentFinder = getPublicToolClone("MooSegmentFinder_NCB","MuonSegmentFinder", DoSummary=False, Csc2dSegmentMaker = getPublicToolClone("Csc2dSegmentMaker_NCB","Csc2dSegmentMaker", segmentTool = getPublicToolClone("CscSegmentUtilTool_NCB", "CscSegmentUtilTool", TightenChi2 = False, IPconstraint=False)), Csc4dSegmentMaker = getPublicToolClone("Csc4dSegmentMaker_NCB","Csc4dSegmentMaker", segmentTool = getPublicTool("CscSegmentUtilTool_NCB")), DoMdtSegments=False,DoSegmentCombinations=False,DoSegmentCombinationCleaning=False), MuonPatternCombinationLocation = "NCB_MuonHoughPatternCombinations", MuonSegmentOutputLocation = "NCB_MuonSegments", MuonSegmentCombinationOutputLocation = "NCB_MooreSegmentCombinations", UseCSC = muonRecFlags.doCSCs(), UseMDT = False, UseRPC = False, UseTGC = False, UseTGCPriorBC = False, UseTGCNextBC = False, doTGCClust = False, doRPCClust = False) ) self.addAlg( CfgMgr.xAODMaker__MuonSegmentCnvAlg("MuonSegmentCnvAlg") ) self.addAlg( CfgMgr.xAODMaker__MuonSegmentCnvAlg("MuonSegmentCnvAlg_NCB",SegmentContainerName="NCB_MuonSegments",xAODContainerName="NCB_MuonSegments") ) if muonStandaloneFlags.doSegmentsOnly(): return # Tracks builder # # add the algorithm (which uses the MuonTrackSteering) # TrackBuilder = CfgMgr.MuPatTrackBuilder("MuPatTrackBuilder", TrackSteering = getPublicTool("MuonTrackSteering") ) self.addAlg( TrackBuilder ) self.registerOutputKey("MuonSpectrometerTracks", self.MuPatTrackBuilder, "SpectrometerTrackOutputLocation") self.registerInputKey ("MuonSegments", self.MuPatTrackBuilder, "MuonSegmentCollection" ) if muonStandaloneFlags.createTrackParticles() and DetFlags.ID_on(): from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg xAODTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg( name = "MuonStandaloneTrackParticleCnvAlg", TrackParticleCreator = getPublicTool("MuonParticleCreatorTool"), TrackContainerName = "MuonSpectrometerTracks", xAODTrackParticlesFromTracksContainerName = "MuonSpectrometerTrackParticles", ConvertTrackParticles = False, ConvertTracks = True ) self.addAlg( xAODTrackParticleCnvAlg )
# set the detectors on/off and steer the fast simulation flags from AthenaCommon.DetFlags import DetFlags DetFlags.ID_setOn() # --- no TRT for SLHC DetFlags.TRT_setOff() DetFlags.detdescr.TRT_setOff() DetFlags.makeRIO.TRT_setOff() # Calo and Muon off for SLHC DetFlags.Calo_setOff() DetFlags.Muon_setOff() #from GeoModelSvc.GeoModelSvcConf import GeoModelSvc #GeoModelSvc.InDetVersionOverride="InnerDetector-SLHC-00" from FastSimulationConfig.FastSimulationFlags import jobproperties jobproperties.FastSimulation.doFatrasID = DetFlags.ID_on() jobproperties.FastSimulation.doFatrasMuon = DetFlags.Muon_on() # run additional fast calo sim FatrasFlags.FastCaloSim = False #-------------------------------------------------------------- # load Global Flags and set defaults (import the new jobProperty globalflags) #-------------------------------------------------------------- from AthenaCommon.GlobalFlags import globalflags # --- default is atlas geometry globalflags.DetGeo = 'atlas' # --- set defaults globalflags.DataSource = 'geant4' # --- input is pool for SLHC
def __init__(self, name='AtlasTrackingGeometrySvc'): if TrkDetFlags.ConfigurationOutputLevel() < 3: print('[ Configuration : start ] *** ' + name + ' ********************************') print('[ TrackingGeometrySvc ]') from AthenaCommon.AppMgr import ToolSvc ################################################################################# # The Geometry Builder ################################################################################# # the name to register the Geometry AtlasTrackingGeometryName = 'AtlasTrackingGeometry' # the geometry builder alg tool from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__GeometryBuilder AtlasGeometryBuilder = Trk__GeometryBuilder( name='AtlasGeometryBuilder') # switch the building outputlevel on AtlasGeometryBuilder.OutputLevel = TrkDetFlags.ConfigurationOutputLevel( ) # the envelope definition service from AthenaCommon.CfgGetter import getPrivateTool,getPrivateToolClone,getPublicTool,getPublicToolClone,\ getService,getServiceClone,getAlgorithm,getAlgorithmClone AtlasEnvelopeSvc = getService('AtlasGeometry_EnvelopeDefSvc') # (ID) if DetFlags.ID_on(): # get hand on the ID Tracking Geometry Builder if TrkDetFlags.ISF_FatrasCustomGeometry(): if hasattr(ToolSvc, TrkDetFlags.ISF_FatrasCustomGeometryBuilderName()): InDetTrackingGeometryBuilder = getattr( ToolSvc, TrkDetFlags.ISF_FatrasCustomGeometryBuilderName()) elif TrkDetFlags.XMLFastCustomGeometry(): if hasattr(ToolSvc, TrkDetFlags.InDetTrackingGeometryBuilderName()): InDetTrackingGeometryBuilder = getattr( ToolSvc, TrkDetFlags.InDetTrackingGeometryBuilderName()) else: if not TrkDetFlags.SLHC_Geometry( ) and not TrkDetFlags.InDetStagedGeometryBuilder(): from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder elif not TrkDetFlags.SLHC_Geometry(): from InDetTrackingGeometry.ConfiguredStagedTrackingGeometryBuilder import ConfiguredStagedTrackingGeometryBuilder as IDGeometryBuilder else: from InDetTrackingGeometry.ConfiguredSLHC_InDetTrackingGeometryBuilder import ConfiguredSLHC_InDetTrackingGeometryBuilder as IDGeometryBuilder InDetTrackingGeometryBuilder = IDGeometryBuilder( name='InDetTrackingGeometryBuilder') InDetTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc InDetTrackingGeometryBuilder.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel( ) # and give it to the Geometry Builder AtlasGeometryBuilder.InDetTrackingGeometryBuilder = InDetTrackingGeometryBuilder # # (Calo) if DetFlags.Calo_on(): from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator CaloVolumeCreator = Trk__CylinderVolumeCreator("CaloVolumeCreator") CaloVolumeCreator.OutputLevel = TrkDetFlags.CaloBuildingOutputLevel( ) ToolSvc += CaloVolumeCreator from CaloTrackingGeometry.ConfiguredCaloTrackingGeometryBuilder import ConfiguredCaloTrackingGeometryBuilder as ConfiguredCaloGeo CaloTrackingGeometryBuilder = ConfiguredCaloGeo( name='CaloTrackingGeometryBuilder') CaloTrackingGeometryBuilder.TrackingVolumeCreator = CaloVolumeCreator CaloTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc CaloTrackingGeometryBuilder.OutputLevel = TrkDetFlags.CaloBuildingOutputLevel( ) CaloTrackingGeometryBuilder.GeometryName = 'Calo' # and give it to the Geometry Builder AtlasGeometryBuilder.CaloTrackingGeometryBuilder = CaloTrackingGeometryBuilder # (Muon) if DetFlags.Muon_on(): from MuonTrackingGeometry.ConfiguredMuonTrackingGeometry import MuonTrackingGeometryBuilder MuonTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc # and give it to the Geometry Builder AtlasGeometryBuilder.MuonTrackingGeometryBuilder = MuonTrackingGeometryBuilder # processors AtlasGeometryProcessors = [] # check whether the material retrieval is ment to be from COOL if TrkDetFlags.MaterialSource() is 'COOL': # the material provider from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerMaterialProvider as LayerMaterialProvider AtlasMaterialProvider = LayerMaterialProvider( 'AtlasMaterialProvider') AtlasMaterialProvider.OutputLevel = TrkDetFlags.ConfigurationOutputLevel( ) AtlasMaterialProvider.LayerMaterialMapName = TrkDetFlags.MaterialStoreGateKey( ) AtlasGeometryProcessors += [AtlasMaterialProvider] # the tag names CoolDataBaseFolder = TrkDetFlags.MaterialStoreGateKey() AtlasMaterialTag = TrkDetFlags.MaterialTagBase() + str( TrkDetFlags.MaterialVersion( )) + TrkDetFlags.MaterialSubVersion() + '_' if TrkDetFlags.ConfigurationOutputLevel() < 3: print('[ TrackingGeometrySvc ] Associating DB folder : ', CoolDataBaseFolder) # we need the conditions interface from IOVDbSvc.CondDB import conddb # use a local database if TrkDetFlags.MaterialDatabaseLocal(): # specify the local database DataBasePath = TrkDetFlags.MaterialDatabaseLocalPath() DataBaseName = TrkDetFlags.MaterialDatabaseLocalName() MagicTag = TrkDetFlags.MaterialMagicTag() DataBaseConnection = '<dbConnection>sqlite://X;schema=' + DataBasePath + DataBaseName + ';dbname=OFLP200</dbConnection>' conddb.blockFolder('/GLOBAL/TrackingGeo/LayerMaterialV2') conddb.addFolderWithTag('', DataBaseConnection + CoolDataBaseFolder, AtlasMaterialTag + MagicTag, force=True) if TrkDetFlags.ConfigurationOutputLevel() < 3: print('[ TrackingGeometrySvc ] Using Local Database: ' + DataBaseConnection) # make sure that the pool files are in the catalog elif TrkDetFlags.SLHC_Geometry(): # set the folder to the SLHC location CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialITK' ctag = AtlasMaterialTag + TrkDetFlags.MaterialMagicTag() cfoldertag = CoolDataBaseFolder + ' <tag>' + ctag + '</tag>' conddb.addFolderSplitMC('GLOBAL', cfoldertag, cfoldertag) else: print('[ TrackingGeometrySvc ] base material tag : ', AtlasMaterialTag) cfolder = CoolDataBaseFolder + '<tag>TagInfoMajor/' + AtlasMaterialTag + '/GeoAtlas</tag>' print('[ TrackingGeometrySvc ] translated to COOL: ', cfolder) # load the right folders (preparation for calo inclusion) conddb.addFolderSplitMC('GLOBAL', cfolder, cfolder) elif TrkDetFlags.MaterialSource() is 'Input': # the material provider from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__InputLayerMaterialProvider AtlasMaterialProvider = Trk__InputLayerMaterialProvider( 'AtlasMaterialProvider') AtlasMaterialProvider.OutputLevel = TrkDetFlags.ConfigurationOutputLevel( ) AtlasGeometryProcessors += [AtlasMaterialProvider] # material validation if TrkDetFlags.MaterialValidation(): # load the material inspector from TrkDetDescrTestTools.TrkDetDescrTestToolsConf import Trk__LayerMaterialInspector AtlasLayerMaterialInspector = Trk__LayerMaterialInspector( 'AtlasLayerMaterialInspector') AtlasLayerMaterialInspector.OutputLevel = TrkDetFlags.ConfigurationOutputLevel( ) AtlasGeometryProcessors += [AtlasLayerMaterialInspector] # call the base class constructor : sets the tools Trk__TrackingGeometrySvc.__init__(self,name,\ GeometryBuilder = AtlasGeometryBuilder,\ TrackingGeometryName = AtlasTrackingGeometryName,\ GeometryProcessors = AtlasGeometryProcessors, \ BuildGeometryFromTagInfo = True,\ OutputLevel = TrkDetFlags.ConfigurationOutputLevel()) # screen output of the configuration if TrkDetFlags.ConfigurationOutputLevel() < 3: print(self) print('* [ GeometryBuilder ]') print(AtlasGeometryBuilder) print('* [ Configuration : end ] ***' + name + '********************************')
job += CfgGetter.getAlgorithm(digitizationFlags.digiSteeringConf.get_Value(), tryDefaultConfigurable=True) if 'doFastPixelDigi' in digitizationFlags.experimentalDigi() or 'doFastSCT_Digi' in digitizationFlags.experimentalDigi() or 'doFastTRT_Digi' in digitizationFlags.experimentalDigi(): print "WARNING Setting doFastPixelDigi ,doFastSCT_Digi or doFastTRT_Digi in digitizationFlags.experimentalDigi no longer overrides digitizationFlags.digiSteeringConf." elif 'doSplitDigi' in digitizationFlags.experimentalDigi(): print "WARNING Setting doSplitDigi in digitizationFlags.experimentalDigi no longer overrides digitizationFlags.digiSteeringConf. Use --digiSteeringConf 'Split' on the command-line instead." # MC Truth info #if DetFlags.Truth_on(): # include( "Digitization/TruthDigitization.py" ) # Forward Detectors #if DetFlags.Forward_on(): # include( "Digitization/FwdDetDigitization.py" ) # Inner Detector if DetFlags.ID_on(): include( "Digitization/InDetDigitization.py" ) # Calorimeters if DetFlags.Calo_on(): include( "Digitization/CaloDigitization.py" ) # Muon Digitization if DetFlags.Muon_on(): include( "Digitization/MuonDigitization.py" ) # LVL1 trigger simulation #if DetFlags.digitize.LVL1_on(): include( "Digitization/LVL1Digitization.py" )
def __init__(self): from AthenaCommon.Include import include from AthenaCommon.AppMgr import ToolSvc ################################################################################## # The FatrasTrackingGeometry Svc fragment # # usage: # include('TrkDetDescrSvc/FatrasTrackingGeometrySvc.py') # # + for the navigator, set the TrackingGeometryName to: # FatrasTrackingGeometrySvc.trackingGeometryName() # ################################################################################## # import the DetFlags for the setting from AthenaCommon.DetFlags import DetFlags ################################################################################# # Material for the Geometry # # if only ID is switched on different COOLDB Folders # and different Tag is used # ################################################################################# from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags if TrkDetFlags.ConfigurationOutputLevel() < 3 : print '[ Configuration : start ] *** FatrasTrackingGeometry ********************************' print '[ TrackingGeometrySvc ]' # check whether the material retrieval is ment to be from COOL if TrkDetFlags.MaterialFromCool() : # the tag names CoolDataBaseFolder = TrkDetFlags.MaterialStoreGateKey() AtlasMaterialTag = TrkDetFlags.MaterialTagBase()+str(TrkDetFlags.MaterialVersion())+'_' if TrkDetFlags.ConfigurationOutputLevel() < 3 : print '[ TrackingGeometrySvc ] Associating DB folder : ',CoolDataBaseFolder print '[ TrackingGeometrySvc ] base material tag : ',AtlasMaterialTag # we need the conditions interface from IOVDbSvc.CondDB import conddb # use a local database if TrkDetFlags.MaterialDatabaseLocal(): # specify the local database DataBasePath = TrkDetFlags.MaterialDatabaseLocalPath() DataBaseName = TrkDetFlags.MaterialDatabaseLocalName() MagicTag = TrkDetFlags.MaterialMagicTag() DataBaseConnection = '<dbConnection>sqlite://X;schema='+DataBasePath+DataBaseName+';dbname=OFLP200</dbConnection>' conddb.blockFolder('/GLOBAL/TrackingGeo/LayerMaterial') conddb.addFolderWithTag('',DataBaseConnection+CoolDataBaseFolder,AtlasMaterialTag+MagicTag,force=True) if TrkDetFlags.ConfigurationOutputLevel() < 3 : print '[ TrackingGeometrySvc ] Using Local Database: '+DataBaseConnection # make sure that the pool files are in the catalog #from PoolSvc.PoolSvcConf import PoolSvc #PoolSvc.ReadCatalog += [ DataBasePath+'PoolFileCatalog.xml' ] elif TrkDetFlags.SLHC_Geometry() : # set the folder to the SLHC location CoolDataBaseFolder = '/GLOBAL/TrackingGeo/SLHC_LayerMaterial' ctag = AtlasMaterialTag+TrkDetFlags.MaterialMagicTag() cfoldertag = CoolDataBaseFolder+' <tag>'+ctag+'</tag>' conddb.addFolderSplitMC('GLOBAL',cfoldertag,cfoldertag) else : # load the right folders (preparation for calo inclusion) cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'/GeoAtlas</tag>' conddb.addFolderSplitMC('GLOBAL',cfolder,cfolder) ################################################################################# # The Geometry Builder ################################################################################# # the name to register the Geometry FatrasTrackingGeometryName = 'FatrasTrackingGeometry' # the geometry builder alg tool from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__GeometryBuilder FatrasGeometryBuilder = Trk__GeometryBuilder(name = 'FatrasGeometryBuilder') # switch on the Detectors FatrasGeometryBuilder.InDetTrackingGeometry = DetFlags.ID_on() FatrasGeometryBuilder.CaloTrackingGeometry = DetFlags.Calo_on() FatrasGeometryBuilder.MuonTrackingGeometry = DetFlags.Muon_on() # avoid double building of MTG # register it to tool svc ToolSvc += FatrasGeometryBuilder # (ID) if DetFlags.ID_on() : # get hand on the ID Tracking Geometry Builder if not TrkDetFlags.SLHC_Geometry() : from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder as IDGeometryBuilder else : from InDetTrackingGeometry.ConfiguredSLHC_InDetTrackingGeometryBuilder import ConfiguredSLHC_InDetTrackingGeometryBuilder as IDGeometryBuilder if not TrkDetFlags.SLHC_Geometry() : self.__InDetTrackingGeometryBuilder__ = IDGeometryBuilder(name ='InDetTrackingGeometryBuilder', namePrefix = 'Fatras', setLayerAssociation = False, buildTrtStrawLayers = True) self.__InDetTrackingGeometryBuilder__.VolumeEnclosureOuterR = 1148. else : self.__InDetTrackingGeometryBuilder__ = IDGeometryBuilder(name ='InDetTrackingGeometryBuilder', namePrefix = 'Fatras', setLayerAssociation = False) self.__InDetTrackingGeometryBuilder__.VolumeEnclosureOuterR = 1148. # make a public tool out of it ToolSvc += self.__InDetTrackingGeometryBuilder__ # and give it to the Geometry Builder FatrasGeometryBuilder.InDetTrackingGeometryBuilder = self.__InDetTrackingGeometryBuilder__ # # (Calo) if DetFlags.Calo_on(): from CaloTrackingGeometry.ConfiguredCaloTrackingGeometryBuilder import ConfiguredCaloTrackingGeometryBuilder as ConfiguredCaloGeo CaloTrackingGeometryBuilder = ConfiguredCaloGeo(name = 'FatrasCaloTrackingGeometryBuilder') CaloTrackingGeometryBuilder.RecordLayerIndexCaloSampleMap = True # make a publid tool ToolSvc += CaloTrackingGeometryBuilder # and give it to the Geometry Builder FatrasGeometryBuilder.CaloTrackingGeometryBuilder = CaloTrackingGeometryBuilder # (Muon) if DetFlags.Muon_on(): from MuonTrackingGeometry.ConfiguredMuonTrackingGeometry import MuonTrackingGeometryBuilder FatrasMuonTrackingGeometryBuilder = MuonTrackingGeometryBuilder(name = 'FatrasMuonTrackingGeometryBuilder') FatrasMuonTrackingGeometryBuilder.BarrelZ = 6783. FatrasMuonTrackingGeometryBuilder.InnerBarrelRadius = 4255. ToolSvc += FatrasMuonTrackingGeometryBuilder # and give it to the Geometry Builder FatrasGeometryBuilder.MuonTrackingGeometryBuilder = FatrasMuonTrackingGeometryBuilder # then get the tuning parameters from FatrasExample.FatrasTuning import FatrasTuningFlags if FatrasTuningFlags.MaterialDistortionsX0.statusOn and \ FatrasTuningFlags.MaterialDistortionsRho.statusOn : from TrkDetDescrSvc.TrkDetDescrSvcConf import CalibrationTrackingGeometrySvc as GeometrySvc else : from TrkDetDescrSvc.TrkDetDescrSvcConf import TrackingGeometrySvc as GeometrySvc FatrasTrackingGeometrySvc = GeometrySvc(name = 'FatrasTrackingGeometrySvc') # register the Builder FatrasTrackingGeometrySvc.GeometryBuilder = FatrasGeometryBuilder # and register the name under which the geometry is registered FatrasTrackingGeometrySvc.TrackingGeometryName = FatrasTrackingGeometryName # global scaling of the material if necessary FatrasTrackingGeometrySvc.GlobalScaleFactor = FatrasTuningFlags.MaterialScalor() # some flags - only works when ID is on FatrasTrackingGeometrySvc.AssignMaterialFromCOOL = True FatrasTrackingGeometrySvc.BuildGeometryFromTagInfo = True # Material scaling & distortion if FatrasTuningFlags.MaterialDistortionsX0.statusOn and \ FatrasTuningFlags.MaterialDistortionsRho.statusOn : FatrasTrackingGeometrySvc.RandomDistortions = True FatrasTrackingGeometrySvc.DistortionsRadiationLength = FatrasTuningFlags.MaterialDistortionsX0() FatrasTrackingGeometrySvc.DistortionsDensity = FatrasTuningFlags.MaterialDistortionsRho() from FatrasExample.FatrasValidation import FatrasValidationFlags FatrasTrackingGeometrySvc.RecordDistortions = FatrasValidationFlags.MaterialDistortions() FatrasTrackingGeometrySvc.DistortionOutputFolder = '/'+FatrasValidationFlags.ValidationStream()+'/MaterialDistortions' # switch to the rigth CoolDB folder FatrasTrackingGeometrySvc.InputLayerMaterialSetName = CoolDataBaseFolder from AthenaCommon.AppMgr import ServiceMgr as svcMgr svcMgr += FatrasTrackingGeometrySvc print '* [ Configuration : start ] *** FatrasTrackingGeometry ********************************' print '* [ FatrasTrackingGeometrySvc ]' print FatrasTrackingGeometrySvc print '* [ GeometryBuilder ]' print FatrasGeometryBuilder print '* [ Configuration : end ] *** FatrasTrackingGeometry ********************************' ################################################################################## self.__geoSvc__ = FatrasTrackingGeometrySvc
# set the MuonTrkGeo if not set --- Muon System in Prototype state if not 'MuonTrkGeo' in dir(): MuonTrkGeo = DetFlags.Muon_on() # the steering for the CaloEnergyLoss tool if not 'doCaloTrkEloss' in dir(): doCaloTrkEloss = False if CaloTrkGeo: CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterial' AtlasMaterialTag = 'AtlasLayerMat_v5_' # load the right folders (preparation for calo inclusion) from IOVDbSvc.CondDB import conddb if DetFlags.ID_on() and not CaloTrkGeo: conddb.addFolder('INDET',CoolDataBaseFolder +'<tag>TagInfo/'+AtlasMaterialTag+'/GeoAtlas</tag>') if CaloTrkGeo : conddb.addFolder('GLOBAL',CoolDataBaseFolder +'<tag>TagInfo/'+AtlasMaterialTag+'/GeoAtlas</tag>') ################################################################################# # The Geometry Builder ################################################################################# # the name to register the Geometry AtlasTrackingGeometryName = 'AtlasTrackingGeometry' # the geometry builder alg tool from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__GeometryBuilder AtlasGeometryBuilder = Trk__GeometryBuilder(name = 'AtlasGeometryBuilder') # register it to tool svc