ATLAS Offline Software
Loading...
Searching...
No Matches
egammaCnv_p1.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5*/
6
7// egammaCnv_p1.cxx
8// Implementation file for class egammaCnv_p1
9// Author: K.Cranmer<cranmer@cern.ch>
10// Author: S.Binet<binet@cern.ch>
12
13
14// STL includes
15
16#include "GaudiKernel/GaudiException.h"
17
18// egammaEventTPCnv includes
20
21// some constants used to keep consistency over business of egPID conversion
22// --hack-hack-hack-- (ugly-ugly)
23
25// Public methods:
27
28// Constructors
30
31// Destructor
33
35// Const methods:
37
39 egamma* trans,
40 MsgStream& msg )
41{
42// msg << MSG::DEBUG << "Loading egamma from persistent state..."
43// << endmsg;
44
45 // Clear
46 *trans = egamma (pers->m_author);
47
48 m_momCnv.persToTrans (&pers->m_momentum,
49 &trans->momentumBase(),
50 msg);
51 m_partBaseCnv.persToTrans (&pers->m_particleBase,
52 &trans->particleBase(),
53 msg);
54
55 // element links
57 m_clusterCnv.persToTrans( &pers->m_cluster, &cluster, msg );
58 trans->setClusterElementLink (cluster);
59
61 m_trackCnv.persToTrans( &pers->m_trackParticle,
62 &el,
63 msg );
65
67 m_conversionCnv.persToTrans( &pers->m_conversion,
68 &vx,
69 msg );
70 trans->setConversionElementLink(vx);
71
73 m_egDetailsCnv.persToTrans( &pers->m_egDetails,
74 &egDetails,
75 msg );
76 trans->setDetailElementLinkVector (std::move (egDetails));
77
78 // egPID filling (doubles)
79 {
80 const std::vector<double>& egID = pers->m_egammaDblPIDs;
81 const std::vector<unsigned int>& egEnum = pers->m_egammaEnumPIDs;
82
83 // if you crash here, then there is a data corruption...
84 assert( egEnum.size() == egID.size() );
85
86 for ( unsigned int i=0; i< egID.size(); i++ ) {
87 trans->set_egammaID( (egammaPIDObs::PID) egEnum[i], egID[i] );
88 }
89 }
90 //Clearing Rings ElementLink:
91 trans->resetRings();
92}
93
94void egammaCnv_p1::transToPers( const egamma* /*trans*/,
95 egamma_p1* /*pers*/,
96 MsgStream& /*msg*/ )
97{
98
99 throw GaudiException("Deprecated method, we have evolved to use egamma_p2.Please migrate to use egammaCnv_p2::transToPers","egammaCnv_p1::transToPers", StatusCode::FAILURE);
100}
ElementLinkVector implementation for standalone ROOT.
const momentum_type & momentumBase() const
access to underlying base type (I4Momentum-like)
const particle_type & particleBase() const
access to underlying base type (IParticle-like)
ParticleBaseCnv_p1 m_partBaseCnv
TrackLinkCnv_t m_trackCnv
P4ImplEEtaPhiMCnv_p1 m_momCnv
virtual void persToTrans(const egamma_p1 *persObj, egamma *transObj, MsgStream &msg) override final
Method creating the transient representation of egamma from its persistent representation egamma_p1.
virtual void transToPers(const egamma *transObj, egamma_p1 *persObj, MsgStream &msg) override final
Method creating the persistent representation egamma_p1 from its transient representation egamma.
ConversionLinkCnv_t m_conversionCnv
EgDetailsCnv_t m_egDetailsCnv
ClusterLinkCnv_t m_clusterCnv
unsigned int m_author
Definition egamma_p1.h:80
ElementLinkInt_p1 m_conversion
links to tracks
Definition egamma_p1.h:74
P4EEtaPhiM_p1 m_momentum
the 4-mom part
Definition egamma_p1.h:60
ParticleBase_p1 m_particleBase
the ParticleBase part
Definition egamma_p1.h:63
std::vector< double > m_egammaDblPIDs
Definition egamma_p1.h:84
ElementLinkIntVector_p1 m_egDetails
links to egDetails
Definition egamma_p1.h:77
std::vector< unsigned int > m_egammaEnumPIDs
egamma PID
Definition egamma_p1.h:83
ElementLinkInt_p1 m_trackParticle
links to tracks
Definition egamma_p1.h:71
ElementLinkInt_p1 m_cluster
links to clusters
Definition egamma_p1.h:68
elec/gamma data class.
Definition egamma.h:58
void setTrackParticleElementLink(const ElementLink< Rec::TrackParticleContainer > &link)
Set Track Particle Link.
Definition egamma.cxx:543
void setDetailElementLinkVector(const ElementLinkVector< egDetailContainer > &v)
Definition egamma.cxx:627
bool set_egammaID(egammaPIDObs::PID id, double result)
set_egamma ID, for doubles and all possible weights as likelihood
Definition egamma.cxx:329
void resetRings()
Reset Cluster.
Definition egamma.cxx:479
void setClusterElementLink(const ElementLink< CaloClusterContainer > &link)
Set Cluster Element Link.
Definition egamma.cxx:512
void setConversionElementLink(const ElementLink< VxContainer > &link)
Set Conversion.
Definition egamma.cxx:588
MsgStream & msg
Definition testRead.cxx:32