diff --git a/Simulation/G4Atlas/G4AtlasApps/python/PyG4Atlas.py b/Simulation/G4Atlas/G4AtlasApps/python/PyG4Atlas.py index 3c8e25f011c0bc4e1f0139950bf25ce108179b99..a5aeeec6330ab3a1a195ddf9b8e01f905ac6a971 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/PyG4Atlas.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/PyG4Atlas.py @@ -88,11 +88,9 @@ class G4AtlasEngine: G4AtlasEngine.Dict_MCTruthStrg['SecondarySavingPolicy'] = 'All' G4AtlasEngine.Dict_SenDetector = dict() G4AtlasEngine._List_SenDetector_dependence = list() - G4AtlasEngine.Dict_FastSimModel = dict() G4AtlasEngine.Dict_Fields = dict() G4AtlasEngine.Dict_UserAction = dict() G4AtlasEngine.Dict_Regions = dict() - G4AtlasEngine.Dict_Regions['fastSimModels'] = dict() G4AtlasEngine.Dict_Regions['physicsReg'] = dict() G4AtlasEngine.Dict_RecEnvelope = dict() G4AtlasEngine.Dict_FieldIntegrationParameters = dict() @@ -207,30 +205,6 @@ class G4AtlasEngine: - def add_FastSimModel(self, model_obj): - """ - Adds FastSimModel objects to the G4AtlasEngine. - - The G4AtlasEngine.Dict_Regions gets also populated with the regions - associated to the FastSimModel. - """ - if not isinstance(model_obj, FastSimModel): - G4AtlasEngine.log.error(' FastSimModel: add_PhysicsReg: This is not a PhysicsReg object!!!') - raise RuntimeError('PyG4Atlas: G4AtlasEngine: add_FastSimModel') - - if model_obj.Name not in G4AtlasEngine.Dict_FastSimModel: - G4AtlasEngine.Dict_FastSimModel[model_obj.Name] = model_obj - for i in model_obj.Dict_Regions.keys(): - i_r_obj = model_obj.Dict_Regions.get(i) - G4AtlasEngine.Dict_Regions.get('fastSimModels').update( { i_r_obj.Name : i_r_obj } ) - G4AtlasEngine.log.debug('G4AtlasEngine: adding the FastSimModel %s with associated PhysRegions %s' % - (model_obj.Name, str(model_obj.Dict_Regions.keys())) ) - else: - G4AtlasEngine.log.warning('G4AtlasEngine: adding the FastSimModel: the %s model has been already added to G4Eng with the regions %s' % - (model_obj.Name, str(model_obj.Dict_Regions.keys())) ) - - - def add_Element(self, name_el, symbol_el, z_el, a_el, density_el): """ Add a new element to the simulation. @@ -459,36 +433,6 @@ class G4AtlasEngine: G4AtlasEngine._app_profiler('_init_FieldIntegrationParameters: ') - def _init_FastSimModel(self): - """ Inits all the parametrization models defined. - (for internal use) - - Creates also the Physics Regions used by the model (>=G4.8) - """ - if 'init_FastSimModel' in self._InitList: - G4AtlasEngine.log.warning('G4AtlasEngine: init_FastSimModel is already done') - return - if 'init_G4' in self._InitList: - G4AtlasEngine.log.error('G4AtlasEngine: init_G4 is already done too late for _init_FastSimModel') - return - - G4AtlasEngine.log.debug('G4AtlasEngine:_init_FastSimModel: init parametrization models') - if G4AtlasEngine.Dict_FastSimModel.keys(): - G4AtlasEngine.load_Lib("G4FastSimulation") - G4AtlasEngine.load_Dict("G4FastSimulationDict") - fastmenu = G4AtlasEngine.gbl.FastSimMenu() - for fsm in G4AtlasEngine.Dict_FastSimModel.keys(): - fsm_obj = G4AtlasEngine.Dict_FastSimModel.get(fsm) - if fsm_obj.Library not in G4AtlasEngine.List_LoadedLib: - G4AtlasEngine.load_Lib(fsm_obj.Library) - for r_n in fsm_obj.Dict_Regions.keys(): - r_n_obj = fsm_obj.Dict_Regions.get(r_n) - r_n_obj._construct_Region() - fastmenu.AssignFsModel(r_n_obj.Name, fsm_obj.Name) - self._InitList.append('init_FastSimModel') - G4AtlasEngine._app_profiler('_init_FastSimModel: ') - - def _init_Graphics(self): """ Inits the G4 visualization stuff. @@ -564,7 +508,6 @@ class G4AtlasEngine: pre/postInitDetFacility - called before/after the init_DetFacility method pre/postInitPhysics - called before/after the init_Physics method pre/postInitG4 - called before/after the init_G4 method - pre/postInitFastSimModel - called before/after the init_FastSimModel method pre/postInitPhysicsRegions - called before/after the init_PhysicsRegions method pre/postInitSenDetector - called before/after the init_SenDetector method pre/postInitMCTruth - called before/after the init_MCTruth method @@ -599,7 +542,6 @@ class G4AtlasEngine: _run_init_callbacks(self.init_status) _run_init_stage("DetFacility") - _run_init_stage("FastSimModel") _run_init_stage("PhysicsRegions") _run_init_stage("SenDetector") _run_init_stage("Physics") @@ -1342,20 +1284,18 @@ class DetFacility: """ if isinstance(region_obj,PhysicsReg): if region_obj.Name not in self.Dict_Regions and \ - region_obj.Name not in G4AtlasEngine.Dict_Regions.get('fastSimModels') and \ region_obj.Name not in G4AtlasEngine.Dict_Regions.get('physicsReg'): self.Dict_Regions[region_obj.Name] = region_obj if self.Name in G4AtlasEngine.Dict_DetFacility: ## If the DetFacility is already in G4Eng, we add the region immediately G4AtlasEngine.Dict_Regions.get('physicsReg').update({region_obj.Name : region_obj}) G4AtlasEngine.log.debug(' DetFacility: add_PhysicsReg: adding to %s the PhysRegion %s' % (self.Name, region_obj.Name)) - elif region_obj.Name in G4AtlasEngine.Dict_Regions.get('fastSimModels') or \ - region_obj.Name in G4AtlasEngine.Dict_Regions.get('physicsReg'): + elif region_obj.Name in G4AtlasEngine.Dict_Regions.get('physicsReg'): G4AtlasEngine.log.warning(' DetFacility: add_PhysicsReg: %s is already used by somebody else -- nothing done' % region_obj.Name) else: G4AtlasEngine.log.warning(' DetFacility: add_PhysicsReg: the %s'++' model already has the %s region' % (self.Name, region_obj.Name)) else: - G4AtlasEngine.log.error(' FastSimModel: add_PhysicsReg: This is not a PhysicsReg object!!!') + G4AtlasEngine.log.error(' DetFacility: add_PhysicsReg: This is not a PhysicsReg object!!!') def add_SenDetector(self,lib,sdname,name,volume): @@ -1501,64 +1441,6 @@ class DetConfigurator: -class FastSimModel: - """ FastSimulation model. - - This object contains the name of the FastSimulation model, - and the C++ lib which is needed to load, together with the - regions in which it will be applied. These regions (class - PhysicsReg) must be added after the instantiation using the - method add_Region. - - The FastSimulation object becomes active if it is added to - the simulation engine. - - The regions associated to a given FastSimulation model object - are automatically added to the G4AtlasEngine at the time the - FastSimulation model is added to the G4AtlasEngine (except if - the model is already associated to G4Eng, in this case the - region is added inmediatelly to the G4Eng). - - The construction of the regions here described is automatically - done at the time the FastSimModels are initialized - """ - - def __init__(self,lib,modelname): - self._Built=False - self.Name=modelname - self.Library=lib - self.Dict_Regions = dict() - - - def add_Region(self,region_obj): - """ Adds more region objects to the Dict_Regions in which the - FastSimModel will be applied. - """ - if isinstance(region_obj,PhysicsReg): - if region_obj.Name not in self.Dict_Regions and \ - region_obj.Name not in G4AtlasEngine.Dict_Regions.get('fastSimModels') and \ - region_obj.Name not in G4AtlasEngine.Dict_Regions.get('physicsReg'): - self.Dict_Regions[region_obj.Name] = region_obj - ## We associated to the G4Eng at the time we add the FastSimModel, except if the - ## FastSimodel is already in G4Eng - if self.Name in G4AtlasEngine.Dict_FastSimModel: - G4AtlasEngine.Dict_Regions.get('fastSimModels').update({region_obj.Name : region_obj}) - G4AtlasEngine.log.debug(' FastSimModel: adding the region '+region_obj.Name+' to the FastSimModel' + self.Name + ' from lib '+self.Library) - elif region_obj.Name in self.Dict_Regions: - G4AtlasEngine.log.warning(' FastSimModel: add_PhysicsReg: the '+self.Name+' model already has the '+ region_obj.Name+' region') - elif region_obj.Name in G4AtlasEngine.Dict_Regions.get('fastSimModels') or \ - region_obj.Name in G4AtlasEngine.Dict_Regions.get('physicsReg'): - G4AtlasEngine.log.warning(' FastSimModel: add_PhysicsReg: the '+ region_obj.Name+' is already used by somebody else, nothing done ') - else: - G4AtlasEngine.log.error(' FastSimModel: add_PhysicsReg: This is not a PhysicsReg object!!!') - - - def _build(self): - pass - - - - class MagneticField: """ Magnetic field. @@ -2613,15 +2495,6 @@ class SimSkeleton(object): """ G4AtlasEngine.log.verbose('SimSkeleton._do_PreInit :: starting') - # Add core services - from AthenaCommon.AppMgr import ServiceMgr - if not hasattr(ServiceMgr, "SensitiveDetectorSvc"): - from AthenaCommon.CfgGetter import getService - sensitiveDetectorService = getService("SensitiveDetectorSvc") - if not hasattr(ServiceMgr, "FastSimulationSvc"): - from AthenaCommon.CfgGetter import getService - sensitiveDetectorService = getService("FastSimulationSvc") - # use some different methods for ISF and G4 standalone run from G4AtlasApps.SimFlags import simFlags if simFlags.ISFRun: @@ -2643,6 +2516,15 @@ class SimSkeleton(object): traceback.print_exc(file=sys.stdout) raise RuntimeError('SimSkeleton._do_PreInit :: found problems with the method %s' % k) + # Add core services + from AthenaCommon.AppMgr import ServiceMgr + if not hasattr(ServiceMgr.ToolSvc, "SensitiveDetectorMasterTool"): + from AthenaCommon.CfgGetter import getPublicTool + sensitiveDetectorTool = getPublicTool("SensitiveDetectorMasterTool") + if not hasattr(ServiceMgr.ToolSvc, "FastSimulationMasterTool"): + from AthenaCommon.CfgGetter import getPublicTool + fastSimulationTool = getPublicTool("FastSimulationMasterTool") + ## Run pre-init callbacks G4AtlasEngine.log.debug("G4AtlasEngine:init stage " + "preInit") from G4AtlasApps.SimFlags import simFlags diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimAtlasKernel.py b/Simulation/G4Atlas/G4AtlasApps/python/SimAtlasKernel.py index 6fc2b092654fb20413d5c94016c20932995dccaf..2ecd0b8301d2a9951c3d67b1823fc8ed1bd658a7 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/SimAtlasKernel.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/SimAtlasKernel.py @@ -234,11 +234,6 @@ class AtlasSimSkeleton(SimSkeleton): ## Add configured GeoModelSvc to service manager ServiceMgr += gms - ## Service for the fast simulation - if simFlags.LArParameterization() != 0: - from LArG4FastSimSvc.LArG4FastSimSvcInit import LArG4FastSimSvcInit - LArG4FastSimSvcInit() - ## Run the geometry envelope setup earlier than GeoSD self._do_GeoEnv() AtlasG4Eng.G4Eng.log.verbose('AtlasSimSkeleton._do_external :: done') @@ -409,17 +404,6 @@ class AtlasSimSkeleton(SimSkeleton): rc = RecordingEnvelopes.AtlasMuonEntryLayer(recenv_level, allowSGMods) menuRecordEnvelopes.add_RecEnvelope(rc.recenv) - ## set up PyTileSimUtils here, as it is used by both the - ## MinBiasScintillatorSD (under LAr) and the TileGeoG4SD - from atlas_calo import PyTileSimUtils - pyTileSimUtilsOptions = PyTileSimUtils('PyTileSimUtils', 'TileSimUtilsDict', 'standard') - ## Cosmic setup - if jobproperties.Beam.beamType() == 'cosmics' or (hasattr(simFlags, "ReadTR") and simFlags.ReadTR.statusOn): - pyTileSimUtilsOptions.TileG4SimOptions.SetDeltaTHit(1) - pyTileSimUtilsOptions.TileG4SimOptions.SetDoTOFCorrection(False) - if AtlasG4Eng.G4Eng.log.level <= AtlasG4Eng.G4Eng.log.info: - pyTileSimUtilsOptions.TileG4SimOptions.printMe() - ## LAr if DetFlags.geometry.LAr_on(): from atlas_calo import PyLArG4RunControler @@ -458,10 +442,7 @@ class AtlasSimSkeleton(SimSkeleton): if DetFlags.geometry.Tile_on(): from atlas_calo import Tile tile = Tile(allowSGMods) - if simFlags.CalibrationRun.statusOn and (simFlags.CalibrationRun.get_Value() in ['Tile', 'LAr+Tile']): - tile._initSD(1) - else: - tile._initSD(0) + tile._initSD() AtlasG4Eng.G4Eng.add_DetFacility(tile.atlas_tile, calo) ## LUCID @@ -526,10 +507,6 @@ class AtlasSimSkeleton(SimSkeleton): #AtlasG4Eng.G4Eng.add_DetFacility(muonq02, atlas) from atlas_muon import Muon muon = Muon(allowSGMods) - if hasattr(simFlags, 'SimulateNewSmallWheel'): - if simFlags.SimulateNewSmallWheel(): - muon.atlas_muon.add_SenDetector('MuonG4SD', 'sTGCSensitiveDetector' , 'NEW', 'Muon::sTGC_Sensitive') - muon.atlas_muon.add_SenDetector('MuonG4SD', 'MicromegasSensitiveDetector' , 'NEU', 'Muon::MM_Sensitive') muon._initSD() muon._initPR() AtlasG4Eng.G4Eng.add_DetFacility(muon.atlas_muon, muonq02) @@ -538,9 +515,7 @@ class AtlasSimSkeleton(SimSkeleton): menuRecordEnvelopes.add_RecEnvelope(rc.recenv) if simFlags.StoppedParticleFile.statusOn: - theATLAS = AtlasG4Eng.G4Eng.Dict_DetFacility['Atlas'] - theATLAS.add_SenDetector('TrackWriteFastSim','TrackFastSimSD','TrackFastSimSD',\ - 'Muon::DummyVolumeName') + theATLAS = AtlasG4Eng.G4Eng.Dict_DetFacility['Atlas'] #FIXME still needed? AtlasG4Eng.G4Eng.log.verbose('AtlasSimSkeleton._do_GeoSD :: done') @classmethod diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimCtbKernel.py b/Simulation/G4Atlas/G4AtlasApps/python/SimCtbKernel.py index e0e6b8c63f4ff961421764e3eeb59d728cd1f71a..9fbea4102281611c7ece3669f68c50f8e0c33243 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/SimCtbKernel.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/SimCtbKernel.py @@ -498,21 +498,12 @@ class CtbSim(TBSimSkeleton): AtlasG4Eng.G4Eng.add_DetFacility(LArMuC.MuonChamber,calo) if(DetFlags.Tile_on()): - # options for Tile simulation - from atlas_calo import PyTileSimUtils - PyTileSimUtilsOptions=PyTileSimUtils('PyTileSimUtils',\ - 'TileSimUtilsDict','standard') from ctb_calo import TileDet if (simFlags.GeoModelTileVersion.get_Value()=='TileTB-3B-00'): tiledet=TileDet('CTB-3B') elif(simFlags.GeoModelTileVersion.get_Value()=='TileTB-3B3EB-00'): tiledet=TileDet('CTB-3B3E') - if (simFlags.CalibrationRun.statusOn and - (simFlags.CalibrationRun.get_Value()=='Tile' or - simFlags.CalibrationRun.get_Value()=='LAr+Tile')): - tilesd=tiledet.SD(1) - else: - tilesd=tiledet.SD(0) + tilesd=tiledet.SD() AtlasG4Eng.G4Eng.add_DetFacility(tiledet.ctb_tile,calo) elif(eta<0 or eta>1.201): raise ValueError,('THE ETA VALUE MUST BE IN RANGE [0,1.2]!!!'+ @@ -869,19 +860,11 @@ class Tile2000_2003(TBSimSkeleton): calo.df.RotateY(ThetaY) calo.df.MoveTo(calo_pos) if(DetFlags.Tile_on()): - # options for Tile simulation - from atlas_calo import PyTileSimUtils - PyTileSimUtilsOptions=PyTileSimUtils('PyTileSimUtils',\ - 'TileSimUtilsDict','standard') from ctb_calo import TileDet # different from CTB tiledet=TileDet('TB') AtlasG4Eng.G4Eng.add_DetFacility(tiledet.ctb_tile,calo) - if simFlags.CalibrationRun.statusOn: - if(simFlags.CalibrationRun.get_Value()=='Tile'): - tilesd=tiledet.SD(1) - else: - tilesd=tiledet.SD(0) + tilesd=tiledet.SD() # ancillary: only the MuonWall from ctb_common import MuonWall MuonW=MuonWall(eta,ThetaY,DeltaF) diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimFlags.py b/Simulation/G4Atlas/G4AtlasApps/python/SimFlags.py index d9b7eaab6ff1acb6f3d74cc08f787d9eb70181d1..ecb5340c5465587eca1d7d379e103a04604d82ab 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/SimFlags.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/SimFlags.py @@ -687,6 +687,14 @@ class SimBarcodeOffset(JobProperty): allowedTypes = ['int'] StoredValue = 200000 +class ParticleID(JobProperty): + """ + Add primary particle barcode signature to CaloCalibrationHits. + """ + statusOn = True + allowedTypes = ['bool'] + StoredValue = False + ## Definition and registration of the simulation flag container class SimFlags(JobPropertyContainer): diff --git a/Simulation/G4Atlas/G4AtlasApps/python/atlas_calo.py b/Simulation/G4Atlas/G4AtlasApps/python/atlas_calo.py index 0ad951d593e3c2c6561e619f8671c0f25eabfc0f..68bd5d6902b950eaed6a6e70265349e54f081154 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/atlas_calo.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/atlas_calo.py @@ -8,7 +8,7 @@ __author__ = 'A. Dell`Acqua, M. Gallas, A. Di Simone ' import PyG4Atlas, AtlasG4Eng from PyG4Atlas import DetConfigurator -from SimFlags import SimFlags +from SimFlags import simFlags # -- LAr -- @@ -47,10 +47,10 @@ class PyLArG4RunControler(DetConfigurator): ROOT.SetOwnership(self.LArG4GlobalOptions, 0) ## Enable cond db reading in case we need HV maps - if hasattr(SimFlags, 'LArHighVoltage') and SimFlags.LArHighVoltage.statusOn: - if SimFlags.LArHighVoltage.get_Value() is not None: + if hasattr(simFlags, 'LArHighVoltage') and simFlags.LArHighVoltage.statusOn: + if simFlags.LArHighVoltage.get_Value() is not None: for calo in ["EMB", "EMEC", "HEC", "FCAL"]: - if calo in SimFlags.LArHighVoltage.get_Value(): + if calo in simFlags.LArHighVoltage.get_Value(): from IOVDbSvc.CondDB import conddb conddb.addFolder("", "/LAR/DCS/HV/BARREl/I16") conddb.addFolder("", "/LAR/DCS/HV/BARREL/I8" ) @@ -58,18 +58,18 @@ class PyLArG4RunControler(DetConfigurator): ## TODO: Tidy this... lots of reducible repetition of the same checks self.LArG4BarrelOptions = AtlasG4Eng.G4Eng.gbl.LArG4BarrelOptions() - self.LArG4BarrelOptions.EMBBirksLaw(SimFlags.DoLArBirk()) + self.LArG4BarrelOptions.EMBBirksLaw(simFlags.DoLArBirk()) self.LArG4EMECOptions = AtlasG4Eng.G4Eng.gbl.LArG4EMECOptions() - self.LArG4EMECOptions.EMECBirksLaw(SimFlags.DoLArBirk()) + self.LArG4EMECOptions.EMECBirksLaw(simFlags.DoLArBirk()) self.LArG4HECOptions = AtlasG4Eng.G4Eng.gbl.LArG4HECOptions() - self.LArG4HECOptions.HECBirksLaw(SimFlags.DoLArBirk()) + self.LArG4HECOptions.HECBirksLaw(simFlags.DoLArBirk()) self.LArG4FCALOptions=AtlasG4Eng.G4Eng.gbl.LArG4FCALOptions() - self.LArG4FCALOptions.FCALBirksLaw(SimFlags.DoLArBirk()) - if hasattr(SimFlags, 'LArHighVoltage') and SimFlags.LArHighVoltage.statusOn and SimFlags.LArHighVoltage.get_Value() is not None: - self.LArG4BarrelOptions.EMBHVEnable("EMB" in SimFlags.LArHighVoltage.get_Value()) - self.LArG4EMECOptions.EMECHVEnable("EMEC" in SimFlags.LArHighVoltage.get_Value()) - self.LArG4HECOptions.HECHVEnable("HEC" in SimFlags.LArHighVoltage.get_Value()) - self.LArG4FCALOptions.FCALEnableHV("FCAL" in SimFlags.LArHighVoltage.get_Value()) + self.LArG4FCALOptions.FCALBirksLaw(simFlags.DoLArBirk()) + if hasattr(simFlags, 'LArHighVoltage') and simFlags.LArHighVoltage.statusOn and simFlags.LArHighVoltage.get_Value() is not None: + self.LArG4BarrelOptions.EMBHVEnable("EMB" in simFlags.LArHighVoltage.get_Value()) + self.LArG4EMECOptions.EMECHVEnable("EMEC" in simFlags.LArHighVoltage.get_Value()) + self.LArG4HECOptions.HECHVEnable("HEC" in simFlags.LArHighVoltage.get_Value()) + self.LArG4FCALOptions.FCALEnableHV("FCAL" in simFlags.LArHighVoltage.get_Value()) self.LArG4BarrelOptions.saveMe() self.LArG4EMECOptions.saveMe() self.LArG4HECOptions.saveMe() @@ -163,14 +163,6 @@ class LAr(object): 'MiniFCAL::Wafer', 'MiniFCAL::Wafer', 'LArMgr::MiniFCAL::Wafer') - self.atlas_lar.add_SenDetector('MinBiasScintillator', - 'MinBiasScintillatorSD', - 'MBTS', - 'LArMgr::MBTS1') - self.atlas_lar.add_SenDetector('MinBiasScintillator', - 'MinBiasScintillatorSD', - 'MBTS', - 'LArMgr::MBTS2') elif mode == 1: # calibration mode @@ -226,14 +218,6 @@ class LAr(object): 'MiniFCALMult', 'MiniFCALMult', 'LArMgr::MiniFCAL::Wafer') - self.atlas_lar.add_SenDetector('MinBiasScintillator', - 'MinBiasScintillatorSD', - 'MBTS', - 'LArMgr::MBTS1') - self.atlas_lar.add_SenDetector('MinBiasScintillator', - 'MinBiasScintillatorSD', - 'MBTS', - 'LArMgr::MBTS2') # Calibration SDs """ LAr::BarrelCryostat::Dead @@ -796,14 +780,6 @@ class LAr(object): 'MiniFCAL::Wafer', 'MiniFCAL::Wafer', 'LArMgr::MiniFCAL::Wafer') - self.atlas_lar.add_SenDetector('MinBiasScintillator', - 'MinBiasScintillatorSD', - 'MBTS', - 'LArMgr::MBTS1') - self.atlas_lar.add_SenDetector('MinBiasScintillator', - 'MinBiasScintillatorSD', - 'MBTS', - 'LArMgr::MBTS2') """ LAr::BarrelCryostat::Dead """ self.atlas_lar.add_SenDetector('LArG4SD', @@ -1151,7 +1127,7 @@ class LAr(object): rangeEMEC = 0.03 rangeHEC = 0.03 rangeFCAL = 0.03 - if not '_EMV' in SimFlags.PhysicsList() and not '_EMX' in SimFlags.PhysicsList(): + if not '_EMV' in simFlags.PhysicsList() and not '_EMX' in simFlags.PhysicsList(): rangeEMB = 0.1 rangeEMEC = 0.1 rangeHEC = 1. @@ -1205,7 +1181,7 @@ class LAr(object): # multiple scattering model in G4 9.2, can have bigger range cuts, and one for physics lists with # the old multiple scattering model, called EM variants. As this is tied to EM physics, we really # just need to look for the existance of the variant string - if not '_EMV' in SimFlags.PhysicsList() and not '_EMX' in SimFlags.PhysicsList(): + if not '_EMV' in simFlags.PhysicsList() and not '_EMX' in simFlags.PhysicsList(): rangeEMB = 0.1 rangeEMEC = 0.1 rangeHEC = 1. @@ -1265,25 +1241,12 @@ class LAr(object): self.atlas_FCAL2Para.add_Cuts('e+',rangeFCAL) self.atlas_FCAL2Para.add_Cuts('gamma',rangeFCAL) - # create the FastSimModel obj - self.atlas_EMBFastSimModel=PyG4Atlas.FastSimModel('LArG4FastSimulation','EMBFastShower') - self.atlas_EMECFastSimModel=PyG4Atlas.FastSimModel('LArG4FastSimulation','EMECFastShower') - self.atlas_FCALFastSimModel=PyG4Atlas.FastSimModel('LArG4FastSimulation','FCALFastShower') - self.atlas_FCAL2FastSimModel=PyG4Atlas.FastSimModel('LArG4FastSimulation','FCAL2FastShower') + #Note EMB physics region already added to atlas_lar + self.atlas_lar.add_PhysicsReg(self.atlas_EMECPara) #FIXME temporarily required until G4Atlas geometry migration + self.atlas_lar.add_PhysicsReg(self.atlas_FCALPara) #FIXME temporarily required until G4Atlas geometry migration + self.atlas_lar.add_PhysicsReg(self.atlas_FCAL2Para) #FIXME temporarily required until G4Atlas geometry migration - # add regions to the FastSimModel obj - self.atlas_EMBFastSimModel.add_Region(self.atlas_EMBPara) - self.atlas_EMECFastSimModel.add_Region(self.atlas_EMECPara) - self.atlas_FCALFastSimModel.add_Region(self.atlas_FCALPara) - self.atlas_FCAL2FastSimModel.add_Region(self.atlas_FCAL2Para) - - # add the FastSimModel to the G4Eng - AtlasG4Eng.G4Eng.add_FastSimModel(self.atlas_EMBFastSimModel) - AtlasG4Eng.G4Eng.add_FastSimModel(self.atlas_EMECFastSimModel) - AtlasG4Eng.G4Eng.add_FastSimModel(self.atlas_FCALFastSimModel) - AtlasG4Eng.G4Eng.add_FastSimModel(self.atlas_FCAL2FastSimModel) - - if SimFlags.LArParameterization.get_Value() > 1: + if simFlags.LArParameterization.get_Value() > 1: self.PreSampLAr = PyG4Atlas.PhysicsReg('PreSampLAr') self.PreSampLAr.add_Volumes('LArMgr::LAr::Endcap::Presampler::LiquidArgon') self.atlas_lar.add_PhysicsReg(self.PreSampLAr) @@ -1303,45 +1266,12 @@ class LAr(object): self.atlas_DeadMat.add_Cuts('e-',1.0) self.atlas_DeadMat.add_Cuts('e+',1.0) self.atlas_DeadMat.add_Cuts('gamma',1.0) - self.atlas_DeadMatFastSimModel=PyG4Atlas.FastSimModel('LArG4FastSimulation','DeadMaterialShower') - self.atlas_DeadMatFastSimModel.add_Region(self.atlas_DeadMat) - AtlasG4Eng.G4Eng.add_FastSimModel(self.atlas_DeadMatFastSimModel) + self.atlas_lar.add_PhysicsReg(self.atlas_DeadMat) #FIXME temporarily required until G4Atlas geometry migration # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # -- Tile -- - -class PyTileSimUtils(DetConfigurator): - """ - Class that inherits from G4AtlasApps.PyG4Atlas.DetConfigurator - and it builds the TileSimUtils in accordance with the - user requirements. - - It uses the TileSimUtilsDict dictionary. - """ - - ## __init__() method is not needed - - def build(self, mode): - """ - Builds the TileSimUtils configurator in different modes - Current modes are: - standard - - All the information is saved in StoreGate. The options given - here can act only over the SD. - """ - import ROOT - if mode == 'standard': - self.TileG4SimOptions = AtlasG4Eng.G4Eng.gbl.TileG4SimOptions() - self.TileG4SimOptions.saveMe() - ## We need the following line because otherwise StoreGate will - ## delete the object first and pylcgdict will complain. - ROOT.SetOwnership(self.TileG4SimOptions, 0) - - - class Tile(object): """ Describes the ATLAS Tile detector. @@ -1353,75 +1283,11 @@ class Tile(object): """ self.atlas_tile=PyG4Atlas.DetFacility("GeoDetector","Tile:Tile",allowMods) - def _initSD(self,mode): + def _initSD(self): """ Describes the sensitive detector. 0 --> Normal Tile sensitive detector 1 --> Tile sensitive detector for calibration hits """ - if mode == 0: - # normal mode - self.atlas_tile.add_SenDetector('TileGeoG4SD','TileGeoG4SD', 'TileGeoG4SD', 'Tile::Scintillator') - elif mode == 1: - # calibration mode - self.atlas_tile.add_SenDetector('TileGeoG4SD:TileGeoG4Calib', 'TileGeoG4CalibSD', - 'TileGeoG4CalibSD', 'Tile::Scintillator') - self.atlas_tile_SenDetectorCalib = AtlasG4Eng.G4Eng.Dict_SenDetector.get('TileGeoG4CalibSD') - tile_volumes = ['Tile::Tile', - 'Tile::TileCentralBarrel', - 'Tile::TileEndcapPos', - 'Tile::TileEndcapNeg', - 'Tile::Barrel', - 'Tile::BarrelModule', - 'Tile::FrontPlate', - 'Tile::EndPlate1', - 'Tile::EPHole1', - 'Tile::EndPlate2', - 'Tile::EPHole2', - 'Tile::GirderMother', - 'Tile::GirderIron', - 'Tile::GirderAluminium', - 'Tile::GirderElectronics', - 'Tile::Absorber', - 'Tile::AbsorberChild', - 'Tile::Period', - 'Tile::Glue', - 'Tile::Wrapper', - 'Tile::EBarrel', - 'Tile::EBarrelModule', - 'Tile::EndPlateSh', - 'Tile::ITC', - 'Tile::ITCModule', - 'Tile::Plug1Module', - 'Tile::FrontPlateSh', - 'Tile::Plug2Module', - 'Tile::Gap', - 'Tile::GapModule', - 'Tile::IrUp', - 'Tile::IrDw', - 'Tile::Iron4', - 'Tile::Iron3', - 'Tile::Iron2', - 'Tile::Iron1', - 'Tile::IrBox', - 'Tile::SaddleModule', - 'Tile::LArService', - 'Tile::LArCables', - 'Tile::ExtBarrelSaddleSupport', - 'Tile::Crack', - 'Tile::CrackModule', - 'Tile::FingerModule', - 'Tile::FingerIron', - 'Tile::FingerAluminum', - 'Tile::FingerElectronics', - 'Tile::EFinger', - 'Tile::EFingerModule', - 'Tile::FingerPos', - 'Tile::FingerNeg', - 'Tile::SaddlePos', - 'Tile::SaddleNeg', - 'Tile::ESaddlePos', - 'Tile::ESaddleNeg'] - for i_v in tile_volumes: - self.atlas_tile_SenDetectorCalib.add_Volume(i_v) + pass # See G4AtlasTools/python/G4AtlasToolsConfig.py diff --git a/Simulation/G4Atlas/G4AtlasApps/python/atlas_common.py b/Simulation/G4Atlas/G4AtlasApps/python/atlas_common.py index 50e094505b94220e75cffbc77e622ea650c62546..4bf26447eeaa5711abc220b079aae2a1f94cf700 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/atlas_common.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/atlas_common.py @@ -314,9 +314,6 @@ class BeamPipe(object): #if not hasattr(ServiceMgr, 'DeadMaterialFastSimSvc' ): # from LArG4FastSimSvc.LArG4FastSimSvcConfig import DeadMaterialFastSimSvc # ServiceMgr += DeadMaterialFastSimSvc() - self.atlas_SimpleFastKiller = PyG4Atlas.FastSimModel('G4FastSimulation', 'SimpleFastKiller') - self.atlas_SimpleFastKiller.add_Region(self.atlas_beampipe_PhysReg) - AtlasG4Eng.G4Eng.add_FastSimModel(self.atlas_SimpleFastKiller) AtlasG4Eng.G4Eng.log.info('Adding fast sim model to the beampipe!') else: assert simFlags.BeamPipeCut.statusOn @@ -337,14 +334,9 @@ class BeamPipe(object): ## Set up the forward transport model if simFlags.ForwardDetectors.statusOn and simFlags.ForwardDetectors() == 2: - self.atlas_bPipe_FwdTransport = PyG4Atlas.FastSimModel('ForwardTransport','ForwardTransport') self.atlas_bPipe_PhysReg = PyG4Atlas.PhysicsReg('FWDBeamLine') self.atlas_bPipe_PhysReg.add_Volumes('BeamPipe::SectionF46') self.beampipe.add_PhysicsReg(self.atlas_bPipe_PhysReg) - ## Add region to fwd transport - self.atlas_bPipe_FwdTransport.add_Region(self.atlas_bPipe_PhysReg) - ## Add fwd transport to the G4Eng - AtlasG4Eng.G4Eng.add_FastSimModel(self.atlas_bPipe_FwdTransport) class AtlasCavernGeoModel(object): diff --git a/Simulation/G4Atlas/G4AtlasApps/python/atlas_flags.py b/Simulation/G4Atlas/G4AtlasApps/python/atlas_flags.py index 405bf1b9cb13ac27fdb5feac19482e0fc8985ead..60ed9a7d5977134f6b2cc0fb2c3fc2702932fb1d 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/atlas_flags.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/atlas_flags.py @@ -421,3 +421,12 @@ class TwissFileVersion(JobProperty): allowedTypes = ['str'] StoredValue = 'v01' +class TRTRangeCut(JobProperty): + """ + TRT Range cut in mm + """ + statusOn = True + allowedTypes = ['float'] + allowedValues = [0.05,30.0] + StoredValue = 0.05 + diff --git a/Simulation/G4Atlas/G4AtlasApps/python/atlas_forward.py b/Simulation/G4Atlas/G4AtlasApps/python/atlas_forward.py index fee6db2198b4f2416ef6132971a1039b7eb6cbeb..9ee4c1280dcbd26d1a1574eee00f81b70adc5bcc 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/atlas_forward.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/atlas_forward.py @@ -153,10 +153,7 @@ class ZDC(object): def _initSD(self): """Describes the sensitive detector.""" - AtlasG4Eng.G4Eng.log.debug("ZDC Simulation :: atlas_ZDC.py :: _initSD about to make SenDetector") - self.atlas_ZDC.add_SenDetector('ZDC_SD', 'ZDCPixelSD', 'ZDCPixelSD', 'ZDC::Pixel_Logical') - self.atlas_ZDC.add_SenDetector('ZDC_SD', 'ZDCStripSD', 'ZDCStripSD', 'ZDC::Strip_Logical') - AtlasG4Eng.G4Eng.log.debug("ZDC Simulation :: atlas_ZDC.py :: _initSD SenDetector Done") + pass def _initPR(self): """Describes the physics regions.""" @@ -172,21 +169,7 @@ class ALFA(object): def _initSD(self): """Describes the sensitive detector.""" - self.alfa.add_SenDetector('ALFA_G4_SD','ALFA_SensitiveDetector', 'ALFA_SensitiveDetector','ALFA::logALFA_FiberU') - self.alfa.add_SenDetector('ALFA_G4_SD','ALFA_SensitiveDetector', 'ALFA_SensitiveDetector','ALFA::logALFA_FiberV') - for i_alfa_fiber in xrange(64): - self.alfa.add_SenDetector('ALFA_G4_SD', 'ALFA_SensitiveDetector', - 'ALFA_SensitiveDetector', 'ALFA::logALFA_FiberU[%d]' % i_alfa_fiber) - self.alfa.add_SenDetector('ALFA_G4_SD', 'ALFA_SensitiveDetector', - 'ALFA_SensitiveDetector', 'ALFA::logALFA_FiberV[%d]' % i_alfa_fiber) - self.alfa.add_SenDetector('ALFA_G4_SD','ALFA_SensitiveDetector', 'ALFA_SensitiveDetector', 'ALFA::logOD_FiberActive') - #print 'fiber %d' % i_alfa_fiber - - # ALFA global vacuum sensors - self.alfa.add_SenDetector('ALFA_G4_SD','ALFA_SensitiveDetector', 'ALFA_SensitiveDetector','ALFA::B7L1_GVS') - self.alfa.add_SenDetector('ALFA_G4_SD','ALFA_SensitiveDetector', 'ALFA_SensitiveDetector','ALFA::A7L1_GVS') - self.alfa.add_SenDetector('ALFA_G4_SD','ALFA_SensitiveDetector', 'ALFA_SensitiveDetector','ALFA::A7R1_GVS') - self.alfa.add_SenDetector('ALFA_G4_SD','ALFA_SensitiveDetector', 'ALFA_SensitiveDetector','ALFA::B7R1_GVS') + pass class Lucid(object): @@ -198,7 +181,7 @@ class Lucid(object): def _initSD(self): """Describes the sensitive detector.""" - self.lucid.add_SenDetector('LUCID_G4_SD', 'LUCID_SensitiveDetector', 'LUCID_SensitiveDetector', 'LUCID::lvPmt') + pass def _initOpProcess(self): """Activates the optical process.""" @@ -214,14 +197,7 @@ class AFP(object): def _initSD(self): """Describes the SI sensitive detector.""" - self.AFP.add_SenDetector('AFP_G4_SD','AFP_SensitiveDetector', 'AFP_SensitiveDetector','AFP::AFP*_LogSIDSensor*') - self.AFP.add_SenDetector('AFP_G4_SD','AFP_SensitiveDetector', 'AFP_SensitiveDetector','AFP::AFP*_LogSIDVacuumSensor*') - - """Describes the T sensitive detector.""" - self.AFP.add_SenDetector('AFP_G4_SD','AFP_SensitiveDetector', 'AFP_SensitiveDetector','AFP::AFP*_LogTDSensor*') - #self.AFP.add_SenDetector('AFP_G4_SD','AFP_SensitiveDetector', 'AFP_SensitiveDetector','AFP::AFP*_LogRadiator*') - #self.AFP.add_SenDetector('AFP_G4_SD','AFP_SensitiveDetector', 'AFP_SensitiveDetector','AFP::AFP*_LogVertBar*') - #self.AFP.add_SenDetector('AFP_G4_SD','AFP_SensitiveDetector', 'AFP_SensitiveDetector','AFP::AFP*_LogHorzBar*') + pass def _initOpProcess(self): """Activates the optical process.""" diff --git a/Simulation/G4Atlas/G4AtlasApps/python/atlas_idet.py b/Simulation/G4Atlas/G4AtlasApps/python/atlas_idet.py index 0946d804a51fc6130c3ab5b1cfe26e708395364e..94a7fce802982b2a13a99c14a9aab26e5de91155 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/atlas_idet.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/atlas_idet.py @@ -8,7 +8,7 @@ __author__ = 'A. Dell`Acqua, M. Gallas, A. DiSimone' import PyG4Atlas, AtlasG4Eng -from SimFlags import SimFlags +from SimFlags import simFlags ## -- PIXEL -- @@ -25,7 +25,7 @@ class Pixel(object): """ self.atlas_pixel = PyG4Atlas.DetFacility("GeoDetector","Pixel:Pixel",allowMods) # If we are using the old multiple scattering model, include step limitation - if SimFlags.PhysicsList.get_Value().endswith("_EMV"): + if simFlags.PhysicsList.get_Value().endswith("_EMV"): self.atlas_pixel.add_MaxStepInVolumes('Pixel::siBLayLog', 0.050) self.atlas_pixel.add_MaxStepInVolumes('Pixel::siLog', 0.050) self.atlas_pixel.add_MaxStepInVolumes('Pixel::dbmDiamondLog', 0.050) @@ -33,12 +33,7 @@ class Pixel(object): def _initSD(self): """ Describes the sensitive detector, including BCM and BLM. """ - self.atlas_pixel.add_SenDetector('PixelG4_SD','PixelSensorSD', 'PSD','Pixel::siBLayLog') - self.atlas_pixel.add_SenDetector('PixelG4_SD','PixelSensorSD', 'PSD','Pixel::siLog') - self.atlas_pixel.add_SenDetector('PixelG4_SD','PixelSensorSD', 'PSD','Pixel::dbmDiamondLog') - - self.atlas_pixel.add_SenDetector('BCM_G4_SD','BCMSensorSD', 'BCMSD','Pixel::bcmDiamondLog') - self.atlas_pixel.add_SenDetector('BLM_G4_SD','BLMSensorSD', 'BLMSD','Pixel::blmDiamondLog') + pass def _initPR(self): """ @@ -64,13 +59,13 @@ class SCT(object): Describes the geometry. Sets the max step size to 50 micron for consistency with G3 in: - SCT::BRLSensor, SCT::BRLSensorSS, SCT::BRLSensorMS, - SCT::ECSensor0, SCT::ECSensor1, SCT::ECSensor2, + SCT::BRLSensor, SCT::BRLSensorSS, SCT::BRLSensorMS, + SCT::ECSensor0, SCT::ECSensor1, SCT::ECSensor2, SCT::ECSensor3, SCT::ECSensor4, SCT::ECSensor5 """ self.atlas_sct = PyG4Atlas.DetFacility("GeoDetector", "SCT:SCT",allowMods) # If we are using the old multiple scattering model, include step limitation - if SimFlags.PhysicsList.get_Value().endswith('_EMV'): + if simFlags.PhysicsList.get_Value().endswith('_EMV'): self.atlas_sct.add_MaxStepInVolumes('SCT::BRLSensor', 0.050) self.atlas_sct.add_MaxStepInVolumes('SCT::BRLSensorSS', 0.050) self.atlas_sct.add_MaxStepInVolumes('SCT::BRLSensorMS', 0.050) @@ -85,15 +80,7 @@ class SCT(object): """ Describes the sensitive detector. """ - self.atlas_sct.add_SenDetector('SCT_G4_SD','SctSensorSD', 'SCTSD','SCT::BRLSensor') - self.atlas_sct.add_SenDetector('SCT_G4_SD','SctSensorSD', 'SCTSD','SCT::BRLSensorSS') - self.atlas_sct.add_SenDetector('SCT_G4_SD','SctSensorSD', 'SCTSD','SCT::BRLSensorMS') - self.atlas_sct.add_SenDetector('SCT_G4_SD','SctSensorSD', 'SCTSD','SCT::ECSensor0') - self.atlas_sct.add_SenDetector('SCT_G4_SD','SctSensorSD', 'SCTSD','SCT::ECSensor1') - self.atlas_sct.add_SenDetector('SCT_G4_SD','SctSensorSD', 'SCTSD','SCT::ECSensor2') - self.atlas_sct.add_SenDetector('SCT_G4_SD','SctSensorSD', 'SCTSD','SCT::ECSensor3') - self.atlas_sct.add_SenDetector('SCT_G4_SD','SctSensorSD', 'SCTSD','SCT::ECSensor4') - self.atlas_sct.add_SenDetector('SCT_G4_SD','SctSensorSD', 'SCTSD','SCT::ECSensor5') + pass def _initPR(self): """ @@ -131,14 +118,7 @@ class TRT(object): """ Describes the sensitive detector. """ - self.atlas_trt.add_SenDetector('TRT_G4Utilities:TRT_G4_SD', - 'TRTSensitiveDetector','TRTSD','TRT::Gas') - self.atlas_trt.add_SenDetector('TRT_G4Utilities:TRT_G4_SD', - 'TRTSensitiveDetector','TRTSD','TRT::GasMA') - self.atlas_trt.add_SenDetector('TRT_G4Utilities:TRT_G4_SD', - 'TRTSensitiveDetector','TRTSD','TRT::Gas_Ar') - self.atlas_trt.add_SenDetector('TRT_G4Utilities:TRT_G4_SD', - 'TRTSensitiveDetector','TRTSD','TRT::GasMA_Ar') + pass def _initTRTProcess(self): """ @@ -154,8 +134,10 @@ class TRT(object): self.atlas_trt_PhysReg=PyG4Atlas.PhysicsReg('TRT') self.atlas_trt_PhysReg.add_Volumes('TRT::Gas') self.atlas_trt_PhysReg.add_Volumes('TRT::GasMA') - self.atlas_trt_PhysReg.add_Cuts('e-',0.05) - self.atlas_trt_PhysReg.add_Cuts('e+',0.05) + my_range_cut = 0.05 + if simFlags.TRTRangeCut.statusOn: my_range_cut = simFlags.TRTRangeCut.get_Value() + self.atlas_trt_PhysReg.add_Cuts('e-',my_range_cut) + self.atlas_trt_PhysReg.add_Cuts('e+',my_range_cut) self.atlas_trt_PhysReg.add_Cuts('gamma',0.05) self.atlas_trt.add_PhysicsReg(self.atlas_trt_PhysReg) self.atlas_trt_PhysReg_Ar=PyG4Atlas.PhysicsReg('TRT_Ar') @@ -178,4 +160,3 @@ class IDetServicesMat(object): Describes the geometry. """ self.atlas_idetServMat=PyG4Atlas.DetFacility("GeoDetector", "InDetServMat:InDetServMat") - diff --git a/Simulation/G4Atlas/G4AtlasApps/python/atlas_muon.py b/Simulation/G4Atlas/G4AtlasApps/python/atlas_muon.py index 60b7cf1a55afe5d3ce33d78b6f5d99f37d0b387d..4c5a9114405152ddbfe703aa7e3b7a25c5180bca 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/atlas_muon.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/atlas_muon.py @@ -26,14 +26,7 @@ class Muon(object): def _initSD(self): """ Describes the sensitive detector. """ - sdsuffix = "" - if jobproperties.Beam.beamType() == 'cosmics': - sdsuffix = "_Cosmics" - self.atlas_muon.add_SenDetector('MuonG4SD', 'MDTSens'+sdsuffix, 'AMS', 'Muon::SensitiveGas') - self.atlas_muon.add_SenDetector('MuonG4SD', 'RPCSens'+sdsuffix, 'RMS', 'Muon::gazGap') - self.atlas_muon.add_SenDetector('MuonG4SD', 'TGCSens'+sdsuffix, 'TMS', 'Muon::muo::TGCGas') - self.atlas_muon.add_SenDetector('MuonG4SD', 'CSCSens'+sdsuffix, 'CMS', 'Muon::CscArCO2') - + pass def _initPR(self): """ Describes the physics regions. @@ -56,9 +49,6 @@ class Muon(object): # Add the cavern fast sim model if necessary if jobproperties.SimFlags.CavernBG.statusOn and jobproperties.SimFlags.CavernBG.get_Value() != 'Read': - # create the FastSimModel obj - self.atlas_NeutronFastSimModel=PyG4Atlas.FastSimModel('TrackWriteFastSim','NeutronFastSim') - # add region to the FastSimModel obj self.atlas_muonFastRegion=PyG4Atlas.PhysicsReg('MuonSystemFastRegion') if 'World' in jobproperties.SimFlags.CavernBG.get_Value(): @@ -66,15 +56,5 @@ class Muon(object): self.atlas_muonFastRegion.add_Volumes('IDET::IDET') self.atlas_muonFastRegion.add_Volumes('Muon::MuonSys') self.atlas_muon.add_PhysicsReg(self.atlas_muonFastRegion) - self.atlas_NeutronFastSimModel.add_Region(self.atlas_muonFastRegion) - - - # add the FastSimModel to the G4Eng - AtlasG4Eng.G4Eng.add_FastSimModel(self.atlas_NeutronFastSimModel) - - # if we need it, add the SD to a dummy volume - if 'Write' in jobproperties.SimFlags.CavernBG.get_Value(): - self.atlas_muon.add_SenDetector('TrackWriteFastSim','TrackFastSimSD','TrackFastSimSD',\ - 'Muon::DummyVolumeName') #======================================================================= diff --git a/Simulation/G4Atlas/G4AtlasApps/python/atlas_utilities.py b/Simulation/G4Atlas/G4AtlasApps/python/atlas_utilities.py index 78e135347ba7b35a423bbb839d1e51468fe769cf..197e87b88c820fdfc20130337806e6ebbd120c36 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/atlas_utilities.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/atlas_utilities.py @@ -37,7 +37,7 @@ class ScintillatorSD(object): AtlasG4Eng.G4Eng.load_Lib('G4AncillarySD') AtlasG4Eng.G4Eng.load_Dict('G4AncillarySDDict') SD_HChandler = AtlasG4Eng.G4Eng.gbl.ScintillatorSD_PyHandler() - SD = PyG4Atlas.SenDetector('G4AncillarySD', 'ScintillatorSD', 'ScintillatorSD') + SD = PyG4Atlas.SenDetector('G4AncillarySD', 'ScintillatorSD', 'ScintillatorSD') #FIXME SD to be migrated ATLASSIM-1752 # Make a ScintillatorSD hit collection and each associated volume has a # collection name for v_n in self.List_Volumes: diff --git a/Simulation/G4Atlas/G4AtlasApps/python/ctb_calo.py b/Simulation/G4Atlas/G4AtlasApps/python/ctb_calo.py index 25d16ea8dce41e3ebba68a94943f3b3defcacbb9..48e5f3a34aaa36c125d2fa4af2fe1a9a218879b7 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/ctb_calo.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/ctb_calo.py @@ -204,34 +204,6 @@ class TileDet(object): self.ctb_tile_position=AtlasG4Eng.G4Eng.gbl.CLHEP.Hep3Vector(0.,0.,0.) self.ctb_tile.df.MoveTo(self.ctb_tile_position) # sensitive detector: - def SD(self,mode): - """ - Implements the Tile SD. - - 0 --> Normal Tile sensitive detector - 1 --> Tile sensitive detector for calibration hits - """ - if(mode==0): - # normal mode - self.ctb_tile.add_SenDetector('TileGeoG4SD','TileCTBGeoG4SD',\ - 'TileCTBGeoG4SD','Tile::Scintillator') - elif(mode==1): - # calibration mode - self.ctb_tile.add_SenDetector('TileGeoG4SD:TileGeoG4Calib',\ - 'TileCTBGeoG4CalibSD','TileCTBGeoG4CalibSD','Tile::Scintillator') - self.ctb_tile_SenDetectorCalib=AtlasG4Eng.G4Eng.Dict_SenDetector.get('TileCTBGeoG4CalibSD') - tile_volumes=['Tile::TileTBEnv','Tile::Barrel', - 'Tile::BarrelModule','Tile::FrontPlate', - 'Tile::EndPlate1','Tile::EPHole1','Tile::EndPlate2','Tile::EPHole2', - 'Tile::GirderMother','Tile::GirderIron','Tile::GirderAluminium', - 'Tile::GirderElectronics','Tile::Absorber','Tile::AbsorberChild', - 'Tile::Period','Tile::Glue','Tile::Wrapper', - 'Tile::EBarrel','Tile::EBarrelModule','Tile::EndPlateSh', - 'Tile::ITC','Tile::ITCModule','Tile::Plug1Module', - 'Tile::FrontPlateSh','Tile::Plug2Module', - 'Tile::Finger','Tile::FingerModule','Tile::FingerIron', - 'Tile::FingerAluminum','Tile::FingerElectronics'] - for i_v in tile_volumes: - self.ctb_tile_SenDetectorCalib.add_Volume(i_v) - + def SD(self): + pass #======================================================================= diff --git a/Simulation/G4Atlas/G4AtlasApps/python/ctb_idet.py b/Simulation/G4Atlas/G4AtlasApps/python/ctb_idet.py index 3a8c51b781161700265975e72f07dda8646e372e..22c7349d9c1ed3d9ef8cae9c4083f45f7ceecada 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/ctb_idet.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/ctb_idet.py @@ -48,10 +48,7 @@ class Pixel(object): def _initSD(self): """ Describes the sensitive detector. """ - self.ctb_pixel.add_SenDetector('PixelG4_SD','PixelSensorSD',\ - 'PSD','Pixel::siBLayLog') - self.ctb_pixel.add_SenDetector('PixelG4_SD','PixelSensorSD',\ - 'PSD','Pixel::siLog') + pass #----------------------------------------------------------------------- # -- SCT -- @@ -74,8 +71,8 @@ class SCT(object): def _initSD(self): """ Describes the sensitive detector. """ - self.ctb_sct.add_SenDetector('SCT_G4_SD','SctSensor_CTB','SCT_CTB_SD',\ - 'SCT::ECSensor0') + pass + def _initPR(self): """ Describes the physics regions """ @@ -95,11 +92,12 @@ class TRT(object): to be added to the CTBTRT envelope from ctb_common.ctbtrt """ self.ctb_trt=PyG4Atlas.DetFacility("GeoDetector","TRT:TRT") + def _initSD(self): """ Describes the sensitive detector. """ - self.ctb_trt.add_SenDetector('TRT_G4Utilities:TRT_G4_SD',\ - 'TRTSensitiveDetector','TRTSD','TRT::GasMA') + pass + def _initTRTProcess(self): """Activates the TRT process. """ diff --git a/Simulation/G4Atlas/G4AtlasApps/python/ctb_muon.py b/Simulation/G4Atlas/G4AtlasApps/python/ctb_muon.py index a039b70662d445457a28ec201fe09db460f34b50..70c2ab193af28c2a00ff56f0dcc17fb9c053ec3c 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/ctb_muon.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/ctb_muon.py @@ -20,11 +20,6 @@ __doc__+="""\n ctb_muon = Muon:Muon GeoModel detector ctb_muon=PyG4Atlas.DetFacility("GeoDetector","Muon:Muon") ctb_muon_position=AtlasG4Eng.G4Eng.gbl.CLHEP.Hep3Vector(-34900.0,0.,0.) ctb_muon.df.MoveTo(ctb_muon_position) -# sensitive detector: -ctb_muon.add_SenDetector('MuonG4SD','MDTSens','AMS','Muon::SensitiveGas') -ctb_muon.add_SenDetector('MuonG4SD','RPCSens','RMS','Muon::gazGap') -ctb_muon.add_SenDetector('MuonG4SD','TGCSens','TMS','Muon::muo::TGCGas') -ctb_muon.add_SenDetector('MuonG4SD','CSCSens','CMS','Muon::CscArCO2') # physics-regions: ctb_muon_PhysReg=PyG4Atlas.PhysicsReg('DriftWall') ctb_muon_PhysReg.add_Volumes('Muon::MDTDriftWall')