Template Function HelperFunctions::retrieve(T *&, std::string, xAOD::TEvent *, xAOD::TStore *, MsgStream&)

Function Documentation

template<typename T>
StatusCode HelperFunctions::retrieve(T *&cont, std::string name, xAOD::TEvent *event, xAOD::TStore *store, MsgStream &msg)

Retrieve an arbitrary object from TStore / TEvent.

This tries to make your life simple by providing a one-stop container retrieval shop for all types.

Example Usage:

const xAOD::JetContainer  jets(0);
// look for "AntiKt10LCTopoJets" in both TEvent and TStore
ANA_CHECK( HelperFunctions::retrieve(jets, "AntiKt10LCTopoJets", m_event, m_store) );
// look for "AntiKt10LCTopoJets" in only TStore
ANA_CHECK( HelperFunctions::retrieve(jets, "AntiKt10LCTopoJets", 0, m_store) );
// look for "AntiKt10LCTopoJets" in only TEvent, enable verbose output
ANA_CHECK( HelperFunctions::retrieve(jets, "AntiKt10LCTopoJets", m_event, 0, msg()) );

Checking Order:

  • start by checking TStore

    • check if store contains ‘xAOD::JetContainer’ named ‘name’

      • attempt to retrieve from store

      • return if failure

  • next check TEvent

    • check if event contains ‘xAOD::JetContainer’ named ‘name’

      • attempt to retrieve from event

      • return if failure

    • return FAILURE

  • return SUCCESS (should never reach this last line)

Parameters
  • cont – pass in a pointer to the object to store the retrieved container in

  • name – the name of the object to look up

  • event – the TEvent, usually wk()->xaodEvent(). Set to 0 to not search TEvent.

  • store – the TStore, usually wk()->xaodStore(). Set to 0 to not search TStore.

  • msg – the MsgStream object with appropriate level for debugging