Skip to content

Commit

Permalink
Merge pull request cms-sw#1345 from Dr15Jones/threadSafeFixesDataForm…
Browse files Browse the repository at this point in the history
…atsParticleFlowReco

Multithreading fixes -- Changes non-const statics in PFCluster to avoid static analyzer warnings
  • Loading branch information
ktf committed Nov 10, 2013
2 parents ae26635 + 5a79bf5 commit c06123a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions DataFormats/ParticleFlowReco/interface/PFCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ namespace reco {

friend std::ostream& operator<<(std::ostream& out,
const PFCluster& cluster);
/// counter
static unsigned instanceCounter_;


/// \todo move to PFClusterTools
static void setDepthCorParameters(int mode,
double a, double b,
Expand Down Expand Up @@ -130,8 +128,7 @@ namespace reco {

/// dummy vertex access
math::XYZPoint const & vertex() const {
static math::XYZPoint dummyVtx(0,0,0);
return dummyVtx;
return dummyVtx_;
}
double vx() const { return vertex().x(); }
double vy() const { return vertex().y(); }
Expand Down Expand Up @@ -161,7 +158,8 @@ namespace reco {
/// \todo move to PFClusterTools
static double depthCorBp_;


static const math::XYZPoint dummyVtx_;

/// color (transient)
int color_;

Expand Down
2 changes: 1 addition & 1 deletion DataFormats/ParticleFlowReco/src/PFCluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ double PFCluster::depthCorB_ = 7.3;
double PFCluster::depthCorAp_ = 0.89;
double PFCluster::depthCorBp_ = 4.0;

unsigned PFCluster::instanceCounter_ = 0;
const math::XYZPoint PFCluster::dummyVtx_(0,0,0);

PFCluster::PFCluster(PFLayer::Layer layer, double energy,
double x, double y, double z ) :
Expand Down

0 comments on commit c06123a

Please sign in to comment.