ATLAS Offline Software
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 
27 class 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
63  it = transVect->begin(),
64  iEnd = transVect->end();
65  it != iEnd;
66  ++it ) {
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
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
TrigMissingETContainerCnv_p1::TrigMissingETContainerCnv_p1
TrigMissingETContainerCnv_p1()
Definition: TrigMissingETContainerCnv_p1.h:43
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TrigMissingETContainer
Definition: Trigger/TrigEvent/TrigMissingEtEvent/TrigMissingEtEvent/TrigMissingETContainer.h:12
TPObjRef
Definition: TPObjRef.h:20
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TrigMissingETContainerCnv_p1::persToTrans
virtual void persToTrans(const TrigMissingETContainer_p1 *persVect, TrigMissingETContainer *transVect, MsgStream &log)
Definition: TrigMissingETContainerCnv_p1.h:47
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
T_AthenaPoolTPConverter.h
DataVector::clear
void clear()
Erase all the elements in the collection.
TrigMissingETContainer_p1
Definition: TrigMissingETContainer_p1.h:26
TrigMissingET
Class for LVL2/EF MissingET trigger.
Definition: Trigger/TrigEvent/TrigMissingEtEvent/TrigMissingEtEvent/TrigMissingET.h:35
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
TrigMissingETContainer_p1.h
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
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
TrigMissingETContainer.h
TrigMissingETContainerCnv_p1
Definition: TrigMissingETContainerCnv_p1.h:28
DEBUG
#define DEBUG
Definition: page_access.h:11
TrigMissingETContainerCnv_p1::transToPers
virtual void transToPers(const TrigMissingETContainer *transVect, TrigMissingETContainer_p1 *persVect, MsgStream &log)
Definition: TrigMissingETContainerCnv_p1.h:70
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
TPPtrVectorCnv
Definition: TPConverter.h:919
TrigMissingETCnv_p1.h
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