Skip to content
Snippets Groups Projects
Commit e2c1ebdb authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'muMaxP' into 'master'

Remove unused and non thread-safe maxP function

See merge request atlas/athena!34356
parents a2d36cba d39bb9d2
No related branches found
No related tags found
No related merge requests found
...@@ -15,17 +15,12 @@ ...@@ -15,17 +15,12 @@
#ifndef MUIDCALOISOLATIONTOOLS_MUIDTRACKISOLATION_H #ifndef MUIDCALOISOLATIONTOOLS_MUIDTRACKISOLATION_H
#define MUIDCALOISOLATIONTOOLS_MUIDTRACKISOLATION_H #define MUIDCALOISOLATIONTOOLS_MUIDTRACKISOLATION_H
//<<<<<< INCLUDES >>>>>> #include "MuidInterfaces/IMuidTrackIsolation.h"
#include "AthenaBaseComps/AthAlgTool.h" #include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ToolHandle.h"
#include "MuidInterfaces/IMuidTrackIsolation.h"
#include "TrkTrack/TrackCollection.h" #include "TrkTrack/TrackCollection.h"
#include "StoreGate/ReadHandleKey.h" #include "StoreGate/ReadHandleKey.h"
#include "TrkExInterfaces/IIntersector.h" #include "TrkExInterfaces/IIntersector.h"
#include "GaudiKernel/ConcurrencyFlags.h"
//<<<<<< CLASS DECLARATIONS >>>>>>
namespace Trk namespace Trk
{ {
...@@ -52,10 +47,6 @@ public: ...@@ -52,10 +47,6 @@ public:
get the number of tracks and summed momentum get the number of tracks and summed momentum
in a cone at the production vertex or around the muon calo intersect*/ in a cone at the production vertex or around the muon calo intersect*/
std::pair<int,double> trackIsolation(double eta, double phi) const; std::pair<int,double> trackIsolation(double eta, double phi) const;
/**IMuidTrackIsolation interface:
get the momentum of the most energetic track in the cone*/
double maxP(void) const;
private: private:
// isolation without extrapolation to calo // isolation without extrapolation to calo
...@@ -76,23 +67,12 @@ private: ...@@ -76,23 +67,12 @@ private:
SG::ReadHandleKey<TrackCollection> m_inDetTracksLocation{this,"InDetTracksLocation","Tracks","ID tracks"}; SG::ReadHandleKey<TrackCollection> m_inDetTracksLocation{this,"InDetTracksLocation","Tracks","ID tracks"};
// FIXME: mutable // FIXME: mutable
ToolHandle<Trk::IIntersector> m_intersector{this,"RungeKuttaIntersector","Trk::RungeKuttaIntersector/RungeKuttaIntersector"}; ToolHandle<Trk::IIntersector> m_intersector{this,"RungeKuttaIntersector","Trk::RungeKuttaIntersector/RungeKuttaIntersector"};
mutable std::atomic<double> m_maxP;
Gaudi::Property<double> m_minPt{this,"MinPt",1.0*Gaudi::Units::GeV}; Gaudi::Property<double> m_minPt{this,"MinPt",1.0*Gaudi::Units::GeV};
Gaudi::Property<double> m_trackCone{this,"TrackCone",0.2}; Gaudi::Property<double> m_trackCone{this,"TrackCone",0.2};
Gaudi::Property<bool> m_trackExtrapolation{this,"TrackExtrapolation",false}; Gaudi::Property<bool> m_trackExtrapolation{this,"TrackExtrapolation",false};
}; };
//<<<<<< INLINE PUBLIC MEMBER FUNCTIONS >>>>>>
inline double
MuidTrackIsolation::maxP(void) const
{
if (Gaudi::Concurrency::ConcurrencyFlags::concurrent())
ATH_MSG_WARNING("MuidTrackIsolation::maxP() does not return trustable value in MT");
return m_maxP;
}
} // end of namespace } // end of namespace
#endif // MUIDCALOISOLATIONTOOLS_MUIDTRACKISOLATION_H #endif // MUIDCALOISOLATIONTOOLS_MUIDTRACKISOLATION_H
......
...@@ -10,12 +10,9 @@ ...@@ -10,12 +10,9 @@
// (c) ATLAS Combined Muon software // (c) ATLAS Combined Muon software
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
//<<<<<< INCLUDES >>>>>> #include "MuidCaloIsolationTools/MuidTrackIsolation.h"
#include <cmath>
#include <iomanip>
#include "GaudiKernel/SystemOfUnits.h" #include "GaudiKernel/SystemOfUnits.h"
#include "MuidCaloIsolationTools/MuidTrackIsolation.h"
#include "TrkExUtils/TrackSurfaceIntersection.h" #include "TrkExUtils/TrackSurfaceIntersection.h"
#include "TrkParameters/TrackParameters.h" #include "TrkParameters/TrackParameters.h"
#include "TrkSurfaces/CylinderSurface.h" #include "TrkSurfaces/CylinderSurface.h"
...@@ -24,7 +21,8 @@ ...@@ -24,7 +21,8 @@
#include "TrkTrack/Track.h" #include "TrkTrack/Track.h"
#include "TrkTrack/TrackCollection.h" #include "TrkTrack/TrackCollection.h"
//<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>> #include <cmath>
#include <iomanip>
namespace Rec namespace Rec
{ {
...@@ -115,7 +113,6 @@ MuidTrackIsolation::trackIsolation(double eta, double phi) const ...@@ -115,7 +113,6 @@ MuidTrackIsolation::trackIsolation(double eta, double phi) const
} }
// set initial state // set initial state
m_maxP = 0.;
std::pair<int,double> isolation = std::make_pair(0,0.); std::pair<int,double> isolation = std::make_pair(0,0.);
// retrieve track collection // retrieve track collection
...@@ -143,12 +140,7 @@ MuidTrackIsolation::trackIsolation(double eta, double phi) const ...@@ -143,12 +140,7 @@ MuidTrackIsolation::trackIsolation(double eta, double phi) const
} }
// debug result // debug result
ATH_MSG_DEBUG(std::endl << " Found "<< isolation.first ATH_MSG_DEBUG("Found "<<isolation.first<<std::setiosflags(std::ios::fixed)<<" InDet tracks with total momentum "<< std::setw(8)<<std::setprecision(1)<<isolation.second/Gaudi::Units::GeV<<" GeV");
<< std::setiosflags(std::ios::fixed)
<< " InDet tracks with total momentum "
<< std::setw(8) << std::setprecision(1) << isolation.second/Gaudi::Units::GeV <<" Gaudi::Units::GeV "
<< "and maximum momentum "
<< std::setw(8) << std::setprecision(1) << m_maxP/Gaudi::Units::GeV);
return isolation; return isolation;
} }
...@@ -157,7 +149,6 @@ std::pair<int,double> ...@@ -157,7 +149,6 @@ std::pair<int,double>
MuidTrackIsolation::trackVertex(const TrackCollection* inDetTracks, double eta, double phi) const MuidTrackIsolation::trackVertex(const TrackCollection* inDetTracks, double eta, double phi) const
{ {
// set initial state // set initial state
m_maxP = 0.;
double sumP = 0.; double sumP = 0.;
int numberTracks = 0; int numberTracks = 0;
...@@ -192,7 +183,6 @@ MuidTrackIsolation::trackVertex(const TrackCollection* inDetTracks, double eta, ...@@ -192,7 +183,6 @@ MuidTrackIsolation::trackVertex(const TrackCollection* inDetTracks, double eta,
if ((diffPhi*diffPhi + diffEta*diffEta) > m_trackCone*m_trackCone) continue; if ((diffPhi*diffPhi + diffEta*diffEta) > m_trackCone*m_trackCone) continue;
++numberTracks; ++numberTracks;
double p = perigee.momentum().mag(); double p = perigee.momentum().mag();
if (p > m_maxP) m_maxP = p;
sumP += p; sumP += p;
if (msgLvl(MSG::VERBOSE)) msg() << " inside cone, track#" << std::setw(3) << numberTracks; if (msgLvl(MSG::VERBOSE)) msg() << " inside cone, track#" << std::setw(3) << numberTracks;
...@@ -205,7 +195,6 @@ std::pair<int,double> ...@@ -205,7 +195,6 @@ std::pair<int,double>
MuidTrackIsolation::trackExtrapolated(const TrackCollection* inDetTracks, double eta, double phi) const MuidTrackIsolation::trackExtrapolated(const TrackCollection* inDetTracks, double eta, double phi) const
{ {
// set initial state // set initial state
m_maxP = 0.;
double sumP = 0.; double sumP = 0.;
int numberTracks = 0; int numberTracks = 0;
...@@ -281,7 +270,6 @@ MuidTrackIsolation::trackExtrapolated(const TrackCollection* inDetTracks, double ...@@ -281,7 +270,6 @@ MuidTrackIsolation::trackExtrapolated(const TrackCollection* inDetTracks, double
{ {
++numberTracks; ++numberTracks;
double p = perigee.momentum().mag(); double p = perigee.momentum().mag();
if (p > m_maxP) m_maxP = p;
sumP += p; sumP += p;
if (msgLvl(MSG::VERBOSE)) msg() << " inside cone, track#" << std::setw(3) << numberTracks; if (msgLvl(MSG::VERBOSE)) msg() << " inside cone, track#" << std::setw(3) << numberTracks;
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// IMuidTrackIsolation // IMuidTrackIsolation
// tool interface for estimating the number, total charged momentum and most // tool interface for estimating the number, total charged momentum and most
// energetic inner detector tracks in a cone surrounding a muon // energetic inner detector tracks in a cone surrounding a muon
// //
// (c) ATLAS Combined Muon software // (c) ATLAS Combined Muon software
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
#ifndef MUIDINTERFACES_IMUIDTRACKISOLATION_H #ifndef MUIDINTERFACES_IMUIDTRACKISOLATION_H
#define MUIDINTERFACES_IMUIDTRACKISOLATION_H #define MUIDINTERFACES_IMUIDTRACKISOLATION_H
#include <utility> #include <utility>
#include "GaudiKernel/IAlgTool.h" #include "GaudiKernel/IAlgTool.h"
namespace Rec namespace Rec
{ {
/** Interface ID for IMuidTrackIsolation*/ /** Interface ID for IMuidTrackIsolation*/
static const InterfaceID IID_IMuidTrackIsolation("IMuidTrackIsolation", 1, 0); static const InterfaceID IID_IMuidTrackIsolation("IMuidTrackIsolation", 1, 0);
/**@class IMuidTrackIsolation /**@class IMuidTrackIsolation
Base class for MuidTrackIsolation AlgTool Base class for MuidTrackIsolation AlgTool
@author Alan.Poppleton@cern.ch @author Alan.Poppleton@cern.ch
*/ */
class IMuidTrackIsolation : virtual public IAlgTool class IMuidTrackIsolation : virtual public IAlgTool
{ {
public: public:
/**Virtual destructor*/ /**Virtual destructor*/
virtual ~IMuidTrackIsolation() {} virtual ~IMuidTrackIsolation() {}
/** AlgTool and IAlgTool interface methods */ /** AlgTool and IAlgTool interface methods */
static const InterfaceID& interfaceID() { return IID_IMuidTrackIsolation; } static const InterfaceID& interfaceID() { return IID_IMuidTrackIsolation; }
/**IMuidTrackIsolation interface: /**IMuidTrackIsolation interface:
get the number of tracks and summed momentum get the number of tracks and summed momentum
in a cone at the production vertex or around the muon calo intersect*/ in a cone at the production vertex or around the muon calo intersect*/
virtual std::pair<int,double> trackIsolation (double eta, double phi) const = 0; virtual std::pair<int,double> trackIsolation (double eta, double phi) const = 0;
/**IMuidTrackIsolation interface: };
get the momentum of the most energetic track in the cone*/
virtual double maxP (void) const = 0; } // end of namespace
};
#endif // MUIDINTERFACES_IMUIDTRACKISOLATION_H
} // end of namespace
#endif // MUIDINTERFACES_IMUIDTRACKISOLATION_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment