ATLAS Offline Software
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
7 
11 #include <vector>
12 
13 namespace 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
get_generator_info.result
result
Definition: get_generator_info.py:21
Analysis::transToPersVectorObj
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
TPObjRef
Definition: TPObjRef.h:20
lumiFormat.i
int i
Definition: lumiFormat.py:92
Analysis::persToTransVectorObj
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
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
ref
const boost::regex ref(r_ef)
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7