ATLAS Offline Software
Loading...
Searching...
No Matches
xAODTrigRNNOutputAuxContainerCnv_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// System include(s):
6#include <stdexcept>
7#include <vector>
8
9// Gaudi/Athena include(s):
10#include "GaudiKernel/MsgStream.h"
11
12// EDM include(s):
17
18// Local include(s):
20
22#define MSGLVL MSG::DEBUG
23
25#define ATH_MSG( MSG ) \
26 do { \
27 if( log.level() <= MSGLVL ) { \
28 log << MSGLVL << MSG << endmsg; \
29 } \
30 } while( 0 )
31
35
39 MsgStream& log ) const {
40
41 // Greet the user:
42 ATH_MSG( "Converting xAOD::TrigRNNOutputAuxContainer_v1 to current version..." );
43
44 // Clear the transient object:
45 newObj->resize(0);
46 SG::copyAuxStoreThinned( *oldObj, *newObj, nullptr );
47
48 // Set up an interface container on top of the old object:
50 for( size_t i = 0; i < oldObj->size(); ++i ) {
51 oldInt.push_back( new xAOD::TrigRNNOutput_v1() );
52 }
53 oldInt.setStore( oldObj );
54
55 // Set up an interface container on top of the new object:
57 for (size_t i = 0; i < newObj->size(); ++i) {
58 newInt.push_back( new xAOD::TrigRNNOutput() );
59 }
60 newInt.setStore( newObj );
61
62 // Convert the objects one by one:
63 for( size_t i = 0; i < oldInt.size(); ++i ) {
64 newInt[ i ]->setRnnDecision( oldInt[ i ]->decision() );
65 }
66
67 return;
68}
69
76 MsgStream& log ) const {
77
78 log << MSG::ERROR
79 << "Somebody called xAODTrigRNNOutputAuxContainerCnv_v1::transToPers"
80 << endmsg;
81 throw std::runtime_error( "Somebody called "
82 "xAODTrigRNNOutputAuxContainerCnv_v1::"
83 "transToPers" );
84
85 return;
86}
#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::TrigRNNOutputAuxContainer *, xAOD::TrigRNNOutputAuxContainer_v1 *, MsgStream &log) const override
Dummy function inherited from the base class.
virtual void persToTrans(const xAOD::TrigRNNOutputAuxContainer_v1 *oldObj, xAOD::TrigRNNOutputAuxContainer *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 TrigRNNOutput 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.
DataVector< TrigRNNOutput_v1 > TrigRNNOutputContainer_v1
Define the RingerRings container as a simple DataVector.
TrigRNNOutput_v2 TrigRNNOutput
Define the latest version of the RingerRings class.
TrigRNNOutputAuxContainer_v2 TrigRNNOutputAuxContainer
Define the latest version of the RingerRings class.
TrigRNNOutputContainer_v2 TrigRNNOutputContainer
Define the latest version of the TrigRNNOutputContainer class.