Skip to content

Commit

Permalink
Merge pull request #37661 from Dr15Jones/fixL1MuBMTrackSegPhiCtr
Browse files Browse the repository at this point in the history
Properly initialize all member data in L1MuBMTrackSegPhi
  • Loading branch information
cmsbuild authored Apr 26, 2022
2 parents 23db5f0 + 8178e48 commit 146950e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
10 changes: 8 additions & 2 deletions DataFormats/L1TMuon/interface/L1MuBMTrackSegPhi.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ class L1MuBMTrackSegPhi {
bool etaFlag = false);

/// copy constructor
L1MuBMTrackSegPhi(const L1MuBMTrackSegPhi&);
L1MuBMTrackSegPhi(const L1MuBMTrackSegPhi&) = default;

/// move constructor
L1MuBMTrackSegPhi(L1MuBMTrackSegPhi&&) = default;

/// destructor
virtual ~L1MuBMTrackSegPhi();
Expand Down Expand Up @@ -118,7 +121,10 @@ class L1MuBMTrackSegPhi {
inline void setEtaFlag(bool flag) { m_etaFlag = flag; }

/// assignment operator
L1MuBMTrackSegPhi& operator=(const L1MuBMTrackSegPhi&);
L1MuBMTrackSegPhi& operator=(const L1MuBMTrackSegPhi&) = default;

/// move assignment operator
L1MuBMTrackSegPhi& operator=(L1MuBMTrackSegPhi&&) = default;

/// equal operator
bool operator==(const L1MuBMTrackSegPhi&) const;
Expand Down
26 changes: 1 addition & 25 deletions DataFormats/L1TMuon/src/L1MuBMTrackSegPhi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ L1MuBMTrackSegPhi::L1MuBMTrackSegPhi(
m_phi(phi),
m_phib(phib),
m_quality(quality),
m_tag(tag),
m_bx(bx),
m_etaFlag(etaFlag) {
/*
Expand Down Expand Up @@ -80,15 +81,6 @@ L1MuBMTrackSegPhi::L1MuBMTrackSegPhi(
*/
}

L1MuBMTrackSegPhi::L1MuBMTrackSegPhi(const L1MuBMTrackSegPhi& id)
: m_location(id.m_location),
m_phi(id.m_phi),
m_phib(id.m_phib),
m_quality(id.m_quality),
m_tag(id.m_tag),
m_bx(id.m_bx),
m_etaFlag(id.m_etaFlag) {}

//--------------
// Destructor --
//--------------
Expand Down Expand Up @@ -124,22 +116,6 @@ double L1MuBMTrackSegPhi::phiValue() const {
//
double L1MuBMTrackSegPhi::phibValue() const { return static_cast<double>(m_phib) / 512; }

//
// Assignment operator
//
L1MuBMTrackSegPhi& L1MuBMTrackSegPhi::operator=(const L1MuBMTrackSegPhi& id) {
if (this != &id) {
m_location = id.m_location;
m_phi = id.m_phi;
m_phib = id.m_phib;
m_quality = id.m_quality;
m_tag = id.m_tag;
m_bx = id.m_bx;
m_etaFlag = id.m_etaFlag;
}
return *this;
}

//
// Equal operator
//
Expand Down

0 comments on commit 146950e

Please sign in to comment.