13#include "AthLinks/ElementLink.h"
23 declareInterface<ITrigMuonEFInfoToMuonCnvTool>(
this);
35 else ATH_MSG_INFO(
"Will not make links to EF ID xAOD track particles");
38 return StatusCode::SUCCESS;
53 const int nmuin = muoncontainer.
size();
57 if( !infotrk->hasExtrapolatedTrack() && !infotrk->hasCombinedTrack() ){
58 ATH_MSG_WARNING(
"TrigMuonEFInfoTrack has no extrapolated or combined track, will not be converted to xAOD");
67 if(infotrk->hasExtrapolatedTrack()) {
70 if(extrapParticleContainer) extrapParticleContainer->
push_back( extrapTrackPart );
74 if(
sc.isFailure())
return sc;
77 if(extrapParticleContainer) {
79 muon->setTrackParticleLink( xAOD::Muon::MuonSpectrometerTrackParticle, link );
83 muon->setP4(extraptrk->
pt(),extraptrk->
eta(),extraptrk->
phi());
85 muon->addAllAuthor(xAOD::Muon::MuidSA);
86 muon->setAuthor(xAOD::Muon::MuidSA);
87 muon->setMuonType(xAOD::Muon::MuonStandAlone);
90 if(!extrapParticleContainer)
delete extraptrk;
94 if(infotrk->hasCombinedTrack()) {
97 if(combParticleContainer) combParticleContainer->
push_back( combinedTrackPart );
101 if(
sc.isFailure())
return sc;
104 if(combParticleContainer) {
106 muon->setTrackParticleLink( xAOD::Muon::CombinedTrackParticle, link );
110 muon->setP4(combtrk->
pt(),combtrk->
eta(),combtrk->
phi());
113 muon->addAllAuthor(xAOD::Muon::MuidCo);
114 muon->setAuthor(xAOD::Muon::MuidCo);
115 muon->setMuonType(xAOD::Muon::Combined);
117 muon->addAllAuthor(xAOD::Muon::MuGirl);
118 muon->setAuthor(xAOD::Muon::MuGirl);
120 muon->setMuonType(xAOD::Muon::Combined);
137 else ATH_MSG_WARNING(
"Created an invalid element link to ID xAOD track particle");
139 }
else ATH_MSG_WARNING(
"TrigMuonEFCbTrack with invalid element link to ID track - cannot create link for xAOD muon");
143 if(!combParticleContainer)
delete combinedTrackPart;
149 ATH_MSG_DEBUG(
"Conversion finished, n(muons) added to xAOD container = " << muoncontainer.
size()-nmuin);
151 return StatusCode::SUCCESS;
161 for(
const auto *efinfo : efinfocont) {
162 StatusCode
sc =
convertTrigMuonEFInfo( *efinfo, muoncontainer, combParticleContainer, extrapParticleContainer );
163 if(
sc.isFailure())
return sc;
166 return StatusCode::SUCCESS;
175 if( std::abs(eftrack.
p()) < p ) {
176 ATH_MSG_WARNING(
"TrigMuonEFTrack has p close to zero = " << eftrack.
p() <<
"set to " << p);
178 p = std::abs(eftrack.
p());
180 const double qoverp =
charge / p;
197 return StatusCode::SUCCESS;
Scalar theta() const
theta method
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
double charge(const T &p)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
ElementLink implementation for ROOT usage.
const ID_type & dataID() const
Get the key that we reference, as a string.
void resetWithKeyAndIndex(const ID_type &dataID, index_type elemID, IProxyDict *sg=0)
Set the link to an element given by string key and index.
index_type index() const
Get the index of the element inside of its container.
bool isValid() const
Test to see if the link can be dereferenced.
virtual double eta() const
pseudo rapidity
virtual double p() const
momentum magnitude
virtual double pt() const
transverse momentum
virtual double tanTh() const
tan theta
virtual double phi() const
get phi data member
void makePrivateStore()
Create a new (empty) private store for this object.
const ElementLink< Rec::TrackParticleContainer > & getIDTrackParticleLink() const
static const int MuonTypeEFMuon
const TrigMuonEFInfoTrackContainer * TrackContainer() const
void setParametersOrigin(float x, float y, float z)
Set the origin for the parameters.
void setDefiningParameters(float d0, float z0, float phi0, float theta, float qOverP)
Set the defining parameters.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Muon_v1 Muon
Reference the current persistent version:
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".