Skip to content
Snippets Groups Projects
Commit a8251af1 authored by Christos Anastopoulos's avatar Christos Anastopoulos
Browse files

TrkGeometrySurfaces/TrkAlignableSurfaces move inline methods to separate icc,...

TrkGeometrySurfaces/TrkAlignableSurfaces move inline methods to separate icc, add override final where applicable possible
parent bf291a33
No related branches found
No related tags found
No related merge requests found
Showing
with 177 additions and 151 deletions
......@@ -43,7 +43,7 @@ class TrkDetElementBase;
@author Andreas.Salzburger@cern.ch
*/
class AlignablePlaneSurface
class AlignablePlaneSurface final
: public PlaneSurface
, public AlignableSurface
{
......@@ -66,12 +66,12 @@ public:
/**Assignment operator */
AlignablePlaneSurface& operator=(const AlignablePlaneSurface& sf);
/**Equality operator*/
virtual bool operator==(const Surface& sf) const override;
virtual bool operator==(const Surface& sf) const override final;
/**Implicit constructor - uses the copy constructor */
virtual AlignablePlaneSurface* clone() const override;
virtual AlignablePlaneSurface* clone() const override final;
/** return associated Detector Element - forwarded from nominal Surface */
const TrkDetElementBase* associatedDetectorElement() const;
const TrkDetElementBase* associatedDetectorElement() const ;
/** return Identifier of the associated Detector Element - forwarded from nominal Surface */
Identifier associatedDetectorElementIdentifier() const;
......@@ -80,72 +80,30 @@ public:
const Layer* associatedLayer() const;
/** -------------------------- interface from AlignableSurface ------------------ */
/** Get the Surface representation */
virtual const PlaneSurface& surfaceRepresentation() const override;
virtual const PlaneSurface& surfaceRepresentation() const override final;
/** Get the nominal surface */
virtual const PlaneSurface& nominalSurface() const override;
virtual const PlaneSurface& nominalSurface() const override final;
/** Get the nominal transformation */
virtual const Amg::Transform3D& nominalTransform() const override;
virtual const Amg::Transform3D& nominalTransform() const override final;
/** Add an alignment correction on top of the actual one */
virtual void addAlignmentCorrection(Amg::Transform3D& corr) override;
virtual void addAlignmentCorrection(Amg::Transform3D& corr) override final;
/** Set an alignment correction on top of the nominal one */
virtual void setAlignmentCorrection(Amg::Transform3D& corr) override;
virtual void setAlignmentCorrection(Amg::Transform3D& corr) override final;
/** Set an alignment correction on top of the nominal one */
virtual void setAlignableTransform(Amg::Transform3D& trans) override;
virtual void setAlignableTransform(Amg::Transform3D& trans) override final ;
protected:
/** The pointer ro the nominal Surface */
const PlaneSurface* m_nominalSurface;
};
inline AlignablePlaneSurface*
AlignablePlaneSurface::clone() const
{
return new AlignablePlaneSurface(*this);
}
inline const TrkDetElementBase*
AlignablePlaneSurface::associatedDetectorElement() const
{
return m_nominalSurface->associatedDetectorElement();
}
inline Identifier
AlignablePlaneSurface::associatedDetectorElementIdentifier() const
{
return m_nominalSurface->associatedDetectorElementIdentifier();
}
inline const Trk::Layer*
AlignablePlaneSurface::associatedLayer() const
{
return m_nominalSurface->associatedLayer();
}
inline const PlaneSurface&
AlignablePlaneSurface::surfaceRepresentation() const
{
return (*this);
}
inline const PlaneSurface&
AlignablePlaneSurface::nominalSurface() const
{
return (*m_nominalSurface);
}
inline const Amg::Transform3D&
AlignablePlaneSurface::nominalTransform() const
{
return m_nominalSurface->transform();
}
} // end of namespace Trk
#include "TrkAlignableSurfaces/AlignablePlaneSurface.icc"
#endif // TRKALIGNABLESURFACES_ALGINABLESURFACE_H
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
namespace Trk {
inline AlignablePlaneSurface*
AlignablePlaneSurface::clone() const
{
return new AlignablePlaneSurface(*this);
}
inline const TrkDetElementBase*
AlignablePlaneSurface::associatedDetectorElement() const
{
return m_nominalSurface->associatedDetectorElement();
}
inline Identifier
AlignablePlaneSurface::associatedDetectorElementIdentifier() const
{
return m_nominalSurface->associatedDetectorElementIdentifier();
}
inline const Trk::Layer*
AlignablePlaneSurface::associatedLayer() const
{
return m_nominalSurface->associatedLayer();
}
inline const PlaneSurface&
AlignablePlaneSurface::surfaceRepresentation() const
{
return (*this);
}
inline const PlaneSurface&
AlignablePlaneSurface::nominalSurface() const
{
return (*m_nominalSurface);
}
inline const Amg::Transform3D&
AlignablePlaneSurface::nominalTransform() const
{
return m_nominalSurface->transform();
}
}
......@@ -43,10 +43,10 @@ class AlignableSurface
public:
/** Default Constructor - needed for pool and inherited classes */
AlignableSurface();
AlignableSurface() = default;
/** Destructor */
virtual ~AlignableSurface();
virtual ~AlignableSurface() = default;
/** Get the Surface representation */
virtual const Surface& surfaceRepresentation() const = 0;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// AlignableSurface.cxx, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
// Trk
#include "TrkAlignableSurfaces/AlignableSurface.h"
Trk::AlignableSurface::AlignableSurface() {}
Trk::AlignableSurface::~AlignableSurface() {}
......@@ -32,7 +32,7 @@ namespace Trk {
*/
template<class T>
class BinnedArrayArrayT : public BinnedArrayT<T>
class BinnedArrayArrayT final: public BinnedArrayT<T>
{
public:
......
......@@ -57,7 +57,7 @@ public:
SlidingCylinderSurface& operator=(const SlidingCylinderSurface& psf);
/**Equality operator*/
virtual bool operator==(const Surface& sf) const override;
virtual bool operator==(const Surface& sf) const override final;
/** This method returns true if the GlobalPosition is on the Surface for both,
within or without check of whether the local position is inside boundaries
......@@ -65,31 +65,31 @@ public:
virtual bool isOnSurface(const Amg::Vector3D& glopo,
BoundaryCheck bchk = true,
double tol1 = 0.,
double tol2 = 0.) const override;
double tol2 = 0.) const override final;
/** Specialized for DiscSurface: LocalToGlobal method without dynamic memory
* allocation */
virtual void localToGlobal(const Amg::Vector2D& locp,
const Amg::Vector3D& mom,
Amg::Vector3D& glob) const override;
Amg::Vector3D& glob) const override final;
/** Specialized for DiscSurface: GlobalToLocal method without dynamic memory
* allocation - boolean checks if on surface
*/
virtual bool globalToLocal(const Amg::Vector3D& glob,
const Amg::Vector3D& mom,
Amg::Vector2D& loc) const override;
Amg::Vector2D& loc) const override final;
/** fast straight line distance evaluation to Surface */
virtual DistanceSolution straightLineDistanceEstimate(
const Amg::Vector3D& pos,
const Amg::Vector3D& dir) const override;
const Amg::Vector3D& dir) const override final;
/** fast straight line distance evaluation to Surface - with bound option*/
virtual DistanceSolution straightLineDistanceEstimate(
const Amg::Vector3D& pos,
const Amg::Vector3D& dir,
bool Bound) const override;
bool Bound) const override final;
/**This method allows access to the bin utility*/
const Trk::BinUtility* binUtility() const { return m_etaBin; }
......
......@@ -77,10 +77,10 @@ public:
SlidingDiscSurface& operator=(const SlidingDiscSurface& dsf);
/**Equality operator*/
virtual bool operator==(const Surface& sf) const override;
virtual bool operator==(const Surface& sf) const override final;
/** Virtual constructor*/
virtual SlidingDiscSurface* clone() const override;
virtual SlidingDiscSurface* clone() const override final;
/** This method returns true if the GlobalPosition is on the Surface for both,
within or without check of whether the local position is inside boundaries
......@@ -88,20 +88,20 @@ public:
virtual bool isOnSurface(const Amg::Vector3D& glopo,
BoundaryCheck bchk = true,
double tol1 = 0.,
double tol2 = 0.) const override;
double tol2 = 0.) const override final;
/** Specialized for DiscSurface: LocalToGlobal method without dynamic memory
* allocation */
virtual void localToGlobal(const Amg::Vector2D& locp,
const Amg::Vector3D& mom,
Amg::Vector3D& glob) const override;
Amg::Vector3D& glob) const override final;
/** Specialized for DiscSurface: GlobalToLocal method without dynamic memory
* allocation - boolean checks if on surface
*/
virtual bool globalToLocal(const Amg::Vector3D& glob,
const Amg::Vector3D& mom,
Amg::Vector2D& loc) const override;
Amg::Vector2D& loc) const override final;
/** fast straight line intersection schema - standard: provides closest
intersection and (signed) path length forceDir is to provide the closest
......@@ -127,13 +127,13 @@ public:
/** fast straight line distance evaluation to Surface */
virtual DistanceSolution straightLineDistanceEstimate(
const Amg::Vector3D& pos,
const Amg::Vector3D& dir) const override;
const Amg::Vector3D& dir) const override final;
/** fast straight line distance evaluation to Surface - with bound option*/
virtual DistanceSolution straightLineDistanceEstimate(
const Amg::Vector3D& pos,
const Amg::Vector3D& dir,
bool Bound) const override;
bool Bound) const override final;
/**This method allows access to the bin utility*/
const Trk::BinUtility* binUtility() const { return m_etaBin; }
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -29,7 +29,7 @@ namespace Trk {
@author Sarka.Todorova@cern.ch
*/
class SubtractedCylinderSurface : public CylinderSurface
class SubtractedCylinderSurface final : public CylinderSurface
{
public:
/** Default Constructor - needed for persistency*/
......@@ -57,50 +57,24 @@ public:
bool shared() const;
/**This method calls the inside() method of the Bounds*/
bool insideBounds(const Amg::Vector2D& locpos, double tol1 = 0., double tol2 = 0.) const;
virtual bool insideBounds(const Amg::Vector2D& locpos,
double tol1 = 0.,
double tol2 = 0.) const override final;
/**This method allows access to the subtracted part*/
SharedObject<AreaExcluder> subtractedVolume() const;
/** Return properly formatted class name for screen output */
std::string name() const { return "Trk::SubtractedCylinderSurface"; }
virtual std::string name() const override final
{
return "Trk::SubtractedCylinderSurface";
}
protected:
SharedObject<AreaExcluder> m_subtrVol;
bool m_shared;
};
inline bool
SubtractedCylinderSurface::insideBounds(const Amg::Vector2D& locpos, double tol1, double tol2) const
{
// no subtracted volume exists
if (!m_subtrVol.get())
return (this->bounds().inside(locpos, tol1, tol2));
// subtracted volume exists, needs to be checked
double rCyl = bounds().r();
double phiPos = locpos[Trk::locRPhi] / rCyl;
const Amg::Vector3D gp(rCyl * cos(phiPos), rCyl * sin(phiPos), locpos[Trk::locZ]);
bool inside_shared(this->bounds().inside(locpos, tol1, tol2) && m_subtrVol.get()->inside(gp, 0.));
bool inside(this->bounds().inside(locpos, tol1, tol2) && !m_subtrVol.get()->inside(gp, 0.));
if (m_shared)
return inside_shared;
return inside;
}
inline bool
SubtractedCylinderSurface::shared() const
{
return m_shared;
}
inline SharedObject<AreaExcluder>
SubtractedCylinderSurface::subtractedVolume() const
{
return m_subtrVol;
}
} // end of namespace
#include "TrkGeometrySurfaces/SubtractedCylinderSurface.icc"
#endif // TRKGEOMETRYSURFACES_SUBTRACTEDCYLINDERSURFACE_H
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
namespace Trk {
inline bool
SubtractedCylinderSurface::insideBounds(const Amg::Vector2D& locpos,
double tol1,
double tol2) const
{
// no subtracted volume exists
if (!m_subtrVol.get())
return (this->bounds().inside(locpos, tol1, tol2));
// subtracted volume exists, needs to be checked
double rCyl = bounds().r();
double phiPos = locpos[Trk::locRPhi] / rCyl;
const Amg::Vector3D gp(
rCyl * cos(phiPos), rCyl * sin(phiPos), locpos[Trk::locZ]);
bool inside_shared(this->bounds().inside(locpos, tol1, tol2) &&
m_subtrVol.get()->inside(gp, 0.));
bool inside(this->bounds().inside(locpos, tol1, tol2) &&
!m_subtrVol.get()->inside(gp, 0.));
if (m_shared)
return inside_shared;
return inside;
}
inline bool
SubtractedCylinderSurface::shared() const
{
return m_shared;
}
inline SharedObject<AreaExcluder>
SubtractedCylinderSurface::subtractedVolume() const
{
return m_subtrVol;
}
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -28,7 +28,7 @@ namespace Trk {
@author Sarka.Todorova@cern.ch
*/
class SubtractedPlaneSurface : public PlaneSurface
class SubtractedPlaneSurface final : public PlaneSurface
{
public:
/** Default Constructor - needed for persistency*/
......@@ -56,46 +56,24 @@ public:
bool shared() const;
/**This method calls the inside() method of the Bounds*/
bool insideBounds(const Amg::Vector2D& locpos, double tol1 = 0., double tol2 = 0.) const;
virtual bool insideBounds(const Amg::Vector2D& locpos,
double tol1 = 0.,
double tol2 = 0.) const override final;
/**This method allows access to the subtracted part*/
SharedObject<AreaExcluder> subtractedVolume() const;
/** Return properly formatted class name for screen output */
std::string name() const { return "Trk::SubtractedPlaneSurface"; }
virtual std::string name() const override final
{
return "Trk::SubtractedPlaneSurface";
}
protected:
SharedObject<AreaExcluder> m_subtrVol;
bool m_shared;
};
inline bool
SubtractedPlaneSurface::insideBounds(const Amg::Vector2D& locpos, double tol1, double tol2) const
{
// no subtracted volume exists
if (!m_subtrVol.get())
return (this->bounds().inside(locpos, tol1, tol2));
// subtracted volume exists, needs to be checked
Amg::Vector3D gp(locpos.x(), locpos.y(), 0.);
if (m_shared)
return (this->bounds().inside(locpos, tol1, tol2) && m_subtrVol.get()->inside(gp, 0.));
bool in(this->bounds().inside(locpos, tol1, tol2) && !m_subtrVol.get()->inside(gp, 0.));
return in;
}
inline bool
SubtractedPlaneSurface::shared() const
{
return m_shared;
}
inline SharedObject<AreaExcluder>
SubtractedPlaneSurface::subtractedVolume() const
{
return m_subtrVol;
}
} // end of namespace
#include "TrkGeometrySurfaces/SubtractedPlaneSurface.icc"
#endif // TRKGEOMETRYSURFACES_SUBTRACTEDPLANESURFACE_H
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
namespace Trk {
inline bool
SubtractedPlaneSurface::insideBounds(const Amg::Vector2D& locpos,
double tol1,
double tol2) const
{
// no subtracted volume exists
if (!m_subtrVol.get()){
return (this->bounds().inside(locpos, tol1, tol2));
}
// subtracted volume exists, needs to be checked
Amg::Vector3D gp(locpos.x(), locpos.y(), 0.);
if (m_shared){
return (this->bounds().inside(locpos, tol1, tol2) &&
m_subtrVol.get()->inside(gp, 0.));
}
bool in(this->bounds().inside(locpos, tol1, tol2) &&
!m_subtrVol.get()->inside(gp, 0.));
return in;
}
inline bool
SubtractedPlaneSurface::shared() const
{
return m_shared;
}
inline SharedObject<AreaExcluder>
SubtractedPlaneSurface::subtractedVolume() const
{
return m_subtrVol;
}
}
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