ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMissingETContainerCnv_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: TrigMissingEtEventTPCnv
8 * @class : TrigMissingETContainerCnv_p1
9 *
10 * @brief transient persistent converter for TrigMissingETContainer
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: TrigMissingETContainerCnv_p1.h,v 1.2 2009-04-01 22:10:11 salvator Exp $
17 **********************************************************************************/
18#ifndef TRIGMISSINGETEVENTTPCNV_TRIGMISSINGETCONTAINER_CNV_P1_H
19#define TRIGMISSINGETEVENTTPCNV_TRIGMISSINGETCONTAINER_CNV_P1_H
20
22
26
27class TrigMissingETContainerCnv_p1 : public T_AthenaPoolTPPtrVectorCnv< TrigMissingETContainer, TrigMissingETContainer_p1, ITPConverterFor<TrigMissingET> >
28{
29
30 public:
32
33 //this part is implemented in T_AthenaPoolTPConverter.h.
34 //It is here temporarily to override and allow some extra debugging
35 virtual void persToTrans(const TrigMissingETContainer_p1* persVect, TrigMissingETContainer* transVect, MsgStream &log) {
36 log << MSG::DEBUG << "TrigMissingETContainerCnv::persToTrans" << endmsg;
37 transVect->clear();
38 if (persVect){
39 transVect->reserve( persVect->size() );
40 // convert vector entries one by one
41 for( TrigMissingETContainer_p1::const_iterator
42 it = persVect->begin(),
43 iEnd = persVect->end();
44 it != iEnd; ++it ) {
46 transVect->push_back( p);
47 if (!p)
48 log << MSG::WARNING << "TrigMissingETContainerCnv::persToTrans failed for an element " << endmsg;
49 }
50 } else {
51 log << MSG::WARNING << "TrigMissingETContainerCnv::persToTrans cannot convert NULL persVect" << endmsg;
52
53 return;
54 }
55 }
56
57
58 virtual void transToPers(const TrigMissingETContainer* transVect, TrigMissingETContainer_p1* persVect, MsgStream &log) {
59 persVect->clear();
60 persVect->reserve( transVect->size() );
61 // convert vector entries one by one
62 for( TrigMissingETContainer::const_iterator
63 it = transVect->begin(),
64 iEnd = transVect->end();
65 it != iEnd;
66 ++it ) {
67 TPObjRef a = toPersistent( &m_elementCnv, *it, log );
68 persVect->push_back( a );
69 if (a.isNull()){
70 log << MSG::WARNING << "TrigMissingETContainerCnv::transToPers failed for an element " << *it << " "
71 << m_elementCnv << endmsg;
72
73 }
74 }
75 }
76
77}; //end of class definitions
78
79#endif
#define endmsg
static Double_t a
TPPtrVectorCnv< TRANS, PERS, CONV > T_AthenaPoolTPPtrVectorCnv
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 persToTrans(const TrigMissingETContainer_p1 *persVect, TrigMissingETContainer *transVect, MsgStream &log)
virtual void transToPers(const TrigMissingETContainer *transVect, TrigMissingETContainer_p1 *persVect, MsgStream &log)