~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to src/common_cpp/DataStructure/ThreeVector.hh

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
          ThreeVector(double x = 0.0, double y = 0.0, double z = 0.0)
66
66
      : TVector3(x, y, z) {}
67
67
 
68
 
    /** Assignment operator */
 
68
    /** Assignment operators */
69
69
    inline ThreeVector& operator=(const ThreeVector& vec) {
70
70
        if (this == &vec)
71
71
            return *this;
73
73
        return *this;
74
74
    }
75
75
 
 
76
    inline ThreeVector& operator/=(const double& d) {
 
77
        (*this) *= (1./d);
 
78
        return *this;
 
79
    }
 
80
 
76
81
    /** Destructor - does nothing */
77
82
    virtual ~ThreeVector() {}
78
83
 
105
110
    MAUS_VERSIONED_CLASS_DEF(ThreeVector)
106
111
};
107
112
 
108
 
inline const ThreeVector operator /(const ThreeVector& v, const double& d) {
109
 
    return v*(1./d);
 
113
inline ThreeVector operator/(const ThreeVector& v, const double& d) {
 
114
    return ThreeVector(v) /= d;
110
115
}
111
116
 
112
117
inline bool operator==(const ThreeVector& v1, const ThreeVector& v2) {