Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default initialize TrajectorySeed::dir_ #35795

Merged
merged 3 commits into from
Oct 26, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DataFormats/TrajectorySeed/interface/TrajectorySeed.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class TrajectorySeed {
private:
RecHitContainer hits_;
PTrajectoryStateOnDet tsos_;
PropagationDirection dir_;
PropagationDirection dir_ = oppositeToMomentum; // = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why oppositeToMomentum?

Copy link
Contributor Author

@slava77 slava77 Oct 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why oppositeToMomentum?

because its int value is 0 and that's what's the most likely "empty" memory default is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I do not find this argument convincing.
Either it is left uninitialized (and the cause fixed) or it shall be initialized to a "invalid" value eventually extending the corresponding enum

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either it is left uninitialized (and the cause fixed) or it shall be initialized to a "invalid" value eventually extending the corresponding enum

fair enough. I've extended the enum.

};

inline void swap(TrajectorySeed& rh, TrajectorySeed& lh) noexcept { rh.swap(lh); }
Expand Down