ATLAS Offline Software
Loading...
Searching...
No Matches
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
27class 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 ) {
66 TPObjRef a = toPersistent( &m_elementCnv, *it, log );
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
#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 persToTrans(const TrigEMClusterContainer_p1 *persVect, TrigEMClusterContainer *transVect, MsgStream &log)
virtual void transToPers(const TrigEMClusterContainer *transVect, TrigEMClusterContainer_p1 *persVect, MsgStream &log)
Class with calibrated variables for egamma clustering.