ATLAS Offline Software
Loading...
Searching...
No Matches
TrigL2BphysContainerCnv_p1.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5/**********************************************************************************
6 * @Project: Trigger
7 * @Package: TrigParticleTPCnv
8 * @class : TrigL2BphysContainerCnv_p1
9 *
10 * @brief transient persistent converter for TrigL2BphysContainer
11 *
12 * @author Andrew Hamilton <Andrew.Hamilton@cern.ch> - U. Geneva
13 * @author Francesca Bucci <F.Bucci@cern.ch> - U. Geneva
14 *
15 * File and Version Information:
16 * $Id: TrigL2BphysContainerCnv_p1.h,v 1.2 2009-04-01 22:13:30 salvator Exp $
17 * $Id: TrigL2BphysContainerCnv_p1.h,v 1.3 2010-08-11 demelian Exp $
18 **********************************************************************************/
19#ifndef TTRIGPARTICLETPCNV_RIGL2BPHYSCONTAINER_CNV_P1_H
20#define TTRIGPARTICLETPCNV_RIGL2BPHYSCONTAINER_CNV_P1_H
21
23
24//#include "TrigParticleTPCnv/TrigL2BphysCnv_p2.h"
27
28class TrigL2BphysContainerCnv_p1 : public T_AthenaPoolTPPtrVectorCnv< TrigL2BphysContainer, TrigL2BphysContainer_p1, ITPConverterFor<TrigL2Bphys> >
29{
30
31 public:
33
34 //this part is implemented in T_AthenaPoolTPConverter.h.
35 //It is here temporarily to override and allow some extra debugging
36 virtual void persToTrans(const TrigL2BphysContainer_p1* persVect, TrigL2BphysContainer* transVect, MsgStream &log) {
37 log << MSG::DEBUG << "TrigL2BphysContainerCnv::persToTrans" << endmsg;
38 if (persVect){
39 transVect->clear();
40 transVect->reserve( persVect->size() );
41 // convert vector entries one by one
42 for( TrigL2BphysContainer_p1::const_iterator
43 it = persVect->begin(),
44 iEnd = persVect->end();
45 it != iEnd; ++it ) {
47 transVect->push_back( p);
48 if (!p)
49 log << MSG::WARNING << "TrigL2BphysContainerCnv::persToTrans failed for an element " << endmsg;
50 }
51 } else {
52 log << MSG::WARNING << "TrigL2BphysContainerCnv::persToTrans cannot convert NULL persVect" << endmsg;
53 }
54 }
55
56
57 virtual void transToPers(const TrigL2BphysContainer* transVect, TrigL2BphysContainer_p1* persVect, MsgStream &log) {
58 persVect->clear();
59 persVect->reserve( transVect->size() );
60 // convert vector entries one by one
62 it = transVect->begin(),
63 iEnd = transVect->end();
64 it != iEnd;
65 ++it ) {
66 TPObjRef a = toPersistent( &m_elementCnv, *it, log );
67 persVect->push_back( a );
68 if (a.isNull()){
69 log << MSG::WARNING << "TrigL2BphysContainerCnv::transToPers failed for an element " << *it << " "
70 << m_elementCnv << endmsg;
71
72 }
73 }
74 }
75
76}; //end of class definitions
77
78#endif
#define endmsg
static Double_t a
TPPtrVectorCnv< TRANS, PERS, CONV > T_AthenaPoolTPPtrVectorCnv
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
void clear()
Erase all the elements in the collection.
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
This class is an object reference used in Athena persistent data model.
Definition TPObjRef.h:20
CONV * m_elementCnv
pointer to the TP converter used for vector elements
virtual void transToPers(const TrigL2BphysContainer *transVect, TrigL2BphysContainer_p1 *persVect, MsgStream &log)
virtual void persToTrans(const TrigL2BphysContainer_p1 *persVect, TrigL2BphysContainer *transVect, MsgStream &log)