ATLAS Offline Software
ParticleJetCnv_p1.cxx
Go to the documentation of this file.
1 
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
39 static const P4ImplPxPyPzECnv_p1 momCnv;
40 static const ParticleBaseCnv_p1 partBaseCnv;
41 
42 
43 void
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 
92 void
94  ParticleJet_p1* ,
95  MsgStream& msg ) const
96 {
97  msg << MSG::ERROR << "Creating persistent state of ParticleJet... This should not happen anymore"
98  << endmsg;
99 }
ParticleJetCnv_p1.h
P4PxPyPzE_p1::m_ene
float m_ene
Definition: P4PxPyPzE_p1.h:42
ElectronAssociation.h
ParticleSigStateImpl::e
virtual double e() const
energy
Definition: ParticleSigStateImpl.h:751
MuonConstituent.h
Jet
Basic data class defines behavior for all Jet objects The Jet class is the principal data class for...
Definition: Reconstruction/Jet/JetEvent/JetEvent/Jet.h:47
ParticleJet_p1::m_tagJetInfo
std::vector< Analysis::ITagInfo * > m_tagJetInfo
ITagInfo objects.
Definition: ParticleJet_p1.h:76
Analysis::IConstituent
Class IConstituent: This is the abstract base class for additional jet constituents to be put into th...
Definition: IConstituent.h:52
ParticleSigStateImpl::particleBase
const particle_type & particleBase() const
access to underlying base type (IParticle-like)
Definition: ParticleSigStateImpl.h:469
ParticleSigStateImpl::momentumBase
const momentum_type & momentumBase(state_t s) const
access to underlying base type (I4Momentum-like)
Definition: ParticleSigStateImpl.h:447
ParticleJet_p1
Definition: ParticleJet_p1.h:35
ParticleJetCnv_p1::persToTrans
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...
Definition: ParticleJetCnv_p1.cxx:44
JetTagInfoBase
Definition: JetTagInfoBase.h:56
P4ImplPxPyPzECnv_p1.h
ParticleBaseCnv_p1::persToTrans
virtual void persToTrans(const ParticleBase_p1 *persObj, ParticleBase *transObj, MsgStream &msg) const final
Method creating the transient representation of ParticleBase from its persistent representation Parti...
Definition: ParticleBaseCnv_p1.cxx:49
ElectronConstituent.h
Jet::setCombinedLikelihood
void setCombinedLikelihood(const std::vector< double > &combinedLikelihood)
(depreciated) Likelihood store setter
Definition: Jet.cxx:978
lumiFormat.i
int i
Definition: lumiFormat.py:85
ParticleJet_p1::m_author
std::string m_author
authors
Definition: ParticleJet_p1.h:73
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ParticleBaseCnv_p1.h
ParticleJetCnv_p1::transToPers
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.
Definition: ParticleJetCnv_p1.cxx:93
ParticleJet_p1::m_momentum
P4PxPyPzE_p1 m_momentum
the 4-mom part
Definition: ParticleJet_p1.h:62
P4ImplPxPyPzECnv_p1
Definition: P4ImplPxPyPzECnv_p1.h:38
Analysis::ITagInfo::infoType
virtual TagInfoType infoType() const =0
a clone method for the proper workings of the copy constructor
MuonAssociation.h
ParticleJet_p1::m_combinedLikelihood
std::vector< double > m_combinedLikelihood
combined likelihoods
Definition: ParticleJet_p1.h:70
ParticleBaseCnv_p1
Definition: ParticleBaseCnv_p1.h:30
ParticleSigStateImpl::setSignalState
virtual bool setSignalState(state_t s)
set the current signal state
Definition: ParticleSigStateImpl.h:1157
ParticleJet_p1::m_particleBase
ParticleBase_p1 m_particleBase
the ParticleBase part
Definition: ParticleJet_p1.h:65
DEBUG
#define DEBUG
Definition: page_access.h:11
P4SignalState::CALIBRATED
@ CALIBRATED
Definition: ISignalState.h:31
Analysis::IConstituent::name
virtual NameType name() const =0
returns the infoType of the info objects.
ParticleJet_p1::m_constituents
std::vector< Analysis::IConstituent * > m_constituents
IConstituents objects.
Definition: ParticleJet_p1.h:79
Jet.h
P4ImplPxPyPzECnv_p1::persToTrans
virtual void persToTrans(const P4ImplPxPyPzE_p1 *persObj, P4ImplPxPyPzE *transObj, MsgStream &msg) const override
Method creating the transient representation of P4ImplPxPyPzE from its persistent representation P4Im...
Definition: P4ImplPxPyPzECnv_p1.cxx:26
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Jet::setTagInfo
void setTagInfo(const mkey_t &key, const taginfo_t *pTagInfo, bool useLink=false)
Set tag info object.
Definition: Jet.cxx:853
Jet::setJetAuthor
void setJetAuthor(const std::string &author)
Set author of this Jet (only the author, tags unchanged)
Definition: Jet.cxx:1094