ATLAS Offline Software
xAODRODHeaderContainerCnv_v1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id: xAODRODHeaderContainerCnv_v1.cxx 694352 2015-09-11 12:05:29Z krasznaa $
6 
7 // System include(s):
8 #include <stdexcept>
9 
10 // Gaudi/Athena include(s):
11 #include "GaudiKernel/MsgStream.h"
12 
13 // Local include(s):
15 
17 #define MSGLVL MSG::DEBUG
18 
20 #define ATH_MSG( MSG ) \
21  do { \
22  if( log.level() <= MSGLVL ) { \
23  log << MSGLVL << MSG << endmsg; \
24  } \
25  } while( 0 )
26 
28 {
29 }
30 
34  MsgStream& log ) const {
35 
36  // Greet the user:
37  ATH_MSG( "Converting xAOD::RODHeaderContainer_v1 to current version..." );
38 
39  // Clear the transient object:
40  newObj->clear();
41 
42  // Simply fill the transient object with as many default xAOD::RODHeader
43  // objects, as many there are in the old object:
44  for( size_t i = 0; i < oldObj->size(); ++i ) {
45  newObj->push_back( new xAOD::RODHeader() );
46  }
47 
48  // Tell the user what happened:
49  ATH_MSG( "Converting xAOD::RODHeaderContainer_v1 to current version "
50  "[OK]" );
51 
52  // Return gracefully:
53  return;
54 }
55 
60  MsgStream& log ) const {
61 
62  log << MSG::ERROR << "xAODRODHeaderContainerCnv_v1::transToPers got "
63  << "called" << endmsg;
64  throw std::runtime_error( "xAODRODHeaderContainerCnv_v1::transToPers got "
65  "called" );
66 
67  return;
68 }
xAODRODHeaderContainerCnv_v1.h
xAODRODHeaderContainerCnv_v1::xAODRODHeaderContainerCnv_v1
xAODRODHeaderContainerCnv_v1()
Default constructor.
Definition: xAODRODHeaderContainerCnv_v1.cxx:27
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
xAOD::RODHeader_v2
Description of RODHeader_v2.
Definition: RODHeader_v2.h:23
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DataVector::clear
void clear()
Erase all the elements in the collection.
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ATH_MSG
#define ATH_MSG(MSG)
Convenience macro for printing messages in the converter.
Definition: xAODRODHeaderContainerCnv_v1.cxx:20
xAODRODHeaderContainerCnv_v1::transToPers
virtual void transToPers(const xAOD::RODHeaderContainer *, xAOD::RODHeaderContainer_v1 *, MsgStream &log) const override
Dummy function inherited from the base class.
Definition: xAODRODHeaderContainerCnv_v1.cxx:58
xAODRODHeaderContainerCnv_v1::persToTrans
virtual void persToTrans(const xAOD::RODHeaderContainer_v1 *oldObj, xAOD::RODHeaderContainer *newObj, MsgStream &log) const override
Function converting from the old type to the current one.
Definition: xAODRODHeaderContainerCnv_v1.cxx:32
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.