35 return StatusCode::SUCCESS;
44 return StatusCode::RECOVERABLE;
52 return StatusCode::RECOVERABLE;
57 std::vector<const TrigMuonEFInfoTrack*> efinfotracks;
58 for(
const auto *infoit : *infocont) {
60 for(
const auto *trk : *trkcont) {
62 if(trk->hasCombinedTrack() || trk->hasExtrapolatedTrack()) {
64 efinfotracks.push_back(trk);
70 ATH_MSG_DEBUG(
"N(TrigMuonEFInfoTrack) = " << efinfotracks.size());
73 if(efinfotracks.size() != muoncont->
size()) {
76 return StatusCode::RECOVERABLE;
81 for(
unsigned int i=0; i<muoncont->
size(); ++i) {
88 return StatusCode::RECOVERABLE;
92 return StatusCode::RECOVERABLE;
103 return StatusCode::SUCCESS;
113 ATH_MSG_DEBUG(
"TrigMuonEFInfo track has no extrapolated track");
114 if(muon->muonSpectrometerTrackParticleLink().isValid() ) {
115 ATH_MSG_ERROR(
"Mismatch: TrigMuonEFInfoTrack has no ME track, xAOD::Muon does");
116 return StatusCode::RECOVERABLE;
119 return StatusCode::SUCCESS;
123 ATH_MSG_DEBUG(
"TrigMuonEFInfo track has extrapolated track");
124 if( !(muon->muonSpectrometerTrackParticleLink().isValid()) ) {
125 ATH_MSG_ERROR(
"Mismatch: TrigMuonEFInfoTrack has ME track, xAOD::Muon does not");
126 return StatusCode::RECOVERABLE;
132 if(
sc.isFailure())
return sc;
135 return StatusCode::SUCCESS;
145 if(muon->combinedTrackParticleLink().isValid() ) {
146 ATH_MSG_ERROR(
"Mismatch: TrigMuonEFInfoTrack has no combined track, xAOD::Muon does");
147 return StatusCode::RECOVERABLE;
150 return StatusCode::SUCCESS;
155 if( !(muon->combinedTrackParticleLink().isValid()) ) {
156 ATH_MSG_ERROR(
"Mismatch: TrigMuonEFInfoTrack has combined track, xAOD::Muon does not");
157 return StatusCode::RECOVERABLE;
163 if(
sc.isFailure())
return sc;
166 return StatusCode::SUCCESS;
181 if(primtrk!=
nullptr && muon->primaryTrackParticleLink().isValid()) {
182 StatusCode
sc =
compareTracks(primtrk, *(muon->primaryTrackParticleLink()));
183 if(
sc.isFailure())
return sc;
185 if(primtrk!=
nullptr || muon->primaryTrackParticleLink().isValid()) {
186 ATH_MSG_ERROR(
"One of the primary tracks is not good, old = " << (primtrk!=
nullptr) <<
", new = " << muon->primaryTrackParticleLink().isValid() );
187 return StatusCode::RECOVERABLE;
188 }
else return StatusCode::SUCCESS;
193 return StatusCode::SUCCESS;
199 if(
msgLvl(MSG::VERBOSE)) {
200 msg() << MSG::VERBOSE <<
"Compare Track:" <<
endmsg;
201 msg() << MSG::VERBOSE <<
"old track pt = " << eftrack->
pt() <<
", new track pt = " << xaodtrack->
pt() <<
endmsg;
202 msg() << MSG::VERBOSE <<
"old track eta = " << eftrack->
eta() <<
", new track eta = " << xaodtrack->
eta() <<
endmsg;
203 msg() << MSG::VERBOSE <<
"old track phi = " << eftrack->
phi() <<
", new track phi = " << xaodtrack->
phi() <<
endmsg;
205 const double dpt = std::abs(eftrack->
pt() - xaodtrack->
pt());
208 ATH_MSG_ERROR(
"pT of two tracks is different, old = " << std::fixed << std::setprecision(8) << eftrack->
pt() <<
", new = " << xaodtrack->
pt() <<
", dpt = " << dpt);
209 return StatusCode::RECOVERABLE;
213 ATH_MSG_ERROR(
"eta of two tracks is different, old = " << eftrack->
eta() <<
", new = " << xaodtrack->
eta());
214 return StatusCode::RECOVERABLE;
218 ATH_MSG_ERROR(
"phi of two tracks is different, old = " << eftrack->
phi() <<
", new = " << xaodtrack->
phi());
219 return StatusCode::RECOVERABLE;
222 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
static const double etaphicheckthres
static const double ptcheckthres
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
bool msgLvl(const MSG::Level lvl) const
size_type size() const noexcept
Returns the number of elements in the collection.
virtual double eta() const
pseudo rapidity
virtual double pt() const
transverse momentum
virtual double phi() const
get phi data member
StatusCode compareTracks(const TrigMuonEFTrack *eftrack, const xAOD::TrackParticle *xaodtrack)
compare tracks
std::string m_xaodMuonContainerName
The key for the xAOD::MuonContainer.
std::string m_aodContainerName
The key of the TrigMuonEFInfoContainer.
StatusCode comparePrimaryTracks(const TrigMuonEFInfoTrack *infotrk, const xAOD::Muon *muon)
compare primary tracks
virtual StatusCode initialize()
Function initialising the algorithm.
StatusCode compareExtrapolatedTracks(const TrigMuonEFInfoTrack *infotrk, const xAOD::Muon *muon)
compare extrapolated tracks
virtual StatusCode execute()
Function executing the algorithm.
TrigMuonEFInfoCnvTestAlg(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
StatusCode compareCombinedTracks(const TrigMuonEFInfoTrack *infotrk, const xAOD::Muon *muon)
compare combined tracks
TrigMuonEFCbTrack * CombinedTrack()
bool hasExtrapolatedTrack() const
bool hasCombinedTrack() const
TrigMuonEFTrack * ExtrapolatedTrack()
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version:
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".