ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkEventCnv
TrkEventTPCnv
src
TrkV0Vertex
V0CandidateCnv_p1.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrkV0Vertex/V0Candidate.h
"
6
#include "
TrkEventTPCnv/TrkV0Vertex/V0CandidateCnv_p1.h
"
7
8
void
V0CandidateCnv_p1::persToTrans
(
const
Trk::V0Candidate_p1
* persObj,
Trk::V0Candidate
* transObj, MsgStream &log)
9
{
10
11
// A simplest possible approcah to work with the base class:
12
// dynamic casting each element of the vector
13
// allows to work with vectors and containers of
14
// all derived types of VxCandidate. I.e. poly converters
15
// are now defined for each of derived types. A VxContainer
16
// of any of them can now be stored and read. But objects
17
// like V0Candidate are now forced to work through a base
18
// type. Dynamic_cast is the simplest solution. In principle,
19
// the template should have been re-written
20
21
std::vector<Trk::VxCandidate *> v;
22
m_v0HypothesisVectorCnv
.persToTrans( &persObj->
m_v0Hyp
, &v,log);
23
std::vector<Trk::V0Hypothesis *> vh;
24
vh.reserve (v.size());
25
for
(
auto
& i : v)
26
vh.push_back(
dynamic_cast<
Trk::V0Hypothesis
*
>
(i));
27
*transObj =
Trk::V0Candidate
(std::move (vh));
28
}
29
30
void
V0CandidateCnv_p1::transToPers
(
const
Trk::V0Candidate
* transObj,
Trk::V0Candidate_p1
* persObj, MsgStream &log){
31
32
std::vector<Trk::VxCandidate *> lVx;
33
// std::cout<<"Ilija writing v0candidate. size: "<<transObj->m_v0Hyp.size()<<std::endl;
34
const
std::vector<Trk::V0Hypothesis *>& v0Hyp = *transObj->
v0Hypothesis
();
35
lVx.reserve(v0Hyp.size());
36
for
(
auto
*i : v0Hyp)
37
lVx.push_back( i);
38
m_v0HypothesisVectorCnv
.transToPers( &lVx, &persObj->
m_v0Hyp
, log);
39
40
}
V0CandidateCnv_p1.h
V0Candidate.h
Trk::V0Candidate_p1
Definition
V0Candidate_p1.h:22
Trk::V0Candidate_p1::m_v0Hyp
std::vector< TPObjRef > m_v0Hyp
Definition
V0Candidate_p1.h:29
Trk::V0Candidate
Definition
V0Candidate.h:33
Trk::V0Candidate::v0Hypothesis
std::vector< Trk::V0Hypothesis * > * v0Hypothesis(void)
Unconst access to the vector of V0Hypothesis Required by the finder to set the element links properly...
Definition
V0Candidate.h:91
Trk::V0Hypothesis
An extension of Trk::ExtendedVxCandidate, to be used for constrained and unconstrained V0 candidates ...
Definition
V0Hypothesis.h:40
V0CandidateCnv_p1::persToTrans
void persToTrans(const Trk::V0Candidate_p1 *persObj, Trk::V0Candidate *transObj, MsgStream &log)
Definition
V0CandidateCnv_p1.cxx:8
V0CandidateCnv_p1::transToPers
void transToPers(const Trk::V0Candidate *transObj, Trk::V0Candidate_p1 *persObj, MsgStream &log)
Definition
V0CandidateCnv_p1.cxx:30
V0CandidateCnv_p1::m_v0HypothesisVectorCnv
V0HypothesisVectorCnv_p1 m_v0HypothesisVectorCnv
Definition
V0CandidateCnv_p1.h:40
Generated on
for ATLAS Offline Software by
1.17.0