diff --git a/Trigger/TrigSteer/TrigSteering/CMakeLists.txt b/Trigger/TrigSteer/TrigSteering/CMakeLists.txt index 6ecf729df5d10e7f4dbe8a4e137ce15be309d3f5..73a50b5d879ca2b9403a8f924d95ef825cdd420d 100644 --- a/Trigger/TrigSteer/TrigSteering/CMakeLists.txt +++ b/Trigger/TrigSteer/TrigSteering/CMakeLists.txt @@ -15,7 +15,7 @@ atlas_add_library( TrigSteeringLib PUBLIC_HEADERS TrigSteering PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES AthContainers AthenaBaseComps AthenaKernel AthenaMonitoringLib ByteStreamCnvSvcBaseLib EventInfo GaudiKernel L1TopoAlgorithms L1TopoCoreSim L1TopoEvent L1TopoSimulationLib TrigConfBase TrigConfHLTData TrigConfInterfaces TrigNavigationLib TrigSteeringEvent TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1Result TrigTimeAlgsLib xAODEventInfo TrigInterfacesLib + LINK_LIBRARIES AthContainers AthenaBaseComps AthenaKernel AthenaMonitoringLib ByteStreamCnvSvcBaseLib EventInfo EventInfoUtils GaudiKernel L1TopoAlgorithms L1TopoCoreSim L1TopoEvent L1TopoSimulationLib TrigConfBase TrigConfHLTData TrigConfInterfaces TrigNavigationLib TrigSteeringEvent TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1Result TrigTimeAlgsLib xAODEventInfo TrigInterfacesLib PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} ${ROOT_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} AthenaMonitoringKernelLib L1TopoCommon L1TopoConfig TrigConfL1Data TrigMonitorBaseLib TrigSerializeResultLib TrigStorageDefinitions TrigT1Interfaces xAODTrigger ) atlas_add_component( TrigSteering diff --git a/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx b/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx index 67341734852d9491fe450acc9b8e34cd7fba0f32..271bcbba331a9d3edb7bdea8e49d5f339d0974bb 100755 --- a/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx +++ b/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx @@ -13,6 +13,7 @@ #include "TrigSteeringEvent/PartialEventBuildingInfo.h" #include "TrigConfHLTData/HLTTriggerType.h" #include "EventInfo/EventInfo.h" +#include "EventInfoUtils/EventInfoFromxAOD.h" #include "TrigSteeringEvent/ScoutingInfo.h" #include "eformat/SourceIdentifier.h" @@ -511,16 +512,38 @@ ErrorCode ResultBuilder::fillTriggerInfo(const std::vector<SteeringChain*>& acti // recording //////////////////////////////////////////////////////////////////// + // Retrieve xAOD::EventInfo + const xAOD::EventInfo* constxEventInfo(0); + if (evtStore()->retrieve(constxEventInfo).isFailure()) { + ATH_MSG_FATAL("Can't get xAOD::EventInfo object"); + return HLT::FATAL; + } + + // Create old EventInfo if not present in the event store + StatusCode sc = StatusCode::SUCCESS; + if (!evtStore()->contains<EventInfo>("EventInfo")) { + sc = evtStore()->record<EventInfo>( + std::make_unique<EventInfo>( + new EventID(eventIDFromxAOD(constxEventInfo)), + new EventType(eventTypeFromxAOD(constxEventInfo)) + ), "EventInfo" + ); + if (sc.isFailure()) { + ATH_MSG_FATAL("Can't record EventInfo created from xAOD::EventInfo"); + return HLT::FATAL; + } + ATH_MSG_DEBUG("Recorded EventInfo created from xAOD::EventInfo"); + } // put it all to SG EventInfo object // get EventInfo const EventInfo* constEventInfo(0); - StatusCode sc = evtStore()->retrieve(constEventInfo); + sc = evtStore()->retrieve(constEventInfo); if(sc.isFailure()){ ATH_MSG_FATAL("Can't get EventInfo object for update of the StreamTag and TriggerInfo"); return HLT::FATAL; } - + ATH_MSG_DEBUG("Retrieved EventInfo for updating with EventID " << *(constEventInfo->event_ID())); ATH_MSG_VERBOSE("Updating TriggerInfo"); EventInfo* eventInfo = const_cast<EventInfo*>(constEventInfo); @@ -603,14 +626,6 @@ ErrorCode ResultBuilder::fillTriggerInfo(const std::vector<SteeringChain*>& acti //// Recording in xAODEventInfo //////////////////////////////// // put it all to SG xAOD::EventInfo object - - const xAOD::EventInfo* constxEventInfo(0); - sc = evtStore()->retrieve(constxEventInfo); - - if (sc.isFailure()) { - ATH_MSG_FATAL("Can't get xAOD::EventInfo object for update of the StreamTag"); - return HLT::FATAL; - } #if 0