ATLAS Offline Software
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 
28 class 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 ) {
67  persVect->push_back( a );
68  if (a.isNull()){
69  log << MSG::WARNING << "TrigL2BphysContainerCnv::transToPers failed for an element " << *it << " "
71 
72  }
73  }
74  }
75 
76 }; //end of class definitions
77 
78 #endif
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TrigL2BphysContainer_p1.h
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
TrigL2BphysContainerCnv_p1::persToTrans
virtual void persToTrans(const TrigL2BphysContainer_p1 *persVect, TrigL2BphysContainer *transVect, MsgStream &log)
Definition: TrigL2BphysContainerCnv_p1.h:49
skel.it
it
Definition: skel.GENtoEVGEN.py:423
TrigL2Bphys
Definition: TrigL2Bphys.h:43
TrigL2BphysContainerCnv_p1::TrigL2BphysContainerCnv_p1
TrigL2BphysContainerCnv_p1()
Definition: TrigL2BphysContainerCnv_p1.h:45
TPObjRef
Definition: TPObjRef.h:20
TrigL2BphysContainer.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
T_AthenaPoolTPConverter.h
TrigL2BphysContainerCnv_p1::transToPers
virtual void transToPers(const TrigL2BphysContainer *transVect, TrigL2BphysContainer_p1 *persVect, MsgStream &log)
Definition: TrigL2BphysContainerCnv_p1.h:70
DataVector::clear
void clear()
Erase all the elements in the collection.
TrigL2BphysContainerCnv_p1
Definition: TrigL2BphysContainerCnv_p1.h:29
ITPConverterFor::toPersistent
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Persistify an object and store the persistent represenation in the storage vector of the top-level pe...
Definition: TPConverter.h:119
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
TrigL2BphysContainer_p1
Definition: TrigL2BphysContainer_p1.h:25
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
a
TList * a
Definition: liststreamerinfos.cxx:10
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TPPtrVectorCnv::m_elementCnv
CONV * m_elementCnv
pointer to the TP converter used for vector elements
Definition: TPConverter.h:963
TrigL2BphysContainer
Definition: TrigL2BphysContainer.h:33
TPPtrVectorCnv
Definition: TPConverter.h:919
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
ITPConverterFor::createTransFromPStore
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
Create transient representation of a persistent object, stored in the the top-level persistent object...
Definition: TPConverter.h:172