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

Function Documentation

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

Return true if an arbitrary object from TStore / TEvent is available.

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

Example Usage:

const xAOD::JetContainer  jets(0);
// look for "AntiKt10LCTopoJets" in both TEvent and TStore
HelperFunctions::isAvailable<xAOD::JetContainer>("AntiKt10LCTopoJets", m_event, m_store)
// look for "AntiKt10LCTopoJets" in only TStore
HelperFunctions::isAvailable<xAOD::JetContainer>("AntiKt10LCTopoJets", 0, m_store)
// look for "AntiKt10LCTopoJets" in only TEvent, enable verbose output
HelperFunctions::isAvailable<xAOD::JetContainer>("AntiKt10LCTopoJets", m_event, 0, MSG::VERBOSE)

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