flags.Concurrency.NumThreads = 1 flags.Concurrency.NumConcurrentEvents = 1 flags.InDet.useSctDCS = False flags.InDet.usePixelDCS = False flags.lock() from AthenaCommon.Constants import DEBUG, WARNING acc = MainServicesCfg(flags) acc.getService('AvalancheSchedulerSvc').VerboseSubSlots = True # this delcares to the scheduer that EventInfo object is produced acc.addEventAlgo( CompFactory.SGInputLoader(Load=[('xAOD::EventInfo', 'StoreGateSvc+EventInfo')]), "AthAlgSeq") from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg acc.merge(ByteStreamReadCfg(flags)) from TriggerJobOpts.TriggerHistSvcConfig import TriggerHistSvcConfig acc.merge(TriggerHistSvcConfig(flags)) from TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT_newJO import generateMenu as generateHLTMenu from TriggerJobOpts.TriggerConfig import triggerRunCfg acc.merge(triggerRunCfg(flags, seqName="AthMasterSeq", menu=generateHLTMenu))
return acc if __name__ == "__main__": from AthenaConfiguration.AllConfigFlags import ConfigFlags from AthenaCommon.Logging import log from AthenaCommon.Constants import DEBUG from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior = 1 log.setLevel(DEBUG) from AthenaConfiguration.TestDefaults import defaultTestFiles ConfigFlags.Input.Files = defaultTestFiles.RAW ConfigFlags.lock() from AthenaConfiguration.MainServicesConfig import MainServicesCfg from LArByteStream.LArRawDataReadingConfig import LArRawDataReadingCfg acc = MainServicesCfg(ConfigFlags) acc.merge(LArRawDataReadingCfg(ConfigFlags)) acc.merge(LArRawChannelBuilderAlgCfg(ConfigFlags)) DumpLArRawChannels = CompFactory.DumpLArRawChannels acc.addEventAlgo(DumpLArRawChannels( LArRawChannelContainerName="LArRawChannels_FromDigits", ), sequenceName="AthAlgSeq") acc.run(3)
from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior = 1 from AthenaConfiguration.AllConfigFlags import ConfigFlags ConfigFlags.Input.Files = [ "myRDO.pool.root", ] ConfigFlags.lock() from AthenaConfiguration.MainServicesConfig import MainServicesCfg from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg cfg = MainServicesCfg(ConfigFlags) cfg.merge(PoolReadCfg(ConfigFlags)) from LArGeoAlgsNV.LArGMConfig import LArGMCfg cfg.merge(LArGMCfg(ConfigFlags)) from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg cfg.merge(LArOnOffIdMappingCfg(ConfigFlags)) cfg.addEventAlgo( CompFactory.DumpLArRawChannels(NtupStream="LARRC", OutputFileName="", ToLog=False)) cfg.addService( CompFactory.THistSvc( Output=["LARRC DATAFILE='LARRC.root', OPT='RECREATE'"])) cfg.run(-1)
if __name__=="__main__": from AthenaConfiguration.AllConfigFlags import ConfigFlags from AthenaCommon.Logging import log from AthenaCommon.Constants import DEBUG,WARNING from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior=1 log.setLevel(DEBUG) ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data17_13TeV.00330470.physics_Main.daq.RAW._lb0310._SFO-1._0001.data",] ConfigFlags.lock() from AthenaConfiguration.MainServicesConfig import MainServicesCfg acc = MainServicesCfg(ConfigFlags) acc.merge(CaloRecoCfg(ConfigFlags)) CaloCellDumper=CompFactory.CaloCellDumper acc.addEventAlgo(CaloCellDumper()) ClusterDumper=CompFactory.ClusterDumper acc.addEventAlgo(ClusterDumper("TopoDumper",ContainerName="CaloCalTopoClusters",FileName="TopoCluster.txt")) f=open("CaloRec.pkl","wb") acc.store(f) f.close() acc.run(10,OutputLevel=WARNING)
from TileGeoG4SD.TileGeoG4SDToolConfig import TileGeoG4SDCalcCfg cfg.merge(TileGeoG4SDCalcCfg(ConfigFlags)) # FIXME hack to match to buggy behaviour in old style configuration OutputStreamHITS = cfg.getEventAlgo("OutputStreamHITS") OutputStreamHITS.ItemList.remove("xAOD::EventInfo#EventInfo") OutputStreamHITS.ItemList.remove("xAOD::EventAuxInfo#EventInfoAux.") # FIXME hack because deduplication is broken PoolAttributes = ["TREE_BRANCH_OFFSETTAB_LEN = '100'"] PoolAttributes += ["DatabaseName = '" + ConfigFlags.Output.HITSFileName + "'; ContainerName = 'TTree=CollectionTree'; TREE_AUTO_FLUSH = '1'"] cfg.getService("AthenaPoolCnvSvc").PoolAttributes += PoolAttributes # Dump config cfg.addEventAlgo(CompFactory.JobOptsDumperAlg(FileName="G4AtlasTestConfig.txt")) cfg.getService("StoreGateSvc").Dump = True cfg.getService("ConditionStore").Dump = True cfg.printConfig(withDetails=True, summariseProps = True) ConfigFlags.dump() # Execute and finish #sc = cfg.run(maxEvents=evtMax) b = time.time() log.info("Run G4AtlasAlg in " + str(b-a) + " seconds") # Success should be 0 #os.sys.exit(not sc.isSuccess())
from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg from TrigEDMConfig import DataScoutingInfo from AthenaCommon.CFElements import seqAND from Gaudi.Configuration import DEBUG cfg = MainServicesCfg(ConfigFlags) cfg.merge(ByteStreamReadCfg(ConfigFlags)) histSvc = CompFactory.THistSvc() histSvc.Output += [ "COSTSTREAM DATAFILE='" + args.outputHist + "' OPT='RECREATE'" ] cfg.addService(histSvc) cfg.addSequence(seqAND("Decoding")) cfg.addEventAlgo(CfgMgr.HLTResultMTByteStreamDecoderAlg(), "Decoding") costDataDeserialiser = CfgMgr.TriggerEDMDeserialiserAlg( "CostDataTrigDeserialiser") costDataDeserialiser.ModuleID = DataScoutingInfo.DataScoutingIdentifiers[ "CostMonDS"] cfg.addEventAlgo(costDataDeserialiser, "Decoding") hltConfigSvc = CfgMgr.TrigConf__HLTConfigSvc("HLTConfigSvc") hltConfigSvc.ConfigSource = "None" hltConfigSvc.XMLMenuFile = "None" hltConfigSvc.InputType = "file" hltConfigSvc.JsonFileName = "HLTMenu_9.json" cfg.addService(hltConfigSvc) enhancedBiasWeighter = CfgMgr.EnhancedBiasWeighter() enhancedBiasWeighter.RunNumber = 379158
theKey="CaloCalTopoClustersNew" topoAcc=CaloTopoClusterCfg(ConfigFlags) topoAlg = topoAcc.getPrimary() topoAlg.ClustersOutputName=theKey cfg.merge(topoAcc) from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg cfg.merge(OutputStreamCfg(ConfigFlags,"xAOD", ItemList=["xAOD::CaloClusterContainer#CaloCalTopoClusters*",#+theKey, "xAOD::CaloClusterAuxContainer#*CaloCalTopoClusters*Aux.",#+theKey+"Aux.", # "CaloClusterCellLinkContainer#"+theKey+"_links" ])) ThinNegativeEnergyCaloClustersAlg=CompFactory.ThinNegativeEnergyCaloClustersAlg theNegativeEnergyCaloClustersThinner = ThinNegativeEnergyCaloClustersAlg( "ThinNegativeEnergyCaloClustersAlg", CaloClustersKey=theKey, ThinNegativeEnergyCaloClusters = True, StreamName = 'StreamAOD' ) cfg.addEventAlgo(theNegativeEnergyCaloClustersThinner,"AthAlgSeq") # cfg.getService("StoreGateSvc").Dump=True cfg.run(10) #f=open("CaloTopoCluster.pkl","wb") #cfg.store(f) #f.close()
# when trying AOD # from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg # cfg.merge( PoolReadCfg( ConfigFlags ) ) from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg cfg.merge(ByteStreamReadCfg(ConfigFlags)) acc = regSelCfg(ConfigFlags) cfg.merge(acc) RegSelTestAlg = CompFactory.RegSelTestAlg testerAlg = RegSelTestAlg() testerAlg.Mt = True testerAlg.OutputLevel = DEBUG cfg.addEventAlgo(testerAlg) AthenaPoolCnvSvc = CompFactory.AthenaPoolCnvSvc apcs = AthenaPoolCnvSvc() cfg.addService(apcs) EvtPersistencySvc = CompFactory.EvtPersistencySvc cfg.addService( EvtPersistencySvc("EventPersistencySvc", CnvServices=[ apcs.getFullJobOptName(), ])) cfg.getService("IOVDbSvc").OutputLevel = DEBUG cfg.store(open("test.pkl", "wb")) print("used flags") ConfigFlags.dump()
# # Try to get around TRT alignment folder problem in MC cfgFlags.GeoModel.Align.Dynamic = False # cfgFlags.lock() from AthenaConfiguration.MainServicesConfig import MainServicesCfg cfg = MainServicesCfg(cfgFlags) from CaloRec.CaloTopoClusterConfig import CaloTopoClusterCfg tccfg = CaloTopoClusterCfg(cfgFlags, doLCCalib=True) tcalg = tccfg.getPrimary() tcalg.ClustersOutputName = "CaloCalTopoClustersNew" cfg.merge(tccfg) cfg.addEventAlgo(tcalg, sequenceName="AthAlgSeq") from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg cfg.merge(PoolReadCfg(cfgFlags)) cfg.merge(PFCfg(cfgFlags)) cfg.printConfig() # (summariseProps=True) outputlist = [ "xAOD::CaloClusterContainer#CaloCalTopoClusters*", "xAOD::CaloClusterAuxContainer#*CaloCalTopoClusters*Aux.", "xAOD::PFOContainer#*ParticleFlowObjects", "xAOD::PFOAuxContainer#*ParticleFlowObjectsAux." ] from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
rates = CompFactory.FullMenu() rates.PrescaleXML = args.inputPrescalesXML rates.DoTriggerGroups = args.disableTriggerGroups rates.DoGlobalGroups = args.disableGlobalGroups rates.DoExpressRates = args.disableExpressGroup rates.DoUniqueRates = args.disableUniqueRates rates.DoHistograms = args.disableHistograms rates.UseBunchCrossingTool = useBunchCrossingTool rates.TargetLuminosity = args.targetLuminosity rates.VetoStartOfTrain = args.vetoStartOfTrain rates.EnableLumiExtrapolation = args.disableLumiExtrapolation rates.EnhancedBiasRatesTool = ebw rates.TrigDecisionTool = tdt rates.TrigConfigSvc = cfgsvc cfg.addEventAlgo(rates) # Setup for accessing bunchgroup data from the DB if useBunchCrossingTool: if isMC: cfg.addPublicTool(CompFactory.BunchCrossingTool("MC")) else: cfg.addPublicTool(CompFactory.BunchCrossingTool("LHC")) eventLoop = CompFactory.AthenaEventLoopMgr() eventLoop.EventPrintoutInterval = 1000 cfg.addService(eventLoop) # If you want to turn on more detailed messages ... # exampleMonitorAcc.getEventAlgo('ExampleMonAlg').OutputLevel = 2 # DEBUG cfg.printConfig(withDetails=False) # set True for exhaustive info
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon import Logging from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory if __name__=="__main__": # Setting needed for the ComponentAccumulator to do its thing from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior=True # Set message levels from AthenaCommon import Constants msgLvl = "WARNING" from AthenaCommon.Logging import log log.setLevel(msgLvl) # Config flags steer the job at various levels from AthenaConfiguration.AllConfigFlags import ConfigFlags ConfigFlags.Input.isMC = True ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/ASG/mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._000001.pool.root.1"] # Flags relating to multithreaded execution nthreads=0 ConfigFlags.Concurrency.NumThreads =nthreads if nthreads>0: ConfigFlags.Concurrency.NumThreads = 1 ConfigFlags.Concurrency.NumConcurrentEvents = 1 ConfigFlags.MET.UseTracks = True ConfigFlags.MET.DoPFlow = True if ConfigFlags.Beam.Type == 'cosmics' or ConfigFlags.Beam.Type == 'singlebeam':# used to have " or not rec.doInDet()" on the end
def TPCnvTest(infile, keys, useGeoModelSvc=False, useIOVDbSvc=False, doPixel=False, doSCT=False, doTRT=False, doLAr=False, doTile=False, doMuon=False): # Make sure we don't have a stale file catalog. if os.path.exists('PoolFileCatalog.xml'): os.remove('PoolFileCatalog.xml') if ('ATLAS_REFERENCE_TAG' not in globals() and 'ATLAS_REFERENCE_TAG' in os.environ): ATLAS_REFERENCE_TAG = os.environ['ATLAS_REFERENCE_TAG'] # noqa: F841 refpaths = [ os.environ.get('ATLAS_REFERENCE_DATA', None), '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art', '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs', '/afs/cern.ch/atlas/maxidisk/d33/referencefiles' ] if infile.startswith('rtt:'): infile = infile[4:] infile = find_file(infile, refpaths) # Provide MC input ConfigFlags.Input.Files = [infile] ConfigFlags.GeoModel.AtlasVersion = 'ATLAS-R1-2012-03-01-00' ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Detector.GeometryPixel = doPixel ConfigFlags.Detector.GeometrySCT = doSCT ConfigFlags.Detector.GeometryTRT = doTRT ConfigFlags.Detector.GeometryLAr = doLAr ConfigFlags.Detector.GeometryTile = doTile ConfigFlags.Detector.GeometryMuon = doMuon ConfigFlags.lock() # Construct ComponentAccumulator acc = MainServicesCfg(ConfigFlags) acc.merge(PoolReadCfg(ConfigFlags)) if useIOVDbSvc: acc.merge(IOVDbSvcCfg(ConfigFlags)) if useGeoModelSvc: if ConfigFlags.Detector.GeometryPixel: acc.merge(PixelGeometryCfg(ConfigFlags)) useGeoModelSvc = True if ConfigFlags.Detector.GeometrySCT: acc.merge(SCT_GeometryCfg(ConfigFlags)) useGeoModelSvc = True if ConfigFlags.Detector.GeometryTRT: acc.merge(TRT_GeometryCfg(ConfigFlags)) useGeoModelSvc = True if ConfigFlags.Detector.GeometryLAr: acc.merge(LArGMCfg(ConfigFlags)) useGeoModelSvc = True if ConfigFlags.Detector.GeometryTile: acc.merge(TileGMCfg(ConfigFlags)) useGeoModelSvc = True if ConfigFlags.Detector.GeometryMuon: acc.merge(MuonGeoModelCfg(ConfigFlags)) useGeoModelSvc = True #acc.merge(ForDetGeometryCfg(ConfigFlags)) acc.merge(GeoModelCfg(ConfigFlags)) acc.getService("GeoModelSvc").IgnoreTagDifference = True acc.addEventAlgo( Dumper('dumper', ConfigFlags.Input.Files[0], keys, refpaths), 'AthAlgSeq') return acc.run(maxEvents=10)
from AthenaConfiguration.MainServicesConfig import MainServicesCfg cfg = MainServicesCfg(ConfigFlags) # Add the components for reading in pool files from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg cfg.merge(PoolReadCfg(ConfigFlags)) # Nowadays the jet calibration tool requires the EventInfo # to be decorated with lumi info, which is not in Run 2 AODs from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg cfg.merge(LuminosityCondAlgCfg(ConfigFlags)) from AthenaConfiguration.ComponentFactory import CompFactory muWriter = CompFactory.LumiBlockMuWriter("LumiBlockMuWriter", LumiDataKey="LuminosityCondData") cfg.addEventAlgo(muWriter, "AthAlgSeq") ######################################################################## # Define flags steering the jet reco config jetdefs = DefineJetCollections(ConfigFlags) # Add the components from our jet reconstruction job cfg.merge(JetRecTestCfg(jetdefs, ConfigFlags, args)) # Write what we produced to AOD # First define the output list outputlist = ["EventInfo#*"] originaljets = ["AntiKt4EMPFlowJets", "AntiKt4EMTopoJets"] for jetcoll in originaljets: outputlist += [ "xAOD::JetContainer#" + jetcoll,