ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCnv_p5.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// MuonCnv_p5.cxx
8// Implementation file for class MuonCnv_p5
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_p5.h"
30
35
36// pre-allocate converters
43
44
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;
64 trackCnv.persToTrans( &pers->m_muonSpectrometerTrackParticle,
65 &muonSpectrometerTrackLink,
66 msg );
67 trans->setMuonSpectrometerTrackLink (muonSpectrometerTrackLink);
68
70 trackCnv.persToTrans( &pers->m_muonExtrapolatedTrackParticle,
71 &muonExtrapTrackLink,
72 msg );
73 trans->setMuonExtrapTrackLink (muonExtrapTrackLink,
75
78 &innerExtrapTrackLink,
79 msg );
80 trans->setInnerExtrapTrackLink (innerExtrapTrackLink);
81
83 trackCnv.persToTrans( &pers->m_combinedMuonTrackParticle,
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;
109 trans->set_parameter(MuonParameters::etcone10, params[ 0] );
110 trans->set_parameter(MuonParameters::etcone20, params[ 1] );
111 trans->set_parameter(MuonParameters::etcone30, params[ 2] );
112 trans->set_parameter(MuonParameters::etcone40, params[ 3] );
113
114 trans->set_parameter(MuonParameters::nucone10, params[ 4] );
115 trans->set_parameter(MuonParameters::nucone20, params[ 5] );
116 trans->set_parameter(MuonParameters::nucone30, params[ 6] );
117 trans->set_parameter(MuonParameters::nucone40, params[ 7] );
118
119 trans->set_parameter(MuonParameters::ptcone10, params[ 8] );
120 trans->set_parameter(MuonParameters::ptcone20, params[ 9] );
121 trans->set_parameter(MuonParameters::ptcone30, params[10] );
122 trans->set_parameter(MuonParameters::ptcone40, params[11] );
123
127 trans->set_parameter(MuonParameters::annBarrel, params[15] );
128 trans->set_parameter(MuonParameters::annEndCap, params[16] );
129 trans->set_parameter(MuonParameters::innAngle, params[17] );
130 trans->set_parameter(MuonParameters::midAngle, params[18] );
131
132 trans->set_parameter(MuonParameters::t0, params[19] );
133 trans->set_parameter(MuonParameters::beta, params[20] );
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);
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 trans->set_isMuonBits ( pers->m_isMuonBits );
162
163// msg << MSG::DEBUG << "Loaded Muon from persistent state [OK]"
164// << endmsg;
165
166 return;
167}
168
170 Muon_p5* pers,
171 MsgStream& msg ) const
172{
173// msg << MSG::DEBUG << "Creating persistent state of Muon..."
174// << endmsg;
175
176 // base classes
177 momCnv.transToPers ( &trans->momentumBase(), &pers->m_momentum, msg );
178 partBaseCnv.transToPers( &trans->particleBase(), &pers->m_particleBase, msg );
179
180 // element links
181 trackCnv.transToPers( &trans->inDetTrackLink(),
183 msg );
184 trackCnv.transToPers( &trans->muonSpectrometerTrackLink(),
186 msg );
187 trackCnv.transToPers( &trans->muonExtrapTrackLink(),
189 msg );
190 trackCnv.transToPers( &trans->innerExtrapTrackLink(),
192 msg );
193 trackCnv.transToPers( &trans->combinedTrackLink(),
195 msg );
196
197 clusterCnv.transToPers( &trans->clusterLink(),
198 &pers->m_cluster,
199 msg );
200
201 segmentCnv.transToPers( &trans->muonSegmentLink(),
202 &pers->m_muonSegments,
203 msg );
204
206 caloEnergyCnv.transToPers( &trans->caloEnergyLink(),
207 &pers ->m_caloEnergyLoss,
208 msg );
209
210 // muon parameters
211 std::vector<float>& params = pers->m_parameters;
212 params.resize( 21 );
213 params[ 0] = trans->parameter(MuonParameters::etcone10);
214 params[ 1] = trans->parameter(MuonParameters::etcone20);
215 params[ 2] = trans->parameter(MuonParameters::etcone30);
216 params[ 3] = trans->parameter(MuonParameters::etcone40);
217
218 params[ 4] = trans->parameter(MuonParameters::nucone10);
219 params[ 5] = trans->parameter(MuonParameters::nucone20);
220 params[ 6] = trans->parameter(MuonParameters::nucone30);
221 params[ 7] = trans->parameter(MuonParameters::nucone40);
222
223 params[ 8] = trans->parameter(MuonParameters::ptcone10);
224 params[ 9] = trans->parameter(MuonParameters::ptcone20);
225 params[10] = trans->parameter(MuonParameters::ptcone30);
226 params[11] = trans->parameter(MuonParameters::ptcone40);
227
228 params[12] = trans->parameter(MuonParameters::segmentDeltaEta);
229 params[13] = trans->parameter(MuonParameters::segmentDeltaPhi);
231 params[15] = trans->parameter(MuonParameters::annBarrel);
232 params[16] = trans->parameter(MuonParameters::annEndCap);
233 params[17] = trans->parameter(MuonParameters::innAngle);
234 params[18] = trans->parameter(MuonParameters::midAngle);
235
236 params[19] = trans->parameter(MuonParameters::t0);
237 params[20] = trans->parameter(MuonParameters::beta);
238
239 pers->m_author = trans->author();
240
241 // needed ? most probably...
242 pers->m_hasCombinedMuon = false;
243 pers->m_hasInDetTrackParticle = false;
247
248 // not used
249 pers->m_hasCluster = false;
250
251 // chi2 of the track matching
252 pers->m_matchChi2 = trans->matchChi2();
253
254 // Low Pt muon stuff
257 //
258
259 pers->m_bestMatch = trans->bestMatch();
260 pers->m_matchNumberDoF = trans->matchNumberDoF();
261
263 pers->m_isAlsoFoundByLowPt = trans->alsoFoundByLowPt();
264
267
270
271 pers->m_isCorrected = trans->isCorrected();
272
273 pers->m_allAuthors = trans->allAuthors();
274
275 pers->m_isMuonBits = trans->isMuon().qualityWord();
276
277 pers->m_isMuonLikelihood = trans->isMuonLikelihood();
278
279// msg << MSG::DEBUG << "Created persistent state of Muon [OK]"
280// << endmsg;
281 return;
282}
This file contains the class definition for the ElementLinkCnv_p1 class.
This file contains the class definition for the ElementLinkVectorCnv_p1 class.
static const P4ImplPxPyPzECnv_p1 momCnv
Definition JetCnv_p1.cxx:30
static const TrackLinkCnv_t trackCnv
ElementLinkCnv_p1< ElementLink< CaloClusterContainer > > ClusterLinkCnv_t
ElementLinkCnv_p1< ElementLink< Rec::TrackParticleContainer > > TrackLinkCnv_t
static const ClusterLinkCnv_t clusterCnv
ElementLinkVectorCnv_p1< ElementLinkVector< Trk::SegmentCollection > > segmentLinkCnv_t
static const segmentLinkCnv_t segmentCnv
static const caloEnergyLinkCnv_t caloEnergyCnv
ElementLinkCnv_p1< ElementLink< MuonCaloEnergyContainer > > caloEnergyLinkCnv_t
static const ParticleBaseCnv_p1 partBaseCnv
The ATLAS Muon object - see doxygen, physics workbookd and the Muon Combined Performance WG's pages f...
const ElementLink< MuonCaloEnergyContainer > & caloEnergyLink() const
Access to the smart pointer to the calorimeter energy loss objeect associated to the muon.
bool alsoFoundByCaloMuonId() const
is this muon also reconstructed by a CaloMuon ID algorithm?
unsigned short caloMuonAlsoFoundByMuonReco() const
is this Calo Muon also reconstructed by one of the standard muon reconstruction algorithm?
MuonParameters::Author author() const
return the primary author of this Muon - the algorithm that is most likely to reconstruct prompt muon...
void set_matchNumberDoF(int x)
set the chi2 parameters - number of degrees of freedom
const ElementLink< CaloClusterContainer > & clusterLink() const
const ElementLink< Rec::TrackParticleContainer > & innerExtrapTrackLink() const
Access to the smart pointer to the muon track extrapolated out from the vertex.
void set_isMuonBits(const uint16_t isMuonBits)
set muon quality parameters
void set_isAlsoFoundByCaloMuonId(const bool isAlsoSeenByCaloMuonId)
set is also seen by calo muon Id reconstruction
void setMuonSpectrometerTrackLink(const ElementLink< Rec::TrackParticleContainer > &l)
void set_parameter(MuonParameters::ParamDef index, double value, bool overwrite=false)
set a parameter in the MuonParamDefs.h
Definition Muon.cxx:888
const ElementLink< Rec::TrackParticleContainer > & muonExtrapTrackLink() const
Access to the smart pointer to the muon track extrapolated to the vertex.
const ElementLink< Rec::TrackParticleContainer > & inDetTrackLink() const
Access to the smart pointer to inner detector track.
void setCaloEnergyLink(const ElementLink< MuonCaloEnergyContainer > &l)
void set_caloMuonAlsoFoundByMuonReco(const unsigned short isAlsoFoundByMuonReco)
set if this calo muon is also reconstructed by one of the standard muon recosntruction algorithms tha...
void set_isCorrected(bool corrected)
is this Muon corrected in AOD-to-AOD correction or not?
void set_isAlsoFoundByLowPt(const bool isAlsoSeenByLowPt)
set is also seen by low Pt reconstruction
double parameter(MuonParameters::ParamDef x) const
get a parameter for this Muon - isolation energy in some cone for example
Definition Muon.cxx:485
const ElementLink< Rec::TrackParticleContainer > & muonSpectrometerTrackLink() const
Access to the smart pointer to the muon spectrometer track.
void set_numberOfAssociatedPhiDigits(int nMDT, int nCSC, int nRPC, int nTGC)
Set the LowPt - Associated Phi Digits.
Definition Muon.cxx:848
bool alsoFoundByLowPt() const
is this muon also reconstructed by the lowPt algorithm?
bool isCorrected() const
is this Muon corrected or not in AOD-to-AOD correction
const ElementLink< Rec::TrackParticleContainer > & combinedTrackLink() const
Access to the smart pointer to the muon combined track.
bool bestMatch() const
Is this combined Muon the best match?
void setInnerExtrapTrackLink(const ElementLink< Rec::TrackParticleContainer > &l)
void setClusterLink(const ElementLink< CaloClusterContainer > &l)
uint16_t allAuthors() const
get all the authors of this Muon for example during overlap checking, the same Muon may have been rec...
const MuonQualityWord & isMuon() const
access to muon quality information the user must take care to delete the pointer the Muon does not ow...
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 ...
void set_numberOfAssociatedEtaDigits(int nMDT, int nCSC, int nRPC, int nTGC)
Set the LowPt stuff.
Definition Muon.cxx:840
double matchChi2() const
get the chi2 of the MS-ID track match at the perigee
void setMuonExtrapTrackLink(const ElementLink< Rec::TrackParticleContainer > &l, bool isValid)
void set_author(MuonParameters::Author author)
set the primary Author : the primary author is the algorithm that first created this Muon
float isMuonLikelihood() const
return the muon likelihood - not yet used
void setCombinedTrackLink(const ElementLink< Rec::TrackParticleContainer > &l, bool isValid)
const std::vector< int > & associatedPhiDigits() const
Access to the MS phi hits associated by segment-tagged muons.
void setMuonSegmentLink(const ElementLinkVector< Trk::SegmentCollection > &l)
int matchNumberDoF() const
get the number of DoF of the track match at perigee
const ElementLinkVector< Trk::SegmentCollection > & muonSegmentLink() const
Access to vector smart pointers (ElementLink) to muon segments.
void setInDetTrackLink(const ElementLink< Rec::TrackParticleContainer > &l)
const std::vector< int > & associatedEtaDigits() const
Access to the MS eta hits associated by segment-tagged muons.
void set_matchChi2(float x)
set the chi2 parameters - matchChi2
ElementLinkVector implementation for standalone ROOT.
virtual void transToPers(const Analysis::Muon *transObj, Muon_p5 *persObj, MsgStream &msg) const override
Method creating the persistent representation Muon_p1 from its transient representation Analysis::Muo...
virtual void persToTrans(const Muon_p5 *persObj, Analysis::Muon *transObj, MsgStream &msg) const override
Method creating the transient representation of Analysis::Muon from its persistent representation Muo...
uint16_t qualityWord() const
get back the quality word
unsigned int m_author
author
Definition Muon_p5.h:87
bool m_hasInnerExtrapolatedTrackParticle
Definition Muon_p5.h:93
std::vector< float > m_parameters
muon parameters
Definition Muon_p5.h:129
float m_matchChi2
Chi2 of the track matching.
Definition Muon_p5.h:100
ElementLinkInt_p1 m_muonExtrapolatedTrackParticle
link to associated TrackParticle (Muon extrapolated)
Definition Muon_p5.h:117
ElementLinkIntVector_p1 m_muonSegments
link to the Trk::Segment
Definition Muon_p5.h:111
int m_matchNumberDoF
Definition Muon_p5.h:132
bool m_isCorrected
Definition Muon_p5.h:142
ElementLinkInt_p1 m_muonSpectrometerTrackParticle
link to associated TrackParticle (Muon Spectrometer)
Definition Muon_p5.h:114
bool m_hasCluster
Definition Muon_p5.h:97
uint16_t m_isMuonBits
Definition Muon_p5.h:145
bool m_hasInDetTrackParticle
Definition Muon_p5.h:91
bool m_bestMatch
Definition Muon_p5.h:131
ParticleBase_p1 m_particleBase
the ParticleBase part
Definition Muon_p5.h:82
ElementLinkInt_p1 m_caloEnergyLoss
energy loss in calorimeter
Definition Muon_p5.h:138
bool m_hasCombinedMuonTrackParticle
Definition Muon_p5.h:94
ElementLinkInt_p1 m_inDetTrackParticle
link to associated TrackParticle (Inner Detector)
Definition Muon_p5.h:108
uint16_t m_allAuthors
Definition Muon_p5.h:144
bool m_isAlsoFoundByCaloMuonId
Definition Muon_p5.h:135
std::vector< int > m_associatedPhiDigits
Definition Muon_p5.h:104
std::vector< int > m_associatedEtaDigits
Low Pt muon stuff.
Definition Muon_p5.h:103
ElementLinkInt_p1 m_cluster
link to CaloCluster
Definition Muon_p5.h:126
ElementLinkInt_p1 m_combinedMuonTrackParticle
links to associated TrackParticle (Combined muon)
Definition Muon_p5.h:123
unsigned short m_caloMuonAlsoFoundByMuonReco
Definition Muon_p5.h:140
ElementLinkInt_p1 m_innerExtrapolatedTrackParticle
link to associated TrackParticle (Inner extrapolated)
Definition Muon_p5.h:120
float m_isMuonLikelihood
Definition Muon_p5.h:146
bool m_hasMuonExtrapolatedTrackParticle
Definition Muon_p5.h:92
P4IPtCotThPhiM_p1 m_momentum
the 4-mom part
Definition Muon_p5.h:79
bool m_hasCombinedMuon
switches
Definition Muon_p5.h:90
bool m_isAlsoFoundByLowPt
Definition Muon_p5.h:134
const momentum_type & momentumBase() const
access to underlying base type (I4Momentum-like)
const particle_type & particleBase() const
access to underlying base type (IParticle-like)
@ innAngle
common MuGirl and MuTag parameters
@ t0
MuGirl parameter.
@ segmentDeltaEta
MuTag parameters.
@ etcone10
isolation enums - common parameters
Author
do not change the order of these enums.
MsgStream & msg
Definition testRead.cxx:32