ATLAS Offline Software
Loading...
Searching...
No Matches
xAODJetTrigAuxContainerCnv_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: xAODJetTrigAuxContainerCnv_v1.cxx 800408 2017-03-13 09:28:39Z sschramm $
6#if !(defined(GENERATIONBASE) || defined(SIMULATIONBASE))
7// System include(s):
8#include <stdexcept>
9
10// Gaudi/Athena include(s):
11#include "GaudiKernel/MsgStream.h"
12
13// Core EDM include(s):
18#include "AthLinks/ElementLink.h"
20
21// Local include(s):
23
24#include <utility>
25#include <algorithm>
26
28#define MSGLVL MSG::VERBOSE
29
31#define ATH_MSG( MSG ) \
32 do { \
33 if( log.level() <= MSGLVL ) { \
34 log << MSGLVL << MSG << endmsg; \
35 } \
36 } while( 0 )
37
41
45 MsgStream& log ) const {
46
47 // Greet the user:
48 ATH_MSG( "Converting xAOD::JetTrigAuxContainer_v1 to current version..." );
49
50 // Clear the transient object:
51 newObj->resize( 0 );
52
53 // Copy the payload of the v1 object into the latest one by misusing
54 // the thinning code a bit...
55 SG::copyAuxStoreThinned( *oldObj, *newObj, nullptr );
56
57 //The old uses v_
58 xAOD::JetContainer oldInt;
59 for( size_t i = 0; i < oldObj->size(); ++i ) {
60 oldInt.push_back( new xAOD::Jet() );
61 }
62 oldInt.setStore( oldObj );
63
64 xAOD::JetContainer newInt;
65 for( size_t i = 0; i < newObj->size(); ++i ) {
66 newInt.push_back( new xAOD::Jet() );
67 }
68 newInt.setStore( newObj );
69
70 std::vector< std::vector< ElementLink< xAOD::IParticleContainer > > > GhostTrack;
71
72 // Print what happened:
73 ATH_MSG( "Converting xAOD::JetTrigAuxContainer_v1 to current version "
74 "[OK]" );
75
76 return;
77}
78
85 MsgStream& log ) const {
86
87 log << MSG::ERROR
88 << "Somebody called xAODJetTrigAuxContainerCnv_v1::transToPers"
89 << endmsg;
90 throw std::runtime_error( "Somebody called xAODJetTrigAuxContainerCnv_v1::"
91 "transToPers" );
92
93 return;
94}
95#endif //ifndef SIMULATIONBASE OR GNERATIONBASE
#define endmsg
#define ATH_MSG(lvl)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
virtual void transToPers(const xAOD::JetTrigAuxContainer *, xAOD::JetTrigAuxContainer_v1 *, MsgStream &log) const override
Dummy function inherited from the base class.
virtual void persToTrans(const xAOD::JetTrigAuxContainer_v1 *oldObj, xAOD::JetTrigAuxContainer *newObj, MsgStream &log) const override
Function converting from the old type to the current one.
virtual size_t size() const override
Get the size of the container.
virtual bool resize(size_t size) override
Resize the arrays to a given size.
Temporary container used until we have I/O for AuxStoreInternal.
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.
Jet_v1 Jet
Definition of the current "jet version".
JetTrigAuxContainer_v2 JetTrigAuxContainer
Definition of the current jet trigger auxiliary container.
JetContainer_v1 JetContainer
Definition of the current "jet container version".