Template Function HelperFunctions::makeDeepCopy

Function Documentation

template<typename T1, typename T2, typename T3>
StatusCode HelperFunctions::makeDeepCopy(xAOD::TStore *m_store, std::string containerName, const T1 *cont)

Make a deep copy of a container and put it in the TStore.

This is a very powerful templating function. The point is to remove the triviality of making deep copies by specifying all that is needed. The best way is to demonstrate via example:

const xAOD::JetContainer  selected_jets(nullptr);
ANA_CHECK( m_event->retrieve( selected_jets, "SelectedJets" ));
ANA_CHECK( (HelperFunctions::makeDeepCopy<xAOD::JetContainer, xAOD::JetAuxContainer, xAOD::Jet>(m_store, "BaselineJets", selected_jets)));

Template Parameters
  • T1 – The type of the container you’re going to deep copy into

  • T2 – The type of the aux container you’re going to deep copy into

  • T3 – The type of the object inside the container you’re going to deep copy

Parameters
  • m_store – A pointer to the TStore object

  • containerName – The name of the container to create as output in the TStore

  • cont – The container to deep copy, it should be a container of pointers (IParticleContainer or ConstDataVector)