ATLAS Offline Software
Loading...
Searching...
No Matches
TPHelpers.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef JETTAGINFOTPCNV_TPHELPERS
6#define JETTAGINFOTPCNV_TPHELPERS
10
11#include <vector>
12
13namespace Analysis {
14
19 template<class CNV, class CNVForObj, class ObjType>
20 void persToTransVectorObj (CNV *masterCvt,
21 CNVForObj **cnv,
22 const std::vector<TPObjRef> &persVector,
23 std::vector<ObjType*> &result,
24 MsgStream &msg)
25 {
26 result.clear();
27 result.reserve(persVector.size());
28 for (const TPObjRef& ref : persVector) {
29 result.push_back(masterCvt->createTransFromPStore(cnv, ref, msg));
30 }
31 }
32
37 template<typename CNV, typename CNVForObj, typename ObjType>
38 void transToPersVectorObj(CNV *masterCvt,
39 CNVForObj **cnv,
40 const std::vector<ObjType*> &transVector,
41 std::vector<TPObjRef> &result,
42 MsgStream &msg)
43 {
44 result.clear();
45 result.reserve(transVector.size());
46 for (unsigned int i = 0; i < transVector.size(); i++) {
47 result.push_back(masterCvt->toPersistent(cnv, transVector[i], msg));
48 }
49 }
50}
51
52#endif
const boost::regex ref(r_ef)
This class is an object reference used in Athena persistent data model.
Definition TPObjRef.h:20
The namespace of all packages in PhysicsAnalysis/JetTagging.
void transToPersVectorObj(CNV *masterCvt, CNVForObj **cnv, const std::vector< ObjType * > &transVector, std::vector< TPObjRef > &result, MsgStream &msg)
Translate a set of pointers to objects to their persistent rep, saving them in the tlp container.
Definition TPHelpers.h:38
void persToTransVectorObj(CNV *masterCvt, CNVForObj **cnv, const std::vector< TPObjRef > &persVector, std::vector< ObjType * > &result, MsgStream &msg)
Given a vector of poitners to an object, create the persistent from the transient.
Definition TPHelpers.h:20
MsgStream & msg
Definition testRead.cxx:32