def G4AtlasAlgOutputCfg(ConfigFlags): """ Return ComponentAccumulator with output for G4 simulation. Not standalone. follows G4Atlas.flat.configuration.py """ ItemList = [ "EventInfo#*", "McEventCollection#TruthEvent", "JetCollection#*" ] if ConfigFlags.Sim.IncludeParentsInG4Event: ItemList += ["McEventCollection#GEN_EVENT"] ItemList += ["xAOD::JetContainer#*", "xAOD::JetAuxContainer#*"] if ConfigFlags.Detector.SimulateID: ItemList += [ "SiHitCollection#*", "TRTUncompressedHitCollection#*", "TrackRecordCollection#CaloEntryLayer" ] if ConfigFlags.Detector.SimulateCalo: ItemList += [ "CaloCalibrationHitContainer#*", "LArHitContainer#*", "TileHitVector#*", "TrackRecordCollection#MuonEntryLayer" ] if ConfigFlags.Detector.SimulateMuon: ItemList += [ "RPCSimHitCollection#*", "TGCSimHitCollection#*", "MDTSimHitCollection#*", "TrackRecordCollection#MuonExitLayer" ] if ConfigFlags.Detector.GeometryCSC: ItemList += ["CSCSimHitCollection#*"] if ConfigFlags.Detector.GeometrysTGC: ItemList += ["sTGCSimHitCollection#*"] if ConfigFlags.Detector.GeometryMM: ItemList += ["MMSimHitCollection#*"] if ConfigFlags.Detector.SimulateLucid: ItemList += ["LUCID_SimHitCollection#*"] if ConfigFlags.Detector.SimulateFwdRegion: ItemList += ["SimulationHitCollection#*"] if ConfigFlags.Detector.SimulateZDC: ItemList += [ "ZDC_SimPixelHit_Collection#*", "ZDC_SimStripHit_Collection#*" ] if ConfigFlags.Detector.SimulateALFA: ItemList += ["ALFA_HitCollection#*", "ALFA_ODHitCollection#*"] if ConfigFlags.Detector.SimulateAFP: ItemList += ["AFP_TDSimHitCollection#*", "AFP_SIDSimHitCollection#*"] # TimingAlg ItemList += ["RecoTimingObj#EVNTtoHITS_timings"] # FIXME reproduce to support non standard setups #0140 ## Add cosmics and test beam configuration hit persistency if required cf. geom tag #0141 layout = simFlags.SimLayout.get_Value() #0142 if "tb" not in layout: #0143 from AthenaCommon.BeamFlags import jobproperties #0144 if jobproperties.Beam.beamType() == 'cosmics' or \ #0145 (hasattr(simFlags, "WriteTR") and simFlags.WriteTR.statusOn) or \ #0146 (hasattr(simFlags, "ReadTR") and simFlags.ReadTR.statusOn): #0147 stream1.ItemList += ["TrackRecordCollection#CosmicRecord", "TrackRecordCollection#CosmicPerigee"] #0148 else: #0149 ## CTB-specific #0150 if layout.startswith("ctb"): #0151 if simFlags.LArFarUpstreamMaterial.statusOn and simFlags.LArFarUpstreamMaterial.get_Value(): #0152 stream1.ItemList.append("TrackRecordCollection#LArFarUpstreamMaterialExitLayer") #0153 ## Persistency of test-beam layout #0154 if layout.startswith('ctb') or layout.startswith('tb_Tile2000_'): #0155 stream1.ItemList += ["TBElementContainer#*"] acc = OutputStreamCfg(ConfigFlags, "HITS", ItemList=ItemList) # Make stream aware of aborted events OutputStreamHITS = acc.getEventAlgo("OutputStreamHITS") OutputStreamHITS.AcceptAlgs += ["G4AtlasAlg"] # G4Atlas.flat.configuration.py#0333 onwards # FIXME unifyset now fails #PoolAttributes = ["TREE_BRANCH_OFFSETTAB_LEN = '100'"] #PoolAttributes += ["DatabaseName = '" + ConfigFlags.Output.HITSFileName + "'; ContainerName = 'TTree=CollectionTree'; TREE_AUTO_FLUSH = '1'"] #acc.addService(CompFactory.AthenaPoolCnvSvc(PoolAttributes=PoolAttributes)) return acc
def triggerPOOLOutputCfg(flags, decObj, decObjHypoOut, edmSet): # Get the list of output collections from TriggerEDM from TrigEDMConfig.TriggerEDM import getTriggerEDMList edmList = getTriggerEDMList(edmSet, flags.Trigger.EDMDecodingVersion) # Build the output ItemList itemsToRecord = [] for edmType, edmKeys in six.iteritems (edmList): itemsToRecord.extend([edmType+'#'+collKey for collKey in edmKeys]) # Add decision containers (navigation) for item in decObj: dynamic = '.-' # Exclude dynamic if item in decObjHypoOut: dynamic = '.' # Include dynamic itemsToRecord.append('xAOD::TrigCompositeContainer#{:s}'.format(item)) itemsToRecord.append('xAOD::TrigCompositeAuxContainer#{:s}Aux{:s}'.format(item, dynamic)) # Add EventInfo itemsToRecord.append('xAOD::EventInfo#EventInfo') itemsToRecord.append('xAOD::EventAuxInfo#EventInfoAux.') # Create OutputStream outputType = '' if flags.Output.doWriteRDO: outputType = 'RDO' if flags.Output.doWriteESD: outputType = 'ESD' if flags.Output.doWriteAOD: outputType = 'AOD' from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg acc = OutputStreamCfg(flags, outputType, ItemList=itemsToRecord, disableEventTag=True) streamAlg = acc.getEventAlgo("OutputStream"+outputType) # Keep input RDO objects in the output RDO_TRIG file if flags.Output.doWriteRDO: streamAlg.TakeItemsFromInput = True # Produce trigger bits bitsmaker = CompFactory.TriggerBitsMakerTool() decmaker = CompFactory.getComp("TrigDec::TrigDecisionMakerMT")("TrigDecMakerMT", BitsMakerTool = bitsmaker) acc.addEventAlgo( decmaker ) # Produce trigger metadata menuwriter = CompFactory.getComp("TrigConf::xAODMenuWriterMT")() menuwriter.IsHLTJSONConfig = True menuwriter.IsL1JSONConfig = True acc.addEventAlgo( menuwriter ) # Add metadata to the output stream streamAlg.MetadataItemList += [ "xAOD::TriggerMenuContainer#*", "xAOD::TriggerMenuAuxContainer#*" ] # Ensure OutputStream runs after TrigDecisionMakerMT and xAODMenuWriterMT streamAlg.ExtraInputs += [ ("xAOD::TrigDecision", decmaker.TrigDecisionKey), ("xAOD::TrigConfKeys", menuwriter.EventObjectName)] # Produce xAOD L1 RoIs from RoIBResult from AnalysisTriggerAlgs.AnalysisTriggerAlgsCAConfig import RoIBResultToxAODCfg xRoIBResultAcc, xRoIBResultOutputs = RoIBResultToxAODCfg(flags, acc.getSequence().name) acc.merge(xRoIBResultAcc) # Ensure outputs are produced before streamAlg runs streamAlg.ExtraInputs += xRoIBResultOutputs return acc