from AthenaConfiguration.TestDefaults import defaultTestFiles inputDir = defaultTestFiles.d ConfigFlags.Input.Files = defaultTestFiles.EVNT # Finalize # ConfigFlags.lock() ## Initialize a new component accumulator cfg = MainServicesCfg(ConfigFlags) from G4AtlasTools.G4FieldConfigNew import ATLASFieldManagerToolCfg, TightMuonsATLASFieldManagerToolCfg, Q1FwdFieldManagerToolCfg #add the algorithm acc1 = ATLASFieldManagerToolCfg(ConfigFlags) acc2 = TightMuonsATLASFieldManagerToolCfg(ConfigFlags) cfg.popToolsAndMerge(acc1) cfg.popToolsAndMerge(acc2) #don't run for simulation only tests (todo - make new general test) import os if not "AthSimulation_DIR" in os.environ: acc3 = Q1FwdFieldManagerToolCfg(ConfigFlags) cfg.popToolsAndMerge(acc3) # Dump config #cfg.getService("StoreGateSvc").Dump = True #cfg.getService("ConditionStore").Dump = True cfg.printConfig(withDetails=True, summariseProps=True) ConfigFlags.dump() f = open("test.pkl", "wb")
#ConfigFlags.Sim.Vertex.Source = "VertexOverrideFile.txt"# Vertex.OverrideFile/Vertex.OverrideEventFile ConfigFlags.Sim.Vertex.Source = "CondDB" # Vertex.FromCondD #ConfigFlags.Sim.Vertex.Source = "LongBeamspotVertexPositioner" #included to stop segmentation error - TODO see why it's failing ConfigFlags.Input.isMC = True ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-14" #conditions tag for conddb (which one to use - old one for simulation) ConfigFlags.Input.RunNumber = 284500 # run test job with and without run number and 222510 # Finalize ConfigFlags.lock() ## Initialize a new component accumulator cfg = MainServicesCfg(ConfigFlags) #use this syntax for storegate # Add configuration to read EVNT pool file cfg.merge(PoolReadCfg(ConfigFlags)) # Make use of our defiend function cfg.popToolsAndMerge(BeamEffectsAlgCfg(ConfigFlags)) cfg.getService("StoreGateSvc").Dump = True cfg.printConfig(withDetails=True) ConfigFlags.dump() # Run it in athena cfg.run(maxEvents=20) # Store in a pickle file with open("BeamEffectsAlg.pkl", "wb") as f: cfg.store(f)