Skip to content

Commit 9d9574e

Browse files
committed
mark Particle::SetMass() and SetCharge() deprecated, prefer use SetPid()
1 parent 49ba4ab commit 9d9574e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/Particle.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ class Particle : public Track {
2828
ANALYSISTREE_ATTR_NODISCARD PdgCode_t GetPid() const { return pid_; }
2929
ANALYSISTREE_ATTR_NODISCARD Floating_t GetMass() const { return mass_; }
3030

31-
void SetMass(Floating_t mass) {
31+
ANALYSISTREE_ATTR_DEPRECATED("Use SetPid(), do not use SetMass() unless you want to assign mass field with value different from PDG-true") void SetMass(Floating_t mass) {
3232
mass_ = mass;
3333
}
3434

35+
ANALYSISTREE_ATTR_DEPRECATED("Use SetPid(), do not use SetCharge() unless you want to assign charge field with value different from PDG-true") void SetCharge(Int_t charge) {
36+
Track::SetCharge(charge);
37+
}
38+
3539
void SetPid(PdgCode_t pid);
3640

3741
ANALYSISTREE_ATTR_NODISCARD Floating_t GetEnergy() const { return sqrt(mass_ * mass_ + GetP() * GetP()); }

0 commit comments

Comments
 (0)