Commit 387523a6 authored by Shaun Roe's avatar Shaun Roe Committed by Johannes Elmsheuser
Browse files

22.0-add_uniqueClone to FitQuality

parent 2efb172c
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -11,7 +11,7 @@
#include "Identifier/Identifier.h"
#include "TrkEventPrimitives/FitQuality.h"
#include <memory>
#include <vector>
namespace Muon {
......@@ -44,18 +44,25 @@ namespace Muon {
virtual ~MuonSegmentQuality() {}
/** number of holes */
virtual unsigned int numberOfHoles() const;
unsigned int numberOfHoles() const;
/** vector of identifiers of channels crossed by the segment but without hit */
const std::vector<Identifier>& channelsWithoutHit() const;
virtual MuonSegmentQuality* clone() const;
/** bare pointer clone */
virtual MuonSegmentQuality* clone() const override final;
/** NVI clone to unique_ptr */
std::unique_ptr<MuonSegmentQuality> uniqueClone() const {
return std::unique_ptr<MuonSegmentQuality>(clone());
}
bool isStrict() const; //!< Returns true if the segment was created using strict criteria
private:
std::vector<Identifier> m_channelsWithoutHit;
bool m_isStrict;
std::vector<Identifier> m_channelsWithoutHit{};
bool m_isStrict{};
};
......
......@@ -9,9 +9,10 @@
#ifndef TRKEVENTPRIMITIVES_TRKFITQUALITY_H
#define TRKEVENTPRIMITIVES_TRKFITQUALITY_H
#include <cmath>
#include <iostream>
#include <iosfwd>
#include <cmath> //for std::floor in the included .icc file
#include <memory>
class MsgStream;
namespace Trk {
......@@ -48,6 +49,9 @@ public:
/**Virtual constructor */
virtual FitQuality* clone() const;
/**NVI uniqueClone */
std::unique_ptr<FitQuality> uniqueClone() const;
/** returns the @f$ \chi^2 @f$ of the overall track fit*/
double chiSquared() const;
......@@ -68,8 +72,8 @@ public:
private:
double m_chiSquared;
double m_numberDoF;
double m_chiSquared{};
double m_numberDoF{};
}; // end of class definitions
......
......@@ -20,6 +20,13 @@ FitQuality::clone() const
return new FitQuality(*this);
}
inline std::unique_ptr<FitQuality>
FitQuality::uniqueClone() const
{
return std::unique_ptr<FitQuality>(clone());
}
inline double
FitQuality::chiSquared() const
{
......@@ -29,7 +36,7 @@ FitQuality::chiSquared() const
inline int
FitQuality::numberDoF() const
{
return static_cast<int>(floor(m_numberDoF + 0.5));
return static_cast<int>(std::floor(m_numberDoF + 0.5));
}
inline double
......
......@@ -9,6 +9,7 @@
#include "TrkEventPrimitives/FitQuality.h"
#include "GaudiKernel/MsgStream.h"
#include <string>
#include <ostream>
/**Overload of << operator for both, MsgStream and std::ostream for debug output*/
MsgStream& Trk::operator << ( MsgStream& sl, const Trk::FitQuality& fq)
......
Markdown is supported
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