ATLAS Offline Software
Loading...
Searching...
No Matches
xAODTrigRingerRingsAuxContainerCnv_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id: xAODTrigRingerRingsAuxContainerCnv_v1.cxx 713588 2015-12-09 13:59:15Z jodafons $
6
7// System include(s):
8#include <stdexcept>
9
10// Gaudi/Athena include(s):
11#include "GaudiKernel/MsgStream.h"
12
13// EDM include(s):
18
19// Local include(s):
21
23#define MSGLVL MSG::DEBUG
24
26#define ATH_MSG( MSG ) \
27 do { \
28 if( log.level() <= MSGLVL ) { \
29 log << MSGLVL << MSG << endmsg; \
30 } \
31 } while( 0 )
32
36
40 MsgStream& log ) const {
41
42 // Greet the user:
43 ATH_MSG( "Converting xAOD::TrigRingerRingsAuxContainer_v1 to current "
44 "version..." );
45
46 // Clear the transient object:
47 newObj->resize( 0 );
48
49 SG::copyAuxStoreThinned( *oldObj, *newObj, nullptr );
50
51 // Set up an interface container for the old object:
53 for( size_t i = 0; i < oldObj->size(); ++i ) {
54 oldInt.push_back( new xAOD::TrigRingerRings_v1() );
55 }
56 oldInt.setStore( oldObj );
57
58 // Set up an interface container for the new object:
60 for( size_t i = 0; i < newObj->size(); ++i ) {
61 newInt.push_back( new xAOD::TrigRingerRings() );
62 }
63 newInt.setStore( newObj );
64
65 // Translate the objects one by one:
66 for( size_t i = 0; i < oldInt.size(); ++i ) {
67 newInt[ i ]->setRings( oldInt[ i ]->rings() );
68 }
69
70 return;
71}
72
79 MsgStream& log ) const {
80
81 log << MSG::ERROR
82 << "Somebody called xAODTrigRingerRingsAuxContainerCnv_v1::transToPers"
83 << endmsg;
84 throw std::runtime_error( "Somebody called "
85 "xAODTrigRingerRingsAuxContainerCnv_v1::"
86 "transToPers" );
87
88 return;
89}
#define endmsg
#define ATH_MSG(lvl)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual void transToPers(const xAOD::TrigRingerRingsAuxContainer *, xAOD::TrigRingerRingsAuxContainer_v1 *, MsgStream &log) const override
Dummy function inherited from the base class.
virtual void persToTrans(const xAOD::TrigRingerRingsAuxContainer_v1 *oldObj, xAOD::TrigRingerRingsAuxContainer *newObj, MsgStream &log) const override
Function converting from the old type to the current one.
virtual bool resize(size_t size) override
Resize the arrays to a given size.
virtual size_t size() const override
Get the size of the container.
This is a fixed implementation of the trigger TrigRingerRings auxiliary store.
Helper to copy an aux store while applying thinning.
void copyAuxStoreThinned(const SG::IConstAuxStore &orig, SG::IAuxStore &copy, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
TrigRingerRings_v2 TrigRingerRings
Define the latest version of the TrigRingerRings class.
TrigRingerRingsContainer_v2 TrigRingerRingsContainer
Define the latest version of the TrigRingerRingsContainer class.
DataVector< TrigRingerRings_v1 > TrigRingerRingsContainer_v1
Define the TrigRingerRings container as a simple DataVector.
TrigRingerRingsAuxContainer_v2 TrigRingerRingsAuxContainer
Define the latest version of the TrigRingerRings class.