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

Fix thread-safety issue in PrimaryVertexGenerator #3702

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion FastSimulation/Event/interface/PrimaryVertexGenerator.h
Expand Up @@ -22,7 +22,8 @@ class PrimaryVertexGenerator : public math::XYZVector {
/// Generation process (to be implemented)
virtual void generate(RandomEngineAndDistribution const*) = 0;

TMatrixD* boost() const;
TMatrixD* boost();
const TMatrixD* boost() const;

/// Return x0, y0, z0
inline const math::XYZPoint& beamSpot() const { return beamSpot_; }
Expand Down
7 changes: 6 additions & 1 deletion FastSimulation/Event/src/PrimaryVertexGenerator.cc
Expand Up @@ -11,11 +11,16 @@ PrimaryVertexGenerator::~PrimaryVertexGenerator() {
if ( boost_ ) delete boost_;
}

TMatrixD*
const TMatrixD*
PrimaryVertexGenerator::boost() const {
return boost_;
}

TMatrixD*
PrimaryVertexGenerator::boost() {
return boost_;
}

void
PrimaryVertexGenerator::setBoost(TMatrixD* aBoost) {
boost_ = aBoost;
Expand Down