Skip to content
Snippets Groups Projects

Draft: add xAOD::EventInfo to HIT files instead of old EventInfo

Closed Michael Duehrssen-Debling requested to merge mduehrss/athena:xAODEventInfoInHITs into master
5 unresolved threads

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

Edited by John Derek Chapman

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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;
  • Comment on lines +1191 to +1197

    Use std::unique_ptr for new_eID perhaps?

  • 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 if modify_evtid would change the pointer, we have a memory leak, but this needs to be addressed inside modify_evtid as far as I can see

  • OK, so something for later then. Maybe put a comment to this effect in the code here to deflect future reviewer comments? :-)

  • Please register or sign in to reply
  • 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);
  • 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")
    • This is really picky, but maybe 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-Debling
    • How about InputEventInfo?

    • in 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

    • Please register or sign in to reply
  • 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
  • John Derek Chapman changed the description

    changed the description

  • added 1 commit

    • 9b655f22 - first draft to run pileup with xAOD::EventInfo

    Compare with previous version

  • John Derek Chapman mentioned in merge request !50332 (merged)

    mentioned in merge request !50332 (merged)

  • Closing for now as work is continuing in !50332 (merged).

  • Please register or sign in to reply
    Loading