ATLAS Offline Software
MuonCnv_p4.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 // MuonCnv_p4.cxx
8 // Implementation file for class MuonCnv_p4
9 // Author: Ketevi A. Assamagan <ketevi@bnl.gov>
11 
12 
13 // STL includes
14 
15 // DataModelAthenaPool includes
18 
19 // EventCommonTPCnv includes
21 
22 // ParticleEventTPCnv includes
24 
25 // muonEvent includes
26 #include "muonEvent/Muon.h"
27 
28 // RecTPCnv includes
29 #include "RecTPCnv/MuonCnv_p4.h"
30 
35 
36 // pre-allocate converters
37 static const P4ImplIPtCotThPhiMCnv_p1 momCnv;
38 static const ParticleBaseCnv_p1 partBaseCnv;
39 static const TrackLinkCnv_t trackCnv;
40 static const ClusterLinkCnv_t clusterCnv;
41 static const segmentLinkCnv_t segmentCnv;
42 static const caloEnergyLinkCnv_t caloEnergyCnv;
43 
44 
45 void MuonCnv_p4::persToTrans( const Muon_p4* pers,
46  Analysis::Muon* trans,
47  MsgStream& msg ) const
48 {
49 // msg << MSG::DEBUG << "Loading Muon from persistent state..."
50 // << endmsg;
51 
52  // base classes
53  momCnv.persToTrans ( &pers->m_momentum, &trans->momentumBase(), msg );
54  partBaseCnv.persToTrans( &pers->m_particleBase, &trans->particleBase(), msg );
55 
56  // element links
58  trackCnv.persToTrans( &pers->m_inDetTrackParticle,
59  &inDetTrackLink,
60  msg );
61  trans->setInDetTrackLink (inDetTrackLink);
62 
63  ElementLink<Rec::TrackParticleContainer> muonSpectrometerTrackLink;
65  &muonSpectrometerTrackLink,
66  msg );
67  trans->setMuonSpectrometerTrackLink (muonSpectrometerTrackLink);
68 
69  ElementLink<Rec::TrackParticleContainer> muonExtrapTrackLink;
71  &muonExtrapTrackLink,
72  msg );
73  trans->setMuonExtrapTrackLink (muonExtrapTrackLink,
75 
76  ElementLink<Rec::TrackParticleContainer> innerExtrapTrackLink;
78  &innerExtrapTrackLink,
79  msg );
80  trans->setInnerExtrapTrackLink (innerExtrapTrackLink);
81 
84  &combinedTrackLink,
85  msg );
86  trans->setCombinedTrackLink (combinedTrackLink,
88 
90  clusterCnv.persToTrans( &pers->m_cluster,
91  &clusterLink,
92  msg );
93  trans->setClusterLink (clusterLink);
94 
96  segmentCnv.persToTrans( &pers->m_muonSegments,
97  &muonSegmentLink,
98  msg );
99  trans->setMuonSegmentLink (muonSegmentLink);
100 
102  caloEnergyCnv.persToTrans( &pers->m_caloEnergyLoss,
103  &caloEnergyLink,
104  msg );
105  trans->setCaloEnergyLink (caloEnergyLink);
106 
107  // muon parameters
108  const std::vector<float>& params = pers->m_parameters;
113 
118 
123 
131 
134 
135  // author
136  trans->set_author (static_cast<MuonParameters::Author>(pers->m_author));
137 
138  // chi2 of the track matching
139  trans->set_matchChi2 (pers->m_matchChi2);
140 
141  // Low Pt muon stuff
144 
145  trans->set_bestMatch (pers->m_bestMatch);
146  trans->set_matchNumberDoF (pers->m_matchNumberDoF);
147 
148  // this muon is also found by the lowPT reconstruction algorithm
150 
151  // this muon is also found by the Calo Muon ID reconstruction algorithm
153 
156 
157  trans->set_isCorrected (pers->m_isCorrected);
158 
159  trans->set_allAuthors (pers->m_allAuthors);
160 // msg << MSG::DEBUG << "Loaded Muon from persistent state [OK]"
161 // << endmsg;
162 
163  return;
164 }
165 
167  Muon_p4* pers,
168  MsgStream& msg ) const
169 {
170 // msg << MSG::DEBUG << "Creating persistent state of Muon..."
171 // << endmsg;
172  msg << MSG::ERROR << "Analysis::Muon at " << trans << " Persistent Muon_p4 at " << pers << " Cannot write to Muon_p4" << endmsg;
173  throw std::runtime_error("Writing to Muon_p4 is not supported - MuonCnv_p4::transToPers(...)");
174  return;
175 }
TrackLinkCnv_t
ElementLinkCnv_p1< ElementLink< Rec::TrackParticleContainer > > TrackLinkCnv_t
Definition: MuonCnv_p4.cxx:31
ElementLinkCnv_p1.h
This file contains the class definition for the ElementLinkCnv_p1 class.
caloEnergyLinkCnv_t
ElementLinkCnv_p1< ElementLink< MuonCaloEnergyContainer > > caloEnergyLinkCnv_t
Definition: MuonCnv_p4.cxx:33
MuonParameters::etcone20
@ etcone20
Definition: MuonParamDefs.h:114
Muon_p4::m_combinedMuonTrackParticle
ElementLinkInt_p1 m_combinedMuonTrackParticle
links to associated TrackParticle (Combined muon)
Definition: Muon_p4.h:109
Analysis::Muon::set_isCorrected
void set_isCorrected(bool corrected)
is this Muon corrected in AOD-to-AOD correction or not?
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:603
Analysis::Muon::set_isAlsoFoundByLowPt
void set_isAlsoFoundByLowPt(const bool isAlsoSeenByLowPt)
set is also seen by low Pt reconstruction
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:189
Analysis::Muon::setCaloEnergyLink
void setCaloEnergyLink(const ElementLink< MuonCaloEnergyContainer > &l)
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:411
MuonParameters::nucone20
@ nucone20
Definition: MuonParamDefs.h:118
Analysis::Muon::set_bestMatch
void set_bestMatch(bool best)
set the best match
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:600
Muon_p4::m_momentum
P4IPtCotThPhiM_p1 m_momentum
the 4-mom part
Definition: Muon_p4.h:65
Analysis::Muon::setMuonSpectrometerTrackLink
void setMuonSpectrometerTrackLink(const ElementLink< Rec::TrackParticleContainer > &l)
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:399
MuonParameters::t0
@ t0
MuGirl parameter.
Definition: MuonParamDefs.h:143
Analysis::Muon::set_allAuthors
void set_allAuthors(const uint16_t allAuthors)
set all the authors of this Muon the authors are 16-bit word, 1-bit reserved for each muon Algorithm ...
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:142
ElementLinkVectorCnv_p1
Definition: ElementLinkVectorCnv_p1.h:28
Analysis::Muon::setMuonExtrapTrackLink
void setMuonExtrapTrackLink(const ElementLink< Rec::TrackParticleContainer > &l, bool isValid)
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:361
Muon_p4::m_caloMuonAlsoFoundByMuonReco
unsigned short m_caloMuonAlsoFoundByMuonReco
Definition: Muon_p4.h:126
Analysis::Muon::setInDetTrackLink
void setInDetTrackLink(const ElementLink< Rec::TrackParticleContainer > &l)
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:355
MuonParameters::innAngle
@ innAngle
common MuGirl and MuTag parameters
Definition: MuonParamDefs.h:148
ElementLinkVectorCnv_p1.h
This file contains the class definition for the ElementLinkVectorCnv_p1 class. NOTE: it should be inc...
Muon_p4::m_hasCombinedMuonTrackParticle
bool m_hasCombinedMuonTrackParticle
Definition: Muon_p4.h:80
ElementLinkVector
ElementLinkVector implementation for standalone ROOT.
Definition: AthLinks/ElementLinkVector.h:65
ElementLinkVectorCnv_p1::persToTrans
void persToTrans(const PersLinkVect_t &pers, LinkVect_t &trans, MsgStream &log) const
Muon_p4::m_associatedPhiDigits
std::vector< int > m_associatedPhiDigits
Definition: Muon_p4.h:90
Analysis::Muon::set_isAlsoFoundByCaloMuonId
void set_isAlsoFoundByCaloMuonId(const bool isAlsoSeenByCaloMuonId)
set is also seen by calo muon Id reconstruction
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:194
Analysis::Muon::setInnerExtrapTrackLink
void setInnerExtrapTrackLink(const ElementLink< Rec::TrackParticleContainer > &l)
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:374
MuonParameters::ptcone20
@ ptcone20
Definition: MuonParamDefs.h:122
Muon_p4::m_innerExtrapolatedTrackParticle
ElementLinkInt_p1 m_innerExtrapolatedTrackParticle
link to associated TrackParticle (Inner extrapolated)
Definition: Muon_p4.h:106
MuonParameters::segmentDeltaPhi
@ segmentDeltaPhi
Definition: MuonParamDefs.h:140
MuonParameters::annBarrel
@ annBarrel
Definition: MuonParamDefs.h:145
Analysis::Muon::set_matchNumberDoF
void set_matchNumberDoF(int x)
set the chi2 parameters - number of degrees of freedom
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:595
ClusterLinkCnv_t
ElementLinkCnv_p1< ElementLink< CaloClusterContainer > > ClusterLinkCnv_t
Definition: MuonCnv_p4.cxx:32
Muon_p4::m_matchNumberDoF
int m_matchNumberDoF
Definition: Muon_p4.h:118
Analysis::Muon::set_matchChi2
void set_matchChi2(float x)
set the chi2 parameters - matchChi2
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:593
MuonParameters::ptcone40
@ ptcone40
Definition: MuonParamDefs.h:124
MuonParameters::etcone30
@ etcone30
Definition: MuonParamDefs.h:115
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
Muon_p4::m_muonSegments
ElementLinkIntVector_p1 m_muonSegments
link to the Trk::Segment
Definition: Muon_p4.h:97
Analysis::Muon::setMuonSegmentLink
void setMuonSegmentLink(const ElementLinkVector< Trk::SegmentCollection > &l)
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:346
Muon_p4::m_author
unsigned int m_author
author
Definition: Muon_p4.h:73
MuonParameters::Author
Author
do not change the order of these enums.
Definition: MuonParamDefs.h:39
Analysis::Muon::set_author
void set_author(MuonParameters::Author author)
set the primary Author : the primary author is the algorithm that first created this Muon
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:133
Analysis::Muon::setCombinedTrackLink
void setCombinedTrackLink(const ElementLink< Rec::TrackParticleContainer > &l, bool isValid)
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:380
MuonParameters::midAngle
@ midAngle
Definition: MuonParamDefs.h:149
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuonCnv_p4.h
MuonParameters::segmentDeltaEta
@ segmentDeltaEta
MuTag parameters.
Definition: MuonParamDefs.h:139
ParticleBaseCnv_p1.h
Muon_p4::m_hasMuonExtrapolatedTrackParticle
bool m_hasMuonExtrapolatedTrackParticle
Definition: Muon_p4.h:78
Analysis::Muon
The ATLAS Muon object - see doxygen, physics workbookd and the Muon Combined Performance WG's pages f...
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:48
Muon_p4::m_parameters
std::vector< float > m_parameters
muon parameters
Definition: Muon_p4.h:115
Analysis::Muon::setClusterLink
void setClusterLink(const ElementLink< CaloClusterContainer > &l)
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:405
ParticleImpl::momentumBase
const momentum_type & momentumBase() const
access to underlying base type (I4Momentum-like)
Definition: ParticleImpl.h:393
MuonParameters::nucone10
@ nucone10
Definition: MuonParamDefs.h:117
Muon_p4::m_bestMatch
bool m_bestMatch
Definition: Muon_p4.h:117
ElementLinkCnv_p1
Definition: ElementLinkCnv_p1.h:27
Muon_p4::m_muonExtrapolatedTrackParticle
ElementLinkInt_p1 m_muonExtrapolatedTrackParticle
link to associated TrackParticle (Muon extrapolated)
Definition: Muon_p4.h:103
Muon_p4::m_isAlsoFoundByCaloMuonId
bool m_isAlsoFoundByCaloMuonId
Definition: Muon_p4.h:121
ParticleImpl::particleBase
const particle_type & particleBase() const
access to underlying base type (IParticle-like)
Definition: ParticleImpl.h:403
MuonParameters::nucone40
@ nucone40
Definition: MuonParamDefs.h:120
ElementLinkCnv_p1::persToTrans
void persToTrans(const PersLink_t &pers, Link_t &trans, MsgStream &log) const
MuonParameters::nucone30
@ nucone30
Definition: MuonParamDefs.h:119
P4ImplIPtCotThPhiMCnv_p1.h
Analysis::Muon::set_parameter
void set_parameter(MuonParameters::ParamDef index, double value, bool overwrite=false)
set a parameter in the MuonParamDefs.h
Definition: Muon.cxx:888
P4ImplIPtCotThPhiMCnv_p1::persToTrans
virtual void persToTrans(const P4ImplIPtCotThPhiM_p1 *persObj, P4ImplIPtCotThPhiM *transObj, MsgStream &msg) const override
Method creating the transient representation of P4ImplIPtCotThPhiM from its persistent representation...
Definition: P4ImplIPtCotThPhiMCnv_p1.cxx:26
ParticleBaseCnv_p1
Definition: ParticleBaseCnv_p1.h:30
P4ImplIPtCotThPhiMCnv_p1
Definition: P4ImplIPtCotThPhiMCnv_p1.h:38
Muon_p4::m_isAlsoFoundByLowPt
bool m_isAlsoFoundByLowPt
Definition: Muon_p4.h:120
Analysis::Muon::set_numberOfAssociatedEtaDigits
void set_numberOfAssociatedEtaDigits(int nMDT, int nCSC, int nRPC, int nTGC)
Set the LowPt stuff.
Definition: Muon.cxx:840
Muon_p4::m_allAuthors
uint16_t m_allAuthors
Definition: Muon_p4.h:130
Muon_p4::m_inDetTrackParticle
ElementLinkInt_p1 m_inDetTrackParticle
link to associated TrackParticle (Inner Detector)
Definition: Muon_p4.h:94
MuonParameters::annEndCap
@ annEndCap
Definition: MuonParamDefs.h:146
Muon_p4::m_associatedEtaDigits
std::vector< int > m_associatedEtaDigits
Low Pt muon stuff.
Definition: Muon_p4.h:89
MuonCnv_p4::persToTrans
virtual void persToTrans(const Muon_p4 *persObj, Analysis::Muon *transObj, MsgStream &msg) const override
Method creating the transient representation of Analysis::Muon from its persistent representation Muo...
Definition: MuonCnv_p4.cxx:45
MuonParameters::etcone10
@ etcone10
isolation enums - common parameters
Definition: MuonParamDefs.h:113
Muon.h
Analysis::Muon::set_numberOfAssociatedPhiDigits
void set_numberOfAssociatedPhiDigits(int nMDT, int nCSC, int nRPC, int nTGC)
Set the LowPt - Associated Phi Digits.
Definition: Muon.cxx:848
MuonParameters::ptcone30
@ ptcone30
Definition: MuonParamDefs.h:123
Muon_p4::m_caloEnergyLoss
ElementLinkInt_p1 m_caloEnergyLoss
energy loss in calorimeter
Definition: Muon_p4.h:124
Muon_p4::m_cluster
ElementLinkInt_p1 m_cluster
link to CaloCluster
Definition: Muon_p4.h:112
segmentLinkCnv_t
ElementLinkVectorCnv_p1< ElementLinkVector< Trk::SegmentCollection > > segmentLinkCnv_t
Definition: MuonCnv_p4.cxx:34
MuonParameters::etcone40
@ etcone40
Definition: MuonParamDefs.h:116
Muon_p4::m_isCorrected
bool m_isCorrected
Definition: Muon_p4.h:128
MuonParameters::ptcone10
@ ptcone10
Definition: MuonParamDefs.h:121
Muon_p4::m_muonSpectrometerTrackParticle
ElementLinkInt_p1 m_muonSpectrometerTrackParticle
link to associated TrackParticle (Muon Spectrometer)
Definition: Muon_p4.h:100
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
MuonParameters::segmentChi2OverDoF
@ segmentChi2OverDoF
Definition: MuonParamDefs.h:141
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
Muon_p4
Definition: Muon_p4.h:36
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Analysis::Muon::set_caloMuonAlsoFoundByMuonReco
void set_caloMuonAlsoFoundByMuonReco(const unsigned short isAlsoFoundByMuonReco)
set if this calo muon is also reconstructed by one of the standard muon recosntruction algorithms tha...
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:204
Muon_p4::m_matchChi2
double m_matchChi2
Chi2 of the track matching.
Definition: Muon_p4.h:86
Muon_p4::m_particleBase
ParticleBase_p1 m_particleBase
the ParticleBase part
Definition: Muon_p4.h:68
MuonCnv_p4::transToPers
virtual void transToPers(const Analysis::Muon *transObj, Muon_p4 *persObj, MsgStream &msg) const override
Method creating the persistent representation Muon_p1 from its transient representation Analysis::Muo...
Definition: MuonCnv_p4.cxx:166