ATLAS Offline Software
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 
33 {
34 }
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 }
SG::copyAuxStoreThinned
void copyAuxStoreThinned(const SG::IConstAuxStore &orig, SG::IAuxStore &copy, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
xAODTrigRNNOutputAuxContainerCnv_v1.h
xAOD::TrigRNNOutput_v2
Definition: TrigRNNOutput_v2.h:24
xAOD::TrigRNNOutputAuxContainer_v2
This is a fixed implementation of the trigger TrigRNNOutput auxiliary store.
Definition: TrigRNNOutputAuxContainer_v2.h:32
xAOD::TrigRNNOutput_v1
Definition: TrigRNNOutput_v1.h:22
xAODTrigRNNOutputAuxContainerCnv_v1::persToTrans
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.
Definition: xAODTrigRNNOutputAuxContainerCnv_v1.cxx:37
xAOD::AuxContainerBase::resize
virtual bool resize(size_t size) override
Resize the arrays to a given size.
Definition: AuxContainerBase.cxx:505
xAOD::TrigRNNOutputAuxContainer_v1
This is a fixed implementation of the trigger TrigRNNOutput auxiliary store.
Definition: TrigRNNOutputAuxContainer_v1.h:30
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
TrigRNNOutput.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
TrigRNNOutputContainer.h
TrigRNNOutputContainer_v1.h
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
xAODTrigRNNOutputAuxContainerCnv_v1::transToPers
virtual void transToPers(const xAOD::TrigRNNOutputAuxContainer *, xAOD::TrigRNNOutputAuxContainer_v1 *, MsgStream &log) const override
Dummy function inherited from the base class.
Definition: xAODTrigRNNOutputAuxContainerCnv_v1.cxx:74
ATH_MSG
#define ATH_MSG(MSG)
Another convenience macro for printing messages in the converter.
Definition: xAODTrigRNNOutputAuxContainerCnv_v1.cxx:25
xAODTrigRNNOutputAuxContainerCnv_v1::xAODTrigRNNOutputAuxContainerCnv_v1
xAODTrigRNNOutputAuxContainerCnv_v1()
Default constructor.
Definition: xAODTrigRNNOutputAuxContainerCnv_v1.cxx:32