def __init__(self, streamName="Stream2", fileName="HLT.root", catalog="xmlcatalog_file:Catalog1.xml", store=None): import AthenaPoolCnvSvc.WriteAthenaPool from AthenaCommon.AppMgr import ServiceMgr as svcMgr from PoolSvc.PoolSvcConf import PoolSvc svcMgr += PoolSvc() svcMgr.PoolSvc.WriteCatalog = catalog from AthenaPoolCnvSvc.AthenaPoolCnvSvcConf import AthenaPoolCnvSvc svcMgr += AthenaPoolCnvSvc() svcMgr.AthenaPoolCnvSvc.CommitInterval = 10 from OutputStreamAthenaPool.OutputStreamAthenaPool import AthenaPoolOutputConditionStream self.stream = AthenaPoolOutputConditionStream(streamName) from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream self.stream = AthenaPoolOutputStream(streamName) self.stream.OutputFile = fileName if store != None: self.stream.Store = store else: from StoreGate.StoreGateConf import StoreGateSvc self.stream.Store = StoreGateSvc("DetectorStore") TrigConditionStream.setItemList(self.stream)
def __init__(self, fileName="TrigDec.root", catalog="xmlcatalog_file:Catalog1.xml"): from AthenaCommon.AlgSequence import AlgSequence TopAlg = AlgSequence() self.TrigDecMaker = TrigDecisionMaker('TrigDecMaker') TopAlg += self.TrigDecMaker from StoreGate.StoreGateConf import StoreGateSvc sgStore = StoreGateSvc("StoreGateSvc") dtStore = StoreGateSvc("DetectorStore") self.TrigDecStream = TrigDecisionStream("Stream1", fileName, catalog, sgStore)
def __init__(self, streamName="Stream1", fileName="HLT.root", catalog="xmlcatalog_file:Catalog1.xml", store=None): import AthenaPoolCnvSvc.WriteAthenaPool # noqa: F401 from AthenaCommon.AppMgr import ServiceMgr as svcMgr svcMgr.PoolSvc.WriteCatalog = catalog # revert later from OutputStreamAthenaPool.CreateOutputStreams import createOutputStream # revert later self.stream = createOutputStream( streamName ) from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream self.stream = AthenaPoolOutputStream(streamName) self.stream.OutputFile = fileName if store is not None: self.stream.Store = store else: from StoreGate.StoreGateConf import StoreGateSvc self.stream.Store = StoreGateSvc("StoreGateSvc") TrigDecisionStream.setItemList(self.stream)
svcMgr += AthenaPoolCnvSvc() #svcMgr.AthenaPoolCnvSvc.OutputLevel = DEBUG svcMgr.AthenaPoolCnvSvc.CommitInterval = 10; from OutputStreamAthenaPool.OutputStreamAthenaPool import createOutputStream stream = createOutputStream( "Stream1" ) #from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream #stream = AthenaPoolOutputStream( "Stream1" ) stream.OutputFile = "Result.root" stream.ItemList += [ "HLT::HLTResult#HLTResult_L2", "HLT::HLTResult#HLTResult_EF" ] stream.ItemList += [ "TrigRoiDescriptorCollection#HLT_initialRoI" ] from StoreGate.StoreGateConf import StoreGateSvc stream.Store = StoreGateSvc( "StoreGateSvc" ) ######### to here ### print the job ### ##################### #log.info("print job:") #print job ### print services ### ###################### #log.info("print theApp.services():") #print theApp.services()
# ################################################# # Shall athena exit if the partition is shutdown ? # For offline athena tasks mainly. # ################################################# #ByteStreamEmonInputSvc.ExitOnPartitionShutdown = False ByteStreamCnvSvc = Service("ByteStreamCnvSvc") theApp.ExtSvc += ["ByteStreamCnvSvc"] # It looks as if one needs this now online ? if False: from AthenaServices.AthenaServicesConf import MetaDataSvc svcMgr += MetaDataSvc("MetaDataSvc") # Add in MetaData Stores from StoreGate.StoreGateConf import StoreGateSvc svcMgr += StoreGateSvc("MetaDataStore") svcMgr += StoreGateSvc("InputMetaDataStore") # Make MetaDataSvc an AddressProvider svcMgr.ProxyProviderSvc.ProviderNames += ["MetaDataSvc"] # enable IOVDbSvc to read metadata #svcMgr.MetaDataSvc.MetaDataContainer = "MetaDataHdr" #svcMgr.MetaDataSvc.MetaDataTools += [ "IOVDbMetaDataTool" ] MetaDataStore = svcMgr.MetaDataStore #-------------------------------------------------------------- # Private Application Configuration options, replace with # your configuration. #--------------------------------------------------------------
svcMgr.ForwardSchedulerSvc.MaxAlgosInFlight = 1 svcMgr.ForwardSchedulerSvc.ThreadPoolSize = 1 svcMgr.ForwardSchedulerSvc.AlgosDependencies = [[], ['8000/WriteData'], [], []] svcMgr += AthenaHiveEventLoopMgr() svcMgr.AthenaHiveEventLoopMgr.WhiteboardSvc = "EventDataSvc" svcMgr.AthenaHiveEventLoopMgr.OutputLevel = DEBUG from StoreGate.StoreGateConf import SG__HiveMgrSvc svcMgr += SG__HiveMgrSvc("EventDataSvc") svcMgr.EventDataSvc.NSlots = numStores svcMgr.EventDataSvc.OutputLevel = DEBUG from StoreGate.StoreGateConf import StoreGateSvc svcMgr += StoreGateSvc() svcMgr.StoreGateSvc.OutputLevel = VERBOSE svcMgr.StoreGateSvc.Dump = True from StoreGate.StoreGateConf import SGImplSvc svcMgr += SGImplSvc("SGImplSvc") svcMgr.SGImplSvc.OutputLevel = VERBOSE # dummy event loop #theApp.EvtSel = "NONE" # Number of events to be processed (default is 10) theApp.EvtMax = 500 #-------------------------------------------------------------- # Private Application Configuration options #--------------------------------------------------------------
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream Stream1 = AthenaPoolOutputStream("Stream1", "ROOTTREE:SimplePoolFile5.root") Stream1.ItemList += ["ExampleHitContainer#MyHits"] Stream1.MetadataItemList += ["ExampleHitContainer#PedestalWriteData"] Stream1.ProvideDef = True #-------------------------------------------------------------- # Private Application Configuration options #-------------------------------------------------------------- # Load "user algorithm" top algorithms to be run, and the libraries that house them from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__WriteData, AthPoolEx__WriteCond topSequence += AthPoolEx__WriteData("WriteData") from StoreGate.StoreGateConf import StoreGateSvc topSequence += AthPoolEx__WriteCond("WriteCond", DetStore=StoreGateSvc("MetaDataStore"), ConditionName="PedestalWriteData") #-------------------------------------------------------------- # Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL) #-------------------------------------------------------------- svcMgr.MessageSvc.OutputLevel = 3 svcMgr.PoolSvc.OutputLevel = 2 svcMgr.AthenaPoolCnvSvc.OutputLevel = 2 topSequence.WriteData.OutputLevel = 2 Stream1.OutputLevel = 2 # # End of job options file # ###############################################################
def __init__(self, fatrasJob=None, noiseLevels=[]): ############################################################################ # PRINT MESSAGE IF NOTHING IS PROVIDED if fatrasJob is None: printfunc('CONFIGURATION PROBLEM in FatrasReconstruction setup: ') printfunc(' - providing a FatrasJob instance is mandatory') fatrasTools = fatrasJob.tools() fatrasPrimary = fatrasJob.primarySimulation() fatrasExtrapolation = fatrasJob.extrapolation() # import the jobProperties from FatrasExample.FatrasJobProperties import FatrasFlags from FatrasExample.FatrasValidation import FatrasValidationFlags # prepare the StoreGate (configurable for Event overlay) from FastSimulationConfig.FastSimulationFlags import jobproperties EventStoreName = jobproperties.FastSimulation.EventStoreName() from StoreGate.StoreGateConf import StoreGateSvc FatrasEventStore = StoreGateSvc(EventStoreName) # register fatrasJob.registerReconstruction(self) #-------------------------------------------------------------- # load ServiceMgr, ToolSvc, topSequence #-------------------------------------------------------------- from AthenaCommon.AppMgr import theApp from AthenaCommon.AppMgr import ServiceMgr if 'ToolSvc' not in dir(): from AthenaCommon.AppMgr import ToolSvc if 'topSequence' not in dir(): from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() #-------------------------------------------------------------- # InDetFlags configuration #-------------------------------------------------------------- if FatrasFlags.SimulationID(): # --- setup InDetFlags # --- setup InDetFlags according to InDetFlagsJobProperty from InDetRecExample.InDetJobProperties import InDetFlags # the different pattern components InDetFlags.doNewTracking = True InDetFlags.doBackTracking = True InDetFlags.doTruth = True InDetFlags.preProcessing = True InDetFlags.doPRDFormation = False InDetFlags.doFatras = True # switch the detector control system off InDetFlags.useDCS = False if len(noiseLevels) > 0: ToolSvc.FatrasPixelPostProcessor.NoiseFraction = noiseLevels[0] if len(noiseLevels) > 1: ToolSvc.FatrasSCT_PostProcessor.NoiseFraction = noiseLevels[1] if len(noiseLevels) > 2: ToolSvc.FatrasTRT_PostProcessor.NoiseFraction = noiseLevels[2] #-------------------------------------------------------------- # Load Inner Detector reconstruction #-------------------------------------------------------------- if FatrasFlags.ReconstructionID(): include("InDetRecExample/InDetRec_jobOptions.py") elif FatrasFlags.RefittingID(): include("InDetSLHC_Example/InDetRec_jobOptions_refit.py") else: include("InDetRecExample/InDetRecConditionsAccess.py") #-------------------------------------------------------------- # Muon Flags configuration #-------------------------------------------------------------- if FatrasFlags.SimulationMS(): from MuonRecExample.MuonRecFlags import muonRecFlags # let everything be configured by the Muon Reconstruction if FatrasFlags.ReconstructionMS(): muonRecFlags.doDigitization = FatrasFlags.DigitizationMS() muonRecFlags.doMuonboy = FatrasFlags.ReconstructionMS() muonRecFlags.doMoore = FatrasFlags.ReconstructionMS() ServiceMgr.PoolSvc.AttemptCatalogPatch = True # this is to set the Amdc Source format include("AmdcAth/AmdcAth_jobOptions.py") # necessary to avoid a clinch between MetaDataSvc and McEventSelector if FatrasFlags.SingleTrackSimulation(): include.block( 'AthenaPoolCnvSvc/ReadAthenaPool_jobOptions.py') # overwrite Muon containers from bytestream from MuonMDT_CnvTools.MuonMDT_CnvToolsConf import Muon__MDT_RawDataProviderTool MDT_RawDataProviderTool = Muon__MDT_RawDataProviderTool( name='MDT_RawDataProviderTool') MDT_RawDataProviderTool.RdoLocation = 'MDT_dump' ToolSvc += MDT_RawDataProviderTool from MuonRPC_CnvTools.MuonRPC_CnvToolsConf import Muon__RPC_RawDataProviderTool RPC_RawDataProviderTool = Muon__RPC_RawDataProviderTool( name='RPC_RawDataProviderTool') RPC_RawDataProviderTool.RdoLocation = 'RPC_dump' ToolSvc += RPC_RawDataProviderTool from MuonTGC_CnvTools.MuonTGC_CnvToolsConf import Muon__TGC_RawDataProviderTool TGC_RawDataProviderTool = Muon__TGC_RawDataProviderTool( name='TGC_RawDataProviderTool') TGC_RawDataProviderTool.RdoLocation = 'TGC_dump' ToolSvc += TGC_RawDataProviderTool from MuonCSC_CnvTools.MuonCSC_CnvToolsConf import Muon__CSC_RawDataProviderTool CSC_RawDataProviderTool = Muon__CSC_RawDataProviderTool( name='CSC_RawDataProviderTool') CSC_RawDataProviderTool.RdoLocation = 'CSC_dump' ToolSvc += CSC_RawDataProviderTool if FatrasValidationFlags.MuonMonitoringNtuple(): #-------------------------------------------------------------- #build MuonCalibrationNtuple #-------------------------------------------------------------- from MuonRecExample.MuonRecFlags import muonRecFlags from MuonCalibAlgs.MuonCalibFlags import muonCalibFlags muonRecFlags.doCalib = True muonCalibFlags.Mode = 'trackNtuple' muonCalibFlags.EventTag = 'Moore' #-------------------------------------------------------------- import MuonCnvExample.MuonCablingConfig # include the MuonRecExample jobOptions include("MuonRecExample/MuonRec_jobOptions.py") include.block("MuonRecExample/MuonRec_jobOptions.py") # when fast calo sim steered from Fatras if FatrasFlags.FastCaloSim(): from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags include("MuonCombinedRecExample/MuonCombinedRec_config.py") if FatrasValidationFlags.MuonSimHitNtuple(): # from FatrasMuonAlgs.FatrasMuonAlgsConf import Fatras__MuonHitNtuple MuonHitNtuple = Fatras__MuonHitNtuple(name='MuonHitNtuple') MuonHitNtuple.EventStore = FatrasEventStore MuonHitNtuple.ProcessFatrasTracks = True MuonHitNtuple.McEventCollection = FatrasKeyFlags.McEventCollection( ) MuonHitNtuple.Extrapolator = "Trk::Extrapolator/FatrasRecoExtrapolator" MuonHitNtuple.TreeFolderLocation = '/' + FatrasValidationFlags.ValidationStream( ) + '/hits' topSequence += MuonHitNtuple printfunc(MuonHitNtuple)
#--- Secondary Write portion ----- Don't change it !!! #-------------------------------------------------------------- # Load the OutputStream from OutputStreamAthenaPool.CreateOutputStreams import AthenaPoolOutputConditionStream Stream1 = AthenaPoolOutputConditionStream("Stream1", "SimplePoolFile4.root") Stream1.ObjectList += ["ExampleHitContainer#PedestalWriteData"] #-------------------------------------------------------------- # Private Application Configuration options #-------------------------------------------------------------- # Load "user algorithm" top algorithms to be run, and the libraries that house them from AthenaPoolExampleAlgorithms.AthenaPoolExampleAlgorithmsConf import AthPoolEx__ReadData, AthPoolEx__WriteCond topSequence += AthPoolEx__ReadData("ReadData") from StoreGate.StoreGateConf import StoreGateSvc topSequence += AthPoolEx__WriteCond("WriteCond", DetStore=StoreGateSvc("DetectorStore"), ConditionName="PedestalWriteData", Weight=0.0, Offset=0.0) #-------------------------------------------------------------- # Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL) #-------------------------------------------------------------- svcMgr.MessageSvc.OutputLevel = 3 svcMgr.EventSelector.OutputLevel = 2 svcMgr.AthenaPoolAddressProviderSvc.OutputLevel = 2 svcMgr.MetaDataSvc.OutputLevel = 2 svcMgr.PoolSvc.OutputLevel = 2 topSequence.ReadData.OutputLevel = 2 topSequence.WriteCond.OutputLevel = 2
from InDetOverlay.InDetOverlayConf import InDetOverlay job.insert(0, InDetOverlay()) #job.InDetOverlay.OutputLevel = INFO #job.InDetOverlay.mainInputPixelName = 'PixelTest' # McEventCollection copying from OverlayCommonAlgs.OverlayCommonAlgsConf import CopyMcEventCollection job += CopyMcEventCollection() #-------------------------------------------------------------- # Output options #-------------------------------------------------------------- from StoreGate.StoreGateConf import StoreGateSvc ServiceMgr += StoreGateSvc("StoreGateSvc") ServiceMgr.StoreGateSvc.Dump = True from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream outStream = AthenaPoolOutputStream("OverlayOutputStream") outStream.Store = ServiceMgr.StoreGateSvc # Stream's output file outStream.OutputFile = "InDetOverlayOut.pool.root" #FIXME: ### FIXME: this does not work because I and O stores are separate. #FIXME: # Copy everything from the input and must force reading of all input #FIXME: # objects #FIXME: #outStream.ForceRead = True #FIXME: #outStream.TakeItemsFromInput = True # Need to set this to False if an explicit list is to be used
ClassesToPreregister = bswrite)) #-------------------------------------------------------------- # Output options #-------------------------------------------------------------- # ItemList: fullItemList = [] fullItemList+=["HLT::HLTResult#HLTResult_HLT"] # Stream's output file import os try: os.remove('test.bs') except OSError: pass import os try: os.remove('test.bs.writing') except OSError: pass from AthenaCommon.AthenaCommonFlags import athenaCommonFlags athenaCommonFlags.BSRDOOutput = 'test.bs' from ByteStreamCnvSvc import WriteByteStream from StoreGate.StoreGateConf import StoreGateSvc svcMgr += StoreGateSvc('InputMetaDataStore') StreamBSFileOutput = WriteByteStream.getStream("EventStorage","StreamBSFileOutput") # List of DO's to write out StreamBSFileOutput.ItemList += fullItemList include ('DataModelRunTests/commonTrailer.py')
from PartPropSvc.PartPropSvcConf import * #================================================================ # Add an extra EventSelector to read in real data events from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import EventSelectorAthenaPool InputDataEventSelector = EventSelectorAthenaPool("InputDataEventSelector") InputDataEventSelector.InputCollections = InputCollections InputDataEventSelector.SkipEvents = 0 ServiceMgr += InputDataEventSelector #----------------------------------------------------------------= # And a separate event store for the custom selector from StoreGate.StoreGateConf import StoreGateSvc sg2 = StoreGateSvc("InputData_Event_SG") #sg2.Dump = True #sg2.OutputLevel = VERBOSE #================================================================ # Output from OutputStreamAthenaPool.OutputStreamAthenaPool import createOutputStream outStream = createOutputStream("EmbeddedGeneratorOut") outStream.Store = ServiceMgr.StoreGateSvc outStream.OutputFile = OutputFile outStream.ItemList += ["McEventCollection#*"] #================================================================ from AthenaCommon.AlgSequence import AlgSequence topSeq = AlgSequence()
# svcMgr.GeoModelSvc.AutomaticGeometryVersion = True svcMgr.GeoModelSvc.IgnoreTagDifference = True import MuonCnvExample.MuonCablingConfig # PixelLorentzAngleSvc and SCTLorentzAngleSvc (see JIRA ATR-15109/ATEAM-339) from InDetRecExample.InDetJobProperties import InDetFlags include("InDetRecExample/InDetRecConditionsAccess.py") #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # BS conf. #------------------------------------------------------------------------------- # Store Gate svcMgr += StoreGateSvc("BSMetaDataStore") svcMgr += StoreGateSvc("BSStoreGate") svcMgr += ByteStreamEventStorageInputSvc("ByteStreamInputSvc") svcMgr.ByteStreamInputSvc.EventStore = svcMgr.BSStoreGate svcMgr.ByteStreamInputSvc.MetaDataStore = svcMgr.BSMetaDataStore svcMgr.ByteStreamInputSvc.FullFileName = athenaCommonFlags.BSRDOInput() svcMgr += EventSelectorByteStream("BSEventSelector") svcMgr.BSEventSelector.ByteStreamInputSvc = "ByteStreamInputSvc" svcMgr.BSEventSelector.SkipEvents = SKIPEVENTS svcMgr += ByteStreamCnvSvc() svcMgr.ByteStreamCnvSvc.IsSimulation = True svcMgr += ROBDataProviderSvc()
# Set up MC input mcEvtSel = EventSelectorAthenaPool("mcSignal_EventSelector") mcEvtSel.InputCollections = SignalInputCollections mcEvtSel.KeepInputFilesOpen = True if athenaCommonFlags.SkipEvents.statusOn: mcEvtSel.SkipEvents = athenaCommonFlags.SkipEvents() ServiceMgr += mcEvtSel pileUpEventLoopMgr.SignalSelector = "mcSignal_EventSelector" ServiceMgr += pileUpEventLoopMgr # Explicitly create the two extra StoreGateSvc instances used by # Overlay jobs. This prevents warnings later in the configuration. ServiceMgr += StoreGateSvc( overlayFlags.dataStore()) #, Dump=True, OutputLevel=DEBUG) ServiceMgr += StoreGateSvc( overlayFlags.evtStore()) #, Dump=True, OutputLevel=DEBUG) if not hasattr(ServiceMgr, 'PileUpMergeSvc'): from PileUpTools.PileUpToolsConf import PileUpMergeSvc ServiceMgr += PileUpMergeSvc() del PileUpMergeSvc # In overlaying unlike pileup we are NOT combining different MC events. # Make sure HepMcParticleLinks use the right offset in McEventCollection. ServiceMgr.PileUpMergeSvc.ReturnTimedData = False #================================================================ #synchronization of Beam flags and Digitization flags - KAA