ATLAS Offline Software
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 
34 {
35 }
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 }
SG::copyAuxStoreThinned
void copyAuxStoreThinned(const SG::IConstAuxStore &orig, SG::IAuxStore &copy, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
xAODTrigRingerRingsAuxContainerCnv_v1::xAODTrigRingerRingsAuxContainerCnv_v1
xAODTrigRingerRingsAuxContainerCnv_v1()
Default constructor.
Definition: xAODTrigRingerRingsAuxContainerCnv_v1.cxx:33
TrigRingerRingsContainer_v1.h
TrigRingerRingsContainer.h
xAOD::TrigRingerRingsAuxContainer_v2
This is a fixed implementation of the trigger TrigRingerRings auxiliary store.
Definition: TrigRingerRingsAuxContainer_v2.h:30
ATH_MSG
#define ATH_MSG(MSG)
Another convenience macro for printing messages in the converter.
Definition: xAODTrigRingerRingsAuxContainerCnv_v1.cxx:26
xAOD::TrigRingerRingsAuxContainer_v1
This is a fixed implementation of the trigger TrigRingerRings auxiliary store.
Definition: TrigRingerRingsAuxContainer_v1.h:29
xAOD::AuxContainerBase::resize
virtual bool resize(size_t size) override
Resize the arrays to a given size.
Definition: AuxContainerBase.cxx:505
TrigRingerRings.h
xAOD::AuxContainerBase::size
virtual size_t size() const override
Get the size of the container.
Definition: AuxContainerBase.cxx:430
copyAuxStoreThinned.h
Helper to copy an aux store while applying thinning.
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
xAODTrigRingerRingsAuxContainerCnv_v1.h
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
xAOD::TrigRingerRings_v2
Definition: TrigRingerRings_v2.h:24
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
xAODTrigRingerRingsAuxContainerCnv_v1::persToTrans
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.
Definition: xAODTrigRingerRingsAuxContainerCnv_v1.cxx:38
xAODTrigRingerRingsAuxContainerCnv_v1::transToPers
virtual void transToPers(const xAOD::TrigRingerRingsAuxContainer *, xAOD::TrigRingerRingsAuxContainer_v1 *, MsgStream &log) const override
Dummy function inherited from the base class.
Definition: xAODTrigRingerRingsAuxContainerCnv_v1.cxx:77
xAOD::TrigRingerRings_v1
Definition: TrigRingerRings_v1.h:22
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.