Commit 6d6109f9 authored by Scott Snyder's avatar Scott Snyder Committed by Graeme Stewart
Browse files

Avoid some FP divisions by constants and inside loops. (MuidTrackBuilder-03-01-11)

        * Tagging MuidTrackBuilder-03-01-11.
	* Avoid some FP divisions by constants and inside loops.
        * Tagging MuidTrackBuilder-03-01-10.
	* Fix gcc6 indentation warning.

2016-08-31 Peter Kluit
        * fix muons with no AEOTs as reported in ATLASRECTS-3433
        * running always the AligmentErrorTool (and keeping the AEOTs)
        * Tagging as MuidTrackBuilder-03-01-09

2016-08-23 Jochen Meyer
	* endreq -> endmsg; fixing compiler warnings
	* Tagging as MuidTrackBuilder-03-01-08

2016-07-18 Peter Kluit
        * fix for Tier0 JIRA ATLASRECTS-3232
        * CombinedMuonTrackBuilder.cxx and .h
        * introduce a check on the track after fitting
        * checkTrack() method introduced
...
(Long ChangeLog diff - truncated)
parent f84df140
......@@ -16,6 +16,7 @@ atlas_depends_on_subdirs( PUBLIC
Tracking/TrkEvent/TrkParameters
Tracking/TrkEvent/TrkTrack
PRIVATE
Control/AthenaKernel
InnerDetector/InDetRecEvent/InDetRIO_OnTrack
MagneticField/MagFieldInterfaces
MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry
......
......@@ -222,7 +222,8 @@ namespace Rec
const Trk::RecVertex* vertex) const;
void dumpCaloEloss(const Trk::Track* track, std::string txt ) const;
void countAEOTs(const Trk::Track* track, std::string txt ) const;
int countAEOTs(const Trk::Track* track, std::string txt ) const;
bool checkTrack(std::string txt, Trk::Track* newTrack, Trk::Track* track) const;
// helpers, managers, tools
ToolHandle<Rec::IMuidCaloEnergy> m_caloEnergyParam;
......
......@@ -4,6 +4,7 @@ author Alan Poppleton <Alan.Poppleton@cern.ch>
private
use AtlasCLHEP AtlasCLHEP-* External
use AthenaKernel AthenaKernel-* Control
use InDetRIO_OnTrack InDetRIO_OnTrack-* InnerDetector/InDetRecEvent
use MuonCombinedToolInterfaces MuonCombinedToolInterfaces-* Reconstruction/MuonIdentification
use MuonCompetingRIOsOnTrack MuonCompetingRIOsOnTrack-* \
......
......@@ -10,11 +10,13 @@
#include <cmath>
#include <iomanip>
#include "CLHEP/GenericFunctions/CumulativeChiSquare.hh"
#include "GaudiKernel/SystemOfUnits.h"
#include "MuidInterfaces/IMuonTrackQuery.h"
#include "MuidTrackBuilder/MuonMatchQuality.h"
#include "MuonCombinedToolInterfaces/IMuonTrackTagTool.h"
#include "TrkTrack/Track.h"
#include "AthenaKernel/Units.h"
namespace Units = Athena::Units;
namespace Rec
{
......@@ -27,7 +29,7 @@ MuonMatchQuality::MuonMatchQuality (const std::string& type,
m_trackQuery ("Rec::MuonTrackQuery/MuonTrackQuery"),
m_alignmentUncertainty (0),
m_directionUncertainty (0.000001), // not used anymore angle ID and MS: done by m_addIDMSerrors
m_positionUncertainty (0.01*Gaudi::Units::mm), // not used anymore shift ID and MS: done by m_addIDMSerrors
m_positionUncertainty (0.01*Units::mm), // not used anymore shift ID and MS: done by m_addIDMSerrors
m_innerMatchChi2 (999999.),
m_innerMatchDOF (0),
m_innerMatchProbability (0),
......@@ -281,10 +283,10 @@ MuonMatchQuality::setCache (const Trk::Track& track1, const Trk::Track& track2)
}
else
{
deltaQoverP /= Gaudi::Units::TeV;
for (int i = 0; i != Trk::qOverP; ++i) covariance(i,Trk::qOverP) /= Gaudi::Units::TeV;
for (int i = 0; i != Trk::qOverP; ++i) covariance(Trk::qOverP,i) /= Gaudi::Units::TeV;
covariance(Trk::qOverP,Trk::qOverP) /= (Gaudi::Units::TeV*Gaudi::Units::TeV);
deltaQoverP /= Units::TeV;
for (int i = 0; i != Trk::qOverP; ++i) covariance(i,Trk::qOverP) /= Units::TeV;
for (int i = 0; i != Trk::qOverP; ++i) covariance(Trk::qOverP,i) /= Units::TeV;
covariance(Trk::qOverP,Trk::qOverP) /= (Units::TeV*Units::TeV);
}
// }
......
......@@ -12,7 +12,6 @@
#include <cmath>
#include <iomanip>
#include "GaudiKernel/SystemOfUnits.h"
#include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h"
#include "MuidTrackBuilder/MuonTrackQuery.h"
#include "MuonCompetingRIOsOnTrack/CompetingMuonClustersOnTrack.h"
......@@ -40,6 +39,9 @@
#include "TrkTrack/TrackStateOnSurface.h"
#include "muonEvent/CaloEnergy.h"
#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h"
#include "AthenaKernel/Units.h"
namespace Units = Athena::Units;
namespace Rec
{
......@@ -282,7 +284,7 @@ MuonTrackQuery::fieldIntegral (const Trk::Track& track) const
cosTheta);
}
}
Amg::Vector3D momentumKick = startMomentum.cross(endDirection)/(0.3*Gaudi::Units::GeV);
Amg::Vector3D momentumKick = startMomentum.cross(endDirection)/(0.3*Units::GeV);
integratedMomentumKick += momentumKick;
// accumulate abs(Bdl) between measurements (distinguish indet and spectrometer)
......@@ -702,45 +704,45 @@ MuonTrackQuery::momentumBalanceSignificance (const Trk::Track& track) const
{
ATH_MSG_DEBUG( std::setiosflags(std::ios::fixed)
<< " momentum balance " << std::setw(6) << std::setprecision(2)
<< energyBalance/Gaudi::Units::GeV
<< energyBalance/Units::GeV
<< " significance " << std::setw(6) << std::setprecision(1)
<< energyBalance/energyLoss->sigmaDeltaE()
<< " p before/after calo" << std::setw(7) << std::setprecision(2)
<< previousParameters->momentum().mag()/Gaudi::Units::GeV
<< previousParameters->momentum().mag()/Units::GeV
<< " /" << std::setw(7) << std::setprecision(2)
<< (**s).trackParameters()->momentum().mag()/Gaudi::Units::GeV
<< (**s).trackParameters()->momentum().mag()/Units::GeV
<< " energy deposit sigma "
<< energyLoss->sigmaDeltaE()/Gaudi::Units::GeV << " GeV");
<< energyLoss->sigmaDeltaE()/Units::GeV << " GeV");
energyBalance /= energyLoss->sigmaDeltaE();
}
else if (energyBalance < 0.)
{
ATH_MSG_DEBUG( std::setiosflags(std::ios::fixed)
<< " momentum balance " << std::setw(6) << std::setprecision(2)
<< energyBalance/Gaudi::Units::GeV
<< energyBalance/Units::GeV
<< " significance " << std::setw(6) << std::setprecision(1)
<< energyBalance/energyLoss->sigmaDeltaE()
<< " p before/after calo" << std::setw(7) << std::setprecision(2)
<< previousParameters->momentum().mag()/Gaudi::Units::GeV
<< previousParameters->momentum().mag()/Units::GeV
<< " /" << std::setw(7) << std::setprecision(2)
<< (**s).trackParameters()->momentum().mag()/Gaudi::Units::GeV
<< (**s).trackParameters()->momentum().mag()/Units::GeV
<< " energy deposit sigma- "
<< energyLoss->sigmaMinusDeltaE()/Gaudi::Units::GeV << " GeV");
<< energyLoss->sigmaMinusDeltaE()/Units::GeV << " GeV");
energyBalance /= energyLoss->sigmaMinusDeltaE();
}
else
{
ATH_MSG_DEBUG( std::setiosflags(std::ios::fixed)
<< " momentum balance " << std::setw(6) << std::setprecision(2)
<< energyBalance/Gaudi::Units::GeV
<< energyBalance/Units::GeV
<< " significance " << std::setw(6) << std::setprecision(1)
<< energyBalance/energyLoss->sigmaDeltaE()
<< " p before/after calo" << std::setw(7) << std::setprecision(2)
<< previousParameters->momentum().mag()/Gaudi::Units::GeV
<< previousParameters->momentum().mag()/Units::GeV
<< " /" << std::setw(7) << std::setprecision(2)
<< (**s).trackParameters()->momentum().mag()/Gaudi::Units::GeV
<< (**s).trackParameters()->momentum().mag()/Units::GeV
<< " energy deposit sigma+ "
<< energyLoss->sigmaPlusDeltaE()/Gaudi::Units::GeV << " GeV");
<< energyLoss->sigmaPlusDeltaE()/Units::GeV << " GeV");
energyBalance /= energyLoss->sigmaPlusDeltaE();
}
break;
......@@ -1245,7 +1247,7 @@ MuonTrackQuery::spectrometerPhiQuality (const Trk::Track& track) const
// FIXME: check separation between phi meas
double separation = (leadingPhiMeasurement->trackParameters()->position() -
trailingPhiMeasurement->trackParameters()->position()).mag();
if (separation < 2.*Gaudi::Units::meter) return 1;
if (separation < 2.*Units::meter) return 1;
return 0;
}
......
......@@ -16,7 +16,6 @@
#include <cmath>
#include <iomanip>
#include "CLHEP/Units/SystemOfUnits.h"
#include "MuidTrackBuilder/OutwardsCombinedMuonTrackBuilder.h"
......@@ -38,6 +37,10 @@
#include "TrkGeometry/TrackingVolume.h"
#include "TrkPseudoMeasurementOnTrack/PseudoMeasurementOnTrack.h"
#include "AthenaKernel/Units.h"
namespace Units = Athena::Units;
namespace Rec
{
......@@ -94,7 +97,7 @@ OutwardsCombinedMuonTrackBuilder::initialize()
msg(MSG::INFO) << " with options: ";
if (m_allowCleanerVeto) msg(MSG::INFO) << " AllowCleanerVeto";
if (m_cleanCombined) msg(MSG::INFO) << " CleanCombined";
msg(MSG::INFO) << endreq;
msg(MSG::INFO) << endmsg;
if (!m_cleaner.empty()){
if (m_cleaner.retrieve().isFailure())
......@@ -233,7 +236,7 @@ OutwardsCombinedMuonTrackBuilder::indetExtension (const Trk::Track& indetT
Trk::Track*
OutwardsCombinedMuonTrackBuilder::standaloneFit (const Trk::Track& /*spectrometerTrack*/,
const Trk::Vertex* /*vertex*/,
float bs_x, float bs_y, float bs_z ) const
float /*bs_x*/, float /*bs_y*/, float /*bs_z*/ ) const
{
return 0;
}
......@@ -613,7 +616,7 @@ Trk::Track* OutwardsCombinedMuonTrackBuilder::addIDMSerrors(Trk::Track* track)
for ( ; t != track->trackStateOnSurfaces()->end(); ++t) {
itsos++;
if((**t).trackParameters()) {
if(p==-1.) p = (**t).trackParameters()->momentum().mag()/1000.;
if(p==-1.) p = (**t).trackParameters()->momentum().mag()/Units::GeV;
if(m_indetVolume->inside((**t).trackParameters()->position())) {
continue;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment