ATLAS Offline Software
Public Member Functions | List of all members
TauJetCnv_p4 Class Reference

Transient<->persistent converter for Analysis::TauCommonDetails v3. More...

#include <TauJetCnv_p4.h>

Collaboration diagram for TauJetCnv_p4:

Public Member Functions

 TauJetCnv_p4 ()
 Constructor. More...
 
void persToTrans (const TauJet_p4 *pers, Analysis::TauJet *trans, MsgStream &msg) const
 Fills a transient object from a persistent object. More...
 
void transToPers (const Analysis::TauJet *trans, TauJet_p4 *pers, MsgStream &msg) const
 Fills a persistent object from a transient object
More...
 

Detailed Description

Transient<->persistent converter for Analysis::TauCommonDetails v3.

Definition at line 27 of file TauJetCnv_p4.h.

Constructor & Destructor Documentation

◆ TauJetCnv_p4()

TauJetCnv_p4::TauJetCnv_p4 ( )
inline

Constructor.

Definition at line 31 of file TauJetCnv_p4.h.

31 {}

Member Function Documentation

◆ persToTrans()

void TauJetCnv_p4::persToTrans ( const TauJet_p4 pers,
Analysis::TauJet trans,
MsgStream &  msg 
) const

Fills a transient object from a persistent object.

Parameters
persPersistent object
transTransient object
msgMessage stream

Definition at line 52 of file TauJetCnv_p4.cxx.

55 {
56  momCnv.persToTrans( &pers->m_momentum, &trans->momentumBase(), msg );
57  partBaseCnv.persToTrans( &pers->m_particleBase, &trans->particleBase(), msg );
58  clusterCnv.persToTrans( &pers->m_cluster, &trans->clusterLink(), msg );
59  clusterCnv.persToTrans( &pers->m_cellCluster, &trans->cellClusterLink(), msg );
60  jetCnv.persToTrans( &pers->m_jet, &trans->jetLink(), msg );
61  tracksCnv.persToTrans( &pers->m_tracks, &trans->trackLinkVector(), msg );
62  detailsCnv.persToTrans( &pers->m_tauDetails, &trans->tauDetailLinkVector(), msg );
63  trans->setNumberOfTracks (pers->m_numberOfTracks);
64  trans->setROIWord (pers->m_roiWord);
65 
66  if( getBit( pers->m_flags, 0 ) ) {
67  std::vector<std::pair<TauJetParameters::TauID, double> > params;
68  params.reserve(pers->m_params.size());
69  for (const auto& p : pers->m_params) {
70  params.emplace_back( static_cast<TauJetParameters::TauID>( p.first),
71  p.second);
72 
73  }
74 
75  Analysis::TauPID* tauID = new Analysis::TauPID (std::move(params),
76  pers->m_isTauFlags,
77  pers->m_vetoFlags);
78  trans->setTauID (tauID);
79  } else {
80  trans->setTauID( 0 );
81  }
82 
83  if( getBit( pers->m_flags, 2 ) )
85  if( getBit( pers->m_flags, 3 ) )
87  conversionTracksCnv.persToTrans(
88  &pers->m_conversionTracks,
89  &trans->conversionTrackLinkVector(), msg );
90  seedCalo_tracksCnv.persToTrans(
91  &pers->m_seedCalo_tracks,
92  &trans->seedCalo_trackLinkVector(), msg );
93  seedTrk_tracksCnv.persToTrans(
94  &pers->m_seedTrk_tracks,
95  &trans->seedTrk_trackLinkVector(), msg );
96 
97 }

◆ transToPers()

void TauJetCnv_p4::transToPers ( const Analysis::TauJet trans,
TauJet_p4 pers,
MsgStream &  msg 
) const

Fills a persistent object from a transient object

Parameters
transTransient object
persPersistent object
msgMessage stream

Definition at line 99 of file TauJetCnv_p4.cxx.

102 {
103  momCnv.transToPers( &trans->momentumBase(), &pers->m_momentum, msg );
104  partBaseCnv.transToPers( &trans->particleBase(), &pers->m_particleBase, msg );
105  const ElementLink<CaloClusterContainer> clusterLink = trans->clusterLink();
106  clusterCnv.transToPers( &clusterLink, &pers->m_cluster, msg );
107  const ElementLink<CaloClusterContainer> cellClusterLink = trans->cellClusterLink();
108  clusterCnv.transToPers( &cellClusterLink, &pers->m_cellCluster, msg );
109  const ElementLink<JetCollection> jetLink = trans->jetLink();
110  jetCnv.transToPers( &jetLink, &pers->m_jet, msg );
111  tracksCnv.transToPers( &trans->trackLinkVector(), &pers->m_tracks, msg );
112  detailsCnv.transToPers( &trans->tauDetailLinkVector(), &pers->m_tauDetails, msg );
113  pers->m_numberOfTracks = trans->numberOfTracks();
114  pers->m_roiWord = trans->ROIWord();
115  pers->m_params.clear();
116 
117 
118  if( trans->tauID() ) {
119  setBit( pers->m_flags, 0, true );
120 
121  pers->m_vetoFlags = trans->tauID()->vetoFlags().to_ulong();
122  pers->m_isTauFlags = trans->tauID()->isTauFlags().to_ulong();
123 
124  pers->m_params.reserve (trans->tauID()->params().size());
125  for (const auto& p : trans->tauID()->params()) {
126  pers->m_params.emplace_back (static_cast<int>( p.first ), p.second);
127  }
128  } else {
129  setBit( pers->m_flags, 0, false );
130  }
131  if( trans->hasAuthor( TauJetParameters::tauRec ) )
132  setBit( pers->m_flags, 2, true );
133  if( trans->hasAuthor( TauJetParameters::tau1P3P ) )
134  setBit( pers->m_flags, 3, true );
135  conversionTracksCnv.transToPers(
136  &trans->conversionTrackLinkVector(),
137  &pers->m_conversionTracks, msg );
138  seedCalo_tracksCnv.transToPers(
139  &trans->seedCalo_trackLinkVector(),
140  &pers->m_seedCalo_tracks, msg );
141  seedTrk_tracksCnv.transToPers(
142  &trans->seedTrk_trackLinkVector(),
143  &pers->m_seedTrk_tracks, msg );
144 }

The documentation for this class was generated from the following files:
TauJet_p4::m_particleBase
ParticleBase_p2 m_particleBase
Definition: TauJet_p4.h:52
Analysis::TauJet::seedCalo_trackLinkVector
const ElementLinkVector< Rec::TrackParticleContainer > & seedCalo_trackLinkVector() const
Get seed calo track link vector.
Analysis::TauJet::setROIWord
void setROIWord(unsigned int RoiWord)
Set ROI Word (trigger purposes)
Analysis::TauJet::setTauID
void setTauID(TauPID *tauID)
Set TauPID object that contains discriminant values.
Analysis::TauPID
Class containing discriminants produced by identification algorithms.
Definition: TauPID.h:32
ElementLinkCnv_p3::persToTrans
void persToTrans(const PersLink_t &pers, Link_t &trans, MsgStream &log) const
TauJet_p4::m_flags
unsigned char m_flags
Definition: TauJet_p4.h:58
TauJetParameters::tau1P3P
@ tau1P3P
Definition: TauJetParameters.h:36
ParticleBaseCnv_p2::persToTrans
virtual void persToTrans(const ParticleBase_p2 *persObj, ParticleBase *transObj, MsgStream &msg) const final
Method creating the transient representation of ParticleBase from its persistent representation Parti...
Definition: ParticleBaseCnv_p2.cxx:42
TauJet_p4::m_cluster
ElementLinkInt_p3 m_cluster
Definition: TauJet_p4.h:53
Analysis::TauJet::hasAuthor
bool hasAuthor(const TauJetParameters ::Author &author) const
check if this object has Author author (can be more than one)
Analysis::TauJet::numberOfTracks
unsigned int numberOfTracks() const
Get number of tracks.
TauJet_p4::m_params
std ::vector< std ::pair< int, float > > m_params
Definition: TauJet_p4.h:66
ElementLinkVectorCnv_p1::persToTrans
void persToTrans(const PersLinkVect_t &pers, LinkVect_t &trans, MsgStream &log) const
Analysis::TauJet::jetLink
const ElementLink< JetCollection > jetLink() const
ElementLink to seed Jet, might be invalid if not seeded from a Jet
TauJet_p4::m_jet
ElementLinkInt_p3 m_jet
Definition: TauJet_p4.h:55
Analysis::TauPID::isTauFlags
const std::bitset< 32 > & isTauFlags() const
Definition: TauPID.cxx:90
Analysis::TauJet::tauID
const TauPID * tauID() const
Get TauPID object containing discriminant values.
ParticleBaseCnv_p2::transToPers
virtual void transToPers(const ParticleBase *transObj, ParticleBase_p2 *persObj, MsgStream &msg) const final
Method creating the persistent representation ParticleBase_p2 from its transient representation Parti...
Definition: ParticleBaseCnv_p2.cxx:73
ElementLinkCnv_p3::transToPers
void transToPers(const Link_t &trans, PersLink_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
TauJetParameters::tauRec
@ tauRec
Definition: TauJetParameters.h:35
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TauJet_p4::m_conversionTracks
ElementLinkIntVector_p1 m_conversionTracks
Definition: TauJet_p4.h:67
TauJet_p4::m_seedTrk_tracks
ElementLinkIntVector_p1 m_seedTrk_tracks
Definition: TauJet_p4.h:69
Analysis::TauJet::seedTrk_trackLinkVector
const ElementLinkVector< Rec::TrackParticleContainer > & seedTrk_trackLinkVector() const
Get seed trk track link vector.
Analysis::TauJet::conversionTrackLinkVector
const ElementLinkVector< Rec::TrackParticleContainer > & conversionTrackLinkVector() const
Get conversion track element link vector (const)
Analysis::TauPID::vetoFlags
const std::bitset< 32 > & vetoFlags() const
Definition: TauPID.cxx:94
TauJet_p4::m_seedCalo_tracks
ElementLinkIntVector_p1 m_seedCalo_tracks
Definition: TauJet_p4.h:68
Analysis::TauJet::clusterLink
const ElementLink< CaloClusterContainer > clusterLink() const
ElementLink to seed CaloCluster, DEPRECATED as of release 13
ParticleImpl::momentumBase
const momentum_type & momentumBase() const
access to underlying base type (I4Momentum-like)
Definition: ParticleImpl.h:393
TauJet_p4::m_isTauFlags
unsigned long m_isTauFlags
Definition: TauJet_p4.h:63
Analysis::TauJet::ROIWord
unsigned int ROIWord() const
Retrieve ROI Word (trigger purposes)
TauJetParameters::TauID
TauID
Enum for discriminants.
Definition: TauJetParameters.h:44
P4ImplEEtaPhiMCnv_p2::transToPers
virtual void transToPers(const P4ImplEEtaPhiM *transObj, P4EEtaPhiMFloat_p2 *persObj, MsgStream &log) const override
Method creating the persistent representation P4EEtaPhiMFloat_p2 from its transient representation P4...
Definition: P4ImplEEtaPhiMCnv_p2.cxx:38
ParticleImpl::particleBase
const particle_type & particleBase() const
access to underlying base type (IParticle-like)
Definition: ParticleImpl.h:403
TauJet_p4::m_numberOfTracks
unsigned long m_numberOfTracks
Definition: TauJet_p4.h:64
P4ImplEEtaPhiMCnv_p2::persToTrans
virtual void persToTrans(const P4EEtaPhiMFloat_p2 *persObj, P4ImplEEtaPhiM *transObj, MsgStream &log) const override
Method creating the transient representation of P4ImplEEtaPhiM from its persistent representation P4E...
Definition: P4ImplEEtaPhiMCnv_p2.cxx:26
TauJet_p4::m_roiWord
unsigned int m_roiWord
Definition: TauJet_p4.h:65
TauJet_p4::m_cellCluster
ElementLinkInt_p3 m_cellCluster
Definition: TauJet_p4.h:54
Analysis::TauJet::trackLinkVector
const ElementLinkVector< Rec::TrackParticleContainer > & trackLinkVector() const
Get track link vector.
ElementLinkVectorCnv_p1::transToPers
void transToPers(const LinkVect_t &trans, PersLinkVect_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
Analysis::TauJet::setNumberOfTracks
void setNumberOfTracks(unsigned int numberOfTracks)
Set number of tracks @ param numberOfTracks Number of tracks.
TauJet_p4::m_tracks
ElementLinkIntVector_p1 m_tracks
Definition: TauJet_p4.h:56
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
Analysis::TauJet::cellClusterLink
const ElementLink< CaloClusterContainer > cellClusterLink() const
ElementLink to cell CaloCluster, might be invalid the ID variables are calculated from this cluster i...
TauJet_p4::m_momentum
P4EEtaPhiMFloat_p2 m_momentum
Definition: TauJet_p4.h:51
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TauJet_p4::m_vetoFlags
unsigned long m_vetoFlags
Definition: TauJet_p4.h:62
Analysis::TauJet::setAuthor
void setAuthor(const TauJetParameters ::Author &author)
set the author flag to true
Analysis::TauPID::params
const std::vector< std::pair< TauJetParameters::TauID, double > > & params() const
Definition: TauPID.cxx:86
TauJet_p4::m_tauDetails
ElementLinkIntVector_p1 m_tauDetails
Definition: TauJet_p4.h:57
Analysis::TauJet::tauDetailLinkVector
ElementLinkVector< TauDetailsContainer > & tauDetailLinkVector()