ATLAS Offline Software
FTAGValidationAlgorithm.icc
Go to the documentation of this file.
1 
2 template< class CONTAINER >
3  StatusCode FTAGValidationAlgorithm::retrieveCollectionfromStoreGate( const EventContext& context,
4  const CONTAINER*& Collection,
5  const SG::ReadHandleKey< CONTAINER >& inputKey ) const {
6 
7  ATH_MSG_DEBUG( "Retrieving collection from StoreGate with key '" << inputKey.key() << "' ..." );
8 
9  if ( Collection != nullptr ) {
10  ATH_MSG_ERROR( "Input Collection is not empty. We are overwriting objects!" );
11  return StatusCode::FAILURE;
12  }
13 
14  SG::ReadHandle< CONTAINER > ContainerHandle = SG::makeHandle( inputKey,context );
15  CHECK( ContainerHandle.isValid() );
16 
17  Collection = ContainerHandle.get();
18  ATH_MSG_DEBUG( "Found a total of " << Collection->size() << " objects inside the collection ['" << inputKey.key() << "']" );
19 
20  return StatusCode::SUCCESS;
21 }
22