diff --git a/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/TRT_SeededTrackFinderTool/SiNoise_bt.h b/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/TRT_SeededTrackFinderTool/SiNoise_bt.h index c05db9fa72745f9f12d2ea0f6c6f9d3807b03252..949d13887dcd6075829c1a21f446528cf797956a 100755 --- a/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/TRT_SeededTrackFinderTool/SiNoise_bt.h +++ b/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/TRT_SeededTrackFinderTool/SiNoise_bt.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////////////////////////// @@ -16,94 +16,29 @@ #define SiNoise_bt_H #include "TrkParameters/TrackParameters.h" -#include "TrkSurfaces/Surface.h" -//class Trk::TrackParameters; namespace InDet{ - class SiNoise_bt - { - /////////////////////////////////////////////////////////////////// - // Public methods: - /////////////////////////////////////////////////////////////////// + class SiNoise_bt{ public: - - SiNoise_bt(); - SiNoise_bt(const SiNoise_bt&); - ~SiNoise_bt(); - SiNoise_bt& operator = (const SiNoise_bt&); - - /////////////////////////////////////////////////////////////////// - // Main methods - /////////////////////////////////////////////////////////////////// - - const int& model () const {return m_model ;} + const int& model () const {return m_model ;} const double& covarianceAzim() const {return m_covarianceAzim;} const double& covariancePola() const {return m_covariancePola;} const double& covarianceIMom() const {return m_covarianceIMom;} const double& correctionIMom() const {return m_correctionIMom;} + void reset(); + void production(int direction,int model,const Trk::TrackParameters& tp); - void initiate(); - void production(int,int,const Trk::TrackParameters&); - - protected: - - /////////////////////////////////////////////////////////////////// - // Protected Data - /////////////////////////////////////////////////////////////////// - - int m_model ; - double m_covarianceAzim; - double m_covariancePola; - double m_covarianceIMom; - double m_correctionIMom; - - /////////////////////////////////////////////////////////////////// - // Methods - /////////////////////////////////////////////////////////////////// + private: + int m_model{} ; + double m_covarianceAzim{}; + double m_covariancePola{}; + double m_covarianceIMom{}; + double m_correctionIMom{1.0}; }; - - ///////////////////////////////////////////////////////////////////////////////// - // Inline methods - ///////////////////////////////////////////////////////////////////////////////// - - inline SiNoise_bt::SiNoise_bt() - { - initiate(); - } - - inline SiNoise_bt::SiNoise_bt(const SiNoise_bt& N) - { - m_model = N.m_model ; - m_covarianceAzim = N.m_covarianceAzim; - m_covariancePola = N.m_covariancePola; - m_covarianceIMom = N.m_covarianceIMom; - m_correctionIMom = N.m_correctionIMom; - } - - inline SiNoise_bt& SiNoise_bt::operator = (const SiNoise_bt& N) - { - m_model = N.m_model ; - m_covarianceAzim = N.m_covarianceAzim; - m_covariancePola = N.m_covariancePola; - m_covarianceIMom = N.m_covarianceIMom; - m_correctionIMom = N.m_correctionIMom; - return(*this); - } - - inline SiNoise_bt::~SiNoise_bt() {} - - inline void SiNoise_bt::initiate() - { - m_model = 0 ; - m_covarianceAzim = 0.; - m_covariancePola = 0.; - m_covarianceIMom = 0.; - m_correctionIMom = 1.; - } } // end of name space diff --git a/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/src/SiNoise_bt.cxx b/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/src/SiNoise_bt.cxx index d0e9e7910748861824f583a1a259d215d785d61f..d9d73defd4248934496642a293da7845aa5150a0 100755 --- a/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/src/SiNoise_bt.cxx +++ b/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/src/SiNoise_bt.cxx @@ -1,8 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "TRT_SeededTrackFinderTool/SiNoise_bt.h" +#include <cmath> /////////////////////////////////////////////////////////////////// // Noise production @@ -10,6 +11,16 @@ // Model = 1 - muon, 2 - electron /////////////////////////////////////////////////////////////////// +void +InDet::SiNoise_bt::reset(){ + m_model = 0 ; + m_covarianceAzim = 0.; + m_covariancePola = 0.; + m_covarianceIMom = 0.; + m_correctionIMom = 1.; + } + + void InDet::SiNoise_bt::production (int Dir,int Model,const Trk::TrackParameters& Tp) { @@ -21,18 +32,16 @@ void InDet::SiNoise_bt::production m_covarianceIMom = 0; m_correctionIMom = 1.; - //const HepGeom::Transform3D& T = Tp.associatedSurface().transform(); - //const CLHEP::HepVector& Vp = Tp.parameters(); const Amg::Transform3D& T = Tp.associatedSurface().transform(); const AmgVector(5)& Vp = Tp.parameters(); - double q = fabs(Vp[4]); - double cosp = cos(Vp[3]) ; + double q = std::abs(Vp[4]); + double cosp = std::cos(Vp[3]) ; double sinp2 = (1.-cosp)*(1.+cosp) ; if(sinp2==0) sinp2 = 0.000001; double s = - fabs(sqrt(sinp2)*(cos(Vp[2])*T(0,2)+sin(Vp[2]*T(1,2)))+cosp*T(2,2)); + std::abs(std::sqrt(sinp2)*(std::cos(Vp[2])*T(0,2)+std::sin(Vp[2]*T(1,2)))+cosp*T(2,2)); s < .05 ? s = 20. : s = 1./s; m_covariancePola = 134.*s*radlength*q*q; diff --git a/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/src/TRT_SeededTrackFinder_ATL.cxx b/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/src/TRT_SeededTrackFinder_ATL.cxx index ada3dd1b48c879017a283fc15c79fbaba1917ef1..af9abc15eef70dfb52bc7750fe63fed37f68084e 100755 --- a/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/src/TRT_SeededTrackFinder_ATL.cxx +++ b/InnerDetector/InDetRecTools/TRT_SeededTrackFinderTool/src/TRT_SeededTrackFinder_ATL.cxx @@ -72,16 +72,12 @@ namespace{ } double - tanThetaFromSpacePoints(const Trk::SpacePoint* pPoint0, const Trk::SpacePoint* pPoint1 ){ + thetaFromSpacePoints(const Trk::SpacePoint* pPoint0, const Trk::SpacePoint* pPoint1 ){ const double deltaR = getRadius(pPoint1) - getRadius(pPoint0); const double deltaZ = getZ(pPoint1) - getZ(pPoint0); - return deltaR/deltaZ; + return std::atan2(deltaR,deltaZ); } - double - thetaFromSpacePoints(const Trk::SpacePoint* pPoint0, const Trk::SpacePoint* pPoint1 ){ - return std::atan(tanThetaFromSpacePoints(pPoint0, pPoint1)); - } } /////////////////////////////////////////////////////////////////// @@ -516,7 +512,7 @@ std::list<Trk::Track*> InDet::TRT_SeededTrackFinder_ATL::findTrack std::list<Trk::Track*> aTracks ; // List of tracks found per seed std::list<Trk::Track*> cTracks ; // List of cleaned tracks found per seed - event_data.noise().initiate(); //Initiate the noise production tool at the beginning of each seed + event_data.noise().reset(); //Initiate the noise production tool at the beginning of each seed // // --------------- filter SP to improve prediction, scale errors @@ -905,7 +901,7 @@ bool InDet::TRT_SeededTrackFinder_ATL::checkSeed } } } - double tanTheta = tanThetaFromSpacePoints(vsp[0], vsp[1]); + double tanTheta = std::tan(thetaFromSpacePoints(vsp[0], vsp[1])); ///Propagate at the z position of 1st endcap hit on TRT segment double propR = getRadius(vsp[1]) + (gz-getZ(vsp[1]))*tanTheta;