Skip to content
Snippets Groups Projects
Commit 1354f858 authored by Johannes Junggeburth's avatar Johannes Junggeburth :dog2: Committed by Vakhtang Tsulaia
Browse files

MuonR4 - Schedule the new algs also on RDOs instead of sim hits

MuonR4 - Schedule the new algs also on RDOs instead of sim hits
parent bf64de0d
No related branches found
No related tags found
No related merge requests found
#Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
#Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
#### Snippet to schedule the Muon digitization within the Phase II setup
def MuonSimHitToRdoCnvCfg(flags):
result = ComponentAccumulator()
if flags.Detector.GeometryMDT:
if flags.Detector.GeometryMDT and ("xMdtSimHits" in flags.Input.Collections):
from MuonConfig.MDT_DigitizationConfig import MDT_DigitizationDigitToRDOCfg
result.merge(MDT_DigitizationDigitToRDOCfg(flags))
if flags.Detector.GeometryRPC:
if flags.Detector.GeometryRPC and ("xRpcSimHits" in flags.Input.Collections):
from MuonConfig.RPC_DigitizationConfig import RPC_DigitizationDigitToRDOCfg
result.merge(RPC_DigitizationDigitToRDOCfg(flags))
if flags.Detector.GeometryTGC:
if flags.Detector.GeometryTGC and ("xTgcSimHits" in flags.Input.Collections):
from MuonConfig.TGC_DigitizationConfig import TGC_DigitizationDigitToRDOCfg
result.merge(TGC_DigitizationDigitToRDOCfg(flags))
if flags.Detector.GeometrysTGC:
if flags.Detector.GeometrysTGC and ("xStgcSimHits" in flags.Input.Collections):
from MuonConfig.sTGC_DigitizationConfig import sTGC_DigitizationDigitToRDOCfg
result.merge(sTGC_DigitizationDigitToRDOCfg(flags))
if flags.Detector.GeometryMM:
if flags.Detector.GeometryMM and ("xMmSimHits" in flags.Input.Collections):
from MuonConfig.MM_DigitizationConfig import MM_DigitizationDigitToRDOCfg
result.merge(MM_DigitizationDigitToRDOCfg(flags))
from xAODTruthCnv.RedoTruthLinksConfig import RedoTruthLinksAlgCfg
result.merge( RedoTruthLinksAlgCfg(flags) )
if ("TruthEvents" in flags.Input.Collections):
from xAODTruthCnv.RedoTruthLinksConfig import RedoTruthLinksAlgCfg
result.merge( RedoTruthLinksAlgCfg(flags) )
else:
from xAODTruthCnv.xAODTruthCnvConfig import GEN_AOD2xAODCfg
result.merge(GEN_AOD2xAODCfg(flags))
return result
......@@ -3,7 +3,6 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
def setupTestOutputCfg(flags,**kwargs):
kwargs.setdefault("streamName","MuonSimTestStream")
kwargs.setdefault("AcceptAlgs",[])
result = ComponentAccumulator()
......@@ -18,23 +17,9 @@ def setupTestOutputCfg(flags,**kwargs):
"xAOD::TruthEventAuxContainer#",
"McEventCollection#"] + OutputSimContainersCfg(flags)
from xAODMetaDataCnv.InfileMetaDataConfig import propagateMetaData, MetaDataHelperLists
from AthenaConfiguration.Enums import MetadataCategory
from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
result.merge(SetupMetaDataForStreamCfg(flags, kwargs["streamName"]))
mdLists = MetaDataHelperLists()
for mdCategory in (MetadataCategory.FileMetaData, MetadataCategory.EventStreamInfo):
lists, caConfig = propagateMetaData(flags, kwargs["streamName"], mdCategory)
mdLists += lists
result.merge(caConfig)
kwargs.setdefault("MetadataItemList" , mdLists.mdItems)
kwargs.setdefault("HelperTools", mdLists.helperTools)
from AthenaServices.MetaDataSvcConfig import MetaDataSvcCfg
result.merge(MetaDataSvcCfg(flags,
tools=mdLists.mdTools,
toolNames=mdLists.mdToolNames))
from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
kwargs.setdefault("ItemList", container_items)
result.merge(OutputStreamCfg(flags, **kwargs))
......@@ -43,6 +28,8 @@ def setupTestOutputCfg(flags,**kwargs):
if __name__=="__main__":
from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser, executeTest
parser = SetupArgParser()
parser.add_argument("--saveTestNtuple", help="Schedule the SimHits tester n-tuple", action='store_true',
default=False)
parser.set_defaults(nEvents = -1)
parser.set_defaults(outRootFile="SimHits.pool.root")
......@@ -55,7 +42,9 @@ if __name__=="__main__":
from SimulationConfig.SimEnums import SimulationFlavour
flags.Sim.ISF.Simulator = SimulationFlavour.AtlasG4
flags.addFlag("Output.MuonSimTestStreamFileName", args.outRootFile)
streamName = "MuonSimTestStream"
flags.addFlag(f"Output.{streamName}FileName", args.outRootFile)
flags.addFlag(f"Output.doWrite{streamName}", True)
flags, cfg = setupGeoR4TestCfg(args, flags)
......@@ -74,8 +63,9 @@ if __name__=="__main__":
from xAODTruthCnv.xAODTruthCnvConfig import GEN_EVNT2xAODCfg
cfg.merge(GEN_EVNT2xAODCfg(flags,name="GEN_EVNT2xAOD",AODContainerName="TruthEvent"))
cfg.merge(setupTestOutputCfg(flags))
from MuonPRDTestR4.MuonHitTestConfig import MuonHitTesterCfg
cfg.merge(MuonHitTesterCfg(flags))
cfg.merge(setupTestOutputCfg(flags, streamName=streamName))
if args.saveTestNtuple:
from MuonPRDTestR4.MuonHitTestConfig import MuonHitTesterCfg
cfg.merge(MuonHitTesterCfg(flags))
executeTest(cfg)
......@@ -24,7 +24,13 @@ atlas_add_test( HoughTransformTestR3
PROPERTIES TIMEOUT 600
PRIVATE_WORKING_DIRECTORY
POST_EXEC_SCRIPT nopost.sh)
atlas_add_test( HoughTransformTestR3_fromRDO
SCRIPT python -m MuonPatternRecognitionTest.MuonHoughTransformTesterConfig --nEvents 2 --noMonitorPlots --inputFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonGeomRTT/R3Digits.pool.root
PROPERTIES TIMEOUT 600
PRIVATE_WORKING_DIRECTORY
POST_EXEC_SCRIPT nopost.sh)
atlas_add_test( HoughTransformTestR4
SCRIPT python -m MuonPatternRecognitionTest.MuonHoughTransformTesterConfig --noMonitorPlots --nEvents 2 --noMM --noSTGC --geoModelFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/ATLAS-R4-MUONTEST.db --condTag OFLCOND-MC21-SDR-RUN4-01 --geoTag ATLAS-P2-RUN4-01-00-00 --inputFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonGeomRTT/R4SimHits.pool.root
PROPERTIES TIMEOUT 600
......
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