ATLAS Offline Software
TrigEMClusterContainerCnv_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: TrigCaloEventTPCnv
8  * @class : TrigEMClusterContainerCnv_p1
9  *
10  * @brief transient persistent converter for TrigEMClusterContainer
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: TrigEMClusterContainerCnv_p1.h,v 1.2 2009-04-01 22:01:37 salvator Exp $
17  **********************************************************************************/
18 #ifndef TRIGCALOEVENTTPCNV_TRIGEMCLUSTERCONTAINER_CNV_P1_H
19 #define TRIGCALOEVENTTPCNV_TRIGEMCLUSTERCONTAINER_CNV_P1_H
20 
22 
26 
27 class TrigEMClusterContainerCnv_p1 : public T_AthenaPoolTPPtrVectorCnv< TrigEMClusterContainer, TrigEMClusterContainer_p1, ITPConverterFor<TrigEMCluster> >
28 {
29 
30  public:
31 
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 TrigEMClusterContainer_p1* persVect, TrigEMClusterContainer* transVect, MsgStream &log) {
37  log << MSG::DEBUG << "TrigEMClusterContainerCnv::persToTrans" << endmsg;
38  if (persVect){
39  transVect->clear();
40  transVect->reserve( persVect->size() );
41  // convert vector entries one by one
42  for( TrigEMClusterContainer_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 << "TrigEMClusterContainerCnv::persToTrans failed for an element " << endmsg;
50  }
51  } else {
52  log << MSG::WARNING << "TrigEMClusterContainerCnv::persToTrans cannot convert NULL persVect" << endmsg;
53  }
54  }
55 
56 
57  virtual void transToPers(const TrigEMClusterContainer* transVect, TrigEMClusterContainer_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 << "TrigEMClusterContainerCnv::transToPers failed for an element " << *it << " "
70  << m_elementCnv << endmsg;
71 
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.
TrigEMClusterContainerCnv_p1
Definition: TrigEMClusterContainerCnv_p1.h:28
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TrigEMClusterContainer_p1
Definition: TrigEMClusterContainer_p1.h:25
TrigEMClusterContainer.h
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TrigEMClusterContainerCnv_p1::TrigEMClusterContainerCnv_p1
TrigEMClusterContainerCnv_p1()
Definition: TrigEMClusterContainerCnv_p1.h:44
TrigEMCluster
Class with calibrated variables for egamma clustering.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:31
TrigEMClusterContainer
Container from TrigEMCluster type objects.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMClusterContainer.h:32
TPObjRef
Definition: TPObjRef.h:20
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TrigEMClusterContainer_p1.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
T_AthenaPoolTPConverter.h
TrigEMClusterContainerCnv_p1::persToTrans
virtual void persToTrans(const TrigEMClusterContainer_p1 *persVect, TrigEMClusterContainer *transVect, MsgStream &log)
Definition: TrigEMClusterContainerCnv_p1.h:48
DataVector::clear
void clear()
Erase all the elements in the collection.
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
TrigEMClusterContainerCnv_p1::transToPers
virtual void transToPers(const TrigEMClusterContainer *transVect, TrigEMClusterContainer_p1 *persVect, MsgStream &log)
Definition: TrigEMClusterContainerCnv_p1.h:69
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
TrigEMClusterCnv_p1.h
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
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