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 );
71 else extrapTrackPart->makePrivateStore();
74 if(
sc.isFailure())
return sc;
77 if(extrapParticleContainer) {
79 muon->setTrackParticleLink( xAOD::Muon::TrackParticleType::MuonSpectrometerTrackParticle, link );
83 muon->setP4(extraptrk->
pt(),extraptrk->
eta(),extraptrk->
phi());
85 muon->addAllAuthor(xAOD::Muon::Author::MuidSA);
86 muon->setAuthor(xAOD::Muon::Author::MuidSA);
87 muon->setMuonType(xAOD::Muon::MuonType::MuonStandAlone);
90 if(!extrapParticleContainer)
delete extraptrk;
94 if(infotrk->hasCombinedTrack()) {
97 if(combParticleContainer) combParticleContainer->
push_back( combinedTrackPart );
98 else combinedTrackPart->makePrivateStore();
101 if(
sc.isFailure())
return sc;
104 if(combParticleContainer) {
106 muon->setTrackParticleLink( xAOD::Muon::TrackParticleType::CombinedTrackParticle, link );
110 muon->setP4(combtrk->
pt(),combtrk->
eta(),combtrk->
phi());
113 muon->addAllAuthor(xAOD::Muon::Author::MuidCo);
114 muon->setAuthor(xAOD::Muon::Author::MuidCo);
115 muon->setMuonType(xAOD::Muon::MuonType::Combined);
117 muon->addAllAuthor(xAOD::Muon::Author::MuGirl);
118 muon->setAuthor(xAOD::Muon::Author::MuGirl);
120 muon->setMuonType(xAOD::Muon::MuonType::Combined);
135 else ATH_MSG_WARNING(
"Created an invalid element link to ID xAOD track particle");
137 }
else ATH_MSG_WARNING(
"TrigMuonEFCbTrack with invalid element link to ID track - cannot create link for xAOD muon");
141 if(!combParticleContainer)
delete combinedTrackPart;
147 ATH_MSG_DEBUG(
"Conversion finished, n(muons) added to xAOD container = " << muoncontainer.
size()-nmuin);
149 return StatusCode::SUCCESS;
159 for(
const auto *efinfo : efinfocont) {
160 StatusCode
sc =
convertTrigMuonEFInfo( *efinfo, muoncontainer, combParticleContainer, extrapParticleContainer );
161 if(
sc.isFailure())
return sc;
164 return StatusCode::SUCCESS;
173 if( std::abs(eftrack.
p()) < p ) {
174 ATH_MSG_WARNING(
"TrigMuonEFTrack has p close to zero = " << eftrack.
p() <<
"set to " << p);
176 p = std::abs(eftrack.
p());
178 const double qoverp =
charge / p;
195 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.
index_type index() const
Get the index of the element inside of its container.
void resetWithKeyAndIndex(const ID_type &key, index_type index, xAOD::TVirtualEvent *event=0)
Reset with storable key and element index (fast).
bool isValid() const
Check if the element can be found.
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
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".