Skip to content
Snippets Groups Projects
Commit a999a2d7 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'LArMoreRewritten' into 'master'

For LAr: Rewritten EMC, MiniFCAL and DeadSD into new component accumulator style

See merge request atlas/athena!21655
parents dd66dd26 8fbc427e
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,9 @@ from ISF_Algorithms.collection_merger_helpersNew import CollectionMergerCfg
from LArG4SD.LArG4SDConf import LArG4__EMBSDTool
from LArG4SD.LArG4SDConf import LArG4__EMECSDTool
from LArG4SD.LArG4SDConf import LArG4__FCALSDTool
from LArG4SD.LArG4SDConf import LArG4__HECSDTool
from LArG4SD.LArG4SDConf import LArG4__MiniFCALSDTool
from LArG4SD.LArG4SDConf import LArG4__DeadSDTool
def getLArActiveSensitiveDetector(name="LArActiveSensitiveDetector", **kwargs):
## Main configuration
......@@ -32,7 +35,7 @@ def getLArActiveSensitiveDetector(name="LArActiveSensitiveDetector", **kwargs):
kwargs.setdefault("OutputCollectionNames", ["LArCalibrationHitActive"])
return CfgMgr.LArG4__ActiveSDTool(name, **kwargs)
def getLArDeadSensitiveDetector(name="LArDeadSensitiveDetector", **kwargs):
def LArDeadSensitiveDetectorToolCfg(ConfigFlags, name="LArDeadSensitiveDetector", **kwargs):
## Main configuration
kwargs.setdefault("BarrelCryVolumes", ["LArMgr::LAr::Barrel::Cryostat::InnerWall::Vis",
"LArMgr::LAr::Barrel::Cryostat::Sector::*",
......@@ -113,16 +116,14 @@ def getLArDeadSensitiveDetector(name="LArDeadSensitiveDetector", **kwargs):
"LArMgr::LAr::HEC::Module::Depth::FirstAbsorber",
"LArMgr::LAr::HEC::Module::Depth::FirstAbsorber::TieRod"])
# Running PID calibration hits?
from G4AtlasApps.SimFlags import simFlags
kwargs.setdefault("ParticleID",simFlags.ParticleID())
kwargs.setdefault("doEscapedEnergy",simFlags.CalibrationRun.get_Value()!='DeadLAr')
kwargs.setdefault("ParticleID", ConfigFlags.Sim.ParticleID)
kwargs.setdefault("doEscapedEnergy",ConfigFlags.Sim.CalibrationRun !='DeadLAr')
# No effect currently
outputCollectionName = "LArCalibrationHitDeadMaterial"
from G4AtlasApps.SimFlags import simFlags
if simFlags.CalibrationRun.get_Value() in ['LAr', 'LAr+Tile']:
outputCollectionName = "LArCalibrationHitDeadMaterial"
if ConfigFlags.Sim.CalibrationRun in ['LAr', 'LAr+Tile']:
outputCollectionName = "LArCalibrationHitDeadMaterial_DEAD"
kwargs.setdefault("HitCollectionName", outputCollectionName)
return CfgMgr.LArG4__DeadSDTool(name, **kwargs)
return LArG4__DeadSDTool(name, **kwargs)
def LArEMBSensitiveDetectorCfg(ConfigFlags,name="LArEMBSensitiveDetector", **kwargs):
......@@ -197,20 +198,25 @@ def LArFCALSensitiveDetectorCfg(ConfigFlags, name="LArFCALSensitiveDetector", **
result.merge(acc)
return result, LArG4__FCALSDTool(name, **kwargs)
def getLArHECSensitiveDetector(name="LArHECSensitiveDetector", **kwargs):
def LArHECSensitiveDetectorCfg(ConfigFlags, name="LArHECSensitiveDetector", **kwargs):
result = ComponentAccumulator()
bare_collection_name = "LArHitHEC"
mergeable_collection_suffix = "_G4"
merger_input_property = "LArHECHits"
hits_collection_name = generate_mergeable_collection_name(bare_collection_name,
acc, hits_collection_name = CollectionMergerCfg(ConfigFlags, bare_collection_name,
mergeable_collection_suffix,
merger_input_property)
kwargs.setdefault("WheelVolumes",["LArMgr::LAr::HEC::Module::Depth::Slice"])
#kwargs.setdefault("SliceVolumes",["LAr::HEC::Module::Depth::Slice"])
#kwargs.setdefault("LocalVolumes",["LAr::HEC::Module::Depth::Slice::Local"])
kwargs.setdefault("WheelVolumes",["LArMgr::LAr::HEC::Module::Depth::Slice"])
# You might think this should go here, but we don't think so! LAr::HEC::Module::Depth::Slice::Wheel"])
# No effect currently
kwargs.setdefault("OutputCollectionNames", [hits_collection_name])
return CfgMgr.LArG4__HECSDTool(name, **kwargs)
result.merge(acc)
return result, LArG4__HECSDTool(name, **kwargs)
def getLArInactiveSensitiveDetector(name="LArInactiveSensitiveDetector", **kwargs):
## Main configuration
......@@ -273,11 +279,12 @@ def getLArInactiveSensitiveDetector(name="LArInactiveSensitiveDetector", **kwarg
kwargs.setdefault("OutputCollectionNames", ["LArCalibrationHitInactive"])
return CfgMgr.LArG4__InactiveSDTool(name, **kwargs)
def getLArMiniFCALSensitiveDetector(name="LArMiniFCALSensitiveDetector", **kwargs):
def LArMiniFCALSensitiveDetectorToolCfg(ConfigFlags, name="LArMiniFCALSensitiveDetector", **kwargs):
kwargs.setdefault("MiniVolumes",["LArMgr::MiniFCAL::Wafer"])
# No effect currently
kwargs.setdefault("OutputCollectionNames", ["LArHitMiniFCAL"])
return CfgMgr.LArG4__MiniFCALSDTool(name, **kwargs)
return LArG4__MiniFCALSDTool(name, **kwargs)
def getCalibrationDefaultCalculator(name="CalibrationDefaultCalculator", **kwargs):
return CfgMgr.LArG4__CalibrationDefaultCalculator(name, **kwargs)
......
......@@ -37,8 +37,10 @@ if __name__ == '__main__':
from LArG4SD.LArG4SDToolConfig import LArEMBSensitiveDetectorCfg
from LArG4SD.LArG4SDToolConfig import LArEMECSensitiveDetectorCfg
from LArG4SD.LArG4SDToolConfig import LArFCALSensitiveDetectorCfg
from LArG4SD.LArG4SDToolConfig import LArHECSensitiveDetectorCfg
from LArG4SD.LArG4SDToolConfig import LArMiniFCALSensitiveDetectorToolCfg
from LArG4SD.LArG4SDToolConfig import LArDeadSensitiveDetectorToolCfg
#TODO CHECK IF THESE ARE ALL PUBLIC TOOLS!
acc1, tool1 = LArEMBSensitiveDetectorCfg(ConfigFlags)
acc1.addPublicTool(tool1)
cfg.merge(acc1)
......@@ -52,6 +54,17 @@ if __name__ == '__main__':
acc3.addPublicTool(tool3)
cfg.merge(acc3)
acc4, tool4 = LArHECSensitiveDetectorCfg(ConfigFlags)
acc4.addPublicTool(tool4)
cfg.merge(acc4)
toolMiniFCAL = LArMiniFCALSensitiveDetectorToolCfg(ConfigFlags)
cfg.addPublicTool(toolMiniFCAL)
toolDeadSensitiveDetector = LArDeadSensitiveDetectorToolCfg(ConfigFlags)
cfg.addPublicTool(toolDeadSensitiveDetector)
cfg.printConfig(withDetails=True, summariseProps = True)
ConfigFlags.dump()
......
......@@ -8,5 +8,8 @@ def createSimConfigFlags():
scf.addFlag("Sim.ISF.Run",False)
scf.addFlag("Sim.ISF.HITSMergingRequired", True)
scf.addFlag('Sim.ParticleID',False)
scf.addFlag("Sim.CalibrationRun", "DeadLAr") # 'LAr', 'Tile', 'LAr+Tile', 'DeadLAr'
return scf
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment