ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleJetCnv_p1.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5*/
6
7// ParticleJetCnv_p1.cxx
8// Implementation file for class ParticleJetCnv_p1
9// Author: K.Cranmer<cranmer@cern.ch>
10// Author: S.Binet<binet@cern.ch>
12
13
14// STL includes
15
16// JetTagEvent includes
17#include "JetEvent/Jet.h"
18
23
24
25// EventCommonTPCnv includes
27
28// ParticleEventTPCnv includes
30
31
32// ParticleEventTPCnv includes
34
35
36
37
38// converters
41
42
43void
45 Jet* trans,
46 MsgStream& msg ) const
47{
48 msg << MSG::DEBUG << "ParticleJet_p1 Loading Jet from persistent state... pers="<< pers
49 << " trans="<< trans
50 << endmsg;
51
52 msg << MSG::DEBUG << " ParticleJetCnv_p1 pers e="<< pers->m_momentum.m_ene <<endmsg;
53 // base classes
54 partBaseCnv.persToTrans( &pers->m_particleBase, &trans->particleBase(), msg );
55 msg << MSG::DEBUG << "ParticleJet_p1 converted particlebase" << endmsg;
56
57 momCnv.persToTrans ( &pers->m_momentum, &trans->momentumBase(), msg );
58 msg << MSG::DEBUG << "ParticleJet_p1 converted momentum" << endmsg;
59
60
62 msg << MSG::DEBUG << " ParticleJetCnv_p1 pers e="<< pers->m_momentum.m_ene << " trans e="<< trans->e() <<endmsg;
63
65
66 trans->setJetAuthor( pers->m_author );
67
68 size_t ntag = pers->m_tagJetInfo.size();
69 for(size_t i=0;i<ntag;i++){
70 Jet::taginfo_t * tagi = dynamic_cast<Jet::taginfo_t *>(pers->m_tagJetInfo[i]);
71 if (tagi) trans->setTagInfo(tagi->infoType(), tagi);
72 }
73
74 // Constitutents are now Associations
75 //trans->m_constituents = pers->m_constituents;
76 size_t nconst = pers->m_constituents.size();
77 for(size_t i=0;i<nconst;i++){
78 Analysis::IConstituent* iconstit = pers->m_constituents[i];
79 std::string constit_name = iconstit->name();
80 msg << MSG::DEBUG << " constituent = " << constit_name << endmsg;
81
82
83
84 delete iconstit;
85 }
86
87
88 const_cast<ParticleJet_p1*>(pers)->m_tagJetInfo.clear();
89 const_cast<ParticleJet_p1*>(pers)->m_constituents.clear();
90}
91
92void
95 MsgStream& msg ) const
96{
97 msg << MSG::ERROR << "Creating persistent state of ParticleJet... This should not happen anymore"
98 << endmsg;
99}
#define endmsg
static const P4ImplPxPyPzECnv_p1 momCnv
Definition JetCnv_p1.cxx:30
static const ParticleBaseCnv_p1 partBaseCnv
Class IConstituent: This is the abstract base class for additional jet constituents to be put into th...
virtual NameType name() const =0
returns the infoType of the info objects.
virtual TagInfoType infoType() const =0
a clone method for the proper workings of the copy constructor
void setJetAuthor(const std::string &author)
Set author of this Jet (only the author, tags unchanged)
Definition Jet.cxx:1094
void setCombinedLikelihood(const std::vector< double > &combinedLikelihood)
(depreciated) Likelihood store setter
Definition Jet.cxx:978
void setTagInfo(const mkey_t &key, const taginfo_t *pTagInfo, bool useLink=false)
Set tag info object.
Definition Jet.cxx:853
virtual void persToTrans(const ParticleJet_p1 *persObj, Jet *transObj, MsgStream &msg) const override
Method creating the transient representation of Jet from its persistent representation ParticleJet_p1...
virtual void transToPers(const Jet *transObj, ParticleJet_p1 *persObj, MsgStream &msg) const override
Method creating the persistent representation ParticleJet_p1 from its transient representation Jet.
ParticleBase_p1 m_particleBase
the ParticleBase part
std::vector< double > m_combinedLikelihood
combined likelihoods
std::vector< Analysis::IConstituent * > m_constituents
IConstituents objects.
P4PxPyPzE_p1 m_momentum
the 4-mom part
std::string m_author
authors
std::vector< Analysis::ITagInfo * > m_tagJetInfo
ITagInfo objects.
virtual bool setSignalState(state_t s)
set the current signal state
const particle_type & particleBase() const
access to underlying base type (IParticle-like)
virtual double e() const
energy
const momentum_type & momentumBase(state_t s) const
access to underlying base type (I4Momentum-like)
MsgStream & msg
Definition testRead.cxx:32