ATLAS Offline Software
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):
15 #include "xAODJet/JetContainer.h"
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 
39 {
40 }
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
SG::copyAuxStoreThinned
void copyAuxStoreThinned(const SG::IConstAuxStore &orig, SG::IAuxStore &copy, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
xAOD::ByteStreamAuxContainer_v1::resize
virtual bool resize(size_t size) override
Resize the arrays to a given size.
Definition: ByteStreamAuxContainer_v1.cxx:295
JetTrigAuxContainer.h
xAODJetTrigAuxContainerCnv_v1::persToTrans
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.
Definition: xAODJetTrigAuxContainerCnv_v1.cxx:43
xAOD::JetTrigAuxContainer_v2
Temporary container used until we have I/O for AuxStoreInternal.
Definition: JetTrigAuxContainer_v2.h:36
copyAuxStoreThinned.h
Helper to copy an aux store while applying thinning.
JetTrigAuxContainer_v1.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
IParticleContainer.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
xAOD::JetTrigAuxContainer_v1
Temporary container used until we have I/O for AuxStoreInternal.
Definition: JetTrigAuxContainer_v1.h:36
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
xAOD::ByteStreamAuxContainer_v1::size
virtual size_t size() const override
Get the size of the container.
Definition: ByteStreamAuxContainer_v1.cxx:252
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
JetContainer.h
xAODJetTrigAuxContainerCnv_v1::transToPers
virtual void transToPers(const xAOD::JetTrigAuxContainer *, xAOD::JetTrigAuxContainer_v1 *, MsgStream &log) const override
Dummy function inherited from the base class.
Definition: xAODJetTrigAuxContainerCnv_v1.cxx:83
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
xAODJetTrigAuxContainerCnv_v1::xAODJetTrigAuxContainerCnv_v1
xAODJetTrigAuxContainerCnv_v1()
Default constructor.
Definition: xAODJetTrigAuxContainerCnv_v1.cxx:38
ATH_MSG
#define ATH_MSG(MSG)
Another convenience macro for printing messages in the converter.
Definition: xAODJetTrigAuxContainerCnv_v1.cxx:31
xAODJetTrigAuxContainerCnv_v1.h