ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCnv_p6.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_p6.cxx
8// Implementation file for class MuonCnv_p6
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_p6.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
89 ElementLink<Rec::TrackParticleContainer> statCombinedTrackLink;
90 trackCnv.persToTrans( &pers->m_statCombinedMuonTrackParticle,
91 &statCombinedTrackLink,
92 msg );
93 trans->setStatCombinedTrackLink (statCombinedTrackLink);
94
96 clusterCnv.persToTrans( &pers->m_cluster,
97 &clusterLink,
98 msg );
99 trans->setClusterLink (clusterLink);
100
102 segmentCnv.persToTrans( &pers->m_muonSegments,
103 &muonSegmentLink,
104 msg );
105 trans->setMuonSegmentLink (muonSegmentLink);
106
108 caloEnergyCnv.persToTrans( &pers->m_caloEnergyLoss,
109 &caloEnergyLink,
110 msg );
111 trans->setCaloEnergyLink (caloEnergyLink);
112
113 // muon parameters
114 const std::vector<float>& params = pers->m_parameters;
115 trans->set_parameter(MuonParameters::etcone10, params[ 0] );
116 trans->set_parameter(MuonParameters::etcone20, params[ 1] );
117 trans->set_parameter(MuonParameters::etcone30, params[ 2] );
118 trans->set_parameter(MuonParameters::etcone40, params[ 3] );
119
120 trans->set_parameter(MuonParameters::nucone10, params[ 4] );
121 trans->set_parameter(MuonParameters::nucone20, params[ 5] );
122 trans->set_parameter(MuonParameters::nucone30, params[ 6] );
123 trans->set_parameter(MuonParameters::nucone40, params[ 7] );
124
125 trans->set_parameter(MuonParameters::ptcone10, params[ 8] );
126 trans->set_parameter(MuonParameters::ptcone20, params[ 9] );
127 trans->set_parameter(MuonParameters::ptcone30, params[10] );
128 trans->set_parameter(MuonParameters::ptcone40, params[11] );
129
133 trans->set_parameter(MuonParameters::annBarrel, params[15] );
134 trans->set_parameter(MuonParameters::annEndCap, params[16] );
135 trans->set_parameter(MuonParameters::innAngle, params[17] );
136 trans->set_parameter(MuonParameters::midAngle, params[18] );
137
138 trans->set_parameter(MuonParameters::t0, params[19] );
139 trans->set_parameter(MuonParameters::beta, params[20] );
140 if (params.size() >= 24) {
144 if (params.size() >= 25) {
145 trans->set_parameter(MuonParameters::momentumBalanceSignificance, params[24] ); // added muonEvent-05-05-26
146 trans->set_parameter(MuonParameters::etconeNoEm10, params[ 25] ); // added muonEvent-05-05-30
147 trans->set_parameter(MuonParameters::etconeNoEm20, params[ 26] );
148 trans->set_parameter(MuonParameters::etconeNoEm30, params[ 27] );
149 trans->set_parameter(MuonParameters::etconeNoEm40, params[ 28] );
150 }
151 }
152
153 // author
154 trans->set_author (static_cast<MuonParameters::Author>(pers->m_author));
155
156 // chi2 of the track matching
157 trans->set_matchChi2 (pers->m_matchChi2);
158
159 // Low Pt muon stuff
162
163 trans->set_bestMatch (pers->m_bestMatch);
165
166 double outerMatchChi2PerNdof = (double) trans->parameter(MuonParameters::segmentChi2OverDoF);
167 if (pers->m_outerMatchNumberDoF == 0 &&
168 outerMatchChi2PerNdof>0)
169 {
170 int segmentMatchNdof = 4;
171 double chi2 = segmentMatchNdof * outerMatchChi2PerNdof;
172 trans->set_outerMatchChi2 (chi2, segmentMatchNdof);
173 trans->set_outerMatchChi2 (0, 0);
174 trans->set_parameter(MuonParameters::segmentChi2OverDoF, outerMatchChi2PerNdof);
175 }
176 else {
177 double chi2 = pers->m_outerMatchNumberDoF * outerMatchChi2PerNdof;
179 }
180
181 // this muon is also found by the lowPT reconstruction algorithm
183
184 // this muon is also found by the Calo Muon ID reconstruction algorithm
186
189
190 trans->set_isCorrected (pers->m_isCorrected);
191
192 trans->set_allAuthors (pers->m_allAuthors);
193 trans->set_isMuonBits ( pers->m_isMuonBits );
195
196// msg << MSG::DEBUG << "Loaded Muon from persistent state [OK]"
197// << endmsg;
198
199 return;
200}
201
203 Muon_p6* pers,
204 MsgStream& msg ) const
205{
206// msg << MSG::DEBUG << "Creating persistent state of Muon..."
207// << endmsg;
208
209 // base classes
210 momCnv.transToPers ( &trans->momentumBase(), &pers->m_momentum, msg );
211 partBaseCnv.transToPers( &trans->particleBase(), &pers->m_particleBase, msg );
212
213 // element links
214 trackCnv.transToPers( &trans->inDetTrackLink(),
216 msg );
217 trackCnv.transToPers( &trans->muonSpectrometerTrackLink(),
219 msg );
220 trackCnv.transToPers( &trans->muonExtrapTrackLink(),
222 msg );
223 trackCnv.transToPers( &trans->innerExtrapTrackLink(),
225 msg );
226 trackCnv.transToPers( &trans->combinedTrackLink(),
228 msg );
229 trackCnv.transToPers( &trans->statCombinedTrackLink(),
231 msg );
232
233 clusterCnv.transToPers( &trans->clusterLink(),
234 &pers->m_cluster,
235 msg );
236
237 segmentCnv.transToPers( &trans->muonSegmentLink(),
238 &pers->m_muonSegments,
239 msg );
240
242 caloEnergyCnv.transToPers( &trans->caloEnergyLink(),
243 &pers ->m_caloEnergyLoss,
244 msg );
245
246 // muon parameters
247 std::vector<float>& params = pers->m_parameters;
248 params.resize( 29 );
249 params[ 0] = trans->parameter(MuonParameters::etcone10);
250 params[ 1] = trans->parameter(MuonParameters::etcone20);
251 params[ 2] = trans->parameter(MuonParameters::etcone30);
252 params[ 3] = trans->parameter(MuonParameters::etcone40);
253
254 params[ 4] = trans->parameter(MuonParameters::nucone10);
255 params[ 5] = trans->parameter(MuonParameters::nucone20);
256 params[ 6] = trans->parameter(MuonParameters::nucone30);
257 params[ 7] = trans->parameter(MuonParameters::nucone40);
258
259 params[ 8] = trans->parameter(MuonParameters::ptcone10);
260 params[ 9] = trans->parameter(MuonParameters::ptcone20);
261 params[10] = trans->parameter(MuonParameters::ptcone30);
262 params[11] = trans->parameter(MuonParameters::ptcone40);
263
264 params[12] = trans->parameter(MuonParameters::segmentDeltaEta);
265 params[13] = trans->parameter(MuonParameters::segmentDeltaPhi);
267 params[15] = trans->parameter(MuonParameters::annBarrel);
268 params[16] = trans->parameter(MuonParameters::annEndCap);
269 params[17] = trans->parameter(MuonParameters::innAngle);
270 params[18] = trans->parameter(MuonParameters::midAngle);
271
272 params[19] = trans->parameter(MuonParameters::t0);
273 params[20] = trans->parameter(MuonParameters::beta);
278
279 params[25] = trans->parameter(MuonParameters::etconeNoEm10);
280 params[26] = trans->parameter(MuonParameters::etconeNoEm20);
281 params[27] = trans->parameter(MuonParameters::etconeNoEm30);
282 params[28] = trans->parameter(MuonParameters::etconeNoEm40);
283
284 pers->m_author = trans->author();
285
286 // needed ? most probably...
287 pers->m_hasCombinedMuon = false;
288 pers->m_hasInDetTrackParticle = false;
292
293 // not used
294 pers->m_hasCluster = false;
295
296 // chi2 of the track matching
297 pers->m_matchChi2 = trans->matchChi2();
298
299 // Low Pt muon stuff
302 //
303
304 pers->m_bestMatch = trans->bestMatch();
305 pers->m_matchNumberDoF = trans->matchNumberDoF();
307
309 pers->m_isAlsoFoundByLowPt = trans->alsoFoundByLowPt();
310
313
316
317 pers->m_isCorrected = trans->isCorrected();
318
319 pers->m_allAuthors = trans->allAuthors();
320
321 pers->m_isMuonBits = trans->isMuon().qualityWord();
322
323 pers->m_isMuonLikelihood = trans->isMuonLikelihood();
324
325// msg << MSG::DEBUG << "Created persistent state of Muon [OK]"
326// << endmsg;
327 return;
328}
This file contains the class definition for the ElementLinkCnv_p3 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 setStatCombinedTrackLink(const ElementLink< Rec::TrackParticleContainer > &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...
void set_outerMatchChi2(double x, int ndof)
set the outer match chi2/ndof for combined and segment-tagged muons
Definition Muon.cxx:497
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
const ElementLink< Rec::TrackParticleContainer > & statCombinedTrackLink() const
Access to the smart pointer to the muon combined track.
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 persToTrans(const Muon_p6 *persObj, Analysis::Muon *transObj, MsgStream &msg) const override
Method creating the transient representation of Analysis::Muon from its persistent representation Muo...
virtual void transToPers(const Analysis::Muon *transObj, Muon_p6 *persObj, MsgStream &msg) const override
Method creating the persistent representation Muon_p1 from its transient representation Analysis::Muo...
uint16_t qualityWord() const
get back the quality word
bool m_hasCluster
Definition Muon_p6.h:79
bool m_bestMatch
Definition Muon_p6.h:113
float m_matchChi2
Chi2 of the track matching.
Definition Muon_p6.h:82
bool m_isCorrected
Definition Muon_p6.h:124
ElementLinkInt_p3 m_muonSpectrometerTrackParticle
link to associated TrackParticle (Muon Spectrometer)
Definition Muon_p6.h:96
ElementLinkInt_p3 m_innerExtrapolatedTrackParticle
link to associated TrackParticle (Inner extrapolated)
Definition Muon_p6.h:102
ElementLinkInt_p3 m_inDetTrackParticle
link to associated TrackParticle (Inner Detector)
Definition Muon_p6.h:90
float m_isMuonLikelihood
Definition Muon_p6.h:128
bool m_hasMuonExtrapolatedTrackParticle
Definition Muon_p6.h:74
ElementLinkInt_p3 m_combinedMuonTrackParticle
links to associated TrackParticle (Combined muon)
Definition Muon_p6.h:105
bool m_hasInDetTrackParticle
Definition Muon_p6.h:73
unsigned int m_author
author
Definition Muon_p6.h:69
P4IPtCotThPhiM_p1 m_momentum
the 4-mom part
Definition Muon_p6.h:61
bool m_hasInnerExtrapolatedTrackParticle
Definition Muon_p6.h:75
ElementLinkInt_p3 m_muonExtrapolatedTrackParticle
link to associated TrackParticle (Muon extrapolated)
Definition Muon_p6.h:99
unsigned short m_caloMuonAlsoFoundByMuonReco
Definition Muon_p6.h:122
int m_outerMatchNumberDoF
Definition Muon_p6.h:130
uint16_t m_allAuthors
Definition Muon_p6.h:126
int m_matchNumberDoF
Definition Muon_p6.h:114
bool m_hasCombinedMuonTrackParticle
Definition Muon_p6.h:76
bool m_isAlsoFoundByCaloMuonId
Definition Muon_p6.h:117
bool m_isAlsoFoundByLowPt
Definition Muon_p6.h:116
ElementLinkIntVector_p1 m_muonSegments
link to the Trk::Segment
Definition Muon_p6.h:93
uint16_t m_isMuonBits
Definition Muon_p6.h:127
ElementLinkInt_p3 m_statCombinedMuonTrackParticle
links to associated TrackParticle (statistically combined muon)
Definition Muon_p6.h:133
std::vector< int > m_associatedPhiDigits
Definition Muon_p6.h:86
std::vector< float > m_parameters
muon parameters
Definition Muon_p6.h:111
std::vector< int > m_associatedEtaDigits
Low Pt muon stuff.
Definition Muon_p6.h:85
bool m_hasCombinedMuon
switches
Definition Muon_p6.h:72
ParticleBase_p2 m_particleBase
the ParticleBase part
Definition Muon_p6.h:64
ElementLinkInt_p3 m_caloEnergyLoss
energy loss in calorimeter
Definition Muon_p6.h:120
ElementLinkInt_p3 m_cluster
link to CaloCluster
Definition Muon_p6.h:108
const momentum_type & momentumBase() const
access to underlying base type (I4Momentum-like)
const particle_type & particleBase() const
access to underlying base type (IParticle-like)
double chi2(TH1 *h0, TH1 *h1)
@ spectrometerFieldIntegral
Discriminators and further variables.
@ innAngle
common MuGirl and MuTag parameters
@ scatteringNeighbourSignificance
@ scatteringCurvatureSignificance
@ 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