ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ChargePolicy.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ChargePolicy.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2018 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 namespace Acts {
11 
25  public:
29  ChargedPolicy(double charge) : m_dCharge(charge) {}
30 
34  bool operator==(const ChargedPolicy& rhs) const {
35  return m_dCharge == rhs.m_dCharge;
36  }
37 
41  bool operator!=(const ChargedPolicy& rhs) const { return !(*this == rhs); }
42 
46  double getCharge() const { return m_dCharge; }
47 
51  void setCharge(double charge) { m_dCharge = charge; }
52 
54  void flipSign() { m_dCharge *= -1.; }
55 
56  private:
57  double m_dCharge;
58 };
59 
73  public:
77  bool operator==(const NeutralPolicy& /*other*/) const { return true; }
78 
82  bool operator!=(const NeutralPolicy& rhs) const { return !(*this == rhs); }
83 
87  double getCharge() const { return 0.; }
88 };
89 } // namespace Acts