Draft: add xAOD::EventInfo to HIT files instead of old EventInfo
For the simulation of several beam spot sizes for Run3 it is needed to store the beam spot size of an event already in the HIT files. This MR stores the xAOD::EventInfo with the beam spot information instead of the old EventInfo in the HIT files. Relates to ATEAM-804
Merge request reports
Activity
added Simulation master labels
added 223 commits
-
70d52054...e7823cda - 219 commits from branch
atlas:master
- 2d75ef43 - add xAOD::EventInfo to HIT files instead of old EventInfo
- bf4955d6 - Update run number from evtIdModSvc
- 9bf55324 - Rename xAOD::EventInfo and update it
- 4d2ea559 - Update sim+digi to xAOD::EventInfo for digi without pileup
Toggle commit list-
70d52054...e7823cda - 219 commits from branch
1164 1183 return 1; 1165 1184 } 1166 1185 1186 //--------------------------------------------------------------------------- 1187 1188 void AthenaHiveEventLoopMgr::UpdateCtxFromEventIDandOverwrites(EventContext& ctx, const EventID& eID) { 1189 1190 if(m_evtIdModSvc.isSet()) { 1191 EventID* new_eID=new EventID(eID); //interface to m_evtIdModSvc->modify_evtid wants to be able to update the pointer itself, but in reality function doesn't need it. CHECK: Update evtIdModSvc method modify_evtid interface to pointer or reference? 1192 unsigned int oldrunnr=eID.run_number(); 1193 bool consume_stream = false; // FIXME/CHECK: was true inside TP converter and checks for active storegate 1194 m_evtIdModSvc->modify_evtid(new_eID, consume_stream); 1195 info()<<"UpdateCtxFromEventIDandOverwrites: use evtIdModSvc runnr="<<oldrunnr<<" -> "<<new_eID->run_number()<<endmsg; 1196 ctx.setEventID( *new_eID ); 1197 delete new_eID; modify_evtid
takes a reference to a pointer as argument. Can I let it change the pointer stored inside std::unique_ptr? To me this breaks the idea of a uniqu_ptr. I agree that ifmodify_evtid
would change the pointer, we have a memory leak, but this needs to be addressed insidemodify_evtid
as far as I can see
227 232 228 233 //FIXME hack to workaround pylcgdict problem... 229 234 virtual const std::string& name() const override { return Service::name(); } //FIXME 235 236 virtual void UpdateCtxFromEventIDandOverwrites(EventContext& ctx, const EventID& eID); changed this line in version 4 of the diff
101 101 acc.merge(EventInfoOverlayOutputCfg(flags, **kwargs)) 102 102 return acc 103 104 105 106 107 108 def EventInfoUpdateAlgCfg(flags, name="EventInfoUpdate", **kwargs): 109 """Return a ComponentAccumulator for EventInfoUpdate algorithm""" 110 acc = ComponentAccumulator() 111 112 # Add beam spot conditions 113 from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg 114 acc.merge(BeamSpotCondAlgCfg(flags)) 115 116 kwargs.setdefault("SignalInputKey", "HITs_EventInfo") happy to update, but should then update everywhere consistently. We have "EventInfo" and "OverlayEvent" so far. What about just "HitEvent"? We could even make the sim job write out "HitEvent" instead of "EventInfo"
Edited by Michael Duehrssen-Deblingin the pileup workflow, the original EventInfo or xAOD:EventInfo (just typed retrieval always without name) is read in, then a new 'Input_EventInfo' is created by PileUpEventLoopMgr, and 'Input_EventInfo' is updated to 'EventInfo' by 'BeamSpotFixerAlg'. Hence 'InputEventInfo' is possible, but dangerously close to the temporary 'Input_EventInfo'. If we replace BeamSpotFixerAlg with EventInfoUpdate, we'll still need the temporary 'Input_EventInfo' and something different to which we rename whatever is inside the original Hit file
107 108 def EventInfoUpdateAlgCfg(flags, name="EventInfoUpdate", **kwargs): 109 """Return a ComponentAccumulator for EventInfoUpdate algorithm""" 110 acc = ComponentAccumulator() 111 112 # Add beam spot conditions 113 from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg 114 acc.merge(BeamSpotCondAlgCfg(flags)) 115 116 kwargs.setdefault("SignalInputKey", "HITs_EventInfo") 117 kwargs.setdefault("OutputKey", "EventInfo") 118 119 # Do the xAOD::EventInfo overlay 120 xAODMaker__EventInfoUpdate = CompFactory.xAODMaker.EventInfoUpdate 121 alg = xAODMaker__EventInfoUpdate(name, **kwargs) 122 acc.addEventAlgo(alg) 89 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx }; 90 if (!beamSpotHandle.isValid()) { 91 ATH_MSG_ERROR("Beam spot information not valid"); 92 return StatusCode::FAILURE; 93 } 94 outputEvent->setBeamPos( beamSpotHandle->beamPos()[ Amg::x ], 95 beamSpotHandle->beamPos()[ Amg::y ], 96 beamSpotHandle->beamPos()[ Amg::z ] ); 97 outputEvent->setBeamPosSigma( beamSpotHandle->beamSigma( 0 ), 98 beamSpotHandle->beamSigma( 1 ), 99 beamSpotHandle->beamSigma( 2 ) ); 100 outputEvent->setBeamPosSigmaXY( beamSpotHandle->beamSigmaXY() ); 101 outputEvent->setBeamTiltXZ( beamSpotHandle->beamTilt( 0 ) ); 102 outputEvent->setBeamTiltYZ( beamSpotHandle->beamTilt( 1 ) ); 103 outputEvent->setBeamStatus( beamSpotHandle->beamStatus() ); 104 #endif added 1 commit
- 9b655f22 - first draft to run pileup with xAOD::EventInfo
mentioned in merge request !50332 (merged)
Closing for now as work is continuing in !50332 (merged).